/* ============================================================
   LeadRadar — лендинг СПб
   Дизайн-токены + компоненты
   ============================================================ */

:root {
  /* Палитра */
  --deep:      #082f38;   /* петрольно-невский — тёмные экраны */
  --deep-2:    #0b414d;   /* верх градиента героя */
  --deep-ink:  #04212880; /* тень на тёмном */
  --paper:     #eceeec;   /* холодный светлый фон */
  --paper-2:   #f6f7f5;   /* карточки на светлом */
  --ink:       #0b1f22;   /* основной текст */
  --ink-soft:  #45575a;   /* вторичный текст */
  --brass:     #c2943a;   /* латунный акцент */
  --brass-hi:  #e6c072;   /* светлая латунь (на тёмном) */
  --line:      rgba(11,31,34,.12);
  --line-lite: rgba(255,255,255,.14);
  --good:      #3f8f6d;   /* положительная метрика */
  --danger:    #b4472f;

  /* Типографика */
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Ритм */
  --maxw: 1160px;
  --gap: clamp(1rem, 2.5vw, 2rem);
  --radius: 14px;
  --radius-lg: 22px;
  --sect-y: clamp(4rem, 9vw, 8rem);
}

/* ---------- Сброс ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-size: clamp(15px, 1.05vw, 17px);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }

/* ---------- Утилиты ---------- */
.wrap { width: min(var(--maxw), 92vw); margin-inline: auto; }
.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: .6ch;
}
.eyebrow::before {
  content: "";
  width: 1.6ch; height: 1px;
  background: currentColor;
  display: inline-block;
}
.section { padding-block: var(--sect-y); }

/* Кнопки */
.btn {
  --bg: var(--brass);
  --fg: #0b1f22;
  display: inline-flex; align-items: center; justify-content: center;
  gap: .6ch;
  padding: .95rem 1.6rem;
  background: var(--bg);
  color: var(--fg);
  border: none;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: .01em;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, filter .18s ease;
  box-shadow: 0 6px 22px -12px rgba(194,148,58,.9);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -12px rgba(194,148,58,.95); filter: brightness(1.03); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--brass-hi); outline-offset: 3px; }
.btn--ghost {
  --bg: transparent; --fg: var(--ink);
  border: 1.5px solid var(--line);
  box-shadow: none;
}
.btn--ghost:hover { border-color: var(--ink); box-shadow: none; filter: none; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
/* .nav-links a задаёт серый цвет — кнопка должна перебивать его */
.nav-links a.btn,
.btn--nav {
  color: var(--fg);
  padding: .7rem 1.25rem;
  font-size: .9rem;
}

/* Поля */
.field { display: flex; flex-direction: column; gap: .4rem; }
.field > label {
  font-family: var(--font-mono);
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-soft);
}
.input, select.input {
  width: 100%;
  padding: .85rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
  color: var(--ink);
  font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 4px rgba(194,148,58,.15); }
select.input { appearance: none; background-image:
  linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
  linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 20px) center, calc(100% - 15px) center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 2.5rem; }

/* =====================================================
   NAV
===================================================== */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 0;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; width: min(var(--maxw), 92vw); }
.brand { display: flex; align-items: center; gap: .55ch; font-weight: 800; letter-spacing: -.01em; font-size: 1.1rem; text-decoration: none; color: var(--ink); }
.brand .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--brass); box-shadow: 0 0 0 3px rgba(194,148,58,.22); flex-shrink: 0; }
.brand-name { white-space: nowrap; }
.brand-tail { font-weight: 600; letter-spacing: -.015em; color: var(--ink-soft); }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { text-decoration: none; font-size: .92rem; color: var(--ink-soft); transition: color .15s; }
.nav-links a:hover { color: var(--ink); }
.nav-links a.mono { font-family: var(--font-mono); font-size: .8rem; }
@media (max-width: 760px) { .nav-links a:not(.btn) { display: none; } }

