/* ============================================================
   Trade-in — quiz lead gen
   Mobile-first · тёмно-синий + перламутрово-белый (только светлая тема)
   Одностраничный «не двигающийся» экран в духе Marquiz:
   шапка статична, скроллится только тело шага.
   ============================================================ */

:root {
  color-scheme: light;

  /* ── перламутрово-белый фон, тёмно-синий текст ── */
  --bg: #F8F7F4;
  --bg-2: #EDEBE6;
  --surface: #FFFFFF;
  --surface-2: #F4F2EE;
  --tint: #ECF1F8;

  --text: #0B2545;
  --muted: #46587A;
  --faint: #6E7F9B;

  --border: #E5E2DB;
  --border-strong: #CFCBC1;

  --primary: #123A63;
  --primary-dark: #0B2545;
  --on-primary: #FFFFFF;
  --accent: #2E6DA4;

  --warn-bg: #FBF1DA;
  --warn-border: #EAD5A4;
  --warn-text: #6B4A12;

  --danger: #A32B1C;
  --danger-bg: #FBEDE9;

  --ok-bg: #E4F1E5;
  --ok: #1E6B36;

  --shadow-sm: 0 1px 2px rgba(11, 37, 69, .06);
  --shadow: 0 12px 32px -18px rgba(11, 37, 69, .45);
  --shadow-lg: 0 30px 70px -40px rgba(11, 37, 69, .6);
  --ring: 0 0 0 3px rgba(46, 109, 164, .3);

  /* сдержанные скругления — деловой вид */
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --radius-btn: 8px;

  --z-top: 30;
  --z-overlay: 50;
  --z-lightbox: 60;

  --dur: 200ms;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; height: 100%; }

body {
  margin: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;                /* страница не двигается */
  overscroll-behavior: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(38rem 24rem at 88% -10%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 62%),
    radial-gradient(32rem 20rem at -6% 0%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, strong, .btn, .brand__name { font-family: 'Manrope', 'Inter', sans-serif; }
img { max-width: 100%; display: block; }
svg { width: 20px; height: 20px; flex: none; }

/* ══════════ СТАТИЧНАЯ ШАПКА ══════════ */
.topbar {
  flex: none;
  z-index: var(--z-top);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0px);
}
/* Три колонки, а не space-between: боковые равной ширины, поэтому логотип
   стоит ровно по центру шапки и не съезжает от длины соседей. */
.topbar__in {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 14px;
}
.topbar__side { display: flex; min-width: 0; }
.topbar__side--end { justify-content: flex-end; }

.brand { display: inline-flex; align-items: center; text-decoration: none; color: var(--text); }
/* width/height в разметке заданы для соотношения сторон — ширину считает браузер */
.brand__logo { height: 30px; width: auto; }

/* ── переключатель языка: кнопка + выпадающее меню ── */
.lang { position: relative; }
.lang__toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 8px 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur), border-color var(--dur);
}
.lang__toggle:hover { border-color: var(--border-strong); }
.lang__toggle:focus-visible { outline: none; box-shadow: var(--ring); }
.lang__caret { width: 15px; height: 15px; color: var(--faint); transition: transform var(--dur); }
.lang__toggle[aria-expanded="true"] { background: var(--surface); border-color: var(--border-strong); }
.lang__toggle[aria-expanded="true"] .lang__caret { transform: rotate(180deg); }

.lang__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1;
  min-width: 172px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: rise 160ms cubic-bezier(.33, 1, .68, 1);
}
.lang__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur);
}
.lang__item i { font-style: normal; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; color: var(--faint); }
.lang__item:hover { background: var(--surface-2); }
.lang__item:focus-visible { outline: none; box-shadow: var(--ring); }
.lang__item[aria-checked="true"] { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.lang__item[aria-checked="true"] i { color: color-mix(in srgb, var(--on-primary) 70%, transparent); }

/* прогресс */
.progress { max-width: 760px; margin: 0 auto; padding: 0 14px 10px; }
.progress__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.progress__label { font-size: 12.5px; font-weight: 600; color: var(--accent); }
.progress__count { font-size: 12px; font-weight: 500; color: var(--faint); font-variant-numeric: tabular-nums; }
.progress__track { height: 4px; border-radius: 2px; background: var(--bg-2); overflow: hidden; }
.progress__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--primary)));
  transition: width 340ms cubic-bezier(.4, 0, .2, 1);
}

