:root {
    --bg: #08111f;
    --bg-2: #0b1628;
    --card: #14213a;
    --card-2: #182744;
    --card-soft: rgba(255, 255, 255, 0.035);
    --text: #eef4ff;
    --text-soft: #c8d5ee;
    --muted: #8ea2c8;
    --line: rgba(255, 255, 255, 0.08);

    --primary: #3d73ff;
    --primary-hover: #2f63eb;
    --primary-soft: rgba(61, 115, 255, 0.16);

    --secondary: rgba(255, 255, 255, 0.06);
    --secondary-hover: rgba(255, 255, 255, 0.10);

    --nav-btn: rgba(255, 255, 255, 0.04);
    --nav-btn-border: rgba(61, 115, 255, 0.22);

    --success: #19c37d;
    --success-soft: rgba(25, 195, 125, 0.14);

    --warning: #f5b942;
    --warning-soft: rgba(245, 185, 66, 0.14);

    --danger: #ff5d6c;
    --danger-soft: rgba(255, 93, 108, 0.14);

    --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(61, 115, 255, 0.16), transparent 26%),
        radial-gradient(circle at top right, rgba(25, 195, 125, 0.08), transparent 18%),
        linear-gradient(180deg, var(--bg), var(--bg-2));
}

.container {
    min-height: 100vh;
    padding: 26px 18px 34px;
}

.page {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
}

.page-narrow {
    max-width: 820px;
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
    padding: 28px 30px;
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(17, 34, 78, 0.88), rgba(14, 28, 63, 0.92));
    border: 1px solid rgba(61, 115, 255, 0.20);
    box-shadow: var(--shadow);
}

.hero h1 {
    margin: 0;
    font-size: 32px;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.hero p {
    margin: 10px 0 0;
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.5;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge.status-active {
    background: var(--success-soft);
    color: #c9f5e1;
    border-color: rgba(25, 195, 125, 0.24);
}

.badge.status-frozen {
    background: var(--warning-soft);
    color: #ffe6ae;
    border-color: rgba(245, 185, 66, 0.24);
}

.badge.status-expired {
    background: var(--danger-soft);
    color: #ffc5cb;
    border-color: rgba(255, 93, 108, 0.24);
}

.badge.status-no_subscription,
.badge.status-default {
    background: rgba(255, 255, 255, 0.07);
    color: #d9e4f8;
    border-color: rgba(255, 255, 255, 0.10);
}

.grid {
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    gap: 18px;
}

.card {
    background: linear-gradient(180deg, var(--card), var(--card-2));
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow);
}

.card h2 {
    margin: 0 0 20px;
    font-size: 20px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--text);
}

.card p {
    margin: 0;
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.65;
}

.info-list {
    display: grid;
    gap: 14px;
}

.info-item {
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
}

.info-item-active {
    background: linear-gradient(180deg, rgba(61, 115, 255, 0.16), rgba(61, 115, 255, 0.07));
    border: 1px solid rgba(61, 115, 255, 0.28);
    box-shadow: 0 10px 24px rgba(61, 115, 255, 0.10);
}

.info-label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.info-value {
    color: var(--text);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
}

.muted {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.status-box,
.server-switch-block,
.tariff-advantages,
.subscription-highlight,
.qr-block {
    margin-top: 18px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: var(--card-soft);
    border: 1px solid var(--line);
}

.server-status-card {
    margin-bottom: 16px;
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(61, 115, 255, 0.16), rgba(61, 115, 255, 0.07));
    border: 1px solid rgba(61, 115, 255, 0.24);
    box-shadow: 0 10px 24px rgba(61, 115, 255, 0.10);
}

