/* ── Токены ─────────────────────────────────────────────── */
:root {
  --bg:        #0b0f14;
  --bg-soft:   #111820;
  --bg-card:   #151e28;
  --line:      #223040;
  --text:      #e8eef5;
  --text-dim:  #93a4b8;
  --accent:    #2f80ed;
  --accent-2:  #56ccf2;
  --ok:        #27c281;
  --warn:      #f2c94c;
  --radius:    14px;
  --maxw:      1120px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
/* длинные слова, ссылки и номера не должны распирать страницу */
h1, h2, h3, p, li, td, th, summary { overflow-wrap: break-word; }
a { -webkit-tap-highlight-color: rgba(47,128,237,.2); }
a { color: var(--accent-2); }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
section { padding-block: 72px; }
@media (max-width: 640px) { section { padding-block: 48px; } }

h1, h2, h3 { line-height: 1.2; margin: 0 0 16px; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(28px, 5vw, 46px); }
h2 { font-size: clamp(24px, 3.6vw, 34px); }
h3 { font-size: 19px; }
p  { margin: 0 0 16px; }
.lead { font-size: clamp(16px, 2vw, 19px); color: var(--text-dim); }
.dim  { color: var(--text-dim); }
.small { font-size: 14px; }

/* ── Шапка ──────────────────────────────────────────────── */
.hdr {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 15, 20, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.hdr__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; max-width: var(--maxw); margin: 0 auto; }
.logo { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; text-decoration: none; color: var(--text); }
.logo span { color: var(--accent-2); }
.hdr__nav { display: flex; gap: 22px; }
.hdr__nav a { color: var(--text-dim); text-decoration: none; font-size: 15px; }
.hdr__nav a[aria-current="page"] { color: var(--accent-2); }
@media (hover: hover) { .hdr__nav a:hover { color: var(--text); } }

/* На узких экранах меню не скрываем, а уводим во вторую строку с прокруткой:
   иначе со телефона между страницами не перейти. */
@media (max-width: 860px) {
  .hdr__in { flex-wrap: wrap; row-gap: 0; padding: 10px 16px 0; }
  .logo { order: 1; }
  .hdr__in > .btn { order: 2; padding: 9px 16px; font-size: 15px; }
  .hdr__nav {
    order: 3; width: 100%; gap: 0;
    margin: 6px -16px 0; padding: 2px 16px 10px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; scroll-snap-type: x proximity;
  }
  .hdr__nav::-webkit-scrollbar { display: none; }
  .hdr__nav a {
    flex: none; padding: 9px 14px; margin-right: 6px;
    border: 1px solid var(--line); border-radius: 999px;
    white-space: nowrap; font-size: 14px; scroll-snap-align: start;
  }
  .hdr__nav a[aria-current="page"] { border-color: var(--accent); color: var(--accent-2); }
}

/* ── Кнопки ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 16px; cursor: pointer;
  text-decoration: none; transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #04131f; }
.btn--primary:hover { filter: brightness(1.08); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ── Hero ───────────────────────────────────────────────── */
.hero { padding-block: 64px 72px; border-bottom: 1px solid var(--line); background:
  radial-gradient(900px 420px at 15% -10%, rgba(47,128,237,.20), transparent 60%),
  radial-gradient(700px 380px at 95% 0%, rgba(86,204,242,.12), transparent 60%); }
.hero__grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: start; }
@media (max-width: 940px) { .hero__grid { grid-template-columns: 1fr; gap: 32px; } }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; margin-bottom: 20px;
  background: rgba(47,128,237,.12); border: 1px solid rgba(86,204,242,.3);
  color: var(--accent-2); font-size: 14px; font-weight: 500;
}
.hero ul.ticks { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.hero ul.ticks li { padding-left: 30px; position: relative; color: var(--text-dim); }
.hero ul.ticks li::before {
  content: '✓'; position: absolute; left: 0; top: 0;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(39,194,129,.15); color: var(--ok);
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}

/* ── Форма ──────────────────────────────────────────────── */
.form-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.form-card h3 { margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; color: var(--text-dim); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 16px;
  color: var(--text); background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 10px; outline: none;
  transition: border-color .12s ease;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 78px; }
.field--hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.consent { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 18px; font-size: 13px; color: var(--text-dim); }
.consent input { margin-top: 3px; width: 16px; height: 16px; flex: none; accent-color: var(--accent); }

.form-note { margin: 14px 0 0; font-size: 13px; color: var(--text-dim); text-align: center; }
.form-msg { margin-top: 14px; padding: 12px 14px; border-radius: 10px; font-size: 15px; display: none; }
.form-msg--ok  { display: block; background: rgba(39,194,129,.12); border: 1px solid rgba(39,194,129,.4); color: #8ce9c2; }
.form-msg--err { display: block; background: rgba(242,201,76,.10); border: 1px solid rgba(242,201,76,.4); color: var(--warn); }

/* ── Сетки карточек ─────────────────────────────────────── */
.grid { display: grid; gap: 18px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card h3 { margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }
.card__num {
  width: 34px; height: 34px; border-radius: 9px; margin-bottom: 14px;
  background: rgba(47,128,237,.15); color: var(--accent-2);
  display: grid; place-items: center; font-weight: 700;
}

.section-head { max-width: 680px; margin-bottom: 36px; }

/* ── Таблица сравнения ──────────────────────────────────── */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.cmp { width: 100%; border-collapse: collapse; min-width: 720px; font-size: 15px; }
table.cmp th, table.cmp td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); }
table.cmp thead th { background: var(--bg-soft); color: var(--text-dim); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
table.cmp tbody tr:last-child td { border-bottom: 0; }
table.cmp tbody tr:hover { background: rgba(47,128,237,.05); }
table.cmp td:first-child { font-weight: 600; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; background: rgba(39,194,129,.14); color: var(--ok); }
.ph { color: var(--text-dim); font-style: italic; }

/* ── FAQ ────────────────────────────────────────────────── */
details.faq { border: 1px solid var(--line); border-radius: 12px; padding: 0; margin-bottom: 12px; background: var(--bg-card); }
details.faq summary { padding: 18px 22px; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: '+'; color: var(--accent-2); font-size: 22px; line-height: 1; flex: none; }
details.faq[open] summary::after { content: '−'; }
details.faq .faq__body { padding: 0 22px 20px; color: var(--text-dim); }

/* ── CTA ────────────────────────────────────────────────── */
.cta { background: linear-gradient(135deg, rgba(47,128,237,.14), rgba(86,204,242,.07)); border-block: 1px solid var(--line); }
.cta__grid { display: grid; grid-template-columns: 1fr .9fr; gap: 48px; align-items: center; }
@media (max-width: 940px) { .cta__grid { grid-template-columns: 1fr; gap: 28px; } }

/* ── Подвал ─────────────────────────────────────────────── */
.ftr { border-top: 1px solid var(--line); padding-block: 36px; color: var(--text-dim); font-size: 14px; }
.ftr a { color: var(--text-dim); }
.ftr__row { display: flex; flex-wrap: wrap; gap: 16px 28px; justify-content: space-between; align-items: center; }
.disclaimer { margin-top: 20px; font-size: 12.5px; line-height: 1.6; color: #6d7e92; }

/* ── Документ (политика) ───────────────────────────────── */
.doc { max-width: 760px; }
.doc h2 { margin-top: 36px; font-size: 22px; }
.doc ul, .doc ol { color: var(--text-dim); padding-left: 22px; }
.doc li { margin-bottom: 8px; }

/* ── Статьи-гайды ───────────────────────────────────────── */
.crumbs { font-size: 14px; color: var(--text-dim); margin-bottom: 18px; }
.crumbs a { color: var(--text-dim); text-decoration: none; }
.crumbs a:hover { color: var(--accent-2); }
.crumbs span { margin: 0 8px; opacity: .5; }

.doc h2, .doc h3 { scroll-margin-top: 90px; }
.doc h2 { border-top: 1px solid var(--line); padding-top: 28px; }
.doc h2:first-of-type { border-top: 0; padding-top: 0; }
.doc > p, .doc li { font-size: 16px; }
.doc strong { color: var(--text); }

.toc { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 36px; }
.toc p { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); font-weight: 600; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin-bottom: 6px; }

.steps { list-style: none; counter-reset: s; padding: 0; margin: 0 0 24px; }
.steps > li { counter-increment: s; position: relative; padding: 0 0 22px 46px; border-left: 1px solid var(--line); margin-left: 16px; }
.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps > li::before {
  content: counter(s); position: absolute; left: -17px; top: -2px;
  width: 34px; height: 34px; border-radius: 9px;
  background: rgba(47,128,237,.15); border: 1px solid var(--line);
  color: var(--accent-2); display: grid; place-items: center; font-weight: 700; font-size: 15px;
}
.steps h3 { margin-bottom: 6px; }
.steps p:last-child { margin-bottom: 0; }

.note { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px;
  background: var(--bg-card); padding: 18px 22px; margin: 0 0 24px; }
.note--warn { border-left-color: var(--warn); }
.note p:last-child { margin-bottom: 0; }
.note b { color: var(--text); }

.doc table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 0 0 24px; }
.doc table th, .doc table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc table thead th { background: var(--bg-soft); color: var(--text-dim); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }

.readnext { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); margin-top: 8px; }
@media (max-width: 680px) { .readnext { grid-template-columns: 1fr; } }
.readnext a { display: block; background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px 20px; text-decoration: none; color: var(--text); }
.readnext a:hover { border-color: var(--accent); }
.readnext b { display: block; margin-bottom: 4px; }
.readnext span { color: var(--text-dim); font-size: 14px; }

