:root {
    color-scheme: dark;
    --pay-pink: #ff1680;
    --pay-purple: #8c3cff;
    --pay-panel: #17131d;
    --pay-card: #251d2d;
    --pay-muted: #aaa2b0;
}

* { box-sizing: border-box; }

body.pay-credits-page {
    margin: 0;
    min-height: 100vh;
    color: #fff;
    background:
        radial-gradient(circle at 78% 15%, rgba(140, 60, 255, .2), transparent 34%),
        radial-gradient(circle at 20% 90%, rgba(255, 22, 128, .14), transparent 35%),
        #0b0910;
    font-family: Inter, Arial, sans-serif;
}

.credit-store-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 22px;
}

.credit-store {
    position: relative;
    width: min(100%, 980px);
    min-height: 610px;
    display: grid;
    grid-template-columns: minmax(310px, .82fr) minmax(460px, 1.18fr);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 26px;
    background: rgba(19, 15, 24, .96);
    box-shadow: 0 28px 90px rgba(0,0,0,.55);
}

.credit-store-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid rgba(255, 255, 255, 0.32);
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}

.credit-store-close:hover,
.credit-store-close:focus-visible {
    background: #ff007a;
    border-color: #ff007a;
    color: #ffffff;
    transform: scale(1.08);
    box-shadow: 0 0 16px rgba(255, 0, 122, 0.6);
    outline: none;
}

.credit-store-close:active {
    transform: scale(0.94);
}

.credit-store-close svg {
    display: block;
    width: 20px;
    height: 20px;
    pointer-events: none;
}

body.pay-credits-embedded .credit-store-close {
    display: none;
}

.credit-promo {
    position: relative;
    min-height: 610px;
    overflow: hidden;
    background: linear-gradient(145deg, #29162b, #0d0b12 65%);
}

.credit-promo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(4,3,6,.12) 42%, rgba(4,3,6,.9));
    pointer-events: none;
}

.credit-promo-video {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    object-fit: cover;
    transition: opacity .3s ease;
}

.credit-promo-video.is-switching { opacity: 0; }

.credit-brand, .credit-promo-copy, .credit-video-dots { position: absolute; z-index: 1; }
.credit-brand { top: 28px; left: 30px; font-size: 27px; font-weight: 900; letter-spacing: -.9px; }
.credit-brand span { color: var(--pay-pink); }
.credit-promo-copy { left: 30px; right: 30px; bottom: 62px; }
.credit-promo-copy small { color: #ffc0df; font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
.credit-promo-copy h2 { max-width: 330px; margin: 10px 0 0; font-size: clamp(26px, 3vw, 38px); line-height: 1.04; }
.credit-video-dots { left: 30px; bottom: 28px; display: flex; gap: 8px; }
.credit-video-dot { width: 7px; height: 7px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.38); }
.credit-video-dot.is-active { width: 22px; border-radius: 10px; background: #fff; }

.credit-offer {
    position: relative;
    padding: 38px 42px 30px;
    display: flex;
    flex-direction: column;
}

.credit-offer-kicker { margin: 0 0 8px; color: #ff9dca; font-size: 12px; font-weight: 850; letter-spacing: 1.2px; text-transform: uppercase; }
.credit-offer h1 { margin: 0; font-size: clamp(28px, 4vw, 39px); line-height: 1.05; letter-spacing: -1.2px; }
.credit-offer-subtitle { margin: 10px 0 16px; color: var(--pay-muted); line-height: 1.45; }

.credit-voucher-section {
    margin: 0 0 14px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
}
.credit-voucher-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.credit-voucher-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    padding: 8px 12px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    outline: none;
    transition: border-color 0.18s ease;
}
.credit-voucher-input:focus {
    border-color: var(--pay-pink);
}
.credit-voucher-btn {
    background: linear-gradient(100deg, var(--pay-pink), var(--pay-purple));
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 8px 15px;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.18s ease;
}
.credit-voucher-btn:hover {
    opacity: 0.92;
}
.credit-voucher-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}
.credit-voucher-status {
    margin: 6px 0 0;
    font-size: 12px;
    font-weight: 600;
}

