/* ─────────────────────────────────────────────
   Мебель·Подбор — design tokens + global styles
   inspired by warm-paper aggregator design
   ───────────────────────────────────────────── */

:root {
  --bg: #F2EFE8;
  --surface: #FFFFFF;
  --surface-2: #ECE7DC;
  --ink: #14130F;
  --ink-2: #5B584F;
  --ink-3: #8C887D;
  --line: #E5E0D3;
  --accent: #FFB627;
  --accent-ink: #14130F;
  --accent-soft: #FFE9B8;
  --tile-lav: #E6E2F0;
  --tile-mint: #DAEAE0;
  --tile-peach: #F4DECF;
  --tile-sky: #D7E4ED;
  --tile-rose: #F2DADD;
  --danger: #B6452B;
  --success: #1F7A4A;

  --radius-s: 12px;
  --radius-m: 18px;
  --radius-l: 28px;
  --radius-xl: 36px;
  --pad-card: 28px;
  --pad-card-lg: 40px;

  --font: "Onest", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body { overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

/* Container */
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 24px; } }
.wrap--narrow { max-width: 820px; }

/* Top nav */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid color-mix(in oklab, var(--line) 70%, transparent);
}
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; height: 56px;
}
@media (min-width: 720px) { .nav__inner { height: 64px; } }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 17px; letter-spacing: -0.01em;
}
.brand__mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--ink); display: grid; place-items: center;
  color: var(--accent); font-weight: 700; font-size: 16px;
}
.nav__links { display: none; gap: 22px; font-size: 15px; color: var(--ink-2); }
@media (min-width: 900px) { .nav__links { display: inline-flex; } }
.nav__links a:hover { color: var(--ink); }
.nav__cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  background: var(--ink); color: #fff;
  font-weight: 500; font-size: 14px; border: 0;
}
.nav__cta:hover { background: #2a2823; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px; height: 56px; padding: 0 28px; border-radius: 999px;
  font-weight: 500; font-size: 17px; letter-spacing: -0.005em;
  border: 0; transition: transform .12s ease, background .15s ease;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary, .btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover, .btn--primary:hover { background: color-mix(in oklab, var(--accent) 90%, #000 6%); }
.btn-ghost, .btn--ghost {
  background: transparent; color: var(--ink); border: 1px solid var(--line);
}
.btn-ghost:hover, .btn--ghost:hover { background: var(--surface); }
.btn-lg, .btn--lg { height: 62px; font-size: 18px; padding: 0 32px; }
.btn-sm { height: 42px; font-size: 14px; padding: 0 18px; }

/* Section + heads */
.section { padding: 56px 0; }
@media (min-width: 720px) { .section { padding: 88px 0; } }
.section__eyebrow {
  font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 12px; font-weight: 500;
}
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; }
.h1 { font-size: clamp(32px, 6.4vw, 60px); line-height: 1.04; font-weight: 600; letter-spacing: -0.03em; text-wrap: balance; }
.h2 { font-size: clamp(28px, 4.4vw, 44px); line-height: 1.08; font-weight: 600; letter-spacing: -0.025em; text-wrap: balance; }
.h3 { font-size: clamp(20px, 2.4vw, 24px); line-height: 1.2; font-weight: 600; letter-spacing: -0.015em; }
.lead { font-size: clamp(17px, 1.9vw, 20px); line-height: 1.45; color: var(--ink-2); text-wrap: pretty; }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
@media (min-width: 720px) { .section__head { margin-bottom: 40px; } }

/* Card */
.card {
  background: var(--surface);
  border-radius: var(--radius-l);
  padding: var(--pad-card);
}
@media (min-width: 720px) { .card { padding: var(--pad-card-lg); } }
.card--tint-lav { background: var(--tile-lav); }
.card--tint-mint { background: var(--tile-mint); }
.card--tint-peach { background: var(--tile-peach); }
.card--tint-sky { background: var(--tile-sky); }
.card--tint-rose { background: var(--tile-rose); }
.card--tint-cream { background: var(--surface-2); }
.card--dark { background: var(--ink); color: #fff; }

/* Hero */
.hero { padding-top: 32px; padding-bottom: 24px; }
@media (min-width: 900px) { .hero { padding-top: 56px; padding-bottom: 40px; } }
.hero__grid { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; }
@media (min-width: 900px) { .hero__grid { grid-template-columns: 1.05fr .95fr; gap: 40px; } }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; color: var(--ink-2); font-weight: 500;
}
.badge__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--success) 18%, transparent);
}
.hero__h1 { margin: 18px 0 16px; }
.hero__sub { max-width: 560px; margin: 0 0 28px; }
.hero__explainer {
  background: var(--accent-soft);
  border-radius: var(--radius-m);
  padding: 16px 18px;
  margin: 0 0 24px;
  max-width: 560px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}
