/* Дубна VPN — сайт в стиле приложения: тёмный «Acorn liquid glass».
   Токены и слои 1:1 с Android/Windows-клиентами (см. brand/tokens.md для
   происхождения значений). Без клиентского JS: все эффекты — чистый CSS. */

:root {
  --bg-0: #2c2d30;
  --bg-1: #1c1d20;
  --bg-2: #232325;

  --text: #e6e6e6;
  --text-secondary: #999999;
  --text-muted: #666666;

  --primary: #f49048;
  --primary-light: #f7ad78;
  --secondary: #f7b526;
  --success: #77c464;
  --error: #d64363;
  --pencil: #d4c9b8;

  --glass-fill: rgba(255, 255, 255, 0.08);
  --glass-fill-strong: rgba(255, 255, 255, 0.16);
  --glass-stroke: rgba(255, 255, 255, 0.2);
  --glass-stroke-soft: rgba(255, 255, 255, 0.1);

  --radius-field: 24px;
  --radius-btn: 24px;
  --radius-card: 28px;
  --radius-chip: 16px;
  --radius-pill: 999px;

  --pad: 24px;
  --cta-h: 60px;
  --field-h: 56px;
  --max: 1120px;

  --font-hand: "Marck Script", cursive;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@font-face {
  font-family: "Marck Script";
  src: url("/static/fonts/marck-script/MarckScript-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  color: var(--text);
  background: linear-gradient(160deg, var(--bg-0) 0%, var(--bg-1) 55%, var(--bg-2) 100%);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* Тёплые/светлые «блики» по углам — то же самое, что диагональный градиент
   + радиальные пятна на ShellBorder (MainWindow.xaml) и LiquidGlassAtmosphere
   (Android). Фиксированы, чтобы читаться одинаково на любой странице. */
body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}
body::before {
  width: 62vmax;
  height: 62vmax;
  top: -24vmax;
  left: -20vmax;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 70%);
}
body::after {
  width: 70vmax;
  height: 70vmax;
  bottom: -26vmax;
  right: -24vmax;
  background: radial-gradient(circle, rgba(244, 144, 72, 0.18), transparent 70%);
}

img { max-width: 100%; height: auto; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
ul { margin: 0; padding: 0; list-style: none; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--bg-1);
  color: var(--text);
  padding: 10px 16px;
  z-index: 400;
}
.skip-link:focus { left: 12px; top: 12px; }

a { color: var(--primary-light); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
label:focus-within {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* ==== Header / Footer ==== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-fill);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-stroke-soft);
}
.theme-home .site-header,
.theme-download .site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 100;
  background: transparent;
  border-bottom: none;
  backdrop-filter: none;
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 16px;
}
.header-cta {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  pointer-events: auto;
  box-shadow: 0 8px 18px rgba(244, 144, 72, 0.24);
}
.header-cta:hover { background: var(--primary-light); color: #ffffff; }
.brand {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.brand-name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}
.brand-logo {
  height: 44px;
  width: 44px;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.site-footer {
  margin-top: auto;
  padding: 28px 0 32px;
  background: rgba(28, 29, 32, 0.72);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-stroke-soft);
  color: var(--text-secondary);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 16px 32px;
}
.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-brand .brand-logo { height: 36px; width: 36px; }
.footer-brand .brand-name { font-size: 20px; }
.footer-slogan { font-size: 13px; color: var(--primary-light); font-weight: 600; }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 20px;
  grid-column: 2;
  grid-row: 1;
}
.footer-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
}
.footer-nav a:hover { color: var(--text); }

main { flex: 1; }