/* ── Адаптация под узкие экраны ─────────────────────────── */
/* Отступ для якорей: шапка липкая, на мобильных она в две строки */
.doc h2, .doc h3 { scroll-margin-top: 90px; }
@media (max-width: 860px) { .doc h2, .doc h3 { scroll-margin-top: 130px; } }

/* Таблицы внутри статей скроллятся, а не рвут вёрстку */
.doc .table-scroll { margin-bottom: 24px; }
.doc .table-scroll table { margin-bottom: 0; min-width: 520px; }

@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .form-card { padding: 20px 18px; box-shadow: none; }
  .card { padding: 20px 18px; }
  .toc { padding: 16px 18px; }
  .note { padding: 15px 16px; }
  .doc table th, .doc table td { padding: 10px 12px; }
  .steps > li { padding-left: 40px; margin-left: 14px; }
  .ftr__row { flex-direction: column; align-items: flex-start; gap: 14px; }
  details.faq summary { padding: 15px 16px; }
  .cta { padding-block: 40px; }
}

/* Совсем узкие экраны (320–360px) */
@media (max-width: 380px) {
  h1 { font-size: 26px; }
  .btn { padding: 12px 16px; font-size: 15px; }
  .hdr__in > .btn { padding: 8px 12px; font-size: 14px; }
  .logo { font-size: 16px; }
}

