/* Sprut VPN — тема default. Цвета акцента приходят из админки как CSS-переменные. */
:root {
  --accent: #4F46E5;
  --accent-soft: #EEF2FF;
  --accent-ink: #3730A3;
  --ink: #111111;
  --ink-2: #4B5563;
  --ink-3: #6B7280;
  --line: #E5E7EB;
  --bg: #FFFFFF;
  --bg-2: #F8F9FB;
  --ok: #15803D;
  --ok-soft: #ECFDF3;
  --warn: #B45309;
  --warn-soft: #FFFBEB;
  --err: #B91C1C;
  --err-soft: #FEF2F2;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(17, 17, 17, .04), 0 4px 16px rgba(17, 17, 17, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.55; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.015em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.125rem); font-weight: 750; }
h3 { font-size: 1.125rem; font-weight: 700; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 560px; }
.center { text-align: center; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* шапка */
.header { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--line); }
.header .container { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 1.125rem; }
.brand:hover { text-decoration: none; }
.brand img { height: 34px; width: auto; }
.nav { display: flex; gap: 22px; align-items: center; margin-left: 12px; }
.nav a { color: var(--ink-2); font-weight: 500; }
.nav a:hover { color: var(--ink); text-decoration: none; }
.header .actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.user-email { color: var(--ink-3); font-size: .875rem; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .nav, .user-email { display: none; }
  .header .actions .btn { padding: 8px 12px; }
}

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 999px; padding: 11px 22px; font: inherit; font-weight: 600; cursor: pointer; line-height: 1.2; transition: background .15s, box-shadow .15s, color .15s; text-decoration: none !important; white-space: nowrap; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-secondary { background: var(--accent-soft); color: var(--accent-ink); }
.btn-secondary:hover { background: #E0E7FF; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-link { background: none; border: none; color: var(--ink-2); padding: 0; font-weight: 500; }
.btn-lg { padding: 15px 30px; font-size: 1.0625rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .6; cursor: progress; }

/* главная */
.hero { padding: 72px 0 56px; background: radial-gradient(1200px 420px at 50% -120px, var(--accent-soft), transparent 70%); }
.hero .container { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.hero p.lead { font-size: 1.1875rem; color: var(--ink-2); max-width: 540px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 18px; }
.hero .checks { display: flex; gap: 18px; flex-wrap: wrap; color: var(--ink-2); font-size: .9375rem; padding: 0; margin: 0; list-style: none; }
.hero .checks li::before { content: "✓"; color: var(--accent); font-weight: 800; margin-right: 6px; }
.hero-art { display: flex; justify-content: center; }
.hero-art img { width: min(360px, 80%); }
@media (max-width: 860px) {
  .hero { padding: 40px 0 32px; }
  .hero .container { grid-template-columns: 1fr; }
  .hero-art { display: none; }
}
.section { padding: 64px 0; }
.section-alt { background: var(--bg-2); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.section-head p { color: var(--ink-2); }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.feature .icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 14px; }
.feature p { color: var(--ink-2); margin: 0; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr; } }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step { padding: 8px 4px; }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; margin-bottom: 12px; }
.step p { color: var(--ink-2); margin: 0; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.faq { max-width: 760px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink-2); margin: 12px 0 0; }
.cta-band { background: var(--accent); color: #fff; border-radius: 24px; padding: 44px; display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cta-band h2 { margin: 0; }
.cta-band .btn-primary { background: #fff; color: var(--accent-ink); }

/* тарифы */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; box-shadow: var(--shadow); }
.plan.is-featured { border: 2px solid var(--accent); }
.plan .badge-top { position: absolute; top: -13px; left: 24px; background: var(--accent); color: #fff; font-size: .75rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; letter-spacing: .02em; }
.plan .price { font-size: 2.25rem; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 2px; }
.plan .per { color: var(--ink-3); font-size: .9375rem; margin-bottom: 18px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 24px; color: var(--ink-2); }
.plan li { padding: 5px 0; }
.plan li::before { content: "✓"; color: var(--accent); font-weight: 800; margin-right: 8px; }
.plan .btn { margin-top: auto; }
.plan.is-unavailable { opacity: .6; }

/* карточки и формы */
.page { padding: 40px 0 72px; min-height: calc(100vh - 64px - 160px); }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card + .card { margin-top: 20px; }
.card-soft { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-weight: 600; font-size: .9375rem; margin-bottom: 6px; }
.input { width: 100%; font: inherit; padding: 12px 14px; border: 1px solid #D1D5DB; border-radius: var(--radius-sm); background: #fff; color: var(--ink); }
.input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.pw-wrap { position: relative; }
.pw-wrap .pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--ink-3); cursor: pointer; padding: 6px; font-size: .8125rem; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9375rem; color: var(--ink-2); margin-bottom: 16px; }
.check input { margin-top: 4px; accent-color: var(--accent); }
.error { color: var(--err); font-size: .875rem; margin-top: 6px; }
.hint { color: var(--ink-3); font-size: .8125rem; margin-top: 6px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.alert { border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 20px; font-size: .9375rem; }
.alert-success { background: var(--ok-soft); color: var(--ok); }
.alert-error { background: var(--err-soft); color: var(--err); }
.alert-info { background: var(--accent-soft); color: var(--accent-ink); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }

/* оформление */
.checkout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
@media (max-width: 860px) { .checkout { grid-template-columns: 1fr; } .checkout .summary { order: -1; } }
.summary dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 0; }
.summary dt { color: var(--ink-2); }
.summary dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.summary .total dt, .summary .total dd { font-weight: 800; font-size: 1.25rem; color: var(--ink); padding-top: 10px; border-top: 1px solid var(--line); }
.summary .discount dd { color: var(--ok); }
.methods { display: grid; gap: 10px; }
.methods .btn { justify-content: space-between; border-radius: var(--radius-sm); }

/* кабинет */
.cab-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.cab-head h1 { font-size: 1.75rem; margin: 0; }
.sub-card .sub-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.sub-card h2 { font-size: 1.375rem; margin: 0 0 4px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .8125rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.status-active { background: var(--ok-soft); color: var(--ok); }
.status-expired { background: var(--warn-soft); color: var(--warn); }
.status-disabled { background: #F3F4F6; color: var(--ink-3); }
.status-trial { background: var(--accent-soft); color: var(--accent-ink); }
.meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.meta div { background: var(--bg-2); border-radius: var(--radius-sm); padding: 12px 14px; }
.meta b { display: block; font-size: 1.0625rem; }
.meta span { color: var(--ink-3); font-size: .8125rem; }
@media (max-width: 600px) { .meta { grid-template-columns: 1fr 1fr; } }
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: var(--accent); }
.link-row { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.link-row + .link-row { margin-top: 10px; }
.link-row .flag { font-size: 1.5rem; }
.link-row .url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8125rem; color: var(--ink-2); word-break: break-all; }
.link-row .acts { display: flex; gap: 8px; }
.qr { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; width: 200px; }
.qr svg { display: block; width: 100%; height: auto; }
.qr svg path, .qr svg rect { fill: #111; }
.qr-box { display: none; grid-column: 1 / -1; justify-items: center; }
.qr-box.is-open { display: grid; }
@media (min-width: 861px) { .link-row { grid-template-columns: auto 1fr auto auto; } .qr-box { display: grid; grid-column: auto; } .qr-btn { display: none !important; } .qr { width: 132px; } }
@media (max-width: 600px) { .link-row { grid-template-columns: auto 1fr; } .link-row .acts { grid-column: 1 / -1; } }
.others details { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.others details + details { margin-top: 10px; }
.others summary { cursor: pointer; padding: 14px 18px; display: flex; gap: 12px; align-items: center; list-style: none; }
.others summary::-webkit-details-marker { display: none; }
.others .inner { padding: 0 18px 18px; }
.orders .order { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--line); }
.orders .order:first-child { border-top: 0; }
.empty { text-align: center; padding: 32px 16px; }
.empty img { width: 120px; margin-bottom: 8px; }

/* возврат */
.spinner { width: 44px; height: 44px; border: 4px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* подвал */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 32px 0; color: var(--ink-3); font-size: .875rem; }
.footer .container { display: flex; gap: 20px; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer a { color: var(--ink-2); }

.prose { max-width: 760px; }
.prose h2 { margin-top: 1.6em; }
.prose img { border-radius: var(--radius-sm); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: .875rem; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50; }
.toast.is-on { opacity: 1; }

/* мобильные правки */
.brand { white-space: nowrap; }
.link-row .acts { flex-wrap: wrap; }
@media (max-width: 600px) {
  .meta { grid-template-columns: 1fr; gap: 6px; }
  .meta div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 14px; }
  .meta div .progress { display: none; }
  .link-row .acts .btn { flex: 1 1 140px; padding: 10px 12px; }
  .cab-head .btn { width: 100%; }
  .header .btn-link { font-size: .875rem; }
}
@media (max-width: 420px) { body.is-cabinet .brand-name { display: none; } }
