/* Шрифт Manrope — самохостинг (файлы в /static/fonts, не грузим с CDN, чтобы
   работало в РФ без VPN). Кириллица и латиница — отдельные файлы, браузер сам
   выбирает нужный по unicode-range. font-display: swap — текст виден сразу. */
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/fonts/cyrillic-600-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/fonts/latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/fonts/cyrillic-700-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/fonts/latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("/static/fonts/cyrillic-800-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("/static/fonts/latin-800-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Витрина VPN-сервиса — оформление. Этап 1 (каркас).
   Тёмная тема, адаптив под телефон. Меняется в одном файле. */

:root {
  --bg: #0c1a38;          /* тёмно-синий фон эмблемы */
  --bg-soft: #122349;
  --card: #142a52;
  --card-2: #1a3563;
  --text: #eef3ff;
  --muted: #9fb2d6;
  --border: #294066;
  --accent: #e6b24a;      /* золото банера и лаврового венка */
  --accent-2: #6fd8ec;    /* бирюза призрака / «матрицы» */
  --red: #d23b3b;         /* звезда на шапке и полосы */
  --tg: #229ed9;
  --tg-hover: #1b8ec4;
  --radius: 16px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(109, 139, 255, 0.18), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(58, 208, 196, 0.12), transparent 55%),
    var(--bg);
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }

/* --- Кнопки --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-tg { background: var(--tg); color: #fff; }
.btn-tg:hover { background: var(--tg-hover); }
.btn-lg { padding: 15px 28px; font-size: 17px; }
.btn-outline { border-color: var(--border); background: transparent; color: var(--text); width: 100%; justify-content: center; }
.btn-outline:hover { border-color: var(--accent); background: rgba(230, 178, 74, .10); }
.btn-sm { padding: 8px 15px; font-size: 14px; width: auto; }
.nav-user { color: var(--text); font-weight: 600; font-size: 14px; }

/* Баннеры под шапкой (ошибка/успех входа) */
.banner-error, .banner-ok {
  max-width: 640px;
  margin: 0 auto 22px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 15px;
}
.banner-error { background: rgba(210, 59, 59, .15); border: 1px solid var(--red); color: #ffd9d9; }
.banner-ok { background: rgba(111, 216, 236, .12); border: 1px solid var(--accent-2); color: #d6f6ff; }
.banner-info {
  max-width: 640px;
  margin: 0 auto 18px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  background: rgba(230, 178, 74, .12);
  border: 1px solid var(--accent);
  color: #ffe9c2;
}

/* --- Шапка --- */
.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 21px; letter-spacing: .2px; }
.brand-logo { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a:not(.btn) {
  position: relative;
  color: var(--muted);
  font-weight: 600;
  padding: 4px 2px;
  transition: color .2s ease;
}
/* Анимированное подчёркивание-градиент: растёт из-под пункта на наведении, у
   активного пункта раскрыто полностью — делает меню живее. */
.nav-links a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.nav-links a:not(.btn):hover { color: var(--text); }
.nav-links a:not(.btn):hover::after { transform: scaleX(1); }
.nav-links a.active:not(.btn) { color: var(--text); }
.nav-links a.active:not(.btn)::after { transform: scaleX(1); }
.brand { text-decoration: none; }

/* Гамбургер: симметричен логотипу, спрятан на десктопе — включается в @media
   ниже. Три полоски складываются в «крестик», когда меню раскрыто. */
.nav-toggle {
  display: none;
  width: 52px;
  height: 52px;
  padding: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  cursor: pointer;
}
.nav-toggle:hover { border-color: var(--accent); }
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Большой логотип в герое */
.hero-logo {
  display: block;
  width: 190px;
  max-width: 55vw;
  height: auto;
  margin: 0 auto 26px;
  border-radius: 24px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, .45);
}

/* --- Экран-герой --- */
.hero {
  max-width: 820px;
  margin: 56px auto 40px;
  padding: 0 24px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.1;
  margin: 0 0 18px;
  background: linear-gradient(90deg, var(--accent), #f3dca0 45%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead { font-size: clamp(16px, 2.2vw, 20px); color: var(--muted); margin: 0 auto 30px; max-width: 640px; }
.hero-cta { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.hero-note { color: var(--muted); font-size: 14px; }

/* --- Возможности --- */
.features {
  max-width: var(--maxw);
  margin: 40px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.feature {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.feature .ic { font-size: 28px; }
.feature h3 { margin: 12px 0 6px; font-size: 18px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }

/* --- Тарифы --- */
.tariffs { max-width: var(--maxw); margin: 64px auto; padding: 0 24px; text-align: center; }
.tariffs h2 { font-size: clamp(26px, 4vw, 36px); margin: 0 0 10px; }
.section-sub { color: var(--muted); max-width: 620px; margin: 0 auto 34px; }
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  text-align: left;
}
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card-featured {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(109, 139, 255, .15);
}
.badge {
  position: absolute;
  top: -11px;
  left: 22px;
  background: var(--accent);
  color: #0b1020;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}
.card-title { font-size: 20px; font-weight: 700; }
.card-devices { color: var(--muted); font-size: 14px; }
.price-list { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.price-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.price-list li:last-child { border-bottom: none; }
.price-list span { color: var(--muted); font-size: 14px; }
.price-list b { font-size: 17px; }
.price-buy { display: inline-flex; align-items: center; gap: 12px; }
.buy-form { margin: 0; }
.btn-buy {
  padding: 6px 14px;
  font-size: 13px;
  background: var(--accent);
  color: #0b1020;
}
.btn-buy:hover { background: #f0c264; }
.card-note { color: var(--muted); font-size: 12.5px; text-align: center; margin: 2px 0 0; }

/* --- Финальный призыв --- */
.cta {
  max-width: 720px;
  margin: 64px auto;
  padding: 44px 24px;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-soft), transparent);
  border: 1px solid var(--border);
  border-radius: 24px;
}
.cta h2 { margin: 0 0 10px; font-size: clamp(24px, 4vw, 32px); }
.cta p { color: var(--muted); margin: 0 0 24px; }

/* --- Подвал --- */
.footer {
  max-width: var(--maxw);
  margin: 40px auto 32px;
  padding: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
}
.footer p { margin: 6px 0; }
.footer .muted a { color: var(--accent); }
.footer .muted a:hover { text-decoration: underline; }
.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0 0 18px;
}
.footer-links a { color: var(--muted); font-size: 14px; font-weight: 500; }
.footer-links a:hover { color: var(--text); }

/* Кнопки-действия под инструкцией/страницей */
.how-cta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}
.how-cta .btn-outline { width: auto; }
.section-note { color: var(--muted); font-size: 14px; max-width: 620px; margin: 22px auto 0; text-align: center; }
.cabinet-actions-bottom { margin-top: 18px; }
.cabinet-actions-bottom .btn-buy { width: auto; }

/* --- Кабинет «Мой доступ» --- */
.cabinet {
  max-width: 720px;
  margin: 0 auto 34px;
  padding: 22px 24px;
  text-align: left;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--accent);
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(109, 139, 255, .15);
}
.cabinet-title { margin: 0 0 16px; font-size: 22px; }
.cabinet-empty { color: var(--muted); margin: 0 0 16px; }
.cabinet-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.cabinet-actions .btn-outline { width: auto; }
.cabinet-grid { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: start; }
.cab-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
}
.cab-row span { color: var(--muted); font-size: 14px; }
.cab-row b { text-align: right; }
.cab-row b.ok { color: var(--accent-2); }
.cab-row b.bad { color: var(--red); }
.cab-sub-label { display: block; margin: 16px 0 8px; font-weight: 600; font-size: 14px; }
.cab-sub { display: flex; gap: 8px; }
.cab-sub-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}
.cab-sub .btn-sm { flex-shrink: 0; }
.cab-hint { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.cabinet-qr img {
  display: block;
  width: 190px;
  height: 190px;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}

/* --- Пробный доступ по email (этап 6) --- */
.trial {
  max-width: 720px;
  margin: 0 auto 34px;
  padding: 24px;
  text-align: center;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border);
  border-radius: 20px;
}
.trial-done { border-color: var(--accent-2); text-align: left; }
.trial h2 { margin: 0 0 8px; font-size: 22px; }
.trial-form {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 6px 0 4px;
}
.trial-input {
  flex: 1;
  min-width: 220px;
  max-width: 340px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
}
.trial-input:focus { outline: none; border-color: var(--accent); }
.trial-form .btn-buy { flex-shrink: 0; }
.trial-captcha { flex-basis: 100%; display: flex; justify-content: center; margin: 4px 0; }
.trial-resend { margin-top: 10px; }
/* Таймер срока жизни кода */
.trial-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  margin: 12px 0 6px;
}
.trial-timer b { color: var(--text); font-variant-numeric: tabular-nums; }
.trial-timer.expired { color: var(--red); }
.timer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 8px var(--accent-2);
  animation: timer-pulse 1.6s ease-in-out infinite;
}
.trial-timer.expired .timer-dot { background: var(--red); box-shadow: 0 0 8px var(--red); animation: none; }
@keyframes timer-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn[disabled]:hover { border-color: var(--border); background: transparent; }
.trial-why {
  list-style: none;
  text-align: left;
  margin: 6px auto 18px;
  padding: 0;
  max-width: 520px;
  display: grid;
  gap: 10px;
}
.trial-why li {
  color: var(--muted);
  font-size: 14px;
  padding: 10px 14px;
  background: rgba(111, 216, 236, .06);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.trial-why b { color: var(--text); font-weight: 600; }
.trial-done .cab-hint { text-align: left; }

/* --- Инструкция «Как подключить» (единый макрос connect_guide) --- */
.connect-steps { margin: 8px 0 6px; padding-left: 22px; color: var(--text); }
.connect-steps > li { margin: 8px 0; }
.connect-steps ul { list-style: none; margin: 6px 0; padding-left: 0; }
.connect-steps ul li { color: var(--muted); font-size: 14px; padding: 2px 0; }
.connect-steps ul b { color: var(--text); }
.connect-tip { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
/* коробка инструкции на экране «доступ готов» */
.connect-box { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border); }
.connect-title { margin: 0 0 6px; font-size: 17px; }

/* --- Раздел «Как подключить» на лендинге --- */
.how { max-width: 720px; margin: 64px auto; padding: 0 24px; text-align: center; }
.how h2 { font-size: clamp(26px, 4vw, 36px); margin: 0 0 10px; }
.how-box {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}

/* --- FAQ (раскрывающиеся вопросы) --- */
.faq { max-width: 720px; margin: 64px auto; padding: 0 24px; }
.faq h2 { font-size: clamp(26px, 4vw, 36px); margin: 0 0 20px; text-align: center; }
.faq details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 18px;
  margin: 0 0 12px;
}
.faq details[open] { border-color: var(--accent); }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 12px 0;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "＋ "; color: var(--accent); font-weight: 700; }
.faq details[open] summary::before { content: "－ "; }
.faq details p { color: var(--muted); margin: 0 0 12px; }
.faq details ul { color: var(--muted); margin: 0 0 12px; padding-left: 20px; }

