/* ════════════════════════════════════════════════════
   ПРЕЛЕНД: стили (mobile-first, база 360–430px)
   ════════════════════════════════════════════════════ */

:root {
  --accent: #2f9e6e;
  --accent-dark: #26855c;
  --accent-soft: #e8f5ef;
  --text: #24272b;
  --muted: #6b7280;
  --line: #e5e8e6;
  --bg-soft: #f4f6f5;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(20, 40, 30, 0.10);
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-article: Georgia, "Times New Roman", serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* запас снизу под sticky-кнопку */
  padding-bottom: 84px;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 18px;
}

img { max-width: 100%; height: auto; display: block; }

/* ── Шапка ── */
.hero { padding: 28px 0 8px; }

.hero__kicker {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.hero h1 {
  margin: 0 0 12px;
  font-size: 1.65rem;
  line-height: 1.25;
  font-weight: 800;
}

.hero__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

/* ── Статья ── */
.article { padding-top: 20px; }

.article p {
  font-family: var(--font-article);
  font-size: 1.06rem;
  margin: 0 0 18px;
}

.article h2 {
  font-size: 1.28rem;
  line-height: 1.3;
  margin: 30px 0 12px;
  font-weight: 800;
}

.lead { font-size: 1.12rem; }

/* Фото */
.photo { margin: 22px 0; }

.photo img {
  width: 100%;
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.photo figcaption {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.photo__pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Цитаты героини */
.quote {
  margin: 24px 0;
  padding: 16px 18px;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-article);
  font-style: italic;
  font-size: 1.08rem;
}

/* ── Кнопки ── */
.btn {
  display: inline-block;
  border: 0;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 16px 28px;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(47, 158, 110, 0.35);
}

.btn--primary:hover { background: var(--accent-dark); }
.btn--primary:active { transform: scale(0.97); }

.btn--big {
  display: block;
  width: 100%;
  padding: 18px 24px;
  font-size: 1.12rem;
}

/* Приглашение к квизу */
.quiz-invite {
  margin: 34px 0 26px;
  padding: 22px 20px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  text-align: center;
}

.quiz-invite__title { margin-top: 0 !important; }

.quiz-invite p {
  font-family: var(--font-ui);
  font-size: 0.98rem;
  color: var(--muted);
}

/* ── Квиз ── */
.quiz-section {
  padding: 10px 0 34px;
  scroll-margin-top: 12px;
}

.quiz-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px 18px 26px;
  min-height: 320px;
  overflow: hidden;
}

/* Прогресс */
.quiz-progress { margin-bottom: 18px; }

.quiz-progress__label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}

.quiz-progress__track {
  height: 8px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
}

.quiz-progress__fill {
  height: 100%;
  width: 25%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.35s ease;
}

/* Шаги */
.quiz-step { animation: step-in-right 0.35s ease both; }
.quiz-step--back { animation-name: step-in-left; }

@keyframes step-in-right {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes step-in-left {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: translateX(0); }
}

.quiz-step__title {
  margin: 0 0 16px;
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1.3;
}

.quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 10px;
  padding: 15px 16px;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-soft);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.quiz-option:hover { border-color: var(--accent); background: var(--accent-soft); }
.quiz-option:active { transform: scale(0.98); }

