/* ===== Tokens ===== */
:root {
  --primary: #e64555;
  --primary-dark: #c91f32;
  --primary-soft: #fdecef;
  --primary-glow: rgba(230, 69, 85, 0.28);
  --ink: #002642;
  --ink-muted: rgba(0, 38, 66, 0.55);
  --ink-faint: rgba(0, 38, 66, 0.35);
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --line: rgba(0, 38, 66, 0.08);
  --radius-sm: 0.625rem;
  --radius-md: 1rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.75rem;
  --font: 'Inter', system-ui, sans-serif;
  --shadow-sm: 0 2px 8px rgba(0, 38, 66, 0.06);
  --shadow-md: 0 12px 40px rgba(0, 38, 66, 0.1);
  --shadow-lg: 0 24px 64px rgba(0, 38, 66, 0.14);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 0px;
  --quiz-head-h: 7rem;
  --quiz-foot-h: 4rem;
  --container-w: 38rem;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface-2);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
a { color: inherit; }

.icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.quiz-app {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
}

/* ===== Screens ===== */
.screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.985);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease), visibility 0.45s;
  overflow: hidden;
}

.screen--active {
  opacity: 1;
  visibility: visible;
  transform: none;
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

.screen--leaving {
  opacity: 0;
  transform: translateY(-8px) scale(0.99);
}

.screen--viewport {
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

.screen--viewport.screen--active {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, background 0.2s, opacity 0.2s;
}

.btn:disabled { opacity: 0.42; cursor: not-allowed; transform: none !important; }

.btn--primary {
  background: linear-gradient(135deg, var(--primary) 0%, #f05a68 100%);
  color: #fff;
  padding: 1rem 1.75rem;
  font-size: 1rem;
  box-shadow: 0 8px 24px var(--primary-glow);
}

.btn--primary:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px var(--primary-glow);
}

.btn--glow { position: relative; overflow: hidden; }

.btn--glow::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.22) 50%, transparent 60%);
  transform: translateX(-120%);
  animation: shine 3.5s ease-in-out infinite;
}

@keyframes shine {
  0%, 70% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

.btn--outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid rgba(230, 69, 85, 0.35);
  box-shadow: none;
}

.btn--outline:hover { background: var(--primary-soft); }

.btn--block { width: 100%; }

/* ===== Nav buttons ===== */
.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  border-radius: 999px;
  min-height: 3rem;
  padding: 0 1rem;
  font-weight: 600;
  font-size: 0.9375rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}

.nav-btn .icon { width: 1.125rem; height: 1.125rem; }

.nav-btn--ghost {
  width: 3rem;
  padding: 0;
  border-radius: 50%;
}

.nav-btn--ghost:hover {
  border-color: rgba(230, 69, 85, 0.25);
  background: var(--primary-soft);
  color: var(--primary);
}

.nav-btn--primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  padding: 0 1.25rem 0 1.375rem;
  min-width: 7.5rem;
}

.nav-btn--primary:not(:disabled):hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px var(--primary-glow);
}

.nav-btn--primary.is-auto-loading {
  pointer-events: none;
  opacity: 0.7;
}

.nav-btn--sm {
  width: 2.5rem;
  min-height: 2.5rem;
}

.nav-btn__label { line-height: 1; }

/* ===== Start page ===== */
.screen--start.screen--active {
  height: 100dvh;
  min-height: 100dvh;
}

.start {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  color: #fff;
}

.start__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.04);
  animation: kenburns 18s ease-in-out infinite alternate;
}

@keyframes kenburns {
  from { transform: scale(1.04); }
  to { transform: scale(1.1); }
}

.start__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(0, 18, 36, 0.88) 0%,
    rgba(0, 18, 36, 0.72) 50%,
    rgba(0, 18, 36, 0.32) 72%,
    rgba(0, 18, 36, 0.06) 100%
  );
}

.start__panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: min(100%, 50%);
  max-width: 48rem;
  margin-right: auto;
  min-height: 100%;
  height: 100%;
  padding: clamp(1.25rem, 2.5vh, 2rem) clamp(1.25rem, 3vw, 2.5rem);
  background: transparent;
}

.start__panel-brand {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
  animation: fadeUp 0.8s var(--ease) 0.15s both;
}

.start__panel-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 0;
  padding: 1.5rem 0;
  animation: fadeUp 0.8s var(--ease) 0.25s both;
}

.start__panel-logo-wrap {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(0, 38, 66, 0.08));
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.start__panel-logo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.start__panel-company {
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 0.6875rem;
  text-transform: uppercase;
  color: #fff;
}

