* {
    box-sizing: border-box;
}

:root {
    --bg-1: #050814;
    --bg-2: #0a1020;
    --text: #eef4ff;
    --muted: rgba(238, 244, 255, 0.72);
    --muted-2: rgba(238, 244, 255, 0.58);
    --line: rgba(255, 255, 255, 0.10);
    --line-2: rgba(255, 255, 255, 0.08);
    --glass-1: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
    --glass-2: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.035));
    --glass-3: rgba(255,255,255,0.04);
    --accent: #00bcd4;
    --accent-2: #8ff3ff;
    --accent-dark: #00a9bd;
    --success: #18c37e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow-1: 0 18px 60px rgba(0,0,0,0.32);
    --shadow-2: 0 16px 42px rgba(0,0,0,0.20);
    --radius-xl: 28px;
    --radius-lg: 24px;
    --radius-md: 20px;
    --radius-sm: 16px;
    --content-max: 1240px;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(0, 188, 212, 0.16), transparent 28%),
        radial-gradient(circle at top right, rgba(90, 103, 216, 0.18), transparent 30%),
        linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
    color: var(--text);
    min-height: 100vh;
}

a {
    color: inherit;
}

img,
svg {
    display: block;
    max-width: 100%;
}

.page {
    width: min(100%, var(--content-max));
    margin: 0 auto;
    padding: clamp(18px, 3vw, 40px) clamp(14px, 2.4vw, 24px) clamp(40px, 6vw, 72px);
}

.page--auth {
    max-width: 1180px;
}

.hero {
    padding: clamp(24px, 4vw, 42px);
    border-radius: var(--radius-xl);
    background: var(--glass-1);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-1);
    backdrop-filter: blur(10px);
}

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

.hero__nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(0, 188, 212, 0.14);
    border: 1px solid rgba(0, 188, 212, 0.30);
    color: var(--accent-2);
    font-size: 14px;
    margin-bottom: 18px;
}

.hero__title,
.auth-title {
    margin: 0 0 12px;
    font-size: clamp(30px, 5vw, 46px);
    line-height: 1.08;
    letter-spacing: -0.02em;
}

.hero__text,
.auth-text,
.section-text {
    margin: 0;
    color: var(--muted);
    font-size: clamp(15px, 2vw, 18px);
    line-height: 1.7;
}

.hero__actions,
.dashboard-actions,
.subscription-actions,
.sync-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    padding: 0 22px;
    border: 0;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: transform .18s ease, opacity .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

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

.btn--primary {
    background: linear-gradient(180deg, #00c8e0, #00a9bd);
    color: #041018;
    box-shadow: 0 12px 30px rgba(0, 188, 212, 0.18);
}

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

.btn--small {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 14px;
}

.btn--full {
    width: 100%;
}

.features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.card {
    padding: 24px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.04));
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 14px 40px rgba(0,0,0,0.22);
}

.card h2 {
    margin: 0 0 12px;
    font-size: 22px;
}

.card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.auth-card {
    padding: clamp(22px, 3vw, 34px);
    border-radius: clamp(22px, 3vw, 30px);
    background: var(--glass-1);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-1);
    backdrop-filter: blur(10px);
}

.auth-card--wide {
    max-width: 100%;
}

.back-link {
    display: inline-block;
    margin-bottom: 18px;
    color: var(--accent-2);
    text-decoration: none;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.form-label {
    display: grid;
    gap: 8px;
}

.form-label span {
    font-size: 14px;
    color: rgba(238, 244, 255, 0.82);
}

.form-input {
    width: 100%;
    min-height: 52px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    padding: 0 16px;
    font-size: 16px;
    outline: none;
}

.form-input::placeholder {
    color: rgba(238, 244, 255, 0.38);
}

.form-input:focus {
    border-color: rgba(0, 200, 224, 0.55);
    box-shadow: 0 0 0 3px rgba(0, 200, 224, 0.10);
}

.auth-footer {
    margin-top: 18px;
    color: rgba(238, 244, 255, 0.72);
}

.auth-footer a {
    color: var(--accent-2);
    text-decoration: none;
}

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.55;
}

.alert--error {
    background: rgba(255, 90, 90, 0.12);
    border: 1px solid rgba(255, 90, 90, 0.35);
    color: #ffd6d6;
}

.alert--success {
    background: rgba(60, 190, 110, 0.12);
    border: 1px solid rgba(60, 190, 110, 0.35);
    color: #d8ffe6;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.dashboard-box,
.vpn-card,
.trial-box,
.subscription-box,
.servers-box,
.sync-box {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--glass-2);
    box-shadow: var(--shadow-2);
}

