/* ===== Shared payment checkout modal ===== */
body.premium-payment-open {
    overflow: hidden;
}

.payment-plan-switch {
    margin-top: .72rem;
    padding: .2rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .2rem;
    border: 1px solid #e2e5e9;
    border-radius: .82rem;
    background: #ffffff;
}

.payment-plan-option {
    position: relative;
    min-width: 0;
    cursor: pointer;
}

.payment-plan-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.payment-plan-option span {
    min-height: 2.05rem;
    padding: .48rem .68rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: .62rem;
    color: #747b85;
    font-size: .76rem;
    font-weight: 650;
    line-height: 1.15;
    text-align: center;
    transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.payment-plan-option:hover span {
    color: #34383e;
}

.payment-plan-option input:checked + span {
    background: #3b82f6;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .12);
}

.payment-plan-option input:focus-visible + span {
    outline: 2px solid rgba(59, 130, 246, .42);
    outline-offset: 2px;
}

.premium-payment-modal[hidden] {
    display: none !important;
}

.premium-payment-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}

.premium-payment-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.premium-payment-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.premium-payment-dialog {
    position: relative;
    z-index: 1;
    width: min(37rem, 100%);
    max-height: min(46rem, calc(100svh - 3rem));
    overflow: auto;
    padding: 1.45rem;
    border: 1px solid #e3e6ea;
    border-radius: 1.35rem;
    background: #ffffff;
    box-shadow: 0 26px 70px rgba(15, 23, 42, .2);
    transform: translateY(10px) scale(.985);
    transition: transform .2s cubic-bezier(.22, 1, .36, 1);
    scrollbar-width: thin;
}

.premium-payment-modal.is-open .premium-payment-dialog {
    transform: translateY(0) scale(1);
}

.premium-payment-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    border-radius: .68rem;
    background: #f8f9fa;
    color: #6b7280;
    font: inherit;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.premium-payment-close:hover {
    transform: translateY(-1px);
    background: #f1f3f5;
    color: #25282d;
}

.premium-payment-heading {
    padding-right: 0;
}


.premium-payment-heading h2 {
    margin: 0;
    color: #202327;
    font-size: 1.45rem;
    font-weight: 690;
    letter-spacing: -.025em;
}

.premium-payment-heading p {
    margin: .62rem 0 0;
    color: #747b85;
    font-size: .94rem;
    line-height: 1.52;
}

.premium-payment-form {
    margin-top: 1.5rem;
}

