/* ============================================================
   Квиз «Мифы о наращивании волос» — стили компонента.
   Использует переменные и шрифты из styles.css основного сайта
   (--bg-card, --ink, --muted, --gold, --line, --font-display,
   --font-body, --ease-out). Если этот файл подключается на
   странице без styles.css, ниже заданы безопасные запасные
   значения через fallback в var().
   ============================================================ */

.quiz-section {
  padding: var(--space-section, clamp(56px, 8vw, 110px)) 0;
}

.quiz-lede {
  text-align: center;
  color: var(--muted, #6b5c4d);
  max-width: 46ch;
  margin: -32px auto 40px;
}

.quiz-card {
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 22px;
  background: var(--bg-card, #fffdfa);
  border: 1px solid var(--line, rgba(36, 26, 18, 0.1));
  border-radius: 6px;
}

@media (min-width: 560px) {
  .quiz-card { padding: 40px 44px; }
}

/* ---- progress ---- */
.quiz-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}
.quiz-progress-track {
  flex: 1 1 auto;
  height: 2px;
  background: var(--line-strong, rgba(36, 26, 18, 0.16));
  position: relative;
}
.quiz-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--gold, #9c4a2a);
  transition: width 400ms var(--ease-out, ease-out);
}
.quiz-counter {
  flex: 0 0 auto;
  font-family: var(--font-body, sans-serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted, #6b5c4d);
  white-space: nowrap;
}

/* ---- question ---- */
.quiz-question {
  font-family: var(--font-display, serif);
  font-style: italic;
  font-size: clamp(19px, 3.6vw, 25px);
  line-height: 1.4;
  color: var(--ink, #241a12);
  margin: 0 0 28px;
}

/* ---- answers ---- */
.quiz-answers {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 8px;
}
@media (min-width: 420px) {
  .quiz-answers { grid-template-columns: 1fr 1fr; }
}

.quiz-answer {
  min-height: 60px;
  padding: 14px 20px;
  font-family: var(--font-body, sans-serif);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink, #241a12);
  background: transparent;
  border: 1px solid var(--line-strong, rgba(36, 26, 18, 0.16));
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease, color 200ms ease, transform 160ms var(--ease-out, ease-out);
}
.quiz-answer:active { transform: scale(0.98); }
.quiz-answer:disabled { cursor: default; }
.quiz-answer:focus-visible {
  outline: 2px solid var(--gold, #9c4a2a);
  outline-offset: 2px;
}
@media (hover: hover) and (pointer: fine) {
  .quiz-answer:not(:disabled):hover {
    border-color: var(--gold, #9c4a2a);
    color: var(--gold, #9c4a2a);
  }
}

.quiz-answer.is-correct {
  border-color: var(--quiz-correct, #5f7a52);
  background: var(--quiz-correct-bg, rgba(95, 122, 82, 0.10));
  color: var(--quiz-correct, #5f7a52);
}
.quiz-answer.is-correct::after { content: " ✓"; }
.quiz-answer.is-wrong {
  border-color: var(--quiz-wrong, #a13d4c);
  background: var(--quiz-wrong-bg, rgba(161, 61, 76, 0.08));
  color: var(--quiz-wrong, #a13d4c);
}
.quiz-answer.is-wrong::after { content: " ✗"; }

/* ---- feedback ---- */
.quiz-feedback {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line, rgba(36, 26, 18, 0.1));
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 300ms var(--ease-out, ease-out), transform 300ms var(--ease-out, ease-out);
}
.quiz-feedback.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.quiz-feedback-verdict {
  font-family: var(--font-body, sans-serif);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.quiz-feedback-verdict.is-correct { color: var(--quiz-correct, #5f7a52); }
.quiz-feedback-verdict.is-wrong { color: var(--quiz-wrong, #a13d4c); }
.quiz-explanation {
  color: var(--muted, #6b5c4d);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 24px;
}
.quiz-next { width: 100%; }
@media (min-width: 420px) {
  .quiz-next { width: auto; }
}

/* ---- result screen ---- */
.quiz-result {
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 350ms var(--ease-out, ease-out), transform 350ms var(--ease-out, ease-out);
}
.quiz-result.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.quiz-score {
  font-family: var(--font-display, serif);
  font-size: clamp(44px, 10vw, 64px);
  color: var(--gold-bright, #b85a35);
  margin: 0 0 6px;
  line-height: 1;
}
.quiz-score span {
  font-size: 0.4em;
  color: var(--muted, #6b5c4d);
  font-style: italic;
}
.quiz-result-title {
  font-size: clamp(22px, 3.4vw, 28px);
  margin: 0 0 14px;
}
.quiz-result-message {
  color: var(--muted, #6b5c4d);
  max-width: 44ch;
  margin: 0 auto 32px;
  line-height: 1.65;
}
.quiz-result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
@media (min-width: 420px) {
  .quiz-result-actions { flex-direction: row; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .quiz-feedback, .quiz-result, .quiz-progress-fill {
    transition: none !important;
  }
}
