/* ---------- Основа ---------- */

:root {
  --gutter: clamp(16px, 4vw, 48px);
  --hdr: 64px;
  --radius: 28px;
  --section: clamp(72px, 11vw, 168px);
  --plate-bg: #fff;
  --plate-ink: #000;
}

@media (min-width: 768px) {
  :root { --hdr: 76px; }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font-text);
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }
img, svg { display: block; }
h1, h2, h3, p, ul, ol, dl, dd, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; margin: 0; }
legend { padding: 0; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }

section[id] { scroll-margin-top: var(--hdr); }
#quiz { scroll-margin-top: calc(var(--hdr) + 12px); }

.wrap {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

:focus-visible {
  outline: 2px solid var(--f-focus, var(--accent));
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
.skip:focus { top: 8px; }

/* Контекст: на светлом и на тёмном фоне одни и те же компоненты. */
.on-paper {
  --f-text: var(--ink);
  --f-muted: var(--ink-muted);
  --f-line: rgba(20, 21, 24, 0.16);
  --f-border: var(--ink-muted);
  --f-bg: transparent;
  --f-tile: rgba(20, 21, 24, 0.06);
  --f-tile-hover: rgba(20, 21, 24, 0.12);
  --f-focus: var(--ink);
  --f-panel: var(--paper);
  color: var(--ink);
}
.on-dark {
  --f-text: var(--text);
  --f-muted: var(--muted);
  --f-line: var(--line);
  --f-border: var(--muted);
  --f-bg: var(--bg);
  --f-tile: rgba(245, 243, 239, 0.07);
  --f-tile-hover: rgba(245, 243, 239, 0.14);
  --f-focus: var(--accent);
  --f-panel: var(--surface);
  color: var(--text);
}

.h2 {
  font: 800 clamp(29px, 5.4vw, 76px)/1.06 var(--font-display);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* ---------- Кнопки и поля ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 28px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  background: transparent;
  font: 600 16px/1.2 var(--font-text);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease, transform 0.12s ease;
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost { color: var(--f-text, var(--text)); border-color: var(--f-border, var(--muted)); }
.btn--ghost:hover { background: var(--f-tile, rgba(245, 243, 239, 0.07)); }
.btn--sm { min-height: 44px; padding: 0 18px; font-size: 14px; white-space: nowrap; }
.btn--wide { width: 100%; }
.btn.is-inactive, .btn[aria-disabled='true'] { opacity: 0.65; }
.btn[aria-busy='true'] { cursor: progress; }

.field { display: block; min-width: 0; }
.field__label {
  display: block;
  margin-bottom: 8px;
  color: var(--f-muted);
  font-size: 14px;
  font-weight: 600;
}
.input {
  display: block;
  width: 100%;
  height: 54px;
  padding: 0 22px;
  border: 1.5px solid var(--f-border);
  border-radius: 999px;
  background: var(--f-bg);
  color: var(--f-text);
  font-size: 17px;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.18s ease;
}
.input::placeholder { color: var(--f-muted); opacity: 1; }
.input--area {
  height: auto;
  min-height: 112px;
  padding-block: 14px;
  border-radius: var(--radius);
  line-height: 1.4;
  resize: vertical;
}
.input[aria-invalid='true'], .plate.is-invalid { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.err {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
  color: var(--f-text);
  font-size: 14px;
  font-weight: 600;
}
.err::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-1px);
}

/* Ловушка для ботов: вне экрана, но поле есть в форме. */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Шапка ---------- */

.hdr {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 15, 17, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.hdr__row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--hdr);
}
.hdr__name {
  flex: 0 1 auto;
  min-width: 0;
  margin-right: auto;
  overflow: hidden;
  font: 800 14px/1.2 var(--font-display);
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hdr__nav { display: none; }
.hdr__nav a, .menu__panel a { text-decoration: none; }
.hdr__nav a:hover, .menu__panel a:hover { color: var(--accent-hover); }
.hdr__phone { display: none; font-weight: 600; white-space: nowrap; }
.hdr__phone a { text-decoration: none; }

.menu { position: relative; }
.menu__btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  list-style: none;
}
.menu__btn::-webkit-details-marker { display: none; }
.menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: min(260px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.menu__panel a { display: block; padding: 12px; font-weight: 600; }
.menu__phone { display: block; padding: 12px; font-weight: 600; }

@media (min-width: 768px) {
  .hdr__row { gap: 16px; }
  .hdr__name { font-size: 16px; }
  .hdr__phone { display: block; }
  .menu__phone { display: none; }
}
@media (min-width: 900px) {
  .hdr__row { gap: 28px; }
  .hdr__name { margin-right: 0; max-width: 240px; }
  .hdr__nav { display: flex; flex: 1; gap: 28px; font-size: 15px; }
  .menu { display: none; }
}

/* ---------- Первый экран ---------- */

.hero {
  position: relative;
  margin-top: calc(-1 * var(--hdr));
  padding-top: var(--hdr);
  overflow: hidden;
  isolation: isolate;
}
.hero__media {
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: clamp(420px, 66vh, 640px);
  overflow: hidden;
  background: var(--bg);
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 40%;
  transform: scale(1.08);
  will-change: transform;
}
.hero__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(14, 15, 17, 0.62) 0%, rgba(14, 15, 17, 0.25) 22%, rgba(14, 15, 17, 0.72) 42%, var(--bg) 78%);
}
.hero__inner {
  display: grid;
  gap: 20px;
  padding-top: 20px;
  padding-bottom: clamp(32px, 6vw, 72px);
}
.hero__title {
  font: 800 calc((100vw - 2 * var(--gutter)) / 4.78)/0.96 var(--font-display);
  letter-spacing: -0.015em;
}
.hero__sub {
  margin-top: 12px;
  font-size: clamp(17px, 2.4vw, 28px);
  font-weight: 600;
}
.hero__hook { margin-top: 12px; }
.hero__offer {
  display: inline-block;
  padding: 0.4em 0.8em;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: 800 clamp(16px, 2.1vw, 26px)/1.15 var(--font-display);
  letter-spacing: -0.01em;
}
.hero__push {
  display: block;
  margin-top: 8px;
  font-size: clamp(16px, 1.7vw, 22px);
  font-weight: 600;
}