/* ==== Buttons ==== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--cta-h);
  padding: 0 28px;
  border-radius: var(--radius-btn);
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  max-width: 327px;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(244, 144, 72, 0.28);
}
.btn-primary:hover { background: var(--primary-light); transform: translateY(-1px); }
.btn-danger { background: var(--error); color: #ffffff; }
.btn-danger:hover { transform: translateY(-1px); }
.btn-small {
  min-height: 38px;
  padding: 0 16px;
  font-size: 13px;
  width: auto;
  max-width: none;
  border-radius: var(--radius-pill);
}
.btn-disabled {
  background: var(--glass-fill);
  color: var(--text-muted);
  cursor: not-allowed;
  pointer-events: none;
}

/* ==== Fields / OTP ==== */
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.auth-form label { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.auth-form input:not(.otp-cell) {
  width: 100%;
  max-width: 327px;
  min-height: var(--field-h);
  padding: 0 18px;
  border: 1px solid var(--glass-stroke);
  border-radius: var(--radius-field);
  font-size: 16px;
  font-family: inherit;
  background: var(--glass-fill);
  color: var(--text);
}
.auth-form input:not(.otp-cell)::placeholder { color: var(--text-secondary); }
.auth-form input:not(.otp-cell):focus { border-color: var(--primary); outline: none; }

.otp-boxes {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 327px;
  margin-bottom: 8px;
  scroll-margin-top: 16px;
}
.otp-cell {
  width: 100%;
  min-height: var(--field-h);
  padding: 0;
  border: 1px solid var(--glass-stroke);
  border-radius: var(--radius-chip);
  background: var(--glass-fill);
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
}
.otp-cell:focus { border-color: var(--primary); outline: none; }

.remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.remember-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ==== Chips / icon buttons ==== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--glass-fill);
  border: 1px solid var(--glass-stroke);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}
.chip-gold {
  background: var(--secondary);
  color: #1a1b1e;
  border: none;
  height: auto;
  padding: 6px 12px;
  font-size: 12px;
}
.icon-btn,
.icon-btn-light {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--glass-fill);
  border: 1px solid var(--glass-stroke);
  color: var(--text);
  display: grid;
  place-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary-light); }

/* ==== Hero (landing / download) ==== */
.hero-kit {
  position: relative;
  overflow: hidden;
  padding: 104px 0 0;
  color: var(--text);
}
.theme-home main,
.theme-download main {
  display: flex;
  flex-direction: column;
}
.hero-download {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 96px 0 48px;
}
.download-stage {
  position: relative;
  z-index: 1;
  text-align: center;
  padding-bottom: 48px;
}
.hero-kicker { color: var(--text-secondary); font-size: 14px; margin-bottom: 6px; }
.download-stage h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.15;
  margin: 0 0 8px;
}
.lede { color: var(--text-secondary); font-size: 16px; max-width: 520px; margin: 0 auto 8px; }
.changelog { color: var(--text-secondary); white-space: pre-wrap; margin: 24px 0 0; }

/* Анимированный «жёлудь в ореоле» — веб-эквивалент AcornConnectAura
   (Android Canvas / Windows Canvas): статичная иконка в центре, вокруг —
   мини-жёлуди, пыльца и угли на чистом CSS. */