.start__title {
  font-size: clamp(2rem, 4.2vw, 3rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 1.125rem;
  color: #fff;
}

.start__desc {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
  margin: 0 0 2rem;
}

.start__footer {
  flex-shrink: 0;
  padding-top: 0;
  animation: fadeUp 0.8s var(--ease) 0.4s both;
}

.start__phone {
  display: inline-block;
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
  margin-bottom: 0.375rem;
  color: #fff;
}

.start__phone:hover { color: rgba(255, 255, 255, 0.82); }

.start__legal {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.52);
  max-width: 100%;
}

@media (max-width: 900px) {
  .screen--start.screen--active {
    height: auto;
    min-height: 100dvh;
    max-height: none;
  }

  .start {
    display: grid;
    grid-template-rows: 42vh auto;
    grid-template-columns: 1fr;
    min-height: 100dvh;
    height: auto;
    overflow: visible;
    color: var(--ink);
    justify-content: stretch;
  }

  .start__bg {
    grid-area: 1 / 1;
    position: relative;
    inset: unset;
    height: 42vh;
    min-height: 42vh;
    z-index: 0;
  }

  .start__overlay {
    grid-area: 1 / 1;
    position: relative;
    inset: unset;
    height: 42vh;
    min-height: 42vh;
    z-index: 1;
    background: linear-gradient(
      135deg,
      rgba(0, 38, 66, 0.72) 0%,
      rgba(0, 38, 66, 0.25) 55%,
      rgba(0, 38, 66, 0.08) 100%
    );
  }

  .start__panel {
    grid-area: 2 / 1;
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: none;
    margin-right: 0;
    min-height: auto;
    height: auto;
    padding: 1.125rem 1.25rem 1.25rem;
    background: var(--surface);
  }

  .start__panel-company {
    color: var(--ink);
  }

  .start__title {
    color: var(--ink);
  }

  .start__desc {
    color: var(--ink-muted);
  }

  .start__phone {
    color: var(--ink);
  }

  .start__phone:hover {
    color: var(--primary);
  }

  .start__legal {
    color: var(--ink-faint);
  }

  .start__panel-main {
    flex: none;
    padding: 1.25rem 0 1.5rem;
  }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Quiz stage (без рамки — только контейнер) ===== */
.quiz {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--surface);
}

.quiz__stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vh, 3rem) 1.25rem;
}

.quiz__container {
  width: 100%;
  max-width: var(--container-w);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.quiz__head {
  flex-shrink: 0;
  min-height: var(--quiz-head-h);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin-bottom: 1.75rem;
}

.quiz__head-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.quiz__step {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  white-space: nowrap;
}

.quiz__progress-line {
  flex: 1;
  height: 3px;
  background: rgba(0, 38, 66, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.quiz__progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: inherit;
  transition: width 0.55s var(--ease);
}

.quiz__title {
  font-size: clamp(1.375rem, 2.8vw, 1.75rem);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -0.025em;
  margin: 0;
  min-height: 2.5em;
}

.quiz__head:has(#quiz-hint:not([hidden])) .quiz__title {
  min-height: auto;
}

.quiz__hint {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.3125rem;
  width: fit-content;
  max-width: 100%;
  margin: 0.375rem 0 0;
  padding: 0.25rem 0.4375rem;
  border: 1px solid rgba(230, 69, 85, 0.16);
  border-radius: 0.4375rem;
  background: var(--primary-soft);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--primary);
}

.quiz__hint-icon {
  width: 0.8125rem;
  height: 0.8125rem;
  flex-shrink: 0;
}

.quiz__hint[hidden] {
  display: none;
}

.quiz__answers {
  flex: 1;
  animation: answersIn 0.45s var(--ease);
}

@keyframes answersIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Image answers — сетка 3 в ряд */
.answers-images {
  display: grid;
  gap: 0.875rem;
}

.answers-images--cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.answers-images--cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 520px) {
  .answers-images--cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.answer-image-card {
  cursor: pointer;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.22s var(--ease), box-shadow 0.22s;
  animation: cardIn 0.4s var(--ease) both;
}

.answer-image-card:nth-child(1) { animation-delay: 0.03s; }
.answer-image-card:nth-child(2) { animation-delay: 0.06s; }
.answer-image-card:nth-child(3) { animation-delay: 0.09s; }
.answer-image-card:nth-child(4) { animation-delay: 0.12s; }
.answer-image-card:nth-child(5) { animation-delay: 0.15s; }
.answer-image-card:nth-child(6) { animation-delay: 0.18s; }

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

.answer-image-card:hover {
  transform: translateY(-2px);
  border-color: rgba(230, 69, 85, 0.35);
  box-shadow: 0 6px 20px rgba(230, 69, 85, 0.1);
}

.answer-image-card.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.answer-image-card__check {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.2s, transform 0.22s var(--ease);
  z-index: 1;
}

.answer-image-card.is-selected .answer-image-card__check {
  opacity: 1;
  transform: scale(1);
}

.answer-image-card__img {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.answer-image-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s var(--ease);
}

.answer-image-card:hover .answer-image-card__img img {
  transform: scale(1.05);
}

.answer-image-card__label {
  flex-shrink: 0;
  padding: 0.5rem 0.5rem 0.625rem;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
}

/* Variant answers */
.answers-variants {
  display: grid;
  gap: 0.625rem;
}

.answers-variants--cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 540px) {
  .answers-variants--cols-2 {
    grid-template-columns: 1fr;
  }
}