@media (min-width: 768px) and (max-width: 1023.98px) {
  .hero__inner { gap: 28px; }
}

@media (min-width: 1024px) {
  .hero { min-height: max(100svh, 760px); display: flex; }
  .hero__media { inset: 0; height: auto; }
  /* Машина слева от карточки, заголовок под ней: кадр читается целиком. */
  .hero__media img { object-position: 100% 35%; }
  .hero__media::after {
    background:
      linear-gradient(90deg, rgba(14, 15, 17, 0.45) 0%, rgba(14, 15, 17, 0) 42%),
      linear-gradient(180deg, rgba(14, 15, 17, 0.5) 0%, rgba(14, 15, 17, 0) 24%, rgba(14, 15, 17, 0) 52%, rgba(14, 15, 17, 0.72) 80%, var(--bg) 100%);
  }
  .hero__inner {
    grid-template-columns: minmax(0, 1fr) 460px;
    align-items: center;
    gap: 40px;
    padding-top: 28px;
    padding-bottom: 56px;
  }
  .hero__copy { align-self: end; }
  .hero__title { font-size: min(calc((100vw - 2 * var(--gutter) - 508px) / 4.78), 176px); }
  .hero__sub { margin-top: 20px; }
}

/* ---------- Квиз ---------- */

.quiz {
  min-width: 0;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
@media (min-width: 768px) {
  .quiz { padding: 28px; }
}

.quiz__top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.quiz__count {
  flex: none;
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.road {
  --p: 0.04;
  position: relative;
  flex: 1;
  height: 24px;
  overflow: hidden;
}
.road__line, .road__fill {
  position: absolute;
  left: 0;
  right: 16px;
  bottom: 2px;
  height: 3px;
  border-radius: 3px;
}
.road__line { background: rgba(20, 21, 24, 0.14); }
.road__fill {
  background: var(--accent);
  transform: scaleX(var(--p));
  transform-origin: left;
  transition: transform 240ms ease;
}
.road__carwrap {
  position: absolute;
  left: 0;
  bottom: 3px;
  width: calc(100% - 50px);
  transform: translateX(calc(var(--p) * 100%));
  transition: transform 240ms ease;
}
.road__flag { position: absolute; right: 0; bottom: 2px; }
.road.is-loading .road__fill, .road.is-loading .road__carwrap { transition-duration: 3000ms; transition-timing-function: linear; }

.quiz__title {
  margin-bottom: 14px;
  font: 800 clamp(19px, 2vw, 23px)/1.2 var(--font-display);
  letter-spacing: -0.01em;
  outline: none;
  overflow-wrap: anywhere;
}
.quiz__hint {
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 14px;
}

/* Одна высота на всех шагах: карточка не прыгает при переходах. */
@media (min-width: 1024px) {
  .quiz__body { min-height: 470px; }
  .quiz .tile { min-height: 60px; }
}

/* Стартовое окно: кнопка специально кричит, чтобы на неё хотелось нажать. */
.intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  min-height: inherit;
  padding-block: 10px 14px;
}
.intro__title {
  font: 800 clamp(25px, 3vw, 36px)/1.14 var(--font-display);
  letter-spacing: -0.015em;
  outline: none;
  text-wrap: balance;
}
.start {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  min-height: 104px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: 800 clamp(26px, 3vw, 36px)/1 var(--font-display);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.16s ease, transform 0.12s ease;
  animation: start-pulse 1.5s ease-out infinite;
}
.start:hover { background: var(--accent-hover); transform: scale(1.025); }
.start:active { transform: scale(0.97); }
.start::after {
  content: '';
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: -30%;
  width: 22%;
  background: rgba(255, 255, 255, 0.45);
  transform: skewX(-20deg);
  animation: start-shine 2.4s ease-in-out infinite;
}
.start__label, .start__arrow { position: relative; z-index: 1; }
.start__arrow { animation: start-arrow 0.9s ease-in-out infinite; }
@keyframes start-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 90, 31, 0.65); }
  100% { box-shadow: 0 0 0 22px rgba(255, 90, 31, 0); }
}
@keyframes start-shine {
  0%, 55% { left: -30%; }
  100% { left: 115%; }
}
@keyframes start-arrow {
  50% { transform: translateX(8px); }
}