.brand-orb {
  position: relative;
  width: clamp(180px, 32vw, 260px);
  height: clamp(180px, 32vw, 260px);
  margin: 0 auto 24px;
  display: grid;
  place-items: center;
}
.brand-orb-glow {
  position: absolute;
  inset: -12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 65%);
}
.brand-orb-halo {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 52%, rgba(244, 144, 72, 0.55) 68%, transparent 92%);
  animation: orb-breathe 3.6s ease-in-out infinite;
}
.brand-orb-icon {
  position: relative;
  z-index: 2;
  width: 46%;
  height: 46%;
  object-fit: contain;
  filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.4));
}
.brand-orb-spark {
  position: absolute;
  inset: var(--orbit, 12%);
  z-index: 1;
  margin: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  transform: rotate(var(--spin, 0deg));
  animation: orb-spin var(--period, 12s) linear infinite;
  animation-delay: var(--lag, 0s);
}
.brand-orb-spark::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff6e4 0%, var(--primary) 42%, transparent 100%);
  animation: spark-twinkle 2.4s ease-in-out infinite;
}
.brand-orb-spark.is-seed::after { display: none; }
.brand-orb-spark.is-seed .spark-seed {
  position: absolute;
  top: 0;
  left: 50%;
  width: 32px;
  height: 42px;
  margin: -21px 0 0 -16px;
  filter: drop-shadow(0 0 10px rgba(244, 144, 72, 0.85));
  animation: spark-tumble var(--period, 12s) linear infinite, spark-twinkle 2.8s ease-in-out infinite;
}
.brand-orb-spark.is-pollen::after {
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  background: radial-gradient(circle, #fff6e4 0%, var(--secondary) 50%, transparent 100%);
  animation-duration: 1.8s;
}
.brand-orb-spark.is-ember::after {
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  background: radial-gradient(circle, #fff0c8 0%, #f7b526 40%, transparent 100%);
  filter: drop-shadow(0 0 10px rgba(247, 181, 38, 0.85));
  animation-duration: 1.3s;
}
.spark-1 { --orbit: 14%; --period: 11s; --lag: -1s; --spin: 18deg; }
.spark-2 { --orbit: 9%; --period: 14s; --lag: -4s; --spin: 112deg; animation-direction: reverse; }
.spark-3 { --orbit: 6%; --period: 16s; --lag: -7s; --spin: 208deg; }
.spark-4 { --orbit: 11%; --period: 10s; --lag: -2.5s; --spin: 292deg; animation-direction: reverse; }
.spark-5 { --orbit: 16%; --period: 8s; --lag: -0.6s; --spin: 48deg; }
.spark-6 { --orbit: 7%; --period: 9.5s; --lag: -3.2s; --spin: 156deg; animation-direction: reverse; }
.spark-7 { --orbit: 4%; --period: 7.5s; --lag: -5s; --spin: 248deg; }
.spark-8 { --orbit: 3%; --period: 6.5s; --lag: -1.4s; --spin: 74deg; }
.spark-9 { --orbit: 8%; --period: 7s; --lag: -4.8s; --spin: 318deg; animation-direction: reverse; }
@keyframes orb-spin {
  to { transform: rotate(360deg); }
}
@keyframes spark-tumble {
  to { transform: rotate(-300deg); }
}
@keyframes spark-twinkle {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}
@keyframes orb-breathe {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .brand-orb-halo, .brand-orb-spark, .brand-orb-spark::after, .spark-seed { animation: none; }
}

/* Рукописная подсказка (Marck Script) — тот же приём, что «нажмите для
   подключения» на главном экране приложения. */
.hand-hint {
  font-family: var(--font-hand);
  color: var(--pencil);
  font-size: clamp(20px, 3vw, 26px);
  text-align: center;
  transform: rotate(-2deg);
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.hand-hint-arrow { width: 20px; height: 20px; display: block; opacity: 0.85; }

/* ==== Download tiles ==== */
.dl-pair {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin: 32px auto 0;
}
.dl-btn {
  width: 260px;
  min-height: 300px;
  padding: 32px 24px 26px;
  border-radius: var(--radius-card);
  background: var(--glass-fill);
  border: 1px solid var(--glass-stroke);
  backdrop-filter: blur(20px);
  color: var(--text);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}
.dl-btn img {
  width: 140px;
  height: 140px;
  display: block;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.28));
}
.dl-btn strong { font-size: 22px; }
.dl-btn span { font-size: 14px; color: var(--text-secondary); font-weight: 600; }
.dl-btn:hover { transform: translateY(-4px); background: var(--glass-fill-strong); border-color: var(--primary); }
.dl-btn.is-soon { opacity: 0.5; pointer-events: none; cursor: not-allowed; }
.dl-hint {
  max-width: 36rem;
  margin: 28px auto 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

/* ==== Auth / account / plans / legal shell ==== */
.kit-screen {
  width: 100%;
  max-width: 440px;
  margin: 56px auto;
  padding: 40px 32px 48px;
  background: var(--glass-fill);
  border: 1px solid var(--glass-stroke);
  border-radius: var(--radius-card);
  backdrop-filter: blur(20px);
}
.kit-screen--wide {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px var(--pad) 64px;
  background: none;
  border: none;
  backdrop-filter: none;
}
.page-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.page-heading h1 { font-size: 16px; font-weight: 700; }
.kit-title { font-size: 24px; margin-bottom: 8px; }
.kit-sub { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }

.auth-tabs { display: flex; gap: 28px; margin: 28px 0 8px; font-weight: 700; font-size: 16px; }
.auth-tab { color: var(--text-secondary); text-decoration: none; }
.auth-tab.is-active { color: var(--text); }
.auth-or {
  color: var(--text-secondary);
  font-size: 12px;
  margin: 18px 0 4px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 327px;
}
.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--glass-stroke-soft);
}
.auth-resend {
  display: inline-block;
  margin-top: 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-light);
  text-decoration: none;
}
.forget { font-size: 14px; font-weight: 700; color: var(--text); text-decoration: none; }

