/* ==========================================================================
   Premium subscription page — landing design language (--l-* tokens, .sui-*)
   ========================================================================== */

/* --- alerts --- */

.subscription-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
}

.subscription-alert i {
    font-size: 14px;
}

.subscription-alert--ok {
    background: rgba(52, 185, 91, 0.10);
    border-color: rgba(52, 185, 91, 0.30);
    color: #34B95B;
}

.subscription-alert--fail {
    background: rgba(249, 83, 55, 0.10);
    border-color: rgba(249, 83, 55, 0.30);
    color: #F97066;
}

/* ==========================================================================
   Purchase layout
   ========================================================================== */

.subscription-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 44px;
    align-items: start;
}

/* --- benefit cards --- */

.subscription-benefit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 32px;
}

.benefit {
    position: relative;
    padding: 24px 22px;
}

.benefit__icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--l-accent-soft);
    color: var(--l-accent-hover);
    font-size: 15px;
    margin-bottom: 16px;
}

html[data-theme="dark"] .benefit__icon {
    color: #A78BFA;
}

.benefit__title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--l-text);
}

.benefit__text {
    margin-top: 8px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--l-muted);
}

.benefit--mentor {
    padding-right: 52px;
}

.benefit__play {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--l-border);
    border-radius: 50%;
    background: transparent;
    color: var(--l-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.benefit__play i {
    font-size: 10px;
    margin-left: 1px;
}

.benefit__play:hover {
    border-color: var(--l-accent);
    color: var(--l-accent-hover);
    background: var(--l-accent-soft);
}

.benefit__play:focus-visible {
    outline: 2px solid var(--l-accent);
    outline-offset: 2px;
}

/* ==========================================================================
   Checkout card
   ========================================================================== */

.checkout {
    padding: 30px 28px 26px;
    display: flex;
    flex-direction: column;
}

.checkout__title {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.3;
    color: var(--l-text);
}

.checkout__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 22px 0 26px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--l-border);
}

.checkout__list li {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--l-text);
}

.checkout__list i {
    font-size: 12px;
    color: var(--l-accent-hover);
    flex-shrink: 0;
}

html[data-theme="dark"] .checkout__list i {
    color: #A78BFA;
}

.checkout__footer {
    margin-top: auto;
}

.checkout__price {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--l-text);
}

.checkout__price span {
    font-size: 16px;
    font-weight: 400;
    color: var(--l-muted);
    margin-left: 4px;
}

.checkout__note {
    margin-top: 8px;
    font-size: 13px;
    color: var(--l-dim);
}

.checkout__note__second {
    margin-top: 2px;
    font-size: 13px;
    color: var(--l-dim);
}

.checkout__footer .sui-btn {
    margin-top: 20px;
}

.checkout__hint {
    margin-top: 14px;
    font-size: 12.5px;
    color: var(--l-dim);
    text-align: center;
}

.checkout__hint a {
    color: var(--l-accent-hover);
}

.checkout__hint a:hover {
    text-decoration: underline;
}

.checkout__hint--muted {
    font-size: 11.5px;
}

/* ==========================================================================
   Manage active subscription
   ========================================================================== */

.subscription-manage {
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
}

.manage {
    padding: 30px 32px 24px;
}

/* Шапка карточки на странице истории платежей */
.manage__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 24px 0 20px;
    border-bottom: 1px solid var(--l-border);
}

.manage__title {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--l-text);
}

.manage__title .fa-crown {
    color: var(--l-gold);
    font-size: 16px;
}

.manage__status {
    margin-left: auto;
    padding: 4px 11px;
    border-radius: 999px;
    background: rgba(52, 185, 91, 0.12);
    border: 1px solid rgba(52, 185, 91, 0.28);
    color: #34B95B;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.manage__status--expiring {
    background: rgba(230, 178, 60, 0.12);
    border-color: rgba(230, 178, 60, 0.28);
    color: #E6B23C;
}

.manage__price {
    margin-top: 26px;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--l-text);
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.manage__price-period {
    font-size: 14px;
    font-weight: 400;
    color: var(--l-muted);
}

.manage__billing {
    margin-top: 10px;
    font-size: 13.5px;
    color: var(--l-dim);
}

.manage__wallet {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    padding: 14px 16px;
    background: var(--l-raise);
    border: 1px solid var(--l-border);
    border-radius: 12px;
}

.manage__payment-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.manage__payment-info i {
    color: var(--l-accent);
}

.manage__card {
    font-size: 14px;
    color: var(--l-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.manage__payment-form {
    margin: 0;
}

.manage__card-btn {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--l-accent);
    cursor: pointer;
    white-space: nowrap;
}

.manage__card-btn:hover {
    text-decoration: underline;
}

.manage__card-btn--danger {
    color: #EF4444;
}

.manage__payment-hint {
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--l-dim);
}