.answer-variant {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9375rem 1.125rem;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.2s, background 0.2s;
  animation: cardIn 0.38s var(--ease) both;
}

.answer-variant:nth-child(1) { animation-delay: 0.02s; }
.answer-variant:nth-child(2) { animation-delay: 0.05s; }
.answer-variant:nth-child(3) { animation-delay: 0.08s; }
.answer-variant:nth-child(4) { animation-delay: 0.11s; }
.answer-variant:nth-child(5) { animation-delay: 0.14s; }
.answer-variant:nth-child(6) { animation-delay: 0.17s; }

.answer-variant:hover {
  border-color: rgba(230, 69, 85, 0.3);
}

.answer-variant.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.answer-variant__radio {
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  border: 2px solid rgba(0, 38, 66, 0.14);
  flex-shrink: 0;
  position: relative;
}

.answer-variant.is-selected .answer-variant__radio {
  border-color: var(--primary);
}

.answer-variant.is-selected .answer-variant__radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--primary);
}

.answer-variant__text {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Input */
.answer-input-wrap { max-width: 100%; }

.answer-input {
  width: 100%;
  padding: 1.125rem 1.25rem;
  font-size: 1.0625rem;
  font-weight: 500;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  outline: none;
  background: var(--surface-2);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.answer-input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.answer-input::placeholder { color: var(--ink-faint); }

/* Budget slider */
.answer-slider {
  max-width: 100%;
  animation: answersIn 0.45s var(--ease);
}

.answer-slider__input {
  display: block;
  width: fit-content;
  min-width: 11rem;
  max-width: 100%;
  margin: 0 0 0.875rem;
  padding: 0.6875rem 0.875rem;
  border: 1.5px solid rgba(0, 38, 66, 0.1);
  border-radius: var(--radius-md);
  background: #fff;
  font-family: inherit;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.answer-slider__input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--primary-soft), 0 4px 16px rgba(230, 69, 85, 0.08);
}

.answer-slider__track-wrap {
  position: relative;
  height: 3.5rem;
  margin-bottom: 0.5rem;
}

.answer-slider__track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2.75rem;
  transform: translateY(-50%);
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--line);
  overflow: hidden;
  cursor: pointer;
}

.answer-slider__fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: inherit;
  transition: width 0.08s linear;
  pointer-events: none;
}

.answer-slider__thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 1.625rem;
  height: 1.625rem;
  margin-left: -0.8125rem;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary);
  box-shadow: 0 2px 10px rgba(0, 38, 66, 0.12);
  cursor: grab;
  z-index: 2;
  padding: 0;
  transition: left 0.08s linear, box-shadow 0.2s, transform 0.2s;
}

.answer-slider__thumb:hover {
  box-shadow: 0 4px 16px var(--primary-glow);
  transform: translateY(-50%) scale(1.06);
}

.answer-slider__thumb.is-dragging {
  cursor: grabbing;
  box-shadow: 0 6px 18px var(--primary-glow);
  transform: translateY(-50%) scale(1.08);
}

.answer-slider__labels {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
}

/* Quiz footer — стиль Marquiz */
.quiz__foot {
  flex-shrink: 0;
  margin-top: 2.25rem;
  padding-top: 0.25rem;
}

.quiz__foot-inner {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.quiz__foot-progress { flex-shrink: 0; }

.quiz__foot-actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-left: auto;
}

.quiz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: background 0.2s, transform 0.15s, opacity 0.2s, box-shadow 0.2s;
}

.quiz-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.quiz-btn--back {
  width: 2.625rem;
  height: 2.625rem;
  padding: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-muted);
}

.quiz-btn--back svg {
  width: 1.25rem;
  height: 1.25rem;
}

