/* =========================================================================
   Дизайн-токены — цвета и шрифты можно менять здесь, в одном месте
   ========================================================================= */
:root {
  --bg: #FFFFFF;
  --surface: #F6F5F3;
  --ink: #2A2A28;
  --ink-soft: #6E6E6C;
  --accent: #BD6B46;       /* фирменный оранжевый — кнопки, выбранные ответы, ключевые акценты */
  --accent-deep: #8B8B89;  /* фирменный серый — прогресс-бар, второстепенные элементы */
  --line: #E1DFDB;
  --error: #A2532F;        /* тёмный оранжевый — таймер/предупреждения, чтобы остаться в палитре */

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", system-ui, -apple-system, sans-serif;

  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---- Верхняя шапка (бейдж доверия + прогресс-бар) ------------------------- */
.top-fixed {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.top-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px 4px;
  text-align: center;
}
.top-badge svg { flex-shrink: 0; }
.top-badge span {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.3;
}

.top-proof {
  margin: 0;
  padding: 0 16px 8px;
  text-align: center;
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
}

/* ---- Прогресс-бар (толстая полоса + подарок на конце) --------------------- */
.progress-block {
  margin-bottom: 22px;
}

.progress-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.progress-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.progress-percent {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.progress-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-track {
  flex: 1;
  height: 8px;
  display: flex;
  gap: 4px;
}

.progress-seg {
  flex: 1;
  height: 100%;
  border-radius: 999px;
  background: var(--line);
  transition: background 0.3s ease;
}

.progress-seg.is-filled {
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
}

.progress-gift {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1.5px solid var(--line);
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.progress-gift.is-filled {
  background: #F5E7DE;
  border-color: var(--accent);
  transform: scale(1.12);
}

/* ---- Контейнер ----------------------------------------------------------- */
.quiz-app {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 56px;
}

.screen {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* ---- Медиа (картинка / гифка / видео) ------------------------------------ */
.q-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  background: var(--line);
}
.q-media img,
.q-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---- Типографика ---------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-deep);
  margin: 0 0 10px;
}

.headline {
  font-family: var(--font-display);
  font-size: clamp(28px, 6vw, 38px);
  font-weight: 560;
  line-height: 1.15;
  margin: 0 0 12px;
}

.question-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 560;
  line-height: 1.25;
  margin: 0 0 20px;
}

.subtext {
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 28px;
}

.question-note {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  margin: 0 0 22px;
}

.footnote {
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
  margin: 14px 0 0;
}

/* ---- Информационный экран (сравнение двух колонок) ------------------------ */
.info-screen .question-title { margin-bottom: 8px; }
.info-screen .subtext { margin-bottom: 22px; }

.info-columns {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.info-column {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
}

.info-column.is-positive {
  border-color: var(--accent);
  background: #FBF3EC;
}

.info-col-heading {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.info-col-subheading {
  margin: 2px 0 14px;
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.3;
}

.info-col-steps {
  display: flex;
  flex-direction: column;
}

.info-step-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.info-step-arrow {
  text-align: center;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1;
  margin: 2px 0 2px 13px;
  opacity: 0.6;
}

.info-column.is-muted .info-step-arrow { opacity: 0.35; }

.info-step-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1.5px solid var(--accent);
  color: var(--accent);
}

.info-column.is-muted .info-step-icon {
  border-color: var(--line);
  color: var(--ink-soft);
}

.info-step-icon svg { width: 13px; height: 13px; }

.info-step-label {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.info-step-desc {
  margin: 1px 0 0;
  font-size: 10.5px;
  color: var(--ink-soft);
  line-height: 1.25;
}

.info-col-flow {
  height: 10px;
  border-radius: 999px;
  margin: 14px 0 10px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
}

.info-column.is-muted .info-col-flow {
  background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 10px);
}

.info-col-tag {
  margin: 0;
  text-align: center;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 8px;
}

.info-closing {
  text-align: center;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 650;
  margin: 4px 0 18px;
}

@media (max-width: 360px) {
  .info-columns { gap: 6px; }
  .info-column { padding: 10px 8px; }
}

/* ---- Кнопка основная ------------------------------------------------------ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 16px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}
.btn-primary:hover { background: #A2582F; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---- Ответы -------------------------------------------------------------- */
.answers {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.answer-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid transparent;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.answer-row:hover {
  border-color: var(--accent-deep);
}
.answer-row.is-selected {
  border-left-color: var(--accent);
  background: #F5E7DE;
}

.answer-marker {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--line);
  position: relative;
}
.answer-row.is-selected .answer-marker {
  border-color: var(--accent);
}
.answer-row.is-selected .answer-marker::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---- Форма контактов ------------------------------------------------------ */
.lead-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--ink-soft);
}

.field input {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
}
.field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.consent {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 2px 0 6px;
}

.error-text {
  color: var(--error);
  font-size: 14px;
  margin-top: 10px;
}

/* ---- Финальный экран ------------------------------------------------------ */
.result-screen {
  text-align: center;
}

.score-gauge-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.score-tier {
  margin: 0 0 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.findings-card {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0 0 22px;
}

.findings-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.findings-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.findings-list li {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
}

.findings-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---- Карточка спецпредложения (бейдж + таймер) ---------------------------- */
.offer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  margin: 4px 0 24px;
  background: #F5E7DE;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
}

.offer-badge {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-deep);
}

.offer-timer {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--error);
  letter-spacing: 1px;
}

/* ---- Экран загрузки перед редиректом (например, на 5-м вопросе) ----------- */
.loading-screen {
  align-items: center;
  text-align: center;
  padding: 40px 0;
}

.spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  margin-bottom: 22px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 300px;
}

/* ---- Мобильная адаптация --------------------------------------------------- */
@media (max-width: 420px) {
  .quiz-app { padding: 24px 16px 40px; }
  .btn-primary { padding: 15px 20px; }
}