/* --- Летающие призраки (фоновый акцент) --- */
.ghosts {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}
.ghost {
  position: absolute;
  color: var(--accent-2);
  opacity: .18;
  /* Свечение вокруг фигурки — тесный яркий ореол + мягкий широкий (два слоя). */
  filter: drop-shadow(0 0 5px rgba(111, 216, 236, .85))
          drop-shadow(0 0 16px rgba(111, 216, 236, .55));
  will-change: transform;
}
.ghost svg { display: block; width: 100%; height: 100%; }
/* 5 призраков — у каждого своя стартовая точка, размер, прозрачность и свой
   хаотичный маршрут (разные скорость и waypoints → летают вразнобой). */
.ghost-1 { width: 82px; height: 94px; top: 12%; left: 8%;  opacity: .20; animation: wander1 34s ease-in-out infinite; }
.ghost-2 { width: 54px; height: 62px; top: 58%; left: 14%; opacity: .17; animation: wander2 46s ease-in-out infinite; }
.ghost-3 { width: 68px; height: 78px; top: 26%; left: 68%; opacity: .19; animation: wander3 52s ease-in-out infinite; }
.ghost-4 { width: 42px; height: 48px; top: 74%; left: 52%; opacity: .16; animation: wander4 29s ease-in-out infinite; }
.ghost-5 { width: 60px; height: 69px; top: 44%; left: 38%; opacity: .18; animation: wander5 41s ease-in-out infinite; }
@keyframes wander1 {
  0%   { transform: translate(0, 0) rotate(-6deg) scale(1); }
  20%  { transform: translate(34vw, 16vh) rotate(6deg) scale(1.1); }
  40%  { transform: translate(62vw, -6vh) rotate(-4deg) scale(.95); }
  60%  { transform: translate(28vw, 40vh) rotate(9deg) scale(1.05); }
  80%  { transform: translate(-4vw, 22vh) rotate(-8deg) scale(1); }
  100% { transform: translate(0, 0) rotate(-6deg) scale(1); }
}
@keyframes wander2 {
  0%   { transform: translate(0, 0) rotate(5deg) scale(1); }
  25%  { transform: translate(50vw, -30vh) rotate(-7deg) scale(1.08); }
  50%  { transform: translate(70vw, 8vh) rotate(4deg) scale(.9); }
  75%  { transform: translate(20vw, -18vh) rotate(-5deg) scale(1.03); }
  100% { transform: translate(0, 0) rotate(5deg) scale(1); }
}
@keyframes wander3 {
  0%   { transform: translate(0, 0) rotate(3deg) scale(1); }
  20%  { transform: translate(-40vw, 20vh) rotate(-8deg) scale(1.06); }
  45%  { transform: translate(-58vw, -12vh) rotate(6deg) scale(.94); }
  70%  { transform: translate(-24vw, 34vh) rotate(-3deg) scale(1.1); }
  100% { transform: translate(0, 0) rotate(3deg) scale(1); }
}
@keyframes wander4 {
  0%   { transform: translate(0, 0) rotate(-4deg) scale(1); }
  30%  { transform: translate(28vw, -44vh) rotate(8deg) scale(1.12); }
  55%  { transform: translate(-18vw, -20vh) rotate(-6deg) scale(.92); }
  80%  { transform: translate(12vw, -52vh) rotate(5deg) scale(1.04); }
  100% { transform: translate(0, 0) rotate(-4deg) scale(1); }
}
@keyframes wander5 {
  0%   { transform: translate(0, 0) rotate(7deg) scale(1); }
  22%  { transform: translate(-30vw, -26vh) rotate(-5deg) scale(1.07); }
  44%  { transform: translate(36vw, -34vh) rotate(6deg) scale(.95); }
  66%  { transform: translate(44vw, 20vh) rotate(-8deg) scale(1.05); }
  88%  { transform: translate(-16vw, 28vh) rotate(4deg) scale(1); }
  100% { transform: translate(0, 0) rotate(7deg) scale(1); }
}
/* Уважаем настройку «уменьшить движение»: не летают, тихо стоят по местам. */
@media (prefers-reduced-motion: reduce) {
  .ghost { animation: none !important; }
}

