/* STOM VPN — сайт покупки доступа. Тёмная тема, единый визуальный стиль
   (сайт задуман как самостоятельный "тоннель"-продукт, поэтому не подстраивается
   под системную светлую тему — как и большинство VPN-клиентов). */

:root {
    /* Палитра "Орбита" -- выбранное направление дизайна: один тёплый янтарный
       акцент на очень тёмном фоне, бирюзовый как редкий второй голос, крупный
       курсивный заголовочный шрифт, медленно дрейфующие мягкие сферы фоном. */
    --bg: #0a0a10;
    --bg-glow: radial-gradient(120% 60% at 50% -10%, rgba(255, 184, 100, 0.10), transparent 60%);
    --surface: #131319;
    --surface-2: #1a1a22;
    --surface-border: #29293380;
    --surface-border-soft: #ffffff14;

    --text: #f5f3ef;
    --text-dim: #9a9aa8;
    --text-faint: #6b6b78;

    --accent: #ffb864;
    --accent-soft: #ffb86426;
    --accent-2: #35e0c7;
    --accent-2-soft: #35e0c724;

    --success: #35d68a;
    --success-soft: #35d68a1f;
    --warning: #ffb648;
    --warning-soft: #ffb6481f;
    --danger: #ff5c72;
    --danger-soft: #ff5c721f;

    --radius-lg: 22px;
    --radius-md: 15px;
    --radius-sm: 11px;
    --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 28px -16px rgba(0, 0, 0, 0.65);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg-glow), var(--bg);
    color: var(--text);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}

body.has-bottom-nav { padding-bottom: 78px; }

/* ---------- фоновые дрейфующие сферы (на каждой странице, не только на входе) ---------- */

.bg-orbs { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(64px);
}
.bg-orb.orb-1 {
    width: 300px; height: 300px; left: 50%; top: -60px; margin-left: -150px;
    background: radial-gradient(circle at 35% 35%, rgba(255, 184, 100, 0.40), rgba(255, 184, 100, 0) 70%);
    animation: orbDriftA 9s ease-in-out infinite;
}
.bg-orb.orb-2 {
    width: 220px; height: 220px; right: -70px; top: 340px;
    background: radial-gradient(circle at 40% 40%, rgba(53, 224, 199, 0.30), rgba(53, 224, 199, 0) 70%);
    animation: orbDriftB 11s ease-in-out infinite;
}
@keyframes orbDriftA { 0%, 100% { transform: translate(-6%, -4%) scale(1); } 50% { transform: translate(8%, 6%) scale(1.12); } }
@keyframes orbDriftB { 0%, 100% { transform: translate(4%, 0%) scale(1); } 50% { transform: translate(-10%, -8%) scale(0.9); } }

@media (prefers-reduced-motion: reduce) {
    .bg-orb { animation: none; }
}

.wrap, header.top, .support-banner, main, footer.site-footer, .bottom-nav { position: relative; z-index: 1; }

h1, h2, h3 {
    font-family: "Fraunces", "Space Grotesk", "Inter", serif;
    font-style: italic;
    letter-spacing: -0.01em;
}

.brand-word {
    font-family: "Space Grotesk", "Inter", sans-serif;
    letter-spacing: -0.01em;
}

a { color: inherit; }

code, .mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

::selection { background: var(--accent-soft); }

/* ---------- layout ---------- */

.wrap {
    max-width: 460px;
    margin: 0 auto;
    padding: 18px 18px 48px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0 28px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    color: var(--text);
}

.brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px -4px var(--accent-soft);
}

.brand-mark svg { width: 16px; height: 16px; }
.brand-mark svg path[fill] { fill: var(--accent); fill-opacity: 1; }
.brand-mark svg path[stroke] { stroke: #1a1204; }

.brand-word { font-weight: 700; font-size: 18px; }

.logout {
    color: var(--text-faint);
    font-size: 13.5px;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}
.logout:hover { color: var(--text-dim); background: var(--surface); }

main { flex: 1; }

/* ---------- баннер поддержки ---------- */

.support-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--accent-2-soft);
    border: 1px solid rgba(53, 224, 199, 0.25);
    border-radius: var(--radius-md);
    padding: 10px 10px 10px 14px;
    margin-bottom: 18px;
}
.sb-icon { font-size: 16px; flex-shrink: 0; }
.sb-text { flex: 1; color: var(--text-dim); font-size: 12.5px; line-height: 1.35; }
.sb-btn {
    flex-shrink: 0;
    background: var(--accent-2);
    color: #06231d;
    font-weight: 700;
    font-size: 12px;
    padding: 8px 13px;
    border-radius: 999px;
    text-decoration: none;
    white-space: nowrap;
}
.sb-btn:hover { filter: brightness(1.05); }