/* ══════════ СЦЕНА ══════════ */
.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  padding: 12px;
}

.card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.screen { display: none; min-height: 0; }
.screen.is-active { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 22px 18px 6px;
  animation: rise 300ms cubic-bezier(.33, 1, .68, 1);
}
.screen--center .body { text-align: center; }
.screen--center .body,
.screen[data-screen="intro"] .body { display: flex; flex-direction: column; justify-content: center; }

.body::-webkit-scrollbar { width: 8px; }
.body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
.body::-webkit-scrollbar-track { background: transparent; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ══════════ ТИПОГРАФИКА ══════════ */
.eyebrow {
  margin: 0 0 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}
.h1 { margin: 0 0 10px; font-size: 27px; line-height: 1.15; letter-spacing: -.025em; font-weight: 800; }
.h2 { margin: 0 0 10px; font-size: 20px; line-height: 1.3; letter-spacing: -.015em; font-weight: 700; }
.lead { margin: 0 0 18px; font-size: 15px; color: var(--muted); }
.hint { margin: 0 0 16px; font-size: 13.5px; color: var(--muted); }
.hint--tight { margin-bottom: 12px; }
.screen--center .lead { margin-inline: auto; max-width: 46ch; }

/* ══════════ ИНТРО ══════════ */
.perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.perks li {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.perks svg { color: var(--accent); }
.perks div { display: flex; flex-direction: column; line-height: 1.3; }
.perks strong { font-size: 14.5px; }
.perks span { font-size: 12.5px; color: var(--muted); }

/* ══════════ ВЫБОР ТИПА ══════════ */
.choice-grid { display: grid; gap: 10px; }
.choice { display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.choice__body {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 13px 44px 13px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color var(--dur), background-color var(--dur), box-shadow var(--dur);
}
.choice input:focus-visible + .choice__body { box-shadow: var(--ring); }
.choice input:checked + .choice__body {
  border-color: var(--accent);
  background: var(--tint);
}
.choice__icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  flex: none;
  border-radius: 7px;
  background: var(--tint);
  color: var(--accent);
  transition: background-color var(--dur), color var(--dur);
}
.choice input:checked + .choice__body .choice__icon { background: var(--accent); color: var(--surface); }
.choice__icon svg { width: 22px; height: 22px; }
.choice__text { display: flex; flex-direction: column; gap: 2px; }
.choice__text strong { font-size: 15px; line-height: 1.3; }
.choice__text small { font-size: 12.5px; color: var(--muted); line-height: 1.35; }

.choice__tick {
  position: absolute;
  top: 50%; right: 13px;
  transform: translateY(-50%) scale(.6);
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 5px;
  background: var(--accent);
  color: var(--surface);
  opacity: 0;
  transition: opacity var(--dur), transform var(--dur);
}
.choice__tick svg { width: 13px; height: 13px; }
.choice input:checked + .choice__body .choice__tick { opacity: 1; transform: translateY(-50%) scale(1); }

/* ══════════ ПИЛЮЛИ ══════════ */
.pill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pill-grid--wide { grid-template-columns: 1fr; }
.pill-grid--3 { grid-template-columns: repeat(3, 1fr); }
.pill-grid--3 span { padding-inline: 4px; }

.pill { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.pill span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  height: 100%;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  background: var(--surface);
  transition: border-color var(--dur), background-color var(--dur), color var(--dur), box-shadow var(--dur);
}
.pill input:focus-visible + span { box-shadow: var(--ring); }
.pill input:checked + span {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}

/* ══════════ УВЕДОМЛЕНИЕ ══════════ */
.notice {
  border: 1px solid var(--warn-border);
  background: var(--warn-bg);
  border-radius: var(--radius);
  padding: 14px 15px 14px 17px;
  margin-bottom: 16px;
}
.notice ul { margin: 0; padding-left: 15px; display: grid; gap: 8px; }
.notice li { font-size: 13.5px; color: var(--warn-text); line-height: 1.5; }

/* ══════════ ПОЛЯ ══════════ */
.field { margin-bottom: 14px; }
.two-col { display: grid; gap: 0; }

.label {
  display: block;
  margin-bottom: 6px;
  font-size: 13.5px;
  font-weight: 600;
}
.label .opt { font-weight: 400; color: var(--faint); }

.input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur), box-shadow var(--dur), background-color var(--dur);
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder { color: var(--faint); opacity: .75; }
.input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: var(--ring); }
.input.is-invalid { border-color: var(--danger); background: var(--danger-bg); }