/* ===================================================================
   ЖИВОЙ ИНТЕРАКТИВ И ПОЛИРОВКА (этап «редизайн»)
   Всё ниже — только оформление/поведение на клиенте, без внешних
   ресурсов (работает в РФ без VPN). Уважает prefers-reduced-motion.
   =================================================================== */

/* Доступность: единый заметный фокус для клавиатуры (не мешает мыши). */
:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 6px;
}

/* --- Полоска прогресса прокрутки (сверху) --- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  z-index: 60;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 10px rgba(111, 216, 236, .5);
  transition: width .08s linear;
}

/* --- Прилипающая шапка с блюром при прокрутке --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background .25s ease, box-shadow .25s ease, backdrop-filter .25s ease;
}
.topbar.scrolled {
  background: rgba(12, 26, 56, .72);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35), inset 0 -1px 0 var(--border);
}
.brand-logo { transition: transform .2s ease; }
.brand:hover .brand-logo { transform: rotate(-6deg) scale(1.06); }

/* Контейнер входа через Telegram (виджет или запасная кнопка «Войти по email») */
.tg-login { display: inline-flex; align-items: center; min-height: 34px; }

/* --- Появление секций при прокрутке --- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.22, 1, .36, 1);
}
.reveal.in { opacity: 1; transform: none; }
/* Ступенчатая задержка для сетки карточек/фич (stagger может быть как
   вложенным в .reveal, так и самим .reveal-элементом) */