/* ---------- нижняя вкладочная навигация ---------- */

.bottom-nav {
    position: fixed;
    left: 0;
    right: 12px;
    bottom: 14px;
    left: 12px;
    max-width: 436px;
    margin: 0 auto;
    display: flex;
    gap: 4px;
    background: rgba(19, 19, 25, 0.85);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--surface-border-soft);
    border-radius: 24px;
    padding: 9px max(10px, env(safe-area-inset-left)) calc(9px + env(safe-area-inset-bottom));
    box-shadow: 0 16px 36px -16px rgba(0, 0, 0, 0.6);
    z-index: 40;
}
.bn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 9px 4px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-faint);
    font-size: 11.5px;
    font-weight: 700;
    transition: color 0.15s, background 0.15s;
}
.bn-icon { font-size: 23px; line-height: 1; }
.bn-item.active { color: var(--accent); background: var(--accent-soft); }
.bn-item:active { background: var(--surface); }

footer.site-footer {
    margin-top: 32px;
    padding-top: 18px;
    border-top: 1px solid var(--surface-border-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
footer.site-footer .f-tag { color: var(--text-faint); font-size: 12.5px; }
footer.site-footer a {
    color: var(--text-faint);
    font-size: 12.5px;
    text-decoration: none;
}
footer.site-footer a:hover { color: var(--text-dim); }

/* ---------- type ---------- */

h1 {
    font-size: 23px;
    font-weight: 700;
    margin: 0 0 6px;
    text-wrap: balance;
}
h2 { font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.eyebrow {
    text-transform: uppercase;
    font-size: 11.5px;
    letter-spacing: 0.08em;
    color: var(--accent-2);
    font-weight: 600;
    margin: 0 0 8px;
}
.lede {
    color: var(--text-dim);
    font-size: 14.5px;
    margin: 0 0 24px;
}
.muted { color: var(--text-dim); font-size: 14px; }
.faint { color: var(--text-faint); font-size: 12.5px; }
.error {
    color: var(--danger);
    background: var(--danger-soft);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 13.5px;
    margin-bottom: 14px;
}

/* ---------- buttons ---------- */

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 18px;
    margin-bottom: 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.08s ease, border-color 0.15s, background 0.15s;
}
.btn:hover { border-color: #333e58; }
.btn:active { transform: scale(0.985); }

.btn.primary {
    background: var(--accent);
    border-color: transparent;
    color: #1a1204;
    box-shadow: 0 10px 24px -12px var(--accent-soft);
}
.btn.primary:hover { filter: brightness(1.06); }

.btn.ghost {
    background: transparent;
    border: 1px solid var(--surface-border);
    color: var(--text-dim);
    font-weight: 500;
}
.btn.ghost:hover { color: var(--text); }

.btn.danger-ghost {
    background: transparent;
    border: 1px solid var(--surface-border);
    color: var(--danger);
    font-weight: 500;
}
.btn.danger-ghost:hover { background: var(--danger-soft); border-color: transparent; }

.btn.small { padding: 9px 12px; font-size: 13px; margin-bottom: 0; width: auto; }

form { margin: 0 0 10px; }

/* ---------- cards / surfaces ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--surface-border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 20px;
    margin-bottom: 14px;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}
.stat-tile {
    background: var(--surface);
    border: 1px solid var(--surface-border-soft);
    border-radius: var(--radius-md);
    padding: 16px;
}
.stat-tile .stat-label {
    color: var(--text-faint);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}
.stat-tile .stat-value {
    font-family: "Space Grotesk", sans-serif;
    font-size: 25px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.stat-tile .stat-value.accent-2 { color: var(--accent-2); }

/* ---------- кошелёк (баланс/рефералка) ---------- */

.wallet-card {
    background: linear-gradient(160deg, rgba(255, 184, 100, 0.20), rgba(53, 224, 199, 0.09) 75%);
    border: 1px solid var(--accent-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 26px 20px 22px;
    margin-bottom: 14px;
    text-align: center;
}
.wallet-label {
    color: var(--text-dim);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.wallet-value {
    font-family: "Space Grotesk", sans-serif;
    font-size: 42px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.wallet-value span { font-size: 22px; color: var(--text-dim); font-weight: 600; margin-left: 2px; }
.wallet-sub { color: var(--text-faint); font-size: 12.5px; margin-top: 12px; }
.wallet-sub b { color: var(--text-dim); }

/* ---------- menu tiles ---------- */

.tile-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }

.tile {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 15px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border-soft);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, transform 0.08s;
}
.tile:hover { border-color: #333e58; }
.tile:active { transform: scale(0.99); }

.tile.featured {
    background: linear-gradient(135deg, rgba(255, 184, 100, 0.16), rgba(53, 224, 199, 0.08));
    border-color: var(--accent-soft);
}

.tile-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.tile-body { flex: 1; min-width: 0; }
.tile-title { display: block; font-weight: 600; font-size: 14.5px; }
.tile-sub { display: block; color: var(--text-faint); font-size: 12.5px; margin-top: 2px; }
.tile-chevron { color: var(--text-faint); font-size: 18px; flex-shrink: 0; }

/* ---------- forms ---------- */

.field {
    width: 100%;
    padding: 13px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-border);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 15.5px;
    margin-bottom: 12px;
    transition: border-color 0.15s;
}
.field:focus {
    outline: none;
    border-color: var(--accent);
}
.field::placeholder { color: var(--text-faint); }

.field-code {
    text-align: center;
    letter-spacing: 0.5em;
    font-size: 22px;
    font-family: "Space Grotesk", sans-serif;
    padding-left: 10px; /* компенсирует letter-spacing визуально */
}

.auth-shell { padding-top: 6vh; }
.auth-logo {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 14px 30px -10px var(--accent-soft);
    animation: authLogoBob 4s ease-in-out infinite;
}
.auth-logo svg { width: 28px; height: 28px; }
.auth-logo svg path[fill] { fill: var(--accent); fill-opacity: 1; }
.auth-logo svg path[stroke] { stroke: #1a1204; }
@keyframes authLogoBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { .auth-logo { animation: none; } }
.auth-shell h1, .auth-shell .lede { text-align: center; }
.auth-shell .lede { margin-bottom: 26px; }

.step-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 18px; }
.step-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--surface-border); }
.step-dots span.active { background: var(--accent); width: 18px; border-radius: 3px; }

.auth-tabs {
    display: flex;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--surface-border-soft);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 14px;
}
.auth-tab {
    flex: 1;
    padding: 9px 10px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.auth-tab.active { background: var(--surface-2); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset; }

/* ---------- tariffs ---------- */

.tariff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
@media (max-width: 360px) { .tariff-grid { grid-template-columns: 1fr; } }

.tariff-card {
    position: relative;
    display: block;
    width: 100%;
    text-align: left;
    padding: 18px 16px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border-soft);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.08s;
}
.tariff-card:hover { border-color: var(--accent); }
.tariff-card:active { transform: scale(0.985); }
.tariff-card.best { border-color: var(--accent-soft); background: linear-gradient(160deg, rgba(255, 184, 100, 0.14), var(--surface) 60%); }

.tariff-badge {
    position: absolute;
    top: -9px;
    right: 12px;
    background: var(--accent);
    color: #1a1204;
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

.tariff-title { font-size: 13.5px; color: var(--text-dim); margin-bottom: 8px; }
.tariff-price { font-family: "Space Grotesk", sans-serif; font-size: 24px; font-weight: 700; }
.tariff-price sup { font-size: 13px; font-weight: 600; color: var(--text-dim); }
.tariff-per-day { color: var(--text-faint); font-size: 11.5px; margin-top: 3px; margin-bottom: 10px; }

.ticket-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--accent-2-soft);
    color: var(--accent-2);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 999px;
}