.dashboard-box {
    padding: 18px;
    min-height: 122px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.dashboard-label {
    font-size: 13px;
    line-height: 1.45;
    color: var(--muted-2);
    margin-bottom: 10px;
}

.dashboard-value {
    font-size: clamp(17px, 2vw, 20px);
    line-height: 1.35;
    color: var(--text);
    font-weight: 700;
    word-break: break-word;
}

.dashboard-stack {
    display: grid;
    gap: 18px;
    margin-top: 24px;
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-title {
    margin: 0;
    font-size: clamp(22px, 3vw, 28px);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.section-subtitle {
    margin: 8px 0 0;
    color: var(--muted-2);
    font-size: 14px;
    line-height: 1.6;
}

.vpn-card,
.trial-box,
.subscription-box,
.servers-box,
.sync-box {
    padding: clamp(18px, 2.4vw, 24px);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1.25;
    font-weight: 700;
    border: 1px solid transparent;
    text-align: center;
}

.status-pill--ok {
    background: rgba(16, 185, 129, .14);
    border-color: rgba(16, 185, 129, .22);
    color: #9ef7cf;
}

.status-pill--warn {
    background: rgba(245, 158, 11, .14);
    border-color: rgba(245, 158, 11, .22);
    color: #ffd690;
}

.status-pill--danger {
    background: rgba(239, 68, 68, .14);
    border-color: rgba(239, 68, 68, .22);
    color: #ffb4b4;
}

.vpn-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.vpn-meta__item {
    border: 1px solid var(--line-2);
    border-radius: 18px;
    background: var(--glass-3);
    padding: 14px;
    min-height: 106px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.vpn-meta__label,
.server-item__label {
    font-size: 12px;
    line-height: 1.45;
    color: var(--muted-2);
    margin-bottom: 6px;
}

.vpn-meta__value,
.server-item__value {
    font-size: clamp(15px, 1.8vw, 18px);
    line-height: 1.35;
    color: var(--text);
    font-weight: 700;
    word-break: break-word;
}

.traffic-wrap {
    margin-top: 18px;
    padding: 16px;
    border-radius: 20px;
    background: var(--glass-3);
    border: 1px solid var(--line-2);
}

.traffic-head,
.traffic-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.traffic-head {
    margin-bottom: 12px;
}

.traffic-title {
    font-size: 15px;
    color: rgba(255,255,255,.78);
}

.traffic-value {
    font-size: 15px;
    color: var(--text);
    font-weight: 700;
    text-align: right;
}

.traffic-bar {
    position: relative;
    width: 100%;
    height: 14px;
    background: rgba(255,255,255,.08);
    border-radius: 999px;
    overflow: hidden;
}

.traffic-bar__fill {
    height: 100%;
    border-radius: 999px;
    transition: width .35s ease;
}

.traffic-bar__fill--ok {
    background: linear-gradient(90deg, #18c37e 0%, #39d98a 100%);
}

.traffic-bar__fill--warn {
    background: linear-gradient(90deg, #f59e0b 0%, #ffd166 100%);
}

.traffic-bar__fill--danger {
    background: linear-gradient(90deg, #ef4444 0%, #ff7b7b 100%);
}

.traffic-foot {
    margin-top: 10px;
    font-size: 13px;
    color: var(--muted-2);
}

.subscription-url {
    padding: 16px;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--accent-2);
    word-break: break-word;
    line-height: 1.6;
}

.sync-errors {
    margin: 14px 0 0;
    padding-left: 18px;
    color: #ffb4b4;
    display: grid;
    gap: 8px;
}

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

.server-item {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    background: rgba(255,255,255,0.04);
    padding: 16px;
}

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

.server-item__name {
    font-size: clamp(17px, 2vw, 20px);
    line-height: 1.3;
    color: var(--text);
    font-weight: 700;
}

.server-item__meta {
    margin-top: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted-2);
}

.server-item__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.server-item__cell {
    border-radius: 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    padding: 12px;
    min-height: 96px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.copy-btn {
    appearance: none;
}

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

    .vpn-meta,
    .server-item__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .page {
        padding: 18px 14px 42px;
    }

    .auth-card {
        padding: 20px;
        border-radius: 22px;
    }

    .dashboard-grid,
    .vpn-meta,
    .server-item__grid {
        grid-template-columns: 1fr;
    }

    .section-head,
    .server-item__top,
    .traffic-head,
    .traffic-foot {
        flex-direction: column;
        align-items: stretch;
    }

    .status-pill {
        width: 100%;
    }

    .btn,
    .dashboard-actions .btn,
    .hero__actions .btn {
        width: 100%;
    }

    .hero__actions,
    .dashboard-actions,
    .subscription-actions,
    .sync-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .hero__badge {
        width: 100%;
        justify-content: center;
    }

    .dashboard-box,
    .vpn-meta__item,
    .server-item__cell {
        min-height: auto;
    }

    .subscription-url {
        font-size: 14px;
    }
}