#quiz-search::placeholder { font-size: 15px; }

.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.tiles.is-all {
  max-height: min(52vh, 380px);
  padding-right: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.tile {
  min-height: 52px;
  padding: 6px 3px;
  border: 1.5px solid transparent;
  border-radius: 16px;
  background: var(--f-tile);
  color: var(--f-text);
  font-size: clamp(13px, 3.7vw, 15px);
  font-weight: 600;
  line-height: 1.15;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: background-color 0.16s ease, transform 0.12s ease;
}
.tile:hover { background: var(--f-tile-hover); }
.tile:active { transform: scale(0.97); }
.tile.is-selected { background: var(--accent); color: var(--on-accent); }

.picker__foot { margin-top: 10px; }
.picker__foot .btn { width: 100%; }
.picker__foot .btn--manual { height: auto; min-height: 54px; padding-block: 10px; overflow-wrap: anywhere; }
.picker__empty { color: var(--ink-muted); font-size: 14px; margin-top: 12px; }

.actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.actions .btn--primary { flex: 1; }
.actions .btn--ghost { padding-inline: 22px; }

/* Госномер */
.plate {
  display: flex;
  height: 72px;
  border: 3px solid var(--plate-ink);
  border-radius: 12px;
  background: var(--plate-bg);
  color: var(--plate-ink);
  overflow: hidden;
}
.plate:focus-within { outline: 2px solid var(--f-focus); outline-offset: 2px; }
.plate input {
  display: block;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--plate-ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  outline: none;
}
.plate input::placeholder { color: rgba(0, 0, 0, 0.32); opacity: 1; }
.plate__main {
  flex: 1;
  width: 100%;
  font-size: clamp(25px, 7.8vw, 33px);
  letter-spacing: 0.04em;
}
.plate__side {
  flex: none;
  display: flex;
  flex-direction: column;
  width: 80px;
  border-left: 3px solid var(--plate-ink);
}
.plate__region {
  flex: 1;
  width: 100%;
  font-size: 25px;
  line-height: 1;
}
.plate__rus {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding-bottom: 5px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

/* Чипы */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip { position: relative; display: block; cursor: pointer; }
.chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.chip span {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 46px;
  padding: 8px 16px;
  border: 1.5px solid var(--f-border);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}
.chip:hover span { background: var(--f-tile); }
.chip input:checked + span { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.chip input:checked + span::before {
  content: '';
  width: 12px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(-45deg);
}
.chip input:focus-visible + span { outline: 2px solid var(--f-focus); outline-offset: 2px; }

.stack > * + * { margin-top: 16px; }

/* Мессенджер */
.msgr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.msgr__opt { position: relative; display: block; cursor: pointer; }
.msgr__opt input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.msgr__opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  padding: 0 6px;
  border: 1.5px solid var(--f-border);
  border-radius: 999px;
  font-size: clamp(14px, 3.9vw, 17px);
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}
.msgr__opt:hover span { background: var(--f-tile); }
.msgr__opt input:checked + span { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.msgr__opt input:focus-visible + span { outline: 2px solid var(--f-focus); outline-offset: 2px; }

/* Согласие */
.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 44px;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}
.consent input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.consent a { text-underline-offset: 2px; }
.caption { margin-top: 10px; color: var(--f-muted); font-size: 14px; text-align: center; }

.fail {
  padding: 14px 18px;
  border: 1.5px solid var(--accent);
  border-radius: 20px;
  font-size: 15px;
}
.fail a { font-weight: 600; }

/* Загрузка */
.loader { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 14px; }
.ring {
  width: 76px;
  height: 76px;
  border: 7px solid var(--f-line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader__line {
  min-height: 3em;
  margin-top: 18px;
  font-size: 17px;
  font-weight: 600;
  animation: rise 0.22s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.summary {
  width: 100%;
  margin-top: 8px;
  border-top: 1px solid var(--f-line);
  text-align: left;
}
.summary div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--f-line);
}
.summary dt { color: var(--f-muted); font-size: 14px; }
.summary dd { font-weight: 600; text-align: right; overflow-wrap: anywhere; }

/* Успех */
.done { display: flex; flex-direction: column; align-items: flex-start; padding-top: 8px; }
.done__mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
}
.done__title {
  margin-bottom: 10px;
  font: 800 clamp(22px, 2.4vw, 30px)/1.15 var(--font-display);
  outline: none;
}
.done__text { font-size: 17px; overflow-wrap: anywhere; }

/* ---------- Полоса фактов ---------- */

.facts { background: var(--accent); color: var(--on-accent); }
.facts .ph {
  padding: 0.25em 0.6em;
  background: var(--bg);
  color: var(--text);
  font-size: clamp(12px, 1.5vw, 19px);
  line-height: 1.25;
}
.facts__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 16px;
  padding-block: clamp(28px, 4vw, 52px);
}
.fact__value {
  min-height: 1.15em;
  font: 800 clamp(24px, 3.1vw, 46px)/1.1 var(--font-display);
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
/* Длинное значение подстраивается под колонку, чтобы слово не рвалось посередине. */
.facts__list > li { container-type: inline-size; }
.fact__value--long { font-size: min(9.2cqw, 32px); overflow-wrap: normal; }
.fact__label { margin-top: 8px; font-size: clamp(14px, 1.3vw, 17px); font-weight: 600; }

@media (min-width: 900px) {
  .facts__list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
}

/* ---------- Почему мы ---------- */

.why {
  padding-block: var(--section);
  background: var(--paper);
}
.why__list {
  display: grid;
  gap: 0 clamp(24px, 4vw, 64px);
  margin-top: clamp(40px, 6vw, 88px);
}
.why__item {
  padding-block: clamp(24px, 3vw, 40px);
  border-top: 1px solid var(--f-line);
}
.why__num {
  display: flex;
  align-items: center;
  gap: 12px;
  font: 800 clamp(44px, 6vw, 84px)/1 var(--font-display);
  letter-spacing: -0.03em;
}
.why__num::after {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}
.why__title {
  margin-top: 18px;
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 600;
  line-height: 1.2;
}
.why__text { margin-top: 8px; color: var(--ink-muted); font-size: 16px; }

@media (min-width: 640px) {
  .why__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .why__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Примеры выкупов ---------- */

.deals {
  --ribbon-gap: clamp(12px, 1.6vw, 24px);
  --edge: max(var(--gutter), calc((100% - 1440px) / 2 + var(--gutter)));
  padding-block: var(--section);
  overflow: hidden;
}
.deals__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(28px, 4vw, 56px);
}
.deals__arrows { display: none; flex: none; gap: 10px; }
.arrow {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.16s ease, opacity 0.16s ease;
}
.arrow:hover:not(:disabled) { background: rgba(245, 243, 239, 0.1); }
.arrow:disabled { opacity: 0.3; cursor: default; }

.ribbon {
  position: relative;
  display: flex;
  gap: var(--ribbon-gap);
  padding-inline: var(--edge);
  padding-bottom: 28px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--edge);
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.ribbon::-webkit-scrollbar { display: none; }
@media (hover: hover) {
  .ribbon { user-select: none; }
  .ribbon.is-draggable { cursor: grab; }
}
.ribbon.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  scroll-behavior: auto;
}
.deal {
  position: relative;
  flex: 0 0 85vw;
  scroll-snap-align: start;
}
.deal:last-child { scroll-snap-align: end; }
.ribbon.is-loop .deal:last-child { scroll-snap-align: start; }
.deal__photo {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: radial-gradient(120% 90% at 30% 20%, #23262C 0%, var(--surface) 60%);
  border: 1px solid var(--line);
}
.deal__photo img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
/* Карточка заходит на фото только снизу: машина видна целиком. */
.deal__info {
  position: relative;
  margin: -38px 12px 0;
  padding: 16px 20px;
  border-radius: 22px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
}
.deal__title { font-size: 19px; font-weight: 600; line-height: 1.2; }
.deal__price { margin-top: 8px; font-size: 15px; }
.deal__price b { font: 800 19px/1.2 var(--font-display); letter-spacing: -0.01em; white-space: nowrap; }

@media (min-width: 768px) {
  .deals__arrows { display: flex; }
  .deal { flex-basis: calc((100% - var(--ribbon-gap)) / 2.2); }
}
@media (min-width: 1200px) {
  .deal { flex-basis: calc((100% - 2 * var(--ribbon-gap)) / 2.6); }
  .deal__info { margin-inline: 18px; width: fit-content; min-width: min(340px, calc(100% - 36px)); }
}

/* ---------- Где мы ---------- */

.where {
  padding-block: var(--section);
  background: var(--paper);
}
.where__grid { display: grid; gap: clamp(32px, 5vw, 72px); }
.where__list { margin-block: clamp(24px, 3vw, 40px); }
.where__list div { padding-block: 16px; border-top: 1px solid var(--f-line); }
.where__list dt { color: var(--ink-muted); font-size: 14px; font-weight: 600; }
.where__list dd { margin-top: 4px; font-size: clamp(17px, 1.6vw, 21px); font-weight: 600; }
.where__map {
  display: grid;
  place-items: center;
  min-height: clamp(320px, 42vw, 560px);
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--f-tile);
}
.where__map iframe { display: block; width: 100%; height: 100%; min-height: inherit; border: 0; }
.map-stub { padding: 24px; text-align: center; }
.map-stub p { margin-top: 12px; color: var(--ink-muted); font-size: 15px; }
.map-stub .ph + .ph { margin-left: 6px; }
#route[aria-disabled='true'] { cursor: not-allowed; }

@media (min-width: 900px) {
  .where__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; }
}