.quiz-option.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.quiz-back {
  margin-top: 6px;
  background: none;
  border: 0;
  padding: 10px 4px;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.quiz-back:hover { color: var(--text); }

/* Экран «анализируем» */
.quiz-analyzing {
  text-align: center;
  padding: 40px 0 30px;
  animation: step-in-right 0.35s ease both;
}

.quiz-analyzing__spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 20px;
  border: 5px solid var(--bg-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.quiz-analyzing__text {
  font-size: 1.05rem;
  font-weight: 600;
  min-height: 1.7em;
}

/* Экран результата */
.quiz-result {
  text-align: center;
  animation: step-in-right 0.4s ease both;
}

.quiz-result__badge {
  width: 58px;
  height: 58px;
  margin: 4px auto 14px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 1.7rem;
  line-height: 58px;
}

.quiz-result__title {
  margin: 0 0 12px;
  font-size: 1.3rem;
  font-weight: 800;
}

.quiz-result__text {
  margin: 0 0 8px;
  font-size: 1.02rem;
  text-align: left;
}

.quiz-result__text strong { color: var(--accent-dark); }

.quiz-result .btn--big { margin-top: 18px; }

.quiz-result__note {
  margin: 14px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.quiz-noscript { text-align: center; }

/* ── Фото продукта и форма заявки ── */
.quiz-result__photo {
  width: 240px;
  max-width: 80%;
  height: auto;
  margin: 0 auto 16px;
  filter: drop-shadow(0 12px 22px rgba(20, 40, 30, 0.20));
}

.order-form {
  text-align: center;
  animation: step-in-right 0.35s ease both;
}

.order-form__photo {
  width: 170px;
  max-width: 55%;
  height: auto;
  margin: 0 auto 14px;
  filter: drop-shadow(0 10px 18px rgba(20, 40, 30, 0.18));
}

.order-form__title { text-align: center; }

.order-form__subtitle {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--muted);
}

.order-form__price,
.quiz-result__price {
  display: inline-block;
  margin: 0 0 16px;
  padding: 8px 16px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 999px;
  font-weight: 800;
}

.quiz-result__price { margin-top: 6px; }

.order-field {
  margin-bottom: 12px;
  text-align: left;
}

.order-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 700;
}

.order-field input {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

.order-field input:focus {
  outline: none;
  border-color: var(--accent);
}

.order-form .btn--big { margin-top: 8px; }

.order-form__consent {
  margin: 12px 0 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.form-error {
  margin: 0 0 14px;
  padding: 10px 14px;
  background: #fdecec;
  color: #b3261e;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

/* ── Страница «спасибо» ── */
.thanks {
  padding-top: 48px;
  text-align: center;
}

.thanks .quiz-card { padding: 34px 22px; }

.thanks h1 {
  font-size: 1.5rem;
  margin: 0 0 12px;
}

.thanks__hint {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── Комментарии ── */
.comments { padding: 8px 18px 26px; }

.comments__title {
  font-size: 1.15rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.comments__count { color: var(--muted); font-weight: 400; }

.comments__note {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 8px 0 18px;
}

.comment {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.comment__avatar {
  flex: 0 0 42px;
  height: 42px;
  border-radius: 50%;
  background: #7f9cf5;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comment__avatar--b { background: #f6ad55; }
.comment__avatar--c { background: #68b984; }

.comment__body {
  background: var(--bg-soft);
  border-radius: 4px 16px 16px 16px;
  padding: 10px 14px;
}

.comment__author {
  margin: 0 0 4px;
  font-weight: 700;
  font-size: 0.92rem;
}

.comment__text { margin: 0 0 8px; font-size: 0.95rem; }

.comment__meta {
  margin: 0;
  display: flex;
  gap: 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

/* ── Дисклеймер ── */
.disclaimer {
  padding-top: 16px;
  padding-bottom: 28px;
  border-top: 1px solid var(--line);
}

.disclaimer p {
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}

/* ── Sticky CTA ── */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-top: 1px solid var(--line);
  transform: translateY(110%);
  transition: transform 0.3s ease;
  z-index: 50;
}

.sticky-cta.is-visible { transform: translateY(0); }

.btn--sticky {
  display: block;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 15px 24px;
}

/* ── Появление блоков при скролле ── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* без JS блоки должны быть видимы */
.no-observer .reveal { opacity: 1; transform: none; }

/* ── Доступность: отключение анимаций ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .quiz-step, .quiz-analyzing, .quiz-result, .order-form { animation: none; }
  .quiz-progress__fill, .sticky-cta, .btn { transition: none; }
}

/* ── Десктоп ── */
@media (min-width: 768px) {
  body { font-size: 17px; }

  .hero { padding-top: 48px; }
  .hero h1 { font-size: 2.15rem; }

  .photo--hero { max-width: 440px; margin-left: auto; margin-right: auto; }

  .quiz-card { padding: 30px 34px 34px; }

  .btn--sticky { max-width: 360px; }

  .sticky-cta {
    background: transparent;
    border-top: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: none;
    padding-bottom: 18px;
  }

  .sticky-cta .btn {
    pointer-events: auto;
    box-shadow: 0 10px 28px rgba(47, 158, 110, 0.45);
  }
}