.quiz-btn--back:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: rgba(0, 38, 66, 0.14);
}

.quiz-btn-next-wrap {
  display: flex;
  align-items: center;
}

.quiz-btn--next {
  gap: 0.375rem;
  padding: 0.6875rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #fff;
  font-size: 0.9375rem;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.quiz-btn--next:not(:disabled):hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.quiz-btn--next svg {
  width: 1.125rem;
  height: 1.125rem;
}

.quiz-btn--next.is-loading {
  pointer-events: none;
  opacity: 0.65;
}

.progress-ring {
  position: relative;
  width: 3rem;
  height: 3rem;
}

.progress-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-ring__track {
  fill: none;
  stroke: rgba(0, 38, 66, 0.08);
  stroke-width: 2.5;
}

.progress-ring__fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s var(--ease);
}

.progress-ring__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-ring__percent {
  font-size: 0.625rem;
  font-weight: 800;
  color: var(--ink);
}

/* Desktop: фиксированная навигация, скролл только у ответов */
@media (min-width: 769px) {
  .screen.screen--quiz.screen--active {
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  .quiz {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .quiz__stage {
    flex: 1;
    min-height: 0;
    justify-content: center;
    align-items: stretch;
    padding: clamp(1.5rem, 4vh, 2.5rem) 1.25rem var(--quiz-foot-h);
    overflow: hidden;
  }

  .quiz__container {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .quiz__head {
    margin-bottom: 1.5rem;
  }

  .quiz__answers {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 38, 66, 0.15) transparent;
  }

  .quiz__answers::-webkit-scrollbar {
    width: 6px;
  }

  .quiz__answers::-webkit-scrollbar-thumb {
    background: rgba(0, 38, 66, 0.15);
    border-radius: 999px;
  }

  .quiz__foot {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin-top: 0;
    padding: 0.625rem 1.25rem calc(0.625rem + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 24px rgba(0, 38, 66, 0.06);
    z-index: 50;
  }
}

/* Mobile: фиксированные шапка и навигация, скролл только у ответов */
@media (max-width: 768px) {
  .screen.screen--quiz.screen--active {
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  .quiz {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .quiz__stage {
    flex: 1;
    min-height: 0;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0 0 var(--quiz-foot-h);
    overflow: hidden;
  }

  .quiz__container {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    max-width: 100%;
  }

  .quiz__head {
    flex-shrink: 0;
    min-height: auto;
    margin-bottom: 0;
    justify-content: flex-start;
    padding: calc(0.875rem + env(safe-area-inset-top, 0px)) 1.25rem 1rem;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--line);
  }

  .quiz__head-top {
    margin-bottom: 0.625rem;
  }

  .quiz__title {
    min-height: auto;
    font-size: 1.375rem;
  }

  .quiz__answers {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 1.25rem 0.5rem;
  }

  .quiz__foot {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin-top: 0;
    padding: 0.625rem 1.25rem calc(0.625rem + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 24px rgba(0, 38, 66, 0.06);
    z-index: 50;
  }
}

@media (max-width: 480px) {
  :root { --quiz-head-h: 6.25rem; --container-w: 100%; }
}

/* ===== Form page (one screen) ===== */
.form-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%;
  max-height: 100dvh;
}

.form-page__visual {
  position: relative;
  background-size: cover;
  background-position: center;
}

.form-page__visual-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,38,66,0.15), rgba(0,38,66,0.55));
}

.form-page__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.25rem, 3vh, 2rem) clamp(1.25rem, 4vw, 2.5rem);
  background: var(--surface);
  min-height: 0;
  overflow: hidden;
}

.form-page__scroll {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: none;
}

.form-page__title {
  font-size: clamp(1.4375rem, 2.6vw, 1.875rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.625rem;
  line-height: 1.15;
}

.form-page__submit-error {
  margin: 0.75rem 0 0;
  color: var(--primary);
  font-size: 0.875rem;
  line-height: 1.45;
}

.form-page__lead {
  margin: 0 0 1.875rem;
  color: var(--ink-muted);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.5;
}

.form-page__perks {
  list-style: none;
  margin: 0 0 2.625rem;
  padding: 0 0 2.625rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.875rem;
  position: relative;
}

.form-page__perks::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(0, 38, 66, 0.14) 0%,
    rgba(0, 38, 66, 0.08) 55%,
    transparent 100%
  );
}

.form-page__perks li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 0.5rem;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}

.form-page__perk-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.form-page__perk-icon svg {
  width: 1.0625rem;
  height: 1.0625rem;
}

.form-page__perk-text {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-muted);
}