.reveal.in .stagger > *,
.reveal.stagger.in > * { animation: rise .55s cubic-bezier(.22, 1, .36, 1) both; }
.reveal.in .stagger > *:nth-child(1), .reveal.stagger.in > *:nth-child(1) { animation-delay: .04s; }
.reveal.in .stagger > *:nth-child(2), .reveal.stagger.in > *:nth-child(2) { animation-delay: .10s; }
.reveal.in .stagger > *:nth-child(3), .reveal.stagger.in > *:nth-child(3) { animation-delay: .16s; }
.reveal.in .stagger > *:nth-child(4), .reveal.stagger.in > *:nth-child(4) { animation-delay: .22s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* --- Карточки: подъём и «прожектор» за курсором --- */
.feature, .card {
  position: relative;
  /* Важно: НЕ ставить overflow:hidden — иначе обрезается бейдж «Популярный»,
     который специально торчит над карточкой (.badge top:-11px). «Прожектор»
     ::before и так скруглён своим border-radius:inherit — отдельная обрезка
     не нужна. */
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.feature::before, .card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 0%),
              rgba(111, 216, 236, .16), transparent 60%);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.feature:hover, .card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-2);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .38);
}
.feature:hover::before, .card:hover::before { opacity: 1; }
.card-featured:hover { border-color: var(--accent); box-shadow: 0 20px 50px rgba(230, 178, 74, .18); }
.feature .ic { display: inline-block; transition: transform .25s ease; }
.feature:hover .ic { transform: translateY(-2px) scale(1.12); }

/* Пульсация бейджа «Популярный» */
.badge { box-shadow: 0 0 0 0 rgba(230, 178, 74, .55); animation: badge-pulse 2.4s ease-out infinite; }
@keyframes badge-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(230, 178, 74, .5); }
  70%  { box-shadow: 0 0 0 12px rgba(230, 178, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(230, 178, 74, 0); }
}

/* Кнопки: лёгкое свечение и подъём на наведении */
.btn-tg:hover, .btn-buy:hover { box-shadow: 0 8px 22px rgba(34, 158, 217, .28); transform: translateY(-1px); }
.btn-buy:hover { box-shadow: 0 8px 22px rgba(230, 178, 74, .30); }
.btn-lg:hover { transform: translateY(-1px); }

/* --- Герой: «дыхание» логотипа и живой бейдж --- */
.hero-logo { animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-6px) scale(1.02); } }
.hero-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  margin: 0 0 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: #d6f6ff;
  background: rgba(111, 216, 236, .10);
  border: 1px solid rgba(111, 216, 236, .35);
}
.hero-live .live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #37d67a; box-shadow: 0 0 8px #37d67a;
  animation: timer-pulse 1.6s ease-in-out infinite;
}

