:root {
  --ink: #121a2b;
  --blue: #1f6bff;
  --blue-dark: #1556d6;
  --grad: linear-gradient(90deg, #2b79ff, #00c2ff);
  --bg: #f1f3fb;
  --surface: #ffffff;
  --tint: #eef1fc;
  --muted: #5d6783;
  --line: #e1e6f5;
  --green: #17b26a;
  --danger: #e5384f;
  --font-display: 'Manrope', system-ui, sans-serif;
  --font-body: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* сумісність зі сторінками політики/оферти й адмінки */
  --forest: #ffffff;
  --paper: #ffffff;
  --bg-page: #f1f3fb;
  --bg-card: #ffffff;
  --border-light: #e1e6f5;
  --radius-lg: 18px;
  --radius-md: 10px;
  --shadow-card: 0 18px 40px rgba(30, 60, 120, 0.12);
  --font-heading: var(--font-display);
  --text-heading: var(--ink);
  --text-sub: #34405c;
  --text-muted: var(--muted);
  --color-primary: var(--blue);
  --color-primary-hover: var(--blue-dark);
  --color-danger: var(--danger);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ============ ШАПКА ============ */
.nav { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.nav-in { max-width: 1240px; margin: 0 auto; padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.wordmark::before {
  content: "D";
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  display: grid; place-items: center;
  font-size: 1.1rem;
}
.wordmark em { font-style: normal; color: var(--blue); }
.nav-right { display: flex; align-items: center; gap: 14px; }
.phone { font-weight: 700; text-decoration: none; font-size: 1rem; white-space: nowrap; }
.phone:hover { color: var(--blue); }
.tg-ico {
  width: 40px; height: 40px; border-radius: 12px;
  background: #27a7e7; color: #fff;
  display: grid; place-items: center;
  transition: transform 0.2s;
}
.tg-ico:hover { transform: translateY(-2px); }
.tg-ico svg { width: 22px; height: 22px; }
.tg-handle { font-size: 0.9rem; color: var(--muted); text-decoration: none; font-weight: 600; }
.tg-handle:hover { color: var(--blue); }

/* ============ ГЕРОЙ + КАРТКА ============ */
.page { position: relative; overflow: hidden; }
.page::before {
  content: "";
  position: absolute;
  right: -160px; top: 40px;
  width: 640px; height: 640px;
  border-radius: 50%;
  background: #e1e5fb;
  z-index: 0;
}
.hero-grid {
  position: relative; z-index: 1;
  max-width: 1240px; margin: 0 auto;
  padding: 56px 28px 36px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}
.eyebrow { display: inline-block; color: var(--blue); font-weight: 700; font-size: 0.9rem; margin-bottom: 18px; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 3.6vw, 3.1rem);
  line-height: 1.14;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
  text-wrap: balance;
}
.hero h1 mark { background: none; color: var(--blue); }
.hero-lead { font-size: 1.1rem; color: var(--muted); max-width: 48ch; margin: 0 0 26px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; margin: 0 0 8px; padding: 0; list-style: none; }
.checks li { position: relative; padding-left: 18px; font-weight: 600; font-size: 0.97rem; }
.checks li::before { content: ""; position: absolute; left: 0; top: 0.25em; width: 5px; height: 1.1em; border-radius: 3px; background: var(--green); }
.facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 26px; color: var(--muted); font-size: 0.95rem; }
.facts b { color: var(--ink); font-family: var(--font-display); font-size: 1.5rem; letter-spacing: -0.03em; margin-right: 6px; }

/* картка квізу */
.card {
  background: #fff;
  border-radius: 18px;
  padding: 26px 26px 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid #fff;
  min-height: 560px;
  display: flex;
  flex-direction: column;
}
.screen { display: none; flex: 1; flex-direction: column; }
.screen.active { display: flex; animation: fade 0.3s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.step-pill { font-weight: 800; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue); }
.back { background: none; border: none; color: var(--muted); font-weight: 600; font-size: 0.88rem; display: inline-flex; align-items: center; gap: 5px; padding: 4px; }
.back:hover { color: var(--blue); }
.back[hidden] { visibility: hidden; display: inline-flex !important; }
.back svg { width: 15px; height: 15px; }
.bar { height: 6px; background: var(--tint); border-radius: 6px; overflow: hidden; margin-bottom: 22px; }
.bar i { display: block; height: 100%; width: 25%; background: var(--grad); border-radius: 6px; transition: width 0.4s ease; }

.q-title { font-family: var(--font-display); font-weight: 800; font-size: 1.42rem; line-height: 1.22; letter-spacing: -0.025em; margin: 0 0 6px; }
.q-sub { color: var(--muted); font-size: 0.93rem; margin: 0 0 18px; }

.opts { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: grid;
  grid-template-columns: 40px 1fr 20px;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 9px 14px 9px 9px;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.15s;
}
.opt:hover { border-color: #aebdf0; background: #f8f9ff; transform: translateX(3px); }
.opt:focus-visible { outline: 3px solid rgba(31, 107, 255, 0.35); outline-offset: 1px; }
.opt-emoji { width: 40px; height: 40px; border-radius: 10px; background: var(--tint); display: grid; place-items: center; font-size: 1.2rem; }
.opt-label { display: block; font-weight: 700; font-size: 0.97rem; line-height: 1.25; }
.opt-hint { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 1px; }
.opt-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #c9d2ee; transition: all 0.15s; }
.opt.selected { border-color: var(--blue); background: #f2f6ff; box-shadow: 0 6px 18px rgba(31, 107, 255, 0.12); }
.opt.selected .opt-radio { border-color: var(--blue); background: var(--blue); box-shadow: inset 0 0 0 4px #fff; }
.opt.selected .opt-emoji { background: #dfe9ff; }

/* форма */
.sum { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.sum span { background: var(--tint); border-radius: 8px; padding: 5px 10px; font-size: 0.8rem; }
.sum b { color: var(--blue-dark); font-weight: 700; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.field label { display: block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px 2px; }
.field input[type="text"], .field input[type="tel"] {
  width: 100%;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 13px 14px;
  font: inherit; font-size: 1rem; color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31, 107, 255, 0.12); }
.field.error input { border-color: var(--danger); background: #fff6f7; }
.err { display: none; color: var(--danger); font-size: 0.8rem; margin: 5px 0 0 2px; }
.field.error .err { display: block; }
.way-label { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px 2px; }
.ways { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.way { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px 9px 10px; border-radius: 999px; border: 1.5px solid var(--line); font-weight: 700; font-size: 0.88rem; background: #fff; transition: all 0.15s; }
.way::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #c9d2ee; }
.way.active { border-color: var(--blue); background: #f2f6ff; }
.way.active::before { border-color: var(--blue); background: var(--blue); box-shadow: inset 0 0 0 3px #fff; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 0.82rem; color: var(--muted); cursor: pointer; }
.consent input { margin-top: 2px; width: 17px; height: 17px; accent-color: var(--blue); flex: none; }
.consent a { color: var(--blue); font-weight: 600; }
.consent.error { color: var(--danger); }
#agree-err { display: none; color: var(--danger); font-size: 0.8rem; margin-top: 5px; }
.consent.error + #agree-err { display: block; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: none; border-radius: 10px;
  padding: 15px 26px;
  font-family: var(--font-body);
  font-size: 1rem; font-weight: 700;
  background: var(--grad); color: #fff;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 10px 24px rgba(31, 107, 255, 0.28);
  width: 100%;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(31, 107, 255, 0.34); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn svg { width: 18px; height: 18px; }
.submit-row { margin-top: auto; padding-top: 18px; }
.lock-note { display: block; text-align: center; color: var(--muted); font-size: 0.78rem; margin-top: 10px; }

/* успіх */
.done { text-align: center; justify-content: center; }
.done-mark { width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 50%; background: #e4f8ee; color: var(--green); display: grid; place-items: center; }
.done-mark svg { width: 38px; height: 38px; }
.done-title { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; letter-spacing: -0.03em; margin: 0 0 10px; }
.done-text { color: var(--muted); margin: 0 auto 20px; max-width: 38ch; }
.done-card { background: var(--tint); border-radius: 12px; padding: 4px 16px; margin: 0 auto 22px; text-align: left; width: 100%; }
.done-card div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid #fff; font-size: 0.9rem; }
.done-card div:last-child { border-bottom: none; }
.done-card span { color: var(--muted); }
.restart { display: block; margin: 14px auto 0; background: none; border: none; color: var(--blue); font-weight: 700; font-size: 0.9rem; }
a.btn { text-decoration: none; }

/* плаваюча плашка довіри */
.trust { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 0 28px 20px; display: flex; justify-content: center; }
.trust-in { background: #fff; border-radius: 999px; padding: 16px 34px; box-shadow: 0 14px 34px rgba(30, 60, 120, 0.12); display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 40px; }
.trust-item { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 0.92rem; }
.trust-item i { font-style: normal; width: 34px; height: 34px; border-radius: 10px; background: var(--tint); display: grid; place-items: center; font-size: 1.05rem; }
.trust-item small { display: block; color: var(--muted); font-weight: 500; font-size: 0.78rem; }

.foot { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 18px 28px 30px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 0.84rem; color: var(--muted); }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--blue); }

/* ============ АДАПТИВ ============ */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; padding: 34px 20px 24px; }
  .page::before { width: 420px; height: 420px; right: -180px; top: 120px; }
  .card { min-height: 0; }
  .nav-in { padding: 12px 18px; }
  .trust { padding: 0 20px 16px; }
  .trust-in { border-radius: 24px; padding: 18px 22px; }
  .foot { padding: 14px 20px 26px; }
}
@media (max-width: 560px) {
  .nav-in { padding: 10px 14px; gap: 8px; }
  .wordmark { font-size: 1.08rem; gap: 6px; }
  .wordmark::before { width: 30px; height: 30px; font-size: 0.95rem; border-radius: 9px; }
  .nav-right { gap: 8px; }
  .phone { font-size: 0.84rem; }
  .tg-ico { width: 36px; height: 36px; border-radius: 10px; }
  .tg-handle { display: none; }
  .hero-grid { padding-top: 24px; gap: 22px; }
  .hero h1 { font-size: 1.75rem; margin-bottom: 14px; }
  .checks, .facts { display: none; }
  .hero-lead { margin-bottom: 4px; }
  .checks { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
  .card { padding: 20px 16px; border-radius: 16px; }
  .hero-lead { font-size: 1rem; }
  .trust-in { flex-direction: column; gap: 14px; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ============ ПЕРЕМИКАННЯ: ЗНАЙОМСТВО / КВІЗ ============ */
body.is-intro .hero-grid { display: none; }
body:not(.is-intro) .intro { display: none; }

.intro { position: relative; z-index: 1; }
.intro-in { max-width: 1160px; margin: 0 auto; padding: 56px 28px 40px; animation: fade 0.4s ease both; }
.intro-h { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.1rem, 4.4vw, 3.5rem); line-height: 1.1; letter-spacing: -0.035em; margin: 0 0 18px; text-wrap: balance; }
.intro-h mark { background: none; color: var(--blue); }
.intro-lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; margin: 0 0 34px; }
.gridg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.g { background: #fff; border-radius: 18px; padding: 24px 24px 26px; box-shadow: 0 14px 34px rgba(30, 60, 120, 0.09); border: 1px solid #fff; transition: transform 0.2s, box-shadow 0.2s; }
.g:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(30, 60, 120, 0.15); }
.g i { font-style: normal; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--tint); font-size: 1.4rem; margin-bottom: 16px; }
.g h3 { font-family: var(--font-display); font-weight: 800; font-size: 1.12rem; line-height: 1.25; letter-spacing: -0.02em; margin: 0 0 8px; }
.g p { margin: 0; color: var(--muted); font-size: 0.93rem; }
.g-main { background: var(--grad); color: #fff; grid-row: span 1; }
.g-main p { color: rgba(255, 255, 255, 0.88); }
.g-big { font-family: var(--font-display); font-weight: 800; font-size: 3.4rem; line-height: 1; letter-spacing: -0.05em; margin-bottom: 10px; }
.intro-cta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 22px; margin-top: 34px; }
.btn.btn-intro { width: auto; padding: 17px 34px; font-size: 1.05rem; }
.cta-note { color: var(--muted); font-size: 0.93rem; }
.cta-note b { color: var(--ink); }

/* двоколонковий блок гарантій на кроках квізу */
.tgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; max-width: 640px; }
.ti { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: 0 8px 20px rgba(30, 60, 120, 0.06); }
.ti i { font-style: normal; flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--tint); display: grid; place-items: center; font-size: 1.15rem; }
.ti b { display: block; font-size: 0.92rem; line-height: 1.25; }
.ti small { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 3px; line-height: 1.3; }

@media (max-width: 900px) {
  .gridg { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .intro-in { padding: 28px 18px 28px; }
  .intro-lead { font-size: 1.02rem; margin-bottom: 24px; }
  .gridg { grid-template-columns: 1fr; gap: 12px; }
  .g { padding: 20px; display: grid; grid-template-columns: 46px 1fr; column-gap: 14px; }
  .g i { margin: 0; grid-row: span 2; }
  .g-main { display: block; }
  .g-big { font-size: 2.6rem; }
  .btn.btn-intro { width: 100%; }
  .tgrid { display: none; }
}

/* ===== Мобільне «Знайомство»: велика картка, гарантії списком нижче ===== */
@media (max-width: 640px) {
  .intro-in {
    display: flex; flex-direction: column;
    margin: 14px; padding: 22px 20px 8px;
    background: #fff; border-radius: 18px;
    box-shadow: 0 18px 40px rgba(30, 60, 120, 0.12);
  }
  .intro .eyebrow {
    order: 1; align-self: flex-start;
    background: #eef3ff; border: 1px solid #cfdcfb;
    border-radius: 999px; padding: 9px 16px; margin-bottom: 18px;
    font-size: 0.86rem;
  }
  .intro-h { order: 2; font-size: 2.05rem; line-height: 1.12; margin: 0 0 14px; letter-spacing: -0.035em; }
  .intro-lead { order: 3; display: block; font-size: 1.06rem; margin: 0 0 22px; }
  .intro-cta { order: 4; margin: 0 0 22px; gap: 14px; }
  .btn.btn-intro { width: 100%; justify-content: space-between; padding: 19px 22px 19px 26px; font-size: 1.05rem; border-radius: 14px; }
  .cta-note { text-align: left; width: 100%; font-size: 0.92rem; }
  .gridg { order: 5; display: block; border-top: 1px solid var(--line); padding-top: 6px; }
  .g, .g-main {
    display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; row-gap: 2px;
    background: none; color: var(--ink); box-shadow: none; border: none; border-radius: 0;
    padding: 15px 0; border-bottom: 1px solid var(--line);
  }
  .g:last-child { border-bottom: none; }
  .g:hover { transform: none; box-shadow: none; }
  .g i { grid-row: span 2; margin: 0; width: 44px; height: 44px; border-radius: 12px; font-size: 1.25rem; }
  .g h3 { font-size: 1rem; margin: 0; align-self: end; }
  .g p, .g-main p { display: block; color: var(--muted); font-size: 0.88rem; align-self: start; }
  .g-big { grid-row: span 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--grad); color: #fff; font-size: 0.95rem; letter-spacing: -0.04em; margin: 0; }
}