.credit-packages { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.credit-package {
    position: relative;
    min-height: 136px;
    padding: 16px 18px 18px;
    text-align: left;
    color: #fff;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 17px;
    background: linear-gradient(145deg, rgba(53,42,65,.9), rgba(31,25,38,.96));
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.credit-package:hover, .credit-package:focus-visible { transform: translateY(-2px); border-color: rgba(255,22,128,.7); outline: none; }
.credit-package.is-selected { border-color: var(--pay-pink); box-shadow: 0 0 0 2px rgba(255,22,128,.18), 0 12px 32px rgba(0,0,0,.22); }
.credit-package-badge { position: absolute; top: -9px; right: 12px; padding: 5px 9px; border-radius: 999px; background: linear-gradient(90deg, var(--pay-pink), var(--pay-purple)); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.credit-package-amount { display: block; font-size: 23px; font-weight: 900; line-height: 1.1; }
.credit-package-days { display: block; margin-top: 3px; color: var(--pay-muted); font-size: 12px; font-weight: 600; }
.credit-package-price { display: flex; align-items: baseline; gap: 8px; margin-top: 13px; }
.credit-package-old { color: #8d8593; font-size: 13px; text-decoration: line-through; }
.credit-package-now { font-size: 21px; font-weight: 900; }
.credit-package-saving { display: block; margin-top: 4px; color: #ff9dca; font-size: 11px; font-weight: 750; }

.credit-package-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 10px;
    border-radius: 9px;
    background: linear-gradient(100deg, var(--pay-pink), var(--pay-purple));
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
}
.credit-package:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.credit-continue, .pay-button {
    width: 100%;
    min-height: 52px;
    margin-top: 18px;
    border: 0;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(100deg, var(--pay-pink), var(--pay-purple));
    box-shadow: 0 10px 25px rgba(215,26,142,.25);
    font-size: 16px;
    font-weight: 850;
    cursor: pointer;
}
.credit-continue:disabled, .pay-button:disabled { opacity: .55; cursor: wait; }
.credit-security { margin: 13px 0 0; color: #8f8796; text-align: center; font-size: 11px; }

.credit-payment-view[hidden], .credit-packages-view[hidden] { display: none !important; }
.credit-payment-view { width: 100%; }
.credit-payment-head { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 18px; }
.credit-payment-back { width: 38px; height: 38px; flex: 0 0 38px; border: 1px solid rgba(255,255,255,.12); border-radius: 11px; color: #fff; background: rgba(255,255,255,.05); cursor: pointer; }
.credit-payment-head h1 { font-size: 27px; margin: 0 0 4px; }
.credit-payment-summary { margin: 0; color: var(--pay-muted); }
#payment-element { padding: 14px; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; background: #0d0b10; }
#payment-element:empty { display: none; }
.guest-email-gate { padding: 16px; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; background: #0d0b10; }
.guest-email-gate[hidden] { display: none !important; }
.guest-email-gate label { display: block; margin-bottom: 8px; color: #fff; font-size: 13px; font-weight: 800; }
.guest-email-gate input { width: 100%; min-height: 48px; padding: 0 13px; color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 11px; outline: none; background: #17131d; font: inherit; }
.guest-email-gate input:focus { border-color: var(--pay-pink); box-shadow: 0 0 0 3px rgba(255,22,128,.13); }
.guest-email-gate p { margin: 8px 0 0; color: var(--pay-muted); font-size: 11px; line-height: 1.4; }
.guest-email-gate .pay-button { margin-top: 14px; }
.payment-discretion-note { display: flex; gap: 9px; margin-top: 13px; padding: 10px 12px; color: #c5bec9; border-radius: 12px; background: rgba(255,22,128,.08); font-size: 12px; line-height: 1.4; }
.payment-discretion-note strong { color: #fff; }
#error-message { min-height: 18px; margin-top: 10px; color: #ff7a9d; font-size: 12px; text-align: center; }
.credit-standalone-back { display: block; margin-top: 13px; color: #9e96a3; text-align: center; text-decoration: none; font-size: 13px; }
body.pay-credits-embedded .credit-store-wrap { padding: 0; }
body.pay-credits-embedded .credit-store { width: 100%; min-height: 100vh; border: 0; border-radius: 0; }
body.pay-credits-embedded .credit-standalone-back { display: none; }

@media (max-width: 740px) {
    .credit-store-wrap { padding: 0; }
    .credit-store { min-height: 100vh; grid-template-columns: 1fr; border: 0; border-radius: 0; }
    .credit-store-close {
        position: fixed;
        top: max(14px, calc(env(safe-area-inset-top, 0px) + 10px));
        right: max(14px, calc(env(safe-area-inset-right, 0px) + 10px));
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        z-index: 1000;
    }
    .credit-promo { min-height: 215px; }
    .credit-brand { top: 18px; left: 20px; font-size: 22px; }
    .credit-promo-copy { left: 20px; right: 20px; bottom: 35px; }
    .credit-promo-copy h2 { margin-top: 5px; font-size: 25px; }
    .credit-video-dots { left: auto; right: 20px; bottom: 18px; }
    .credit-offer { padding: 25px 20px 22px; }
    .credit-offer-subtitle { margin-bottom: 18px; }
    .credit-package { min-height: 124px; padding: 15px; }
    .credit-package-amount { font-size: 19px; }
    .credit-package-days { font-size: 11px; margin-top: 2px; }
    .credit-package-price { margin-top: 12px; }
}

@media (max-width: 410px) {
    .credit-packages { grid-template-columns: 1fr; }
    .credit-promo { min-height: 185px; }
}

@media (prefers-reduced-motion: reduce) {
    .credit-promo-video, .credit-package { transition: none; }
}