/* --- Тарифы: тумблер срока + крупная цена --- */
.period-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  margin: 0 auto 32px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
}
.period-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color .18s ease, background .18s ease;
}
.period-btn:hover { color: var(--text); }
.period-btn.active { background: var(--accent); color: #0b1020; }
.period-btn .save-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(55, 214, 122, .18);
  color: #7ef0a8;
}
.period-btn.active .save-pill { background: rgba(11, 16, 32, .18); color: #0b1020; }

/* Один блок цены на карточку — показываем активный срок, прячем прочие */
.tariff-price { display: none; margin-top: auto; }
.tariff-price.active { display: block; animation: rise .3s ease both; }
.price-big { font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.price-big small { font-size: 15px; font-weight: 600; color: var(--muted); }
.price-permonth { color: var(--muted); font-size: 13px; margin: 6px 0 14px; }
.price-save {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(55, 214, 122, .16);
  color: #7ef0a8;
  vertical-align: middle;
}
/* Экономия «за устройство» (вкладка 1 месяц) — отдельная строка и бирюзовый
   бейдж, чтобы не путать со скидкой за длинный срок (та зелёная). */
.price-perdevice { color: var(--muted); font-size: 13px; margin: -8px 0 14px; }
.price-save-device {
  margin-left: 6px;
  background: rgba(111, 216, 236, .16);
  color: #bdeeff;
}
.tariff-price .btn-buy, .tariff-price .btn-outline { width: 100%; justify-content: center; padding: 11px 16px; font-size: 15px; }
.buy-form { margin: 0; }

/* --- Кабинет: свечение QR и успешное копирование --- */
.cabinet-qr img { transition: box-shadow .25s ease, transform .25s ease; }
.cabinet-qr img:hover { transform: scale(1.03); box-shadow: 0 0 0 3px rgba(111, 216, 236, .4), 0 12px 30px rgba(0, 0, 0, .4); }
.btn.copied { border-color: var(--accent-2) !important; background: rgba(111, 216, 236, .14) !important; color: #d6f6ff; }

/* --- FAQ: плавное появление содержимого --- */
.faq details { transition: border-color .2s ease, background .2s ease; }
.faq details:hover { border-color: var(--accent-2); }
.faq summary::before { transition: transform .2s ease; display: inline-block; }
.faq details[open] > *:not(summary) { animation: faq-open .28s ease both; }
@keyframes faq-open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Отключаем декоративное движение по системной настройке */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .reveal.in .stagger > * { animation: none; }
  .hero-logo, .badge, .hero-live .live-dot, .tariff-price.active,
  .faq details[open] > *:not(summary) { animation: none; }
  .feature, .card, .btn { transition: none; }
}

/* --- Адаптив --- */
@media (max-width: 880px) {
  .features, .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  /* Навигация на телефоне: логотип слева, гамбургер справа (симметрично).
     Меню свёрнуто; по тапу на гамбургер раскрывается ПОЛНАЯ навигация ниже —
     включая вход/«Открыть в Telegram». Десктоп (>560px) не затрагивается. */
  .nav { flex-wrap: wrap; align-items: center; gap: 12px; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    flex-basis: 100%;      /* переносится под шапку на всю ширину */
    display: none;         /* свёрнуто по умолчанию */
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 12px;
  }
  .nav-links.open { display: flex; }   /* раскрыто по тапу на гамбургер */
  .features, .cards { grid-template-columns: 1fr; }
  .cabinet-grid { grid-template-columns: 1fr; justify-items: center; }
  .cabinet-info { width: 100%; }
  .period-toggle { display: flex; width: 100%; }
  .period-btn { flex: 1; justify-content: center; padding: 9px 8px; }
}