.check-list { display: grid; gap: 12px; margin: 20px 0 28px; }
.check-list li { display: flex; align-items: center; gap: 10px; color: var(--text-secondary); font-size: 15px; }
.check-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--primary); flex-shrink: 0; position: relative; }
.check-dot::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  width: 6px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 24px 0; }
.plan-card {
  border: 1px solid var(--glass-stroke);
  border-radius: var(--radius-card);
  padding: 22px;
  background: var(--glass-fill);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan-card:hover { border-color: var(--primary); }
.plan-card .plan-price { font-size: 28px; font-weight: 700; }
.plan-meta { color: var(--text-secondary); font-size: 14px; }
.plan-card .btn { margin-top: auto; max-width: none; width: 100%; }

.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 20px; }
.stat-card {
  background: var(--glass-fill);
  border: 1px solid var(--glass-stroke);
  border-radius: var(--radius-card);
  backdrop-filter: blur(20px);
  padding: 18px 20px;
  min-width: 180px;
  flex: 1;
}
.stat-label { display: block; color: var(--text-secondary); font-size: 12px; }
.stat-card strong { font-size: 26px; }
.stat-sub { display: block; color: var(--text-secondary); font-size: 12px; margin-top: 4px; }

.badge { background: var(--primary); color: #ffffff; border-radius: var(--radius-pill); padding: 2px 8px; font-size: 11px; font-weight: 700; }
.inline-form { display: inline-block; margin: 12px 0; }

.device-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.device-table th, .device-table td {
  text-align: left;
  padding: 14px 10px;
  border-bottom: 1px solid var(--glass-stroke-soft);
}
.device-table th { color: var(--text-secondary); font-weight: 600; font-size: 12px; }

.section-label { font-size: 18px; font-weight: 700; margin: 32px 0 8px; }
.kit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--glass-stroke-soft);
}
.kit-row h2, .kit-row strong { font-size: 16px; font-weight: 600; }
.kit-row p, .kit-row .hint { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.kit-row a { color: inherit; text-decoration: none; display: block; }

.toggle-look { width: 51px; height: 31px; border-radius: 100px; background: var(--primary); position: relative; flex-shrink: 0; }
.toggle-look::after {
  content: "";
  width: 27px;
  height: 27px;
  background: #ffffff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  right: 2px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.page-section { padding: 40px 0 64px; }
.legal-body { max-width: 720px; line-height: 1.7; }
.legal-body a { color: var(--primary-light); }

.offline-section { text-align: center; padding: 96px 20px; max-width: 480px; margin: 0 auto; }
.offline-art { width: 160px; height: 210px; margin: 0 auto 28px; position: relative; }
.offline-art::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 120px;
  height: 72px;
  transform: translateX(-50%);
  border-radius: 60px 60px 40px 40px;
  background: rgba(153, 153, 153, 0.5);
}
.offline-art::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 132px;
  height: 128px;
  transform: translateX(-50%);
  border-radius: 50% 50% 46% 46%;
  background: rgba(102, 102, 102, 0.42);
}

.error { color: var(--error); font-size: 14px; }
.status-ok { color: var(--success); font-weight: 700; }

@media (max-width: 720px) {
  .header-row { min-height: 64px; gap: 10px; }
  .brand-logo { height: 36px; width: 36px; }
  .brand-name { font-size: 20px; }
  .header-cta { min-height: 36px; padding: 0 14px; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-nav { grid-column: 1; justify-content: flex-start; }
}

@media (max-width: 520px) {
  .brand-name { display: none; }
}

@media (max-width: 640px) {
  .kit-screen { margin: 32px auto; padding: 32px 22px 40px; }
  .plan-card .btn { width: 100%; }
}

@media (max-height: 780px) {
  .kit-screen--auth {
    margin: 8px auto 0;
    padding: 16px 20px 24px;
  }
  .kit-screen--auth .page-heading { margin-bottom: 10px; }
  .kit-screen--auth .kit-title { font-size: 20px; margin-bottom: 4px; }
  .kit-screen--auth .kit-sub { margin-bottom: 10px; }
  .kit-screen--auth .auth-tabs { margin: 12px 0 8px; }
}