/* Горизонтальная ориентация телефона — не раздуваем вертикальные отступы */
@media (max-height: 500px) and (orientation: landscape) {
  section { padding-block: 36px; }
  .hdr { position: static; }
}

/* Печать: статью можно распечатать без шапки, формы и подвала */
@media print {
  .hdr, .cta, .readnext, .toc, .ftr a, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .doc { max-width: none; }
  a { color: #000; }
  details.faq { border-color: #ccc; }
  details.faq > div { display: block !important; }
}

/* Таблицы в статьях на узких экранах разбираются в карточки:
   горизонтальная прокрутка на телефоне читается плохо */
@media (max-width: 560px) {
  .doc .table-scroll { border: 0; overflow: visible; border-radius: 0; }
  .doc .table-scroll table { min-width: 0; display: block; }
  .doc table thead { display: none; }
  .doc table tbody, .doc table tr, .doc table td { display: block; width: 100%; }
  .doc table tr {
    border: 1px solid var(--line); border-radius: 12px;
    background: var(--bg-card); padding: 4px 16px 12px; margin-bottom: 12px;
  }
  .doc table td { border: 0; padding: 8px 0; }
  .doc table td::before {
    content: attr(data-label); display: block;
    font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-dim); margin-bottom: 3px;
  }
  .doc table td:first-child {
    font-weight: 600; color: var(--text); font-size: 16px;
    border-bottom: 1px solid var(--line); padding: 12px 0 10px;
  }
  .doc table td:first-child::before { display: none; }
  .doc table td:empty { display: none; }
}

/* ── Каталог всех разборов ──────────────────────────────── */
.allguides { margin-top: 36px; border-top: 1px solid var(--line); padding-top: 28px; }
.allguides h2 { font-size: 22px; margin-bottom: 18px; }
.allguides__cols { display: grid; gap: 22px 28px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .allguides__cols { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .allguides__cols { grid-template-columns: 1fr; gap: 20px; } }
.allguides h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-dim); margin: 0 0 10px; font-weight: 600;
}
.allguides ul { list-style: none; margin: 0; padding: 0; }
.allguides li { margin: 0 0 2px; }
.allguides a, .allguides span[aria-current] {
  display: block; padding: 7px 10px; margin-left: -10px; border-radius: 8px;
  font-size: 15px; line-height: 1.35; text-decoration: none; color: var(--text);
}
@media (hover: hover) { .allguides a:hover { background: var(--bg-card); color: var(--accent-2); } }
.allguides span[aria-current] { color: var(--accent-2); background: var(--bg-card); }