.textarea { min-height: 132px; resize: vertical; line-height: 1.5; }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .input { padding-right: 50px; }
.input-suffix { position: absolute; right: 14px; font-size: 13.5px; color: var(--faint); pointer-events: none; }
.input-prefix { position: absolute; left: 14px; font-size: 15.5px; font-weight: 600; color: var(--muted); pointer-events: none; }
.input--prefixed { padding-left: 60px !important; padding-right: 14px !important; }

.counter { margin-top: 5px; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 13.5px;
  line-height: 1.45;
  transition: border-color var(--dur), background-color var(--dur);
  -webkit-tap-highlight-color: transparent;
}
.check input { width: 22px; height: 22px; flex: none; accent-color: var(--accent); cursor: pointer; }
.check:has(input:checked) { border-color: var(--accent); background: var(--tint); }
.check:has(input:focus-visible) { box-shadow: var(--ring); }
.check.is-invalid { border-color: var(--danger); background: var(--danger-bg); }

.err { margin: 7px 0 0; font-size: 13px; font-weight: 500; color: var(--danger); }
.err:empty { display: none; }
.err--form { margin-top: 12px; }

.reveal { margin-top: 14px; }

/* ══════════ ЗАГРУЗКА ФАЙЛОВ ══════════ */
.up-grid { display: grid; gap: 10px; }
.up-grid--3 { grid-template-columns: 1fr 1fr; }

.up {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 11px;
  transition: border-color var(--dur), background-color var(--dur);
}
.up.is-drag { border-color: var(--accent); background: var(--tint); }
.up.is-invalid { border-color: var(--danger); background: var(--danger-bg); }
.up.is-filled { border-style: solid; border-color: var(--accent); background: var(--surface); }

.up__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.up__title { font-size: 13.5px; font-weight: 600; }
.up__meta { font-size: 11.5px; color: var(--faint); font-weight: 400; white-space: nowrap; }

.up__drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 92px;
  padding: 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--dur), background-color var(--dur);
}
.up__drop:active { background: var(--tint); }
.up__drop:focus-visible { outline: none; box-shadow: var(--ring); }
.up__drop svg { width: 22px; height: 22px; color: var(--accent); }
.up__drop b { font-weight: 600; font-size: 13.5px; color: var(--text); }

.up__list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.up__list:empty { display: none; }
.up__list:not(:empty) + .up__drop { margin-top: 9px; min-height: 46px; flex-direction: row; gap: 8px; }
.up__list:not(:empty) + .up__drop span { display: none; }

.up--single .up__list { grid-template-columns: 1fr; }
.up--single .thumb { aspect-ratio: 4 / 3; }
.up--doc .thumb img { object-fit: contain; background: var(--bg-2); }

.up-grid--3 .up { padding: 9px; }
.up-grid--3 .up__title { font-size: 12.5px; }
.up-grid--3 .up__title .up__meta { display: none; }
.up-grid--3 .up__drop { min-height: 78px; }
.up-grid--3 .up__drop span { display: none; }
.up-grid--3 .up--single .thumb { aspect-ratio: 1; }

.thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-2);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.thumb__file {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 8px;
  font-size: 10.5px;
  color: var(--muted);
  text-align: center;
  word-break: break-all;
}
.thumb__del {
  position: absolute;
  top: 4px; right: 4px;
  width: 28px; height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: rgba(8, 24, 45, .72);
  color: #fff;
  cursor: pointer;
  transition: background-color var(--dur);
}
.thumb__del svg { width: 14px; height: 14px; }
.thumb__del:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .85); }

/* ══════════ КАРТА ══════════ */
.map-search { position: relative; display: grid; gap: 8px; margin-bottom: 10px; }
.map-search > svg { position: absolute; top: 15px; left: 13px; color: var(--faint); pointer-events: none; }
.map-search .input { padding-left: 40px; }

.map-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  z-index: 10;
  margin: 0;
  padding: 5px;
  list-style: none;
  max-height: 210px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.map-results li {
  padding: 11px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.35;
  cursor: pointer;
  transition: background-color var(--dur);
}
.map-results li:active, .map-results li:focus-visible { background: var(--tint); outline: none; }

.map-box {
  height: 220px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}
#map { height: 100%; width: 100%; background: var(--bg-2); }
.leaflet-container { font: inherit; }

.coords { margin: 0 0 4px; font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }

/* ══════════ СВОДКА ══════════ */
.summary {
  margin: 2px 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 2px 13px;
}
.summary:empty { display: none; }
.summary__row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.summary__row:last-child { border-bottom: 0; }
.summary__row dt { color: var(--muted); margin: 0; }
.summary__row dd { margin: 0; font-weight: 600; text-align: right; }

/* ══════════ КНОПКИ ══════════ */
.actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px calc(12px + var(--safe-b));
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.actions--single { justify-content: center; }
.actions [data-action="back"] { flex: 0 0 auto; padding-inline: 15px; }
.actions [data-action="back"] span { display: none; }
.actions [data-action="next"],
.actions [data-action="submit"],
.actions--single .btn { flex: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 12px 20px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-btn);
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur), border-color var(--dur), color var(--dur), box-shadow var(--dur), transform 120ms;
}
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:active { transform: scale(.985); }
.btn svg { width: 18px; height: 18px; }

.btn--primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-sm); }
.btn--cta { background: var(--accent); color: var(--surface); }
.btn--ghost { background: var(--surface); color: var(--muted); border-color: var(--border-strong); }
.btn--lg { min-height: 54px; font-size: 16px; }
.btn--sm { min-height: 48px; padding: 8px 14px; font-size: 13.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ══════════ ПОДВАЛ ══════════ */
.footnote {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto;
  padding: 0 16px 14px;
  max-width: 46ch;
  font-size: 12px;
  color: var(--faint);
  text-align: center;
}
.footnote svg { width: 14px; height: 14px; }

/* ══════════ УСПЕХ ══════════ */
.success-mark {
  width: 66px; height: 66px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--ok-bg);
  color: var(--ok);
  animation: pop 400ms cubic-bezier(.34, 1.56, .64, 1);
}
.success-mark svg { width: 32px; height: 32px; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }

.ticket {
  display: inline-block;
  margin: 0 auto;
  padding: 9px 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--muted);
}
.ticket strong { color: var(--text); letter-spacing: .04em; }