/* =====================================================
   HERO — тёмный экран с радаром
===================================================== */
.hero {
  position: relative;
  background: radial-gradient(120% 120% at 70% -10%, var(--deep-2), var(--deep) 60%);
  color: #eaf1f0;
  overflow: hidden;
  isolation: isolate;
}
.hero .wrap { position: relative; z-index: 2; padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 880px) { .hero-grid { grid-template-columns: 1fr; } }

.hero .eyebrow { color: var(--brass-hi); }
.hero h1 {
  font-size: clamp(2.3rem, 5.6vw, 4rem);
  line-height: 1.02;
  letter-spacing: -.025em;
  font-weight: 800;
  margin: 1rem 0 1rem;
}
.hero h1 em { font-style: normal; color: var(--brass-hi); }
.hero .lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: #b9cbc9; max-width: 46ch; margin-bottom: 1.8rem; }
.hero-micro { font-family: var(--font-mono); font-size: .78rem; color: #8fa8a6; margin-top: 1rem; letter-spacing: .04em; }
.hero-micro span { color: var(--brass-hi); }

/* карточка оценки в герое */
.valuation-card {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line-lite);
  border-radius: var(--radius-lg);
  padding: clamp(1.3rem, 2.5vw, 2rem);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
}
.valuation-card h2 { margin: 0 0 .3rem; font-size: 1.15rem; }
.valuation-card .sub { color: #9fb6b4; font-size: .9rem; margin-bottom: 1.1rem; }
.vc-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.valuation-card .input { background: rgba(255,255,255,.06); border-color: var(--line-lite); color: #eaf1f0; }
.valuation-card select.input option { color: #0b1f22; }
.valuation-card .input:focus { border-color: var(--brass-hi); box-shadow: 0 0 0 4px rgba(230,192,114,.2); }
.valuation-card .field > label { color: #8fa8a6; }

/* результат оценки */
.vc-result { margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px dashed var(--line-lite); display: none; }
.vc-result.show { display: block; animation: rise .5s ease both; }
.vc-price { font-family: var(--font-mono); font-size: clamp(1.6rem, 3.4vw, 2.4rem); font-weight: 700; color: var(--brass-hi); letter-spacing: -.01em; }
.vc-label { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; color: #8fa8a6; text-transform: uppercase; }
.vc-range { font-family: var(--font-mono); font-size: .85rem; color: #9fb6b4; margin-top: .2rem; }
.vc-note { font-size: .82rem; color: #86a09e; margin-top: .8rem; }
.vc-capture { margin-top: 1rem; display: grid; gap: .7rem; }

/* радар-фон */
.radar {
  position: absolute; z-index: 1;
  right: -12%; top: -18%;
  width: min(70vw, 720px); aspect-ratio: 1;
  pointer-events: none; opacity: .5;
}
.radar .ring { position: absolute; inset: 0; margin: auto; border: 1px solid rgba(230,192,114,.18); border-radius: 50%; }
.radar .ring.r2 { inset: 14%; }
.radar .ring.r3 { inset: 28%; }
.radar .ring.r4 { inset: 42%; }
.radar .sweep {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(230,192,114,.35), transparent 32%);
  mask: radial-gradient(closest-side, transparent 0, #000 0);
  animation: spin 6s linear infinite;
}
.radar .blip { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--brass-hi); box-shadow: 0 0 0 3px rgba(230,192,114,.2); }
.radar .blip.b1 { top: 30%; left: 58%; animation: blip 6s ease-in-out infinite; }
.radar .blip.b2 { top: 62%; left: 40%; animation: blip 6s ease-in-out .8s infinite; }
.radar .blip.b3 { top: 48%; left: 70%; animation: blip 6s ease-in-out 1.6s infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blip { 0%,20%,100% { opacity: 0; } 40% { opacity: 1; } 70% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .radar .sweep { animation: none; } .radar .blip { animation: none; opacity: .7; } }

/* полоса доверия */
.trust {
  background: var(--deep);
  color: #cddddb;
  border-top: 1px solid var(--line-lite);
}
.trust .wrap { display: flex; flex-wrap: wrap; gap: clamp(1.2rem, 4vw, 3.5rem); justify-content: space-between; padding-block: 1.6rem; }
.trust .stat { display: flex; flex-direction: column; }
.trust .stat b { font-family: var(--font-mono); font-size: 1.4rem; color: #fff; font-weight: 700; }
.trust .stat span { font-size: .8rem; color: #8fa8a6; }

/* =====================================================
   TOOLS
===================================================== */
.section-head { max-width: 60ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); line-height: 1.08; letter-spacing: -.02em; margin: .8rem 0 .6rem; }
.section-head p { color: var(--ink-soft); font-size: 1.05rem; }

.tool {
  border-top: 1px solid var(--line);
  padding-top: clamp(2rem, 4vw, 3rem);
  margin-top: clamp(2rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
.tool:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
@media (max-width: 820px) { .tool { grid-template-columns: 1fr; } }
.tool-intro .tag { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--brass); }
.tool-intro h3 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); letter-spacing: -.02em; margin: .5rem 0 .7rem; }
.tool-intro p { color: var(--ink-soft); }
.tool-intro .why {
  margin-top: 1rem;
  font-size: .9rem;
  padding: .85rem 1rem;
  background: color-mix(in srgb, var(--brass) 8%, var(--paper-2));
  border-left: 3px solid var(--brass);
  border-radius: 0 10px 10px 0;
  color: var(--ink-soft);
}

.panel {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.3rem, 2.5vw, 2rem);
  box-shadow: 0 18px 40px -34px rgba(8, 47, 56, .35);
}

/* Ипотечный калькулятор */
.calc-grid { display: grid; gap: 1.25rem; }
.slider-row label { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.slider-row .val { font-family: var(--font-mono); color: var(--brass); font-weight: 600; white-space: nowrap; }

/* Кастомные ползунки без системной обводки */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
}
input[type="range"]:focus,
input[type="range"]:focus-visible {
  outline: none;
}
input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(194,148,58,.35), 0 2px 8px rgba(8, 47, 56, .22);
}
input[type="range"]:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px rgba(194,148,58,.35), 0 2px 8px rgba(8, 47, 56, .22);
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  border: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 10%, transparent);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6.5px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 2px 8px rgba(8, 47, 56, .22);
  transition: transform .15s ease, box-shadow .15s ease;
}
input[type="range"]:hover::-webkit-slider-thumb {
  transform: scale(1.06);
  box-shadow: 0 3px 10px rgba(8, 47, 56, .28);
}
input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.02);
}
input[type="range"]::-moz-range-track {
  height: 5px;
  border: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 10%, transparent);
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 2px 8px rgba(8, 47, 56, .22);
}
input[type="range"]::-moz-focus-outer { border: 0; }

