/* ===== СТРАНИЦА ПОДПИСОК ===== */
.subscription-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px;
    position: relative;
    z-index: 2;
}

.subscription-hero {
    text-align: center;
    margin: 40px 0 60px;
    padding: 40px 30px;
    background: linear-gradient(145deg, rgba(13, 27, 72, 0.6), rgba(20, 35, 90, 0.5));
    border-radius: 24px;
    border: 1px solid rgba(74, 157, 255, 0.2);
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(0, 40, 100, 0.3);
}

    .subscription-hero h1 {
        font-size: 48px;
        margin-bottom: 20px;
        background: linear-gradient(90deg, var(--accent), var(--primary-light));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        line-height: 1.2;
    }

    .subscription-hero p {
        font-size: 18px;
        color: var(--text-muted);
        max-width: 800px;
        margin: 0 auto 30px;
        line-height: 1.6;
    }

/* Переключатель периодов */
.period-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    margin-top: 40px;
    background: rgba(13, 27, 72, 0.4);
    padding: 20px 30px;
    border-radius: 16px;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid rgba(74, 157, 255, 0.3);
    backdrop-filter: blur(10px);
}

.period-label {
    font-weight: 600;
    color: var(--white);
    font-size: 16px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 80px;
    height: 40px;
}

    .toggle-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 27, 72, 0.6);
    transition: .3s;
    border-radius: 40px;
    border: 2px solid rgba(74, 157, 255, 0.4);
}

    .toggle-slider:before {
        position: absolute;
        content: "";
        height: 32px;
        width: 32px;
        left: 2px;
        bottom: 2px;
        background: linear-gradient(135deg, var(--accent), #00D4A3);
        transition: .3s;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

input:checked + .toggle-slider {
    background: rgba(0, 255, 197, 0.1);
    border-color: var(--accent);
}

    input:checked + .toggle-slider:before {
        transform: translateX(40px);
        background: linear-gradient(135deg, #00D4A3, var(--accent));
    }

.period-label strong {
    color: #69db7c;
    text-shadow: 0 0 10px rgba(105, 219, 124, 0.3);
}

.period-note {
    margin: 14px auto 0;
    font-size: 14px;
    color: var(--text-muted);
    max-width: 650px;
}

/* Скрытый заголовок для корректной семантики */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Тарифные планы */
.plans-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 80px;
}

.plan {
    background: linear-gradient(145deg, rgba(13, 27, 72, 0.7), rgba(20, 35, 90, 0.6));
    border-radius: 22px;
    padding: 40px 30px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(74, 157, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 15px 35px rgba(0, 40, 100, 0.3);
}

    .plan:hover {
        transform: translateY(-10px);
        border-color: var(--accent);
        box-shadow: 0 25px 50px rgba(0, 255, 197, 0.3);
    }

    .plan::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 4px;
        background: linear-gradient(90deg, var(--accent), var(--primary-light));
    }

    .plan.popular {
        border: 2px solid var(--accent);
        transform: scale(1.03);
    }

        .plan.popular:hover {
            transform: translateY(-10px) scale(1.05);
            box-shadow: 0 30px 60px rgba(0, 255, 197, 0.4);
        }

    .plan.friends {
        border-color: rgba(105, 219, 124, 0.4);
    }

        .plan.friends::before {
            background: linear-gradient(90deg, #69db7c, #51cf66);
        }

/* Бейджи */
.plan-badge {
    position: absolute;
    top: 20px;
    right: -32px;
    background: linear-gradient(45deg, var(--accent), #00D4A3);
    color: #00110D;
    padding: 8px 40px;
    font-size: 14px;
    font-weight: 700;
    transform: rotate(45deg);
    transform-origin: center;
    letter-spacing: 1px;
    box-shadow: 0 3px 15px rgba(0, 255, 197, 0.3);
    z-index: 1;
    width: 150px;
    text-align: center;
}

.friends-badge {
    background: linear-gradient(45deg, #69db7c, #51cf66);
    box-shadow: 0 3px 15px rgba(105, 219, 124, 0.4);
}

.plan-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(74, 157, 255, 0.3);
}

.plan-name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--white);
    text-shadow: 0 0 15px rgba(77, 171, 247, 0.4);
}

.plan-description {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.5;
    min-height: 60px;
}

.plan-price {
    margin-bottom: 25px;
}

.price-amount {
    font-size: 48px;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
    text-shadow: 0 0 15px rgba(0, 255, 197, 0.4);
}

.rub {
    font-size: 28px;
    margin-left: 2px;
    display: inline-block;
    vertical-align: top;
}

.price-period {
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 600;
    margin-top: 8px;
    display: block;
}

.price-details {
    margin-top: 15px;
    color: var(--text-muted);
    font-size: 14px;
}

.price-total {
    font-weight: 700;
    color: var(--white);
}

.price-save {
    color: #69db7c;
    font-weight: 700;
    margin-top: 15px;
    font-size: 14px;
    padding: 8px 16px;
    background-color: rgba(105, 219, 124, 0.15);
    border-radius: 8px;
    display: inline-block;
    border: 1px solid rgba(105, 219, 124, 0.3);
    box-shadow: 0 0 10px rgba(105, 219, 124, 0.2);
}

.friends-feature {
    background-color: rgba(105, 219, 124, 0.15);
    border: 1px solid rgba(105, 219, 124, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    color: #69db7c;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 0 10px rgba(105, 219, 124, 0.2);
}

.plan-features {
    list-style: none;
    margin-bottom: 30px;
    text-align: left;
    flex-grow: 1;
}

    .plan-features li {
        padding: 12px 0;
        border-bottom: 1px solid rgba(74, 157, 255, 0.1);
        display: flex;
        align-items: center;
        gap: 12px;
        color: var(--text-muted);
        font-size: 15px;
    }

        .plan-features li:last-child {
            border-bottom: none;
        }

    .plan-features i {
        font-size: 14px;
        width: 22px;
        height: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
        flex-shrink: 0;
    }

.fa-check {
    color: #69db7c;
    background-color: rgba(105, 219, 124, 0.15);
}

/* Легкие иконки без Font Awesome */
.plan-features i,
.friends-feature i,
.comparison-table i,
.economy-banner i {
    font-style: normal;
    font-variant: normal;
}

.plan-features i::before,
.friends-feature i::before,
.comparison-table i::before,
.economy-banner i::before {
    display: inline-block;
    line-height: 1;
}

i.fa-check::before {
    content: "✓";
}

i.fa-times::before {
    content: "✕";
}

i.fa-user-friends::before {
    content: "👥";
}

i.fa-percentage::before {
    content: "%";
}

.fa-times {
    color: #ff6b6b;
    background-color: rgba(255, 107, 107, 0.15);
}

.fa-user-friends {
    color: var(--primary-light);
    background-color: rgba(77, 171, 247, 0.15);
}

/* Кнопки */
.btn-subscribe {
    display: block;
    width: 100%;
    padding: 18px;
    text-align: center;
    background: linear-gradient(135deg, var(--accent), #00D4A3);
    color: #00110D;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    letter-spacing: 0.5px;
    margin-top: auto;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 255, 197, 0.3);
}

    .btn-subscribe:hover {
        background: linear-gradient(135deg, #00D4A3, var(--accent));
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(0, 255, 197, 0.4);
    }

    .btn-subscribe.popular {
        background: linear-gradient(135deg, var(--accent), #00D4A3);
        box-shadow: 0 5px 20px rgba(0, 255, 197, 0.4);
    }

        .btn-subscribe.popular:hover {
            background: linear-gradient(135deg, #00D4A3, #00FFC5);
            box-shadow: 0 8px 25px rgba(0, 255, 197, 0.5);
        }

    .btn-subscribe.friends {
        background: linear-gradient(135deg, #69db7c, #51cf66);
        box-shadow: 0 5px 20px rgba(105, 219, 124, 0.3);
    }

        .btn-subscribe.friends:hover {
            background: linear-gradient(135deg, #51cf66, #40c057);
            box-shadow: 0 8px 25px rgba(105, 219, 124, 0.4);
        }

/* Сравнение функций */
.features-comparison {
    background: linear-gradient(145deg, rgba(13, 27, 72, 0.7), rgba(20, 35, 90, 0.6));
    border-radius: 24px;
    padding: 50px 40px;
    margin-bottom: 80px;
    border: 1px solid rgba(74, 157, 255, 0.3);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(0, 40, 100, 0.3);
}

    .features-comparison::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 4px;
        background: linear-gradient(90deg, var(--accent), var(--primary-light));
    }

    .features-comparison h2 {
        text-align: center;
        margin-bottom: 50px;
        font-size: 36px;
        background: linear-gradient(90deg, var(--accent), var(--primary-light));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        font-weight: 800;
    }

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

    .comparison-table th, .comparison-table td {
        padding: 18px 15px;
        text-align: left;
        border-bottom: 1px solid rgba(74, 157, 255, 0.2);
    }

    .comparison-table th {
        font-weight: 700;
        color: var(--text-muted);
        font-size: 16px;
        background-color: rgba(13, 27, 72, 0.4);
    }

    .comparison-table td {
        color: var(--text-muted);
        font-size: 15px;
    }

.feature-name {
    font-weight: 700;
    color: var(--white);
    font-size: 16px;
}

.check {
    color: #69db7c;
}

.cross {
    color: #ff6b6b;
}

.friends-icon {
    color: var(--primary-light);
}

.economy-banner {
    background: linear-gradient(90deg, rgba(0, 255, 197, 0.1), rgba(74, 157, 255, 0.1));
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-top: 30px;
    border: 1px solid rgba(74, 157, 255, 0.3);
    backdrop-filter: blur(10px);
}

    .economy-banner p {
        color: var(--white);
        font-size: 18px;
        margin: 0;
    }

    .economy-banner span {
        color: #69db7c;
        font-weight: 800;
        font-size: 20px;
        text-shadow: 0 0 10px rgba(105, 219, 124, 0.3);
    }

/* Анимация появления */
.fade-in {
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Адаптивность */
@media (max-width: 1200px) {
    .plans-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .subscription-hero h1 {
        font-size: 36px;
    }

    .period-toggle {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 14px;
        text-align: center;
        padding: 20px;
    }

    .features-comparison {
        padding: 40px 20px;
    }

    .comparison-table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    .plans-container {
        grid-template-columns: 1fr;
        max-width: 560px;
        margin-left: auto;
        margin-right: auto;
    }

    .features-comparison {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .comparison-table {
        display: table;
        width: 100%;
        min-width: 740px;
        table-layout: auto;
    }

    .comparison-table th,
    .comparison-table td {
        white-space: nowrap;
        word-break: normal;
        overflow-wrap: normal;
    }

    .comparison-table .feature-name {
        white-space: normal;
        min-width: 140px;
    }

    .plan.popular {
        transform: scale(1);
    }

        .plan.popular:hover {
            transform: translateY(-4px) scale(1.01);
        }

    .plan-badge {
        right: -28px;
        padding: 6px 35px;
        font-size: 12px;
        width: 130px;
    }
}

@media (max-width: 480px) {
    .subscription-container {
        padding: 20px 15px;
    }

    .subscription-hero {
        padding: 30px 20px;
    }

        .subscription-hero h1 {
            font-size: 28px;
        }

    .plan {
        padding: 30px 20px;
    }

    .price-amount {
        font-size: 36px;
    }

    .features-comparison h2 {
        font-size: 28px;
    }

    .plan-badge {
        right: -24px;
        padding: 5px 30px;
        font-size: 11px;
        width: 120px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .plan:hover {
        transform: none;
        box-shadow: 0 12px 24px rgba(0, 40, 100, 0.24);
    }

    .plan.popular:hover {
        transform: none;
        box-shadow: 0 14px 26px rgba(0, 255, 197, 0.2);
    }

    .btn-subscribe:hover {
        transform: none;
        box-shadow: 0 5px 20px rgba(0, 255, 197, 0.3);
    }
}

/* Светлая тема */
body.light-theme .subscription-hero {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(240, 245, 255, 0.85));
    border: 1px solid rgba(74, 157, 255, 0.2);
}

body.light-theme .period-toggle {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(74, 157, 255, 0.2);
}

body.light-theme .period-label {
    color: var(--primary-dark);
}

body.light-theme .toggle-slider {
    background: rgba(240, 245, 255, 0.8);
    border: 2px solid rgba(74, 157, 255, 0.3);
}

body.light-theme .plan {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(240, 245, 255, 0.85));
    border: 1px solid rgba(74, 157, 255, 0.2);
}

    body.light-theme .plan:hover {
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(240, 245, 255, 0.9));
        border-color: var(--accent);
    }

body.light-theme .plan-name {
    color: var(--primary-dark);
}

body.light-theme .plan-description,
body.light-theme .plan-features li,
body.light-theme .comparison-table td,
body.light-theme .comparison-table th {
    color: #4A5568;
}

body.light-theme .features-comparison {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(240, 245, 255, 0.85));
    border: 1px solid rgba(74, 157, 255, 0.2);
}

body.light-theme .feature-name {
    color: var(--primary-dark);
}

body.light-theme .economy-banner {
    background: linear-gradient(90deg, rgba(0, 162, 255, 0.1), rgba(74, 157, 255, 0.1));
    border: 1px solid rgba(74, 157, 255, 0.2);
}

    body.light-theme .economy-banner p {
        color: var(--primary-dark);
    }

body.light-theme .friends-feature {
    background-color: rgba(105, 219, 124, 0.1);
    border: 1px solid rgba(105, 219, 124, 0.2);
    color: #2b8a3e;
}

body.light-theme .fa-user-friends {
    background-color: rgba(77, 171, 247, 0.1);
}

/* Экстремально маленькие экраны (включая 320x320) */
@media (max-width: 360px), (max-height: 360px) {
    .subscription-container {
        padding: 12px 10px;
    }

    .subscription-hero {
        padding: 18px 12px;
    }

    .subscription-hero h1 {
        font-size: 24px;
        line-height: 1.2;
    }

    .subscription-hero p {
        font-size: 14px;
        line-height: 1.45;
    }

    .period-toggle {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 8px;
        padding: 12px;
    }

    .period-label {
        text-align: center;
        font-size: 12px;
    }

    .toggle-switch {
        margin: 0 auto;
    }

    .plans-container {
        gap: 12px;
    }

    .plan {
        padding: 18px 12px;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: 0 8px 18px rgba(0, 40, 100, 0.22);
    }

    .plan-name {
        font-size: 26px;
    }

    .price-amount {
        font-size: 30px;
    }

    .plan-features li {
        font-size: 13px;
        line-height: 1.4;
    }

    .btn-subscribe {
        width: 100%;
        text-align: center;
    }

    .features-comparison {
        padding: 14px 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .features-comparison h2 {
        font-size: 22px;
    }

    .comparison-table {
        width: 100%;
        min-width: 700px;
        table-layout: auto;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 8px 6px;
        font-size: 11px;
        white-space: nowrap;
        word-break: normal;
        overflow-wrap: normal;
    }

    .comparison-table .feature-name {
        white-space: normal;
        min-width: 130px;
    }

    .plan-badge {
        right: -20px;
        width: 112px;
        padding: 5px 22px;
        font-size: 10px;
    }
}

@media (max-width: 768px) {
    /* Контент сразу статичен без анимаций появления */
    .fade-in,
    .fade-in.is-visible {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}


/* ===== LIGHT THEME ===== */
.subscription-dashboard {
    margin: 10px 0 64px;
    padding: 32px;
    border-radius: 24px;
    border: 1px solid rgba(74, 157, 255, 0.24);
    background: linear-gradient(145deg, rgba(9, 21, 62, 0.7), rgba(16, 33, 85, 0.62));
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 46px rgba(0, 30, 95, 0.33);
}

.dashboard-header {
    margin-bottom: 22px;
}

.dashboard-header h2 {
    margin: 0 0 10px;
    font-size: 34px;
    font-weight: 800;
    background: linear-gradient(90deg, var(--accent), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dashboard-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 16px;
}

.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.kpi-card {
    background: rgba(10, 26, 72, 0.65);
    border: 1px solid rgba(74, 157, 255, 0.2);
    border-radius: 14px;
    padding: 16px;
}

.kpi-label {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--white);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.dashboard-card {
    background: rgba(10, 26, 72, 0.55);
    border: 1px solid rgba(74, 157, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
}

.dashboard-card h3 {
    margin: 0 0 16px;
    color: var(--white);
    font-size: 20px;
}

.detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(74, 157, 255, 0.16);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row span {
    color: var(--text-muted);
}

.detail-row strong {
    color: var(--white);
    text-align: right;
}

.usage-item + .usage-item {
    margin-top: 14px;
}

.usage-label-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.usage-label-row strong {
    color: var(--white);
}

.usage-bar {
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.usage-bar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #00ffc5, #4a9dff);
    transition: width .3s ease;
}

.payment-history-card {
    margin-top: 0;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th,
.history-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(74, 157, 255, 0.16);
    text-align: left;
}

.history-table th {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
}

.history-table td {
    color: var(--white);
    font-size: 14px;
}

.history-status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
}

.history-status.success {
    color: #69db7c;
    background: rgba(105, 219, 124, 0.15);
    border-color: rgba(105, 219, 124, 0.35);
}

@media (max-width: 1100px) {
    .dashboard-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .subscription-dashboard {
        padding: 20px 16px;
        margin-bottom: 40px;
    }

    .dashboard-header h2 {
        font-size: 28px;
    }

    .dashboard-kpis {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .history-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

body.light-theme .subscription-dashboard,
body.light-theme .dashboard-card,
body.light-theme .kpi-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(240, 245, 255, 0.86));
}

body.light-theme .kpi-value,
body.light-theme .dashboard-card h3,
body.light-theme .detail-row strong,
body.light-theme .usage-label-row strong,
body.light-theme .history-table td {
    color: var(--primary-dark);
}