/* ══════════ ОВЕРЛЕЙ И ЛАЙТБОКС ══════════ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: grid;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.overlay__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  padding: 26px 30px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 14.5px;
  font-weight: 500;
  text-align: center;
}
.overlay__box p { margin: 0; }
.spinner {
  width: 30px; height: 30px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-lightbox);
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(4, 12, 24, .92);
}
.lightbox img { max-width: 100%; max-height: 84dvh; border-radius: var(--radius); }
.lightbox__close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  cursor: pointer;
  font-size: 0;
}

/* ══════════ ПЛАНШЕТ И ДЕСКТОП ══════════ */
@media (min-width: 700px) {
  .topbar__in { padding: 12px 20px; }
  .brand__logo { height: 36px; }
  .lang__toggle { min-height: 38px; font-size: 13px; }
  .progress { padding: 0 20px 12px; }
  .progress__label { font-size: 13px; }

  .stage { padding: 20px 20px 4px; align-items: center; }
  /* max-height обязан включать 100%: иначе в невысоком окне карточка растёт
     по содержимому и кнопки «Назад / Отправить» уезжают под нижний край.
     Центрируем через align-items, а НЕ через margin: auto — авто-margin
     у флекс-элемента отключает stretch и как раз ломал вписывание. */
  .card { max-height: min(740px, 100%); }
  .body { padding: 30px 30px 10px; }

  .h1 { font-size: 34px; }
  .h2 { font-size: 24px; }
  .lead { font-size: 16px; margin-bottom: 22px; }
  .hint { font-size: 14px; margin-bottom: 18px; }

  .perks { gap: 10px; }
  .perks li { padding: 13px 16px; }
  .perks strong { font-size: 15px; }
  .perks span { font-size: 13px; }

  .choice-grid { gap: 11px; }
  .choice__body { padding: 16px 48px 16px 16px; gap: 15px; }
  .choice__icon { width: 46px; height: 46px; }
  .choice__text strong { font-size: 16px; }
  .choice__text small { font-size: 13px; }
  .choice:hover .choice__body { border-color: var(--border-strong); background: var(--surface-2); }
  .choice input:checked + .choice__body { background: var(--tint); border-color: var(--accent); }

  .pill-grid { display: flex; flex-wrap: wrap; gap: 9px; }
  .pill span { min-height: 46px; border-radius: var(--radius); padding-inline: 20px; font-size: 14.5px; }
  .pill-grid--wide .pill { flex: 1 1 220px; }
  .pill-grid--3 .pill { flex: 1 1 120px; }
  .pill:hover span { border-color: var(--border-strong); background: var(--surface-2); }
  .pill input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

  .notice { padding: 16px 18px 16px 20px; margin-bottom: 18px; }
  .notice li { font-size: 14px; }

  .two-col { grid-template-columns: 1fr 1fr; gap: 14px; }
  .check { font-size: 14px; padding: 14px 15px; }
  .check:hover { border-color: var(--border-strong); }

  .up-grid { gap: 12px; }
  .up-grid--2 { grid-template-columns: repeat(2, 1fr); }
  .up-grid--3 { grid-template-columns: repeat(3, 1fr); }
  .uploader--wide { grid-column: 1 / -1; }
  .up, .up-grid--3 .up { padding: 12px; }
  .up-grid--3 .up__title { font-size: 13.5px; }
  .up-grid--3 .up__drop { min-height: 88px; }
  .up-grid--3 .up__drop span { display: block; }
  .up__drop:hover { color: var(--accent); background: var(--tint); }
  .up__list { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 9px; }
  .thumb__del:hover { background: var(--danger); }

  .map-search { grid-template-columns: 1fr auto; }
  .map-box { height: 260px; }
  .map-results li:hover { background: var(--tint); }

  .actions { padding: 14px 30px; }
  .actions [data-action="back"] { padding-inline: 22px; }
  .actions [data-action="back"] span { display: inline; }
  .actions [data-action="next"],
  .actions [data-action="submit"] { flex: 0 0 auto; margin-left: auto; }
  .actions--single .btn { flex: 0 0 auto; padding-inline: 32px; }

  .btn--primary:hover { background: var(--primary-dark); }
  .btn--ghost:hover { color: var(--text); border-color: var(--faint); }

  .footnote { display: flex; }
  .lightbox__close { top: 18px; right: 18px; }
}

@media (min-width: 1000px) {
  .card { max-width: 720px; }
}

/* низкие экраны — экономим вертикаль */
@media (max-height: 700px) and (max-width: 700px) {
  .body { padding-top: 16px; }
  .h1 { font-size: 24px; }
  .h2 { font-size: 18.5px; }
  .lead, .hint { margin-bottom: 12px; }
  .map-box { height: 180px; }
}

@media (max-width: 360px) {
  .choice__body { gap: 11px; padding: 11px 40px 11px 11px; }
  .choice__icon { width: 40px; height: 40px; }
  .up__list { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