.server-status-label {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.server-status-value {
    color: var(--text);
    font-size: 27px;
    font-weight: 700;
    line-height: 1.2;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    border: 1px solid transparent;
}

.status-pill.status-active {
    background: var(--success-soft);
    color: #c9f5e1;
    border-color: rgba(25, 195, 125, 0.24);
}

.status-pill.status-frozen {
    background: var(--warning-soft);
    color: #ffe6ae;
    border-color: rgba(245, 185, 66, 0.24);
}

.status-pill.status-expired {
    background: var(--danger-soft);
    color: #ffc5cb;
    border-color: rgba(255, 93, 108, 0.24);
}

.status-pill.status-no_subscription {
    background: rgba(255, 255, 255, 0.07);
    color: #d9e4f8;
    border-color: rgba(255, 255, 255, 0.10);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 18px;
    border-radius: 14px;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    transition: 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary,
.btn {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover,
.btn:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.btn-secondary:hover {
    background: var(--secondary-hover);
}

.btn-back {
    background: var(--nav-btn);
    color: #dbe7ff;
    border: 1px solid var(--nav-btn-border);
}

.btn-back:hover {
    background: rgba(61, 115, 255, 0.12);
}

.active-server-btn {
    background: rgba(61, 115, 255, 0.16);
    color: #dce8ff;
    border: 1px solid rgba(61, 115, 255, 0.26);
    cursor: default;
    opacity: 1;
}

.active-server-btn:hover {
    transform: none;
    background: rgba(61, 115, 255, 0.16);
}

.vpn-code {
    display: block;
    margin-top: 12px;
    padding: 16px;
    border-radius: 16px;
    background: #09142a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #e0ebff;
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.65;
}

.note {
    margin-top: 16px;
    padding: 15px 16px;
    border-radius: var(--radius-md);
    background: rgba(61, 115, 255, 0.09);
    border: 1px solid rgba(61, 115, 255, 0.18);
    color: #d7e5ff;
    font-size: 15px;
    line-height: 1.55;
}

.alert {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 700;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--success-soft);
    color: #c9f5e1;
    border-color: rgba(25, 195, 125, 0.24);
}

.alert-error {
    background: var(--danger-soft);
    color: #ffc5cb;
    border-color: rgba(255, 93, 108, 0.24);
}

.tariff-list {
    display: grid;
    gap: 16px;
}

.tariff-card {
    position: relative;
    padding: 20px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
}

.tariff-card-popular {
    background: linear-gradient(180deg, rgba(61, 115, 255, 0.14), rgba(61, 115, 255, 0.06));
    border: 1px solid rgba(61, 115, 255, 0.26);
    box-shadow: 0 10px 30px rgba(61, 115, 255, 0.12);
}

.tariff-badge {
    display: inline-flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(61, 115, 255, 0.16);
    color: #d6e4ff;
    border: 1px solid rgba(61, 115, 255, 0.20);
    font-size: 13px;
    font-weight: 700;
}

.tariff-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.tariff-name {
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.tariff-subtitle,
.subscription-highlight-text,
.tariff-advantages-list,
.server-switch-subtitle {
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.65;
}

.tariff-price {
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
}

.subscription-highlight-title,
.tariff-advantages-title,
.server-switch-title {
    margin-bottom: 8px;
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
}

.tariff-advantages-list {
    margin: 0;
    padding-left: 20px;
}

.history-list {
    display: grid;
    gap: 14px;
}

.history-item {
    padding: 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
}

.history-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.history-action-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-action {
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    text-transform: uppercase;
}

.history-date {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.history-details {
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.6;
}

.history-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    flex-shrink: 0;
}

.history-dot-success {
    background: var(--success);
    box-shadow: 0 0 12px rgba(25, 195, 125, 0.45);
}

.history-dot-vpn {
    background: var(--primary);
    box-shadow: 0 0 12px rgba(61, 115, 255, 0.45);
}

.history-dot-warning {
    background: var(--warning);
    box-shadow: 0 0 12px rgba(245, 185, 66, 0.45);
}

.history-dot-default {
    background: #99a8c4;
    box-shadow: 0 0 10px rgba(153, 168, 196, 0.30);
}

.server-actions .btn,
.server-actions .active-server-btn {
    min-width: 250px;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(2, 8, 20, 0.74);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 999;
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    width: 100%;
    max-width: 430px;
    border-radius: 22px;
    background: linear-gradient(180deg, var(--card), var(--card-2));
    border: 1px solid var(--line);
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.44);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.modal-header h3 {
    margin: 0;
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: 0;
    color: var(--text);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 22px;
    text-align: center;
}

.qr-image {
    width: 100%;
    max-width: 280px;
    padding: 10px;
    border-radius: 14px;
    background: #fff;
}

.hidden {
    display: none;
}

@media (max-width: 900px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 24px 22px;
    }

    .hero h1 {
        font-size: 30px;
    }

    .page-narrow {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 18px 12px 24px;
    }

    .card {
        padding: 22px 18px;
    }

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

    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-back {
        width: 100%;
    }

    .server-actions .btn,
    .server-actions .active-server-btn {
        min-width: 100%;
    }

    .tariff-top,
    .history-top {
        align-items: flex-start;
    }
}

.btn-back {
    background: linear-gradient(180deg, rgba(91, 76, 167, 0.22), rgba(72, 60, 132, 0.20));
    color: #e6ddff;
    border: 1px solid rgba(145, 126, 255, 0.34);
    box-shadow: 0 8px 20px rgba(64, 45, 120, 0.22);
}

.btn-back:hover {
    background: linear-gradient(180deg, rgba(107, 89, 196, 0.28), rgba(81, 67, 152, 0.24));
}

.btn-soft-blue {
    background: rgba(61, 115, 255, 0.12);
    color: #dbe7ff;
    border: 1px solid rgba(61, 115, 255, 0.24);
}

.btn-soft-blue:hover {
    background: rgba(61, 115, 255, 0.18);
}

.actions-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.actions-left {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.actions-right {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.server-status-card {
    position: relative;
    overflow: hidden;
}

.server-status-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(61, 115, 255, 0.18), 0 0 28px rgba(61, 115, 255, 0.12);
    pointer-events: none;
}

.server-status-value {
    color: #ffffff;
    text-shadow: 0 0 18px rgba(61, 115, 255, 0.18);
}

.info-item-active {
    background: linear-gradient(180deg, rgba(61, 115, 255, 0.22), rgba(61, 115, 255, 0.10));
    border: 1px solid rgba(61, 115, 255, 0.38);
    box-shadow: 0 12px 28px rgba(61, 115, 255, 0.18);
}

.info-item-active .info-value {
    color: #ffffff;
}

.server-actions .active-server-btn {
    background: linear-gradient(180deg, rgba(61, 115, 255, 0.30), rgba(61, 115, 255, 0.16));
    border: 1px solid rgba(61, 115, 255, 0.45);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(61, 115, 255, 0.16);
}

.history-actions-right {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

@media (max-width: 640px) {
    .actions-split {
        flex-direction: column;
        align-items: stretch;
    }

    .actions-left,
    .actions-right {
        width: 100%;
    }

    .actions-right .btn-back {
        width: 100%;
    }

    .history-actions-right {
        justify-content: stretch;
    }

    .history-actions-right .btn-back {
        width: 100%;
    }
}

/* Полировка страницы подписки */
.tariff-advantages {
    margin-top: 0;
    margin-bottom: 24px;
    padding: 20px 22px;
}

.tariff-advantages-title {
    margin-bottom: 12px;
}

.tariff-advantages-list {
    margin: 0;
    padding-left: 22px;
}

.tariff-advantages-list li + li {
    margin-top: 8px;
}

.tariff-list {
    display: grid;
    gap: 20px;
    margin-top: 6px;
}

.tariff-card {
    padding: 22px;
}

.tariff-top {
    margin-bottom: 16px;
}

.tariff-name {
    margin-bottom: 6px;
}

.tariff-card .actions {
    margin-top: 18px;
}

.subscription-highlight {
    margin-top: 22px;
    padding: 20px 22px;
}

.subscription-highlight-title {
    margin-bottom: 10px;
}

.subscription-highlight-text {
    max-width: 520px;
}

.note {
    margin-top: 18px;
}

.card .actions-right {
    margin-top: 22px;
}

.card .actions-right .btn-back {
    min-width: 190px;
}

/* Чуть лучше баланс колонок именно для страницы подписки */
.grid .card .info-list + .note {
    margin-top: 18px;
}