.calc-out { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: .4rem; }
.calc-out .box { background: var(--deep); color: #eaf1f0; border-radius: 12px; padding: 1rem 1.1rem; }
.calc-out .box .k { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: #8fa8a6; }
.calc-out .box .v { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; color: var(--brass-hi); margin-top: .2rem; }

/* Квиз */
.quiz-progress { font-family: var(--font-mono); font-size: .75rem; color: var(--ink-soft); letter-spacing: .1em; margin-bottom: .8rem; }
.quiz-bar { height: 4px; background: var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 1.4rem; }
.quiz-bar > i { display: block; height: 100%; background: var(--brass); width: 0; transition: width .4s ease; }
.quiz-q { font-size: 1.2rem; font-weight: 700; margin-bottom: 1.1rem; letter-spacing: -.01em; }
.quiz-opts { display: grid; gap: .6rem; }
.quiz-opt {
  text-align: left; padding: .9rem 1.1rem; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--paper); color: var(--ink); transition: border-color .15s, background .15s, transform .1s, box-shadow .15s;
}
.quiz-opt:hover { border-color: color-mix(in srgb, var(--brass) 65%, var(--line)); background: #fff; transform: translateX(2px); box-shadow: 0 8px 20px -16px rgba(8,47,56,.35); }
.quiz-opt:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.quiz-result { text-align: center; }
.quiz-result .match { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.quiz-result .dist { font-size: clamp(1.6rem, 3.6vw, 2.3rem); font-weight: 800; letter-spacing: -.02em; color: var(--ink); margin: .3rem 0; }
.quiz-result .price { font-family: var(--font-mono); color: var(--brass); margin-bottom: 1rem; }

/* Карта */
.map-wrap { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); position: relative; }
#map { height: clamp(360px, 55vh, 540px); background: var(--paper-2); }
.map-legend { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.layer-btn {
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .02em;
  padding: .5rem .9rem; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--paper); color: var(--ink-soft); transition: all .15s;
}
.layer-btn:hover { border-color: color-mix(in srgb, var(--brass) 50%, var(--line)); color: var(--ink); }
.layer-btn[aria-pressed="true"] { background: var(--deep); color: var(--brass-hi); border-color: var(--deep); }
.map-note { font-size: .8rem; color: var(--ink-soft); margin-top: .7rem; }
.demo-badge { display: inline-block; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--danger); border: 1px solid currentColor; border-radius: 6px; padding: .1rem .5rem; }
.leaflet-popup-content { font-family: var(--font-body); }
.leaflet-popup-content b { font-family: var(--font-mono); }

/* Общий блок захвата контакта под инструментом */
.capture { margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px dashed var(--line); }
.capture .row { display: grid; grid-template-columns: 1fr 1fr auto; gap: .7rem; align-items: end; }
@media (max-width: 560px) { .capture .row, .vc-row, .calc-out { grid-template-columns: 1fr; } }
.form-msg { font-size: .9rem; margin-top: .7rem; min-height: 1.2em; color: var(--ink-soft); }
.form-msg.ok { color: var(--good); }
.form-msg.err { color: var(--danger); }
.valuation-card .form-msg,
.final .form-msg { color: #9fb6b4; }
.valuation-card .form-msg.ok,
.final .form-msg.ok { color: #7dcea0; }
.valuation-card .form-msg.err,
.final .form-msg.err { color: #e8907a; }
.consent { font-size: .74rem; color: var(--ink-soft); margin-top: .7rem; }
.consent a { color: var(--brass); }

/* =====================================================
   FINAL CTA
===================================================== */
.final {
  background: radial-gradient(120% 140% at 20% 0%, var(--deep-2), var(--deep) 65%);
  color: #eaf1f0; text-align: center;
}
.final h2 { font-size: clamp(1.9rem, 4vw, 3rem); letter-spacing: -.02em; margin-bottom: .8rem; }
.final p { color: #b9cbc9; max-width: 50ch; margin: 0 auto 1.8rem; }
.eyebrow--on-dark { color: var(--brass-hi); }
.final .input {
  background: rgba(255,255,255,.06);
  border-color: var(--line-lite);
  color: #eaf1f0;
}
.final .input::placeholder { color: #8fa8a6; }
.final .input:focus { border-color: var(--brass-hi); box-shadow: 0 0 0 4px rgba(230,192,114,.18); }
.final-form {
  max-width: 460px;
  margin-inline: auto;
  display: grid;
  gap: .7rem;
}

/* =====================================================
   FOOTER
===================================================== */
.foot { background: var(--deep); color: #8fa8a6; border-top: 1px solid var(--line-lite); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; padding-block: 2rem; align-items: center; }
.foot a { color: #cddddb; text-decoration: none; }
.foot a:hover { color: #fff; }
.brand--foot { color: #eaf1f0; }
.brand--foot .brand-tail { color: #9fb6b4; }
.foot-tag { margin: .55rem 0 0; font-family: var(--font-mono); font-size: .78rem; letter-spacing: .02em; }
.foot-links { font-family: var(--font-mono); font-size: .85rem; }
.foot-copy { font-family: var(--font-mono); font-size: .78rem; opacity: .65; }

/* =====================================================
   Анимации появления
===================================================== */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