/* ---------- keys ---------- */

.key-card { position: relative; }
.key-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill.active { background: var(--success-soft); color: var(--success); }
.status-pill.expiring { background: var(--warning-soft); color: var(--warning); }
.status-pill.expired { background: var(--danger-soft); color: var(--danger); }
.status-pill.unlimited { background: var(--accent-soft); color: var(--accent); }

.link-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    padding: 10px 8px 10px 12px;
    margin: 10px 0 12px;
}
.link-row code {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
    color: var(--text-dim);
}
.copy-btn {
    flex-shrink: 0;
    border: none;
    background: var(--surface-2);
    color: var(--text-dim);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.copy-btn:hover { background: var(--accent-soft); color: var(--accent); }
.copy-btn.copied { background: var(--success-soft); color: var(--success); }

.empty-state { text-align: center; padding: 36px 16px; color: var(--text-faint); }
.empty-state .empty-icon { font-size: 30px; margin-bottom: 10px; }

/* ---------- pay wait ---------- */

.spinner-ring {
    width: 56px;
    height: 56px;
    margin: 4px auto 18px;
    border-radius: 50%;
    border: 3px solid var(--surface-border);
    border-top-color: var(--accent);
    animation: spin 0.9s linear infinite;
}
.spinner-ring.done { animation: none; border: none; display: flex; align-items: center; justify-content: center; font-size: 30px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .spinner-ring { animation: none; }
    .btn, .tile, .tariff-card { transition: none; }
}