/* ── Первый экран на телефоне ───────────────────────────── */
/* Трафик из рекламы — почти весь мобильный. Форма должна быть
   сразу под заголовком, а не через полтора экрана прокрутки. */
@media (min-width: 941px) {
  .hero__text  { grid-column: 1; grid-row: 1; }
  .hero__perks { grid-column: 1; grid-row: 2; }
  .hero__grid > div[id="form"] { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
}
@media (max-width: 940px) {
  .hero { padding-block: 28px 40px; }
  .hero h1 { font-size: clamp(26px, 7vw, 34px); margin-bottom: 12px; }
  .hero .lead { font-size: 16px; margin-bottom: 0; }
  .hero .pill { margin-bottom: 14px; }
  .hero__grid { gap: 20px; }
  .hero ul.ticks { margin-top: 0; }
}

/* Липкая кнопка внизу: показывается, когда форма ушла из виду */
.cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(11,15,20,.92); border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
  transform: translateY(110%); transition: transform .2s ease;
}
.cta-bar .btn { width: 100%; }
.cta-bar.on { transform: translateY(0); }
@media (min-width: 861px) { .cta-bar { display: none; } }
@media (prefers-reduced-motion: reduce) { .cta-bar { transition: none; } }

/* ── Баннер про счётчики ──────────────────────────────────
   Показывается, пока посетитель не решил, грузить ли Метрику и пиксель.
   Разметку создаёт /assets/analytics.js, здесь только вид. */
#ls-cookie {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 80;
  max-width: 680px; margin-inline: auto;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px;
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .7);
  font-size: 14px; line-height: 1.5;
  animation: ls-cookie-in .25s ease-out;
}
@keyframes ls-cookie-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #ls-cookie { animation: none; } }
.ls-cookie__text { flex: 1 1 260px; margin: 0; color: var(--text-dim); }
.ls-cookie__text a { color: var(--accent-2); }
.ls-cookie__btn {
  flex: none; cursor: pointer; font: inherit; font-weight: 600;
  padding: 9px 18px; border-radius: 10px;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--line);
}
.ls-cookie__btn:hover { color: var(--text); }
.ls-cookie__btn--ok {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.ls-cookie__btn--ok:hover { color: #fff; filter: brightness(1.08); }
@media (max-width: 560px) {
  #ls-cookie { flex-direction: column; align-items: stretch; }
  .ls-cookie__btn { width: 100%; }
}