.hero__explainer b { font-weight: 600; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero__micro { margin-top: 14px; font-size: 13px; color: var(--ink-3); }

/* Hero art — stacked swatches representing furniture types */
.hero__art {
  position: relative; aspect-ratio: 1 / 1;
  max-width: 520px; margin: 0 auto; width: 100%;
}
.swatch {
  position: absolute; border-radius: 22px;
  box-shadow: 0 1px 1px rgba(0,0,0,.04), 0 18px 40px -12px rgba(20,19,15,.25), inset 0 1px 0 rgba(255,255,255,.4);
  overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 18px; font-size: 13px; font-weight: 500; color: var(--ink);
}
.swatch__tag {
  align-self: flex-start; background: rgba(255,255,255,.86);
  border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 500;
}
.swatch__meta { display: flex; justify-content: space-between; font-size: 12px; color: rgba(20,19,15,.7); }
.swatch--a { top: 6%; left: 6%; width: 56%; aspect-ratio: 4/5;
  background: linear-gradient(155deg, #FAFAF7, #E8E2D3 70%, #D9D2BF); transform: rotate(-7deg); }
.swatch--b { top: 18%; right: 4%; width: 54%; aspect-ratio: 4/5;
  background: linear-gradient(155deg, #2A2823, #14130F); color: #fff; transform: rotate(6deg); }
.swatch--b .swatch__tag { background: rgba(255,255,255,.16); color: #fff; }
.swatch--b .swatch__meta { color: rgba(255,255,255,.7); }
.swatch--c { bottom: 4%; left: 22%; width: 56%; aspect-ratio: 4/5;
  background: linear-gradient(155deg, #FFE9B8, #FFB627); transform: rotate(-2deg); }
.swatch--accent-chip {
  position: absolute; inset: auto auto 4% 4%;
  width: 92px; height: 92px; border-radius: 26px;
  background: linear-gradient(180deg, #FFFFFF, #F4EFE2);
  box-shadow: 0 18px 30px -10px rgba(20,19,15,.25);
  display: grid; place-items: center;
  transform: rotate(-12deg); z-index: 3;
}

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 28px; }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
.tile {
  background: var(--surface); border-radius: 20px; padding: 18px;
  display: flex; flex-direction: column; gap: 10px; min-height: 124px;
  justify-content: space-between; border: 0; text-align: left;
}
.tile:hover { background: #fff; box-shadow: 0 8px 20px -10px rgba(20,19,15,.15); }
.tile__icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; background: var(--surface-2); color: var(--ink);
}
.tile__title { font-size: 14px; font-weight: 500; line-height: 1.25; }

/* Steps */
.steps { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.step__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 12px;
  background: var(--ink); color: var(--accent);
  font-weight: 600; font-size: 15px; margin-bottom: 18px;
}
.step__title { margin-bottom: 10px; }
.step__body { color: var(--ink-2); font-size: 16px; }

/* Why list */
.why-list { display: grid; gap: 12px; }
@media (min-width: 720px) { .why-list { grid-template-columns: 1fr 1fr; } }
.why-item {
  background: var(--surface); border-radius: 22px; padding: 22px 24px;
  display: grid; grid-template-columns: 32px 1fr; gap: 14px; align-items: start;
}
.why-item__bullet {
  width: 26px; height: 26px; border-radius: 9px;
  background: var(--accent-soft); display: grid; place-items: center; margin-top: 2px;
}
.why-item__title { font-weight: 600; margin: 0 0 4px; font-size: 16px; }
.why-item__body { color: var(--ink-2); font-size: 15px; }

/* Split list (yes/no) */
.split { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 900px) { .split { grid-template-columns: 1.05fr 1fr; } }
.recv-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.recv-list li { display: flex; align-items: flex-start; gap: 12px; font-size: 16px; line-height: 1.4; }
.recv-list .mark {
  width: 22px; height: 22px; border-radius: 8px; display: grid; place-items: center;
  flex-shrink: 0; margin-top: 1px; font-size: 13px; font-weight: 600;
}
.recv-list .mark--yes { background: #DEEEE3; color: #1F7A4A; }
.recv-list .mark--no  { background: #F2DADD; color: #A0392B; }

/* FAQ */
.faq { display: grid; gap: 8px; }
.faq__item { background: var(--surface); border-radius: 20px; overflow: hidden; }
.faq__item > summary {
  list-style: none; cursor: pointer;
  padding: 22px 60px 22px 24px;
  font-size: 17px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink);
  position: relative; line-height: 1.3;
}
.faq__item > summary::-webkit-details-marker { display: none; }
.faq__item > summary::after {
  content: ""; position: absolute; right: 22px; top: 50%;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-2); transform: translateY(-50%);
  transition: background .2s ease;
}
.faq__item > summary::before {
  content: "+"; position: absolute; right: 28px; top: 50%;
  transform: translateY(-50%); z-index: 1;
  font-size: 18px; font-weight: 500; color: var(--ink);
  transition: transform .2s ease;
}
.faq__item[open] > summary::before { content: "−"; }
.faq__item[open] > summary::after { background: var(--accent); }
.faq__panel-inner {
  padding: 0 24px 24px; color: var(--ink-2);
  font-size: 16px; line-height: 1.5; max-width: 760px;
}

/* Final dark CTA */
.final {
  position: relative; background: var(--ink); color: #fff;
  border-radius: var(--radius-xl); padding: 48px 28px; overflow: hidden;
}
@media (min-width: 720px) { .final { padding: 80px 56px; } }
.final h2 { color: #fff; text-wrap: balance; }
.final p { color: rgba(255,255,255,.78); margin: 18px 0 28px; max-width: 620px; }
.final__micro { color: rgba(255,255,255,.5); margin-top: 14px; font-size: 13px; }
.final__glow {
  position: absolute; inset: auto -100px -200px auto;
  width: 520px; height: 520px;
  background: radial-gradient(circle at center, rgba(255,182,39,.45), transparent 60%);
  pointer-events: none;
}

/* Footer */
.footer {
  padding: 36px 0 56px; color: var(--ink-3); font-size: 14px;
  border-top: 1px solid var(--line); margin-top: 40px;
}
.footer__grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 720px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer a:hover { color: var(--ink); }

/* ─── Quiz card (preserves IDs/classes used by script.js) ─── */
.section-quiz { padding: 24px 0 56px; scroll-margin-top: 80px; }
@media (min-width: 720px) { .section-quiz { padding: 32px 0 88px; } }

.quiz-card {
  background: var(--surface);
  border-radius: var(--radius-l);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 1px 1px rgba(0,0,0,.02), 0 24px 60px -28px rgba(20,19,15,.22);
}
.quiz-progress { padding: 18px 20px 0; }
@media (min-width: 720px) { .quiz-progress { padding: 22px 32px 0; } }
.quiz-progress-meta {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--ink-3); font-weight: 500; margin-bottom: 10px;
}
.quiz-progress-bar { height: 3px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.quiz-progress-fill { height: 100%; background: var(--accent); transition: width .3s ease; }

.quiz-body { padding: 24px 20px 8px; }
@media (min-width: 720px) { .quiz-body { padding: 32px 40px 8px; } }
.quiz-step { display: grid; gap: 6px; }
.quiz-question {
  font-size: clamp(22px, 3vw, 28px); font-weight: 600;
  letter-spacing: -0.02em; margin: 0 0 4px; text-wrap: balance;
}
.quiz-hint {
  color: var(--ink-2); font-size: 15px; margin: 6px 0 0;
  padding: 12px 14px; background: var(--surface-2); border-radius: 14px;
}

/* Options (radio/checkbox styled as cards) */
.options { display: grid; gap: 10px; margin-top: 22px; padding: 0; list-style: none; }
.option {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 18px;
  font-size: 16px; font-weight: 500; color: var(--ink);
  cursor: pointer; transition: border .15s ease, background .15s ease;
}
.option:hover { border-color: var(--ink-3); }
.option.selected { border-color: var(--ink); background: var(--accent-soft); }
.option input { display: none; }
.option .check {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--ink-3); flex-shrink: 0;
  display: grid; place-items: center;
}
.option.multi .check { border-radius: 7px; }
.option.selected .check { border-color: var(--ink); background: var(--ink); }
.option.selected .check::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.option.selected.multi .check::after {
  content: ""; width: 11px; height: 6px; background: transparent;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg) translate(1px, -1px); border-radius: 0;
}

/* Conditional / input fields */
.field { display: grid; gap: 6px; margin-top: 18px; }
.field label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field input[type=text], .field input[type=tel], .field input[type=email], .field input[type=number], .field textarea, .field select {
  height: 56px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--surface); padding: 0 18px;
  font-size: 17px; font-family: inherit; color: var(--ink);
  transition: border .15s ease, box-shadow .15s ease; width: 100%;
}
.field textarea { height: auto; padding: 14px 18px; min-height: 100px; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--accent-soft);
}
.conditional-field { padding-left: 12px; border-left: 2px solid var(--accent); margin-top: 10px; }

/* Contact segmented */
.contact-fields { display: grid; gap: 14px; margin-top: 22px; }
.contact-segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-option {
  padding: 10px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  cursor: pointer;
}
.seg-option.selected { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Consent */
.consent {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 16px; padding: 12px 14px; background: var(--surface-2);
  border-radius: 14px; font-size: 13px; color: var(--ink-2); cursor: pointer;
}
.consent input { display: none; }
.consent .check-box {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--ink-3); background: #fff;
  flex-shrink: 0; margin-top: 1px; display: grid; place-items: center;
}
.consent input:checked + .check-box { background: var(--ink); border-color: var(--ink); }
.consent input:checked + .check-box::after {
  content: ""; width: 9px; height: 5px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg) translate(1px, -1px);
}

.quiz-error { font-size: 13px; color: var(--danger); margin-top: 8px; }

/* Quiz nav */
.quiz-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); margin-top: 18px;
}
@media (min-width: 720px) { .quiz-nav { padding: 22px 40px; } }
.quiz-nav .btn-ghost { background: transparent; border: 0; height: 44px; padding: 0 8px; color: var(--ink-2); }
.quiz-nav .btn-primary { background: var(--ink); color: #fff; height: 52px; padding: 0 26px; }
.quiz-nav .btn-primary:hover { background: #2a2823; }

/* Thank-you */
.thank-you { padding: 40px 20px; text-align: left; }
@media (min-width: 720px) { .thank-you { padding: 56px 40px; } }
.success-icon {
  width: 64px; height: 64px; border-radius: 20px;
  background: var(--accent); display: grid; place-items: center; margin-bottom: 24px;
  font-size: 32px; color: var(--ink);
}
.thank-you-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.spinner {
  width: 24px; height: 24px; border: 3px solid var(--surface-2);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite; margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Utility */
.dot-sep { display: inline-block; width: 3px; height: 3px;
  background: currentColor; border-radius: 50%; margin: 0 8px; opacity: .5; vertical-align: middle; }
.muted { color: var(--ink-2); }
.tiny { font-size: 13px; }