.premium-payment-country {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.premium-payment-country legend,
.premium-payment-methods-head > span {
    margin: 0;
    color: #4d535c;
    font-size: .8rem;
    font-weight: 700;
}

.premium-country-options {
    margin-top: .72rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .72rem;
}

.premium-country-option {
    position: relative;
    min-width: 0;
    cursor: pointer;
}

.premium-country-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.premium-country-option-body {
    min-height: 4.75rem;
    padding: .82rem .86rem;
    display: flex;
    align-items: center;
    gap: .76rem;
    border: 1px solid #e2e5e9;
    border-radius: .95rem;
    background: #fafbfc;
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.premium-country-option:hover .premium-country-option-body {
    transform: translateY(-1px);
    border-color: #d5d9df;
    background: #f7f8fa;
}

.premium-country-option input:checked + .premium-country-option-body {
    border-color: rgba(59, 130, 246, .48);
    background: #f4f8ff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, .08);
}

.premium-country-option input:focus-visible + .premium-country-option-body {
    outline: 2px solid rgba(59, 130, 246, .42);
    outline-offset: 2px;
}

.premium-country-option-body > img {
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 2.25rem;
    display: block;
}

.premium-country-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .18rem;
}

.premium-country-copy b {
    overflow: hidden;
    color: #2e3238;
    font-size: .9rem;
    font-weight: 680;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.premium-country-copy small {
    color: #8a919a;
    font-size: .74rem;
    line-height: 1.22;
}

.premium-country-option-body > i {
    width: .96rem;
    height: .96rem;
    margin-left: auto;
    flex: 0 0 .96rem;
    border: 1px solid #cbd0d6;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 3px #fff;
    transition: border-color .18s ease, background-color .18s ease;
}

.premium-country-option input:checked + .premium-country-option-body > i {
    border-color: #3b82f6;
    background: #3b82f6;
}

.premium-payment-methods {
    margin-top: 1.45rem;
}

.premium-payment-methods-head {
    display: block;
}

.premium-payment-method-list {
    margin-top: .8rem;
    display: grid;
    gap: .55rem;
}

.premium-payment-method-list[hidden] {
    display: none !important;
}

.premium-payment-method {
    min-height: 4.05rem;
    padding: .68rem .78rem .68rem .88rem;
    display: flex;
    align-items: center;
    gap: .85rem;
    border: 1px solid #e7e9ec;
    border-radius: .9rem;
    background: #ffffff;
}

.premium-payment-method-copy {
    min-width: 0;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: .17rem;
}

.premium-payment-method-copy b {
    color: #34383e;
    font-size: .84rem;
    font-weight: 670;
}

.premium-payment-method-copy span {
    overflow: hidden;
    color: #969ca4;
    font-size: .71rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.premium-payment-logos {
    display: flex;
    align-items: center;
    gap: .38rem;
    flex: 0 0 auto;
}

.premium-payment-logos img {
    width: 2.05rem;
    height: 2.05rem;
    display: block;
    object-fit: contain;
}

.premium-payment-error {
    margin: .72rem 0 0;
    padding: .65rem .72rem;
    border: 1px solid #fed7aa;
    border-radius: .78rem;
    background: #fff7ed;
    color: #a45116;
    font-size: .69rem;
    line-height: 1.4;
}

.premium-payment-error[hidden] {
    display: none !important;
}

.premium-payment-summary {
    margin-top: 1.05rem;
    padding-top: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid #eceef0;
}

.premium-payment-summary strong {
    min-height: 2.55rem;
    display: inline-flex;
    align-items: center;
    color: #202327;
    font-size: 1.65rem;
    font-weight: 720;
    line-height: 1;
    letter-spacing: -.035em;
}

.premium-payment-submit {
    min-height: 2.55rem;
    padding: .66rem 1rem;
    border: 0;
    border-radius: .8rem;
    background: #3b82f6;
    color: #fff;
    font: inherit;
    font-size: .78rem;
    font-weight: 650;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .18s ease, background-color .18s ease;
}

.premium-payment-submit:hover {
    transform: translateY(-1px);
    background: #2563eb;
}


body.dark-theme .payment-plan-switch {
    border-color: #374151;
    background: #111827;
}

body.dark-theme .payment-plan-option span {
    color: #9ca3af;
}

body.dark-theme .payment-plan-option:hover span {
    color: #f3f4f6;
}

body.dark-theme .payment-plan-option input:checked + span {
    background: #3b82f6;
    color: #ffffff;
    box-shadow: none;
}

body.dark-theme .premium-payment-backdrop {
    background: rgba(3, 7, 18, .58);
}

body.dark-theme .premium-payment-dialog {
    border-color: #374151;
    background: #1f2937;
    box-shadow: 0 28px 76px rgba(0, 0, 0, .4);
}

body.dark-theme .premium-payment-close {
    border-color: #3c4858;
    background: #263241;
    color: #9ca3af;
}

body.dark-theme .premium-payment-close:hover {
    background: #2d3a4a;
    color: #f3f4f6;
}

body.dark-theme .premium-payment-heading h2,
body.dark-theme .premium-country-copy b,
body.dark-theme .premium-payment-method-copy b,
body.dark-theme .premium-payment-summary strong {
    color: #f3f4f6;
}

body.dark-theme .premium-payment-heading p,
body.dark-theme .premium-country-copy small,
body.dark-theme .premium-payment-method-copy span {
    color: #9ca3af;
}

body.dark-theme .premium-payment-country legend,
body.dark-theme .premium-payment-methods-head > span {
    color: #cbd5e1;
}

body.dark-theme .premium-country-option-body,
body.dark-theme .premium-payment-method {
    border-color: #374151;
    background: #182230;
}

body.dark-theme .premium-country-option:hover .premium-country-option-body {
    border-color: #4b5563;
    background: #202d3d;
}

body.dark-theme .premium-country-option input:checked + .premium-country-option-body {
    border-color: rgba(96, 165, 250, .58);
    background: #1b2d44;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, .08);
}

body.dark-theme .premium-country-option-body > i {
    border-color: #526072;
    background: #182230;
    box-shadow: inset 0 0 0 3px #182230;
}

body.dark-theme .premium-country-option input:checked + .premium-country-option-body > i {
    border-color: #60a5fa;
    background: #60a5fa;
}

body.dark-theme .premium-payment-error {
    border-color: rgba(251, 146, 60, .3);
    background: rgba(124, 45, 18, .18);
    color: #fdba74;
}

body.dark-theme .premium-payment-summary {
    border-top-color: #374151;
}

body.dark-theme .premium-payment-submit {
    background: #3b82f6;
}

body.dark-theme .premium-payment-submit:hover {
    background: #2563eb;
}

@media (max-width: 560px) {
    .premium-payment-modal {
        align-items: end;
        padding: .75rem;
    }

    .premium-payment-dialog {
        width: 100%;
        max-height: calc(100svh - 1.5rem);
        padding: 1.2rem;
        border-radius: 1.15rem;
    }

    .premium-country-options {
        grid-template-columns: 1fr;
    }

    .premium-payment-summary {
        align-items: stretch;
        flex-direction: column;
        gap: .65rem;
    }

    .premium-payment-submit {
        width: 100%;
    }

}

@media (prefers-reduced-motion: reduce) {
    .premium-payment-modal,
    .premium-payment-dialog,
    .premium-country-option-body,
    .payment-plan-option span,
    .premium-payment-close,
    .premium-payment-submit {
        transition: none !important;
    }
}
