/* Страница квиза: та же палитра, что у сайта — светлая по умолчанию. */

.quiz-page {
  --quiz-share: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* фоновый эквалайзер — полоски растут вместе с прогрессом */
.quiz-bg {
  position: fixed;
  inset: auto 0 0 0;
  height: 38vh;
  display: flex;
  align-items: flex-end;
  gap: clamp(8px, 2vw, 26px);
  padding-inline: clamp(8px, 2vw, 26px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

.quiz-bg span {
  flex: 1;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(to top, var(--accent-soft), transparent);
  height: calc(12% + var(--quiz-share) * 52%);
  transition: height 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.quiz-bg span:nth-child(odd) { height: calc(6% + var(--quiz-share) * 72%); }
.quiz-bg span:nth-child(3n) { height: calc(18% + var(--quiz-share) * 40%); }

.quiz-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(18px, 3vw, 30px) clamp(16px, 5vw, 56px);
}

.quiz-logo {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.quiz-logo__name {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.02em;
}

.quiz-logo__back {
  font-size: 12.5px;
  color: var(--muted);
  transition: color 0.25s ease;
}

.quiz-logo:hover .quiz-logo__back { color: var(--accent); }

.quiz-step {
  margin: 0;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.quiz-progress {
  position: relative;
  z-index: 2;
  height: 2px;
  margin-inline: clamp(16px, 5vw, 56px);
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.quiz-progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.quiz-main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  place-items: center;
  padding: clamp(28px, 6vw, 72px) clamp(16px, 5vw, 56px) clamp(40px, 8vw, 96px);
}

.quiz-card {
  width: min(880px, 100%);
  animation: quiz-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.quiz-card[hidden] { display: none; }

.quiz-card.is-leaving { animation: quiz-out 0.22s ease forwards; }

@keyframes quiz-in {
  from { opacity: 0; transform: translateY(18px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes quiz-out {
  to { opacity: 0; transform: translateY(-14px); filter: blur(4px); }
}

.quiz-number {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin: 0 0 14px;
}

.quiz-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.9rem, 4.4vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin: 10px 0 14px;
  text-wrap: balance;
}

.quiz-title--result { color: var(--accent); }

.quiz-lead {
  margin: 0 0 26px;
  max-width: 62ch;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--ink-soft);
}

.quiz-lead a { color: var(--accent); }

.quiz-hint {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}

.quiz-question .quiz-hint { margin-bottom: 26px; }

.quiz-start { margin-bottom: 16px; }

/* ── Ответы ──────────────────────────────────────────────────────────────── */

.quiz-answers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-answer {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: clamp(16px, 2.2vw, 22px) clamp(18px, 2.4vw, 26px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
  animation: quiz-rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--step, 0) * 70ms);
}

.quiz-answer:hover,
.quiz-answer:focus-visible {
  border-color: var(--accent);
  background: var(--surface-2);
  transform: translateX(6px);
  outline: none;
}

.quiz-answer__key {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.quiz-answer:hover .quiz-answer__key,
.quiz-answer:focus-visible .quiz-answer__key {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--surface);
}

.quiz-answer__text { flex: 1; }

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

.quiz-back {
  margin-top: 22px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.25s ease;
}

.quiz-back:hover { color: var(--accent); }
.quiz-back[hidden] { display: none; }

/* ── Результат ───────────────────────────────────────────────────────────── */

.quiz-points {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 62ch;
}

.quiz-points[hidden] { display: none; }

.quiz-points li {
  position: relative;
  padding-left: 26px;
  color: var(--ink-soft);
  animation: quiz-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--step, 0) * 90ms + 120ms);
}

.quiz-points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 1px;
  background: var(--accent);
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 640px) {
  .quiz-answer { gap: 12px; border-radius: 14px; }
  .quiz-answer__key { width: 26px; height: 26px; }
  .quiz-answer:hover { transform: none; }
  .quiz-bg { height: 30vh; }
}

@media (prefers-reduced-motion: reduce) {
  .quiz-card,
  .quiz-answer,
  .quiz-points li {
    animation: none;
  }
  .quiz-bg span,
  .quiz-progress span { transition: none; }
}