.manage__history {
    padding-top: 18px;
}

.manage__history-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--l-dim);
    transition: color 0.15s ease;
}

.manage__history-link:hover {
    color: var(--l-text);
}

.manage__history-link i {
    font-size: 11px;
}

/* ---------- История платежей ---------- */

.payments__empty {
    padding: 28px 0 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.payments__empty-text {
    color: var(--l-muted);
    font-size: 14.5px;
}

.payments__scroll {
    overflow-x: auto;
    padding: 8px 0 4px;
}

.payments__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    min-width: 560px;
}

.payments__table th {
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--l-dim);
    padding: 10px 12px 10px 0;
    border-bottom: 1px solid var(--l-border);
}


.payments__table td {
    padding: 12px 12px 12px 0;
    border-bottom: 1px solid var(--l-border);
    color: var(--l-muted);
    vertical-align: middle;
}

.payments__table tr:last-child td {
    border-bottom: none;
}

.payments__date {
    white-space: nowrap;
}

.payments__type {
    color: var(--l-dim);
    white-space: nowrap;
}

.payments__desc {
    color: var(--l-text);
}

.payments__col-amount {
    text-align: right;
    white-space: nowrap;
}

.payments__amount {
    color: var(--l-text);
    font-weight: 600;
}

.payments__status {
    font-weight: 500;
    white-space: nowrap;
}

.payments__status--succeeded {
    color: #34B95B;
}

.payments__status--pending {
    color: #E6B23C;
}

.payments__status--canceled {
    color: #E05252;
}

.payments__status--refunded {
    color: #60A5FA;
}

.manage__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--l-border);
}

.manage__renew-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.manage__renew {
    font-size: 14.5px;
    color: var(--l-text);
}

.manage__switch {
    position: relative;
    display: inline-flex;
    cursor: pointer;
    flex-shrink: 0;
}

.manage__switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.manage__switch-track {
    width: 46px;
    height: 27px;
    border-radius: 999px;
    background: var(--l-border-strong);
    transition: background-color 0.2s ease;
    position: relative;
}

.manage__switch-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease;
}

.manage__switch input:checked + .manage__switch-track {
    background: var(--l-accent);
}

.manage__switch input:checked + .manage__switch-track::after {
    transform: translateX(19px);
}

.manage__switch input:focus-visible + .manage__switch-track {
    outline: 2px solid rgba(117, 67, 244, 0.55);
    outline-offset: 2px;
}

.manage__switch input:disabled + .manage__switch-track {
    opacity: 0.6;
    cursor: wait;
}

/* ==========================================================================
   Mentor demo modal
   ========================================================================== */

.subscription-video-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 24px;
}

.subscription-video-modal[hidden] {
    display: none !important;
}

.subscription-video-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.subscription-video-modal__panel {
    position: relative;
    width: min(1400px, calc(100vw - 48px));
    background: var(--l-card);
    border: 1px solid var(--l-border-strong);
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.subscription-video-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--l-border);
}

.subscription-video-modal__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--l-text);
}

.subscription-video-modal__close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--l-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.subscription-video-modal__close:hover {
    background: rgba(148, 163, 184, 0.12);
    color: var(--l-text);
}

.subscription-video-modal__video {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 96px);
    background: #000;
}

/* ==========================================================================
   Theme transition extras (core selectors live in theme-shell.css)
   ========================================================================== */

html.theme-transition .page-subscription .sui-card,
html.theme-transition .page-subscription .subscription-alert,
html.theme-transition .page-subscription .subscription-video-modal__panel,
html.theme-transition .page-subscription .manage__switch-track {
    transition:
        background-color 0.35s ease,
        color 0.35s ease,
        border-color 0.35s ease,
        box-shadow 0.35s ease;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 960px) {
    .subscription-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .checkout {
        max-width: 460px;
        width: 100%;
    }
}

@media (max-width: 767px) {
    .page-subscription .subscription-page {
        padding: 32px 16px 56px;
    }

    .subscription-benefit-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 26px;
    }

    .checkout {
        max-width: none;
        padding: 24px 20px 22px;
    }

    .subscription-video-modal {
        padding: 8px;
    }

    .subscription-video-modal__panel {
        width: 100%;
        border-radius: 12px;
    }

    .subscription-video-modal__video {
        max-height: calc(100vh - 72px);
    }

    .manage {
        padding: 22px 20px 18px;
    }

    .benefit__title,
    .benefit__text,
    .checkout__list li span {
        overflow-wrap: anywhere;
    }
}