/* рамка, фон и отступы убраны временно — можно вернуть:
   padding: 1.625rem 1.25rem;
   border: 1px solid var(--line);
   border-radius: var(--radius-lg);
   background: var(--surface-2); */
.lead-form {
  width: 100%;
}

.field { margin-bottom: 1rem; }

.field:last-of-type { margin-bottom: 0.875rem; }

.field__label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--ink-muted);
}

.field__control {
  position: relative;
}

.field__control:focus-within .field__icon {
  color: var(--primary);
}

.field__input {
  width: 100%;
  padding: 0.9375rem 0.875rem 0.9375rem 2.625rem;
  font-size: 0.9375rem;
  border: 1.5px solid rgba(0, 38, 66, 0.1);
  border-radius: var(--radius-md);
  outline: none;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field__input::placeholder { color: var(--ink-faint); }

.field__input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--primary-soft), 0 4px 16px rgba(230, 69, 85, 0.08);
}

.field__input.is-error {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(230, 69, 85, 0.12);
}

.field__icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
  pointer-events: none;
  transition: color 0.2s;
}

.field__icon svg {
  width: 1.125rem;
  height: 1.125rem;
  display: block;
}

.field__control--phone {
  display: flex;
  align-items: stretch;
  border: 1.5px solid rgba(0, 38, 66, 0.1);
  border-radius: var(--radius-md);
  background: #fff;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field__control--phone:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft), 0 4px 16px rgba(230, 69, 85, 0.08);
}

.field__control--phone.is-error {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(230, 69, 85, 0.12);
}

.field__phone-prefix {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  padding: 0 0.75rem 0 0.875rem;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
  flex-shrink: 0;
}

.field__phone-flag {
  width: 1.375rem;
  height: 0.875rem;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 38, 66, 0.08);
  flex-shrink: 0;
}

.field__phone-flag svg {
  width: 100%;
  height: 100%;
  display: block;
}

.field__phone-code {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.field__input--phone {
  border: none;
  border-radius: 0;
  padding: 0.9375rem 0.875rem;
  box-shadow: none !important;
  background: transparent;
}

.field__input--phone:focus {
  box-shadow: none !important;
}

.field__error {
  margin: 0.3125rem 0 0;
  font-size: 0.75rem;
  color: var(--primary);
}

.lead-form .checkbox {
  margin: 0.875rem 0 1.125rem;
  padding: 0;
  background: none;
  border: none;
}

.lead-form .btn--primary {
  padding: 0.875rem 1.125rem;
  font-size: 0.9375rem;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.checkbox {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  cursor: pointer;
  margin-bottom: 0.875rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--ink-muted);
}

.checkbox input { display: none; }

.checkbox__box {
  width: 1rem;
  height: 1rem;
  border: 1.5px solid var(--line);
  border-radius: 0.3rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}

.checkbox input:checked + .checkbox__box {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox input:checked + .checkbox__box::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0.625rem;
  height: 0.625rem;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6l2.5 2.5 4.5-4.5' fill='none' stroke='%23ffffff' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  border: none;
  transform: none;
}

.checkbox a { color: var(--primary); }

@media (max-width: 768px) {
  .form-page {
    grid-template-columns: 1fr;
    grid-template-rows: 22vh 1fr;
  }

  .form-page__body {
    padding: 1rem 1.125rem;
    justify-content: flex-start;
  }

  .form-page__scroll {
    justify-content: flex-start;
    overflow-y: auto;
  }

  .form-page__lead {
    margin-bottom: 1.5rem;
  }

  .form-page__perks {
    gap: 0.625rem;
    margin-bottom: 2.25rem;
    padding-bottom: 2.25rem;
  }

  .form-page__perk-text {
    font-size: 0.6875rem;
  }
}

/* ===== Success (one screen) ===== */
.success {
  height: 100%;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  position: relative;
  background:
    radial-gradient(circle at 50% 30%, rgba(230, 69, 85, 0.1), transparent 55%),
    var(--surface);
}

.success__glow {
  position: absolute;
  width: 16rem;
  height: 16rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 69, 85, 0.15), transparent 70%);
  top: 28%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.success__icon {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  animation: popIn 0.55s var(--ease);
  position: relative;
  z-index: 1;
  box-shadow: 0 8px 24px var(--primary-glow);
}

.success__icon .icon { width: 2rem; height: 2rem; }

@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.06); }
  100% { transform: scale(1); opacity: 1; }
}

.success__title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.625rem;
  position: relative;
  z-index: 1;
}

.success__text {
  max-width: 22rem;
  color: var(--ink-muted);
  line-height: 1.55;
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  position: relative;
  z-index: 1;
}