/* ---------- Финальная анкета ---------- */

.report { padding-block: var(--section); }
.report__grid { display: grid; gap: clamp(28px, 4vw, 64px); }
.report__lead { margin-top: 18px; max-width: 46ch; color: var(--muted); font-size: clamp(16px, 1.4vw, 19px); }
.report__card {
  min-width: 0;
  padding: clamp(20px, 3vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.report__pair { display: grid; gap: 16px; }
.report__group > .field__label { margin-bottom: 10px; }

@media (min-width: 640px) {
  .report__pair { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1100px) {
  .report__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
  .report__head { position: sticky; top: calc(var(--hdr) + 32px); }
}

/* Подсказки марки и модели */
.combo { position: relative; }
.suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  max-height: 280px;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--bg);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}
.suggest li {
  padding: 12px 16px;
  border-radius: 16px;
  font-weight: 600;
  cursor: pointer;
}
.suggest li:hover, .suggest li.is-active { background: var(--f-tile-hover); }

/* ---------- Подвал ---------- */

.ftr {
  padding-top: clamp(56px, 8vw, 112px);
  padding-bottom: 24px;
  border-top: 1px solid var(--line);
}
.ftr__grid { display: grid; gap: 32px; }
.ftr__grid p { margin-top: 8px; color: var(--muted); }
.ftr__label {
  margin-bottom: 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.ftr__list li + li { margin-top: 8px; }
.ftr__list { color: var(--muted); }
.ftr__list a { text-underline-offset: 3px; }
.ftr__list a:hover { color: var(--text); }
.ftr__giant {
  margin-top: clamp(40px, 7vw, 96px);
  overflow: hidden;
}
#ftr-giant {
  display: inline-block;
  font: 800 12vw/1 var(--font-display);
  letter-spacing: -0.03em;
  white-space: nowrap;
}
#ftr-giant.is-placeholder { color: var(--accent); }

@media (min-width: 768px) {
  .ftr__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.ftr { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

/* ---------- Движение ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero__media img { will-change: auto; }
}

@media (min-width: 900px) {
  .hdr__row { gap: 20px; }
  .hdr__nav { gap: 20px; }
}

/* ---------- Первый экран: заголовок, квиз, выгоды ---------- */

.hero__inner { grid-template-areas: 'copy' 'quiz'; }
.hero__copy { grid-area: copy; min-width: 0; }
.quiz { grid-area: quiz; }

/* Длинный заголовок идёт по светлому капоту: фото темнее, чтобы текст читался. */
.hero:has(.hero__title--long) .hero__media::after { background: rgba(14, 15, 17, 0.68); }

.hero__title--long {
  font-size: clamp(27px, 3.7vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
  overflow-wrap: break-word;
}
.hero__city {
  display: block;
  margin-top: 0.5em;
  font-size: clamp(17px, 2vw, 28px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
@media (min-width: 1024px) {
  .hero__inner {
    grid-template-areas: 'copy quiz';
    grid-template-rows: none;
    gap: 40px;
  }
  .hero__title--long { font-size: min(calc((100vw - 2 * var(--gutter) - 508px) / 15), 54px); }
  .quiz { align-self: center; }
}

/* ---------- Фото автомобиля ---------- */

.photos__input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photos__input:focus-visible + .photos__pick { outline: 2px solid var(--f-focus); outline-offset: 2px; }
.photos__list { display: flex; flex-wrap: wrap; gap: 8px; }
.photos__list:not(:empty) { margin-bottom: 8px; }
.photos__item { position: relative; width: 64px; height: 64px; }
.photos__item img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.photos__remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.photos__pick { min-height: 46px; font-size: 15px; }
.photos__note { margin-top: 6px; color: var(--f-muted); font-size: 14px; }
.photos__note:empty { display: none; }
.btn--skip { margin-top: 8px; min-height: 46px; font-size: 15px; }

/* ---------- Кейсы ---------- */

.deal__problem { margin-top: 4px; color: var(--ink-muted); font-size: 14px; line-height: 1.3; }
.deal__time { display: block; margin-top: 2px; color: var(--ink-muted); font-size: 14px; }

/* ---------- Как проходит выкуп ---------- */

.steps { padding-block: var(--section); background: var(--paper); border-top: 1px solid var(--f-line); }
.steps__list {
  display: grid;
  gap: clamp(20px, 3vw, 40px);
  margin-top: clamp(32px, 5vw, 72px);
}
.steps__num {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font: 800 22px/1 var(--font-display);
}
.steps__title { margin-top: 16px; font-size: clamp(20px, 2vw, 26px); font-weight: 600; line-height: 1.2; }
.steps__text { margin-top: 8px; color: var(--ink-muted); }

@media (min-width: 640px) {
  .steps__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .steps__list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Выкупаем любые авто ---------- */

.any { padding-block: var(--section); }
.any__groups { display: grid; gap: clamp(28px, 3vw, 48px); margin-top: clamp(32px, 5vw, 64px); }
.any__title { margin-bottom: 14px; color: var(--muted); font-size: 15px; font-weight: 600; }
.any__list { display: flex; flex-wrap: wrap; gap: 8px; }
.any__list a {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 8px 18px;
  border: 1.5px solid var(--muted);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.any__list a:hover { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }

/* ---------- Частые вопросы ---------- */

.faq { padding-block: var(--section); background: var(--paper); }
.faq__list { max-width: 900px; margin-top: clamp(28px, 4vw, 56px); }
.faq__item { border-top: 1px solid var(--f-line); }
.faq__item:last-child { border-bottom: 1px solid var(--f-line); }
.faq__item summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
  font-size: clamp(17px, 1.6vw, 21px);
  font-weight: 600;
  line-height: 1.25;
  list-style: none;
  cursor: pointer;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: '+';
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 20px;
  line-height: 1;
}
.faq__item[open] summary::after { content: '−'; }
.faq__item p { padding-bottom: 20px; color: var(--ink-muted); }

/* ---------- Подвал и страница 404 ---------- */

.ftr__label--gap { margin-top: 28px; }
.ftr__more { margin-top: 10px; color: var(--muted); }
.ftr__more summary { min-height: 44px; padding-block: 10px; font-weight: 600; cursor: pointer; }
.ftr__req { font-size: 14px; }

@media (min-width: 768px) {
  .ftr__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .ftr__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.missing { padding-block: var(--section); }
.missing__text { margin-block: 18px 28px; color: var(--muted); }
.missing__links { margin-top: 40px; }

/* ---------- MAX: значок, кнопки, нижняя панель ---------- */

.maxlogo { display: block; width: 100%; height: 100%; }

.hdr__max { flex: none; width: 40px; height: 40px; border-radius: 12px; transition: transform 0.12s ease; }
.hdr__max:active { transform: scale(0.94); }
.hdr__num {
  display: inline-flex;
  flex: none;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  height: 40px;
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--text);
  font: 600 13px/1 var(--font-text);
  white-space: nowrap;
  cursor: pointer;
}
.hdr__num:hover { color: var(--accent-hover); }
.hdr__num small { color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1; }
@media (min-width: 768px) {
  .hdr__num small { font-size: 12px; }
}
.hdr__call {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  transition: background-color 0.18s ease, transform 0.12s ease;
}
.hdr__call svg { width: 20px; height: 20px; }
.hdr__call:hover { background: var(--accent-hover); }
.hdr__call:active { transform: scale(0.94); }
@media (max-width: 419.98px) {
  .hdr__row { gap: 6px; }
  .hdr__name { font-size: 13px; }
  .hdr__num { font-size: 12.5px; }
  .hdr__call, .hdr__max { width: 36px; height: 36px; }
  .hdr__call svg { width: 18px; height: 18px; }
}
@media (max-width: 379.98px) {
  .hdr__row { gap: 5px; }
  .hdr__name { font-size: 12px; }
  .hdr__num { font-size: 12px; }
  .menu__btn { width: 38px; }
}
@media (min-width: 768px) {
  .hdr__num { font-size: 16px; }
  .hdr__call, .hdr__max { width: 44px; height: 44px; }
}

.ftr__max { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.ftr__max .maxlogo { flex: none; width: 28px; height: 28px; }

/* Нижняя панель: звонок одной кнопкой и MAX, после первого экрана. */
.bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(244, 241, 236, 0.96);
  color: var(--ink);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transform: translateY(160%);
  visibility: hidden;
  transition: transform 0.24s ease, visibility 0s linear 0.24s;
}
.bar.is-visible {
  transform: none;
  visibility: visible;
  transition: transform 0.24s ease, visibility 0s;
}
.bar__call {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  transition: background-color 0.18s ease, transform 0.12s ease;
}
.bar__call:hover { background: #26282d; }
.bar__call:active { transform: scale(0.98); }
.bar__call > svg { flex: none; width: 22px; height: 22px; color: var(--accent); }
.bar__label { display: grid; gap: 2px; text-align: left; line-height: 1.1; }
.bar__label b { font-size: 17px; font-weight: 600; }
.bar__label small { color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.bar__max { flex: none; width: 52px; height: 52px; border-radius: 16px; }
.bar__max:active { transform: scale(0.94); }
@media (min-width: 1024px) {
  .bar { left: 50%; right: auto; width: 520px; bottom: 24px; transform: translate(-50%, 160%); }
  .bar.is-visible { transform: translateX(-50%); }
}

/* ---------- Оценка по фото в MAX ---------- */

.maxsec {
  padding-top: clamp(48px, 6vw, 88px);
  overflow: hidden;
  background: var(--bg);
}
.maxsec__grid { display: grid; gap: 40px; }
.maxsec__title { font-size: clamp(24px, 3.6vw, 48px); line-height: 1.12; }
.maxsec__lead {
  max-width: 34em;
  margin-top: 20px;
  color: var(--muted);
  font-size: clamp(17px, 2.4vw, 22px);
  line-height: 1.6;
}
.maxsec__btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  padding: 10px 30px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 20px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.18s ease, transform 0.12s ease;
}
.maxsec__btn:hover { background: #20232a; }
.maxsec__btn:active { transform: scale(0.98); }
.maxsec__btn .maxlogo { flex: none; width: 48px; height: 48px; }

.maxsec__stage { display: flex; justify-content: center; align-self: end; }
.mock {
  width: min(100%, 360px);
  height: 420px;
  padding: 14px 24px 0;
  border: 10px solid #1c1e22;
  border-bottom: 0;
  border-radius: 48px 48px 0 0;
  background: #000;
  text-align: center;
}
.mock__notch { width: 74px; height: 22px; margin: 0 auto; border-radius: 999px; background: #1c1e22; }
.mock__top { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; color: var(--muted); }
.mock__back { display: grid; }
.mock__dots { font-size: 24px; letter-spacing: 2px; line-height: 1; }
.mock__brand { margin-top: 26px; font: 800 32px/1.1 var(--font-display); letter-spacing: -0.02em; }
.mock__status { margin-top: 12px; color: var(--muted); font-size: 16px; }
.mock__card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  padding: 14px 18px 14px 14px;
  border-radius: 22px;
  background: var(--surface);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  transition: background-color 0.18s ease;
}
.mock__card:hover { background: #20232a; }
.mock__card .maxlogo { flex: none; width: 48px; height: 48px; }
.mock__about { margin-top: 22px; color: var(--muted); font-size: 15px; line-height: 1.5; text-align: left; }

@media (min-width: 900px) {
  .maxsec__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: 56px; align-items: center; }
  .maxsec__stage { align-self: end; }
  .maxsec__copy { padding-bottom: clamp(40px, 5vw, 72px); }
}

/* Подсказка после нажатия «Позвонить» */
.toast {
  position: fixed;
  left: 50%;
  top: calc(var(--hdr) + 12px);
  z-index: 60;
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }


/* Окно о cookie: снизу, над нижней панелью. Метрика грузится только после «Согласен». */
.cookie {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 70;
  display: grid;
  gap: 12px;
  max-width: 560px;
  margin-inline: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.cookie__text { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.cookie__text a { color: var(--text); text-underline-offset: 3px; }
.cookie__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cookie__actions .btn { flex: 1 1 120px; min-height: 44px; padding: 0 16px; font-size: 15px; }
/* На телефоне окно ниже и плотнее, чтобы не закрывать кнопку «Начать». */
@media (max-width: 767px) {
  .cookie { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); gap: 10px; padding: 12px 14px; border-radius: 22px; }
}
.ftr__cookie {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.ftr__cookie:hover { color: var(--text); }
