/* ==========================================================================
   Culture Check: one question per screen, outline only, nothing filled.
   Magenta = the selected answer (question screens) / the result frame (result screen).
   ========================================================================== */

.quiz {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3rem, 7vw, 5.5rem);
  min-height: 72vh;
}
.quiz-container {
  max-width: calc(44rem + 2 * var(--gutter));
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.quiz h1.eyebrow {
  margin: 0;
  line-height: 1.6;
}

/* ---------- Progress: 5 dots in Petrol (current filled, done outlined, upcoming faint) ---------- */
.quiz-progress {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  gap: 0.6rem;
}
.js .quiz-progress { display: flex; }
.quiz-progress li {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  border: 1.5px solid rgba(45, 42, 62, 0.2);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.quiz-progress li.is-done { border-color: var(--petrol); }
.quiz-progress li.is-current { border-color: var(--petrol); background: var(--petrol); }
.quiz.is-finished .quiz-progress { display: none; }

/* ---------- Question ---------- */
.quiz-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 0.5rem;
}
.quiz.is-finished .quiz-form { display: none; }

.quiz-step {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.quiz-step + .quiz-step { margin-top: 1rem; }
.js .quiz-step + .quiz-step { margin-top: 0; }
.js .quiz-step:not(.is-active) { display: none; }

.quiz-step legend {
  padding: 0;
  margin-bottom: 1.75rem;
  font-size: var(--fs-h3);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.quiz-step legend:focus { outline: none; }

/* ---------- Answer cards: thin frame, no fill, no radio circle ---------- */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.quiz-option {
  display: flex;
  align-items: center;
  min-height: 3.5rem;
  padding: 0.9rem 1.25rem;
  border: 1.5px solid rgba(45, 42, 62, 0.22);
  border-radius: 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.quiz-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.quiz-option:hover { border-color: var(--petrol); }
.quiz-option:has(input:focus-visible) {
  outline: 3px solid var(--petrol);
  outline-offset: 3px;
}
/* Selected: the one Magenta moment on a question screen (frame grows to 2px without moving the text) */
.quiz-option:has(input:checked) {
  border-color: var(--magenta);
  box-shadow: 0 0 0 0.5px var(--magenta);
  color: var(--magenta);
  font-weight: 700;
}

/* ---------- Next / Back ---------- */
.quiz-actions,
.quiz-result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
}
.quiz-result-actions[hidden],
.quiz-back[hidden],
.quiz .page-next[hidden] { display: none; }  /* (16.11.) the My Offer line hides once the result shows */

.quiz-next { cursor: pointer; }
.quiz-next:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}

/* Text link in muted Tinte, no frame, no weight */
.quiz-back {
  padding: 0.5rem 0;
  font-family: var(--font);
  font-size: var(--fs-small);
  font-weight: 400;
  color: var(--tinte-soft);
  background: none;
  border: 0;
  cursor: pointer;
}
.quiz-back:hover { color: var(--petrol); }

/* Without JS there is no step logic: questions stay readable, the buttons step back */
html:not(.js) .quiz-actions { display: none; }

/* ---------- Result: title + text in a full Magenta frame, button right below ---------- */
.quiz-results {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}
.quiz-result[hidden] { display: none; }
.quiz-result {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}
.quiz-result h2 {
  font-size: var(--fs-h2);
}
.quiz-result h2:focus { outline: none; }
.quiz-takeaway {
  padding: clamp(1.5rem, 3vw, 2rem);
  border: 2px solid var(--magenta);
  border-radius: var(--radius);
}
.quiz-result-actions .btn { white-space: normal; }

.quiz-noscript { color: var(--tinte-muted); font-size: var(--fs-small); }

/* ---------- Motion: calm fade + small slide, the result a touch slower ---------- */
@keyframes quiz-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.js .quiz-step.is-active { animation: quiz-in 0.24s ease both; }
.quiz-result:not([hidden]),
.quiz-result-actions:not([hidden]) { animation: quiz-in 0.45s ease both; }

@media (prefers-reduced-motion: reduce) {
  .js .quiz-step.is-active,
  .quiz-result:not([hidden]),
  .quiz-result-actions:not([hidden]) { animation: none; }
}

/* ==========================================================================
   Round 2 (09.10.): intro screen, A-D letters, lighter buttons, result without a frame
   ========================================================================== */
.quiz .eyebrow { margin: 0; }

/* ---------- Intro: headline like on the other pages, one start button ---------- */
.quiz-intro {
  /* (25.10.) line and start button side by side, wraps on narrow screens */
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}
.quiz-intro h1 { font-size: var(--fs-h2); }
.quiz-intro .btn { cursor: pointer; }
html:not(.js) .quiz-start { display: none; }
.js .quiz:not(.is-intro) .quiz-intro,
.js .quiz.is-intro .quiz-form,
.js .quiz.is-intro .quiz-progress { display: none; }
.js .quiz-intro { animation: quiz-in 0.24s ease both; }

/* ---------- Answers: letter A-D in Petrol, turns Magenta with the selected card ---------- */
.quiz-option { gap: 0.9rem; align-items: baseline; }
.quiz-letter {
  flex: none;
  width: 1.1rem;
  font-weight: 700;
  color: var(--petrol-text);
}
.quiz-option:has(input:checked) .quiz-letter { color: inherit; }

/* ---------- Next / Back: smaller ---------- */
.quiz-actions .quiz-back { font-size: 0.9375rem; }
.quiz-actions { gap: 0.75rem 1.5rem; }

/* ---------- Result: lead line, title, plain text. The button is the only framed element ---------- */
.quiz-result-lead[hidden] { display: none; }
.quiz-result-lead {
  font-size: var(--fs-lead);
  font-weight: 500;
  animation: quiz-in 0.45s ease both;
}
.quiz-result { gap: 1.5rem; }
.quiz-takeaway {
  padding: 0;
  border: 0;
  border-radius: 0;
}
.quiz-takeaway p { font-size: var(--fs-lead); line-height: 1.6; }
.quiz-result-actions { margin-top: 1rem; }
.quiz-result-actions .quiz-back { font-size: 0.9375rem; }

@media (prefers-reduced-motion: reduce) {
  .js .quiz-intro,
  .quiz-result-lead { animation: none; }
}

/* Question number in Petrol, in front of the question */
.quiz-number { color: var(--petrol); }

/* ---------- Result (10.10.): button, then the quiet mail link, then "Start over". Stacked, no line or box in between ---------- */
.quiz-result-actions {
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}
.quiz-mail {
  font-size: var(--fs-small);
  color: var(--tinte-soft);
}
.quiz-mail a {
  text-decoration: none;
  transition: color 0.15s ease;
}
.quiz-mail a:hover { color: var(--petrol); }
.quiz-mail .check-star { color: var(--magenta); }
.quiz-result-actions .quiz-restart { padding-top: 0; }
/* Long button label may wrap on phones: the asterisk stays attached to the last word */
.quiz-result-actions .btn { display: inline-block; }

/* ---------- Result links, round 2 (10.10.): readable text in Tinte, the clickable part underlined with the gradient ---------- */
.quiz-mail,
.quiz-again,
.quiz-mail-note {
  font-size: var(--fs-body);
  color: var(--tinte);
}
.quiz-link {
  padding: 0 0 0.15rem;
  font-family: var(--font);
  font-size: inherit;
  font-weight: 500;
  color: var(--tinte);
  text-decoration: none;
  border: 0;
  cursor: pointer;
  background: var(--shift-gradient) left bottom / 100% 2px no-repeat;
}
.quiz-mail a.quiz-link:hover,
.quiz-link:hover { color: var(--petrol); }
.quiz-mail-note[hidden],
.quiz-again[hidden] { display: none; }
.quiz-mail-note { font-size: var(--fs-small); }

/* "Take the check again" stands on its own, clearly below the CTA group */
.quiz-again {
  margin-top: 1.5rem;
  animation: quiz-in 0.45s ease both;
}
@media (prefers-reduced-motion: reduce) {
  .quiz-again { animation: none; }
}

/* ---------- Result links, round 3 (10.10.): calmer. One small row under the button instead of stacked blocks ---------- */
.quiz-result-actions { gap: 1.1rem; align-items: stretch; }
.quiz-result-actions .btn { align-self: flex-start; }
.quiz-secondary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}
.quiz-mail,
.quiz-again,
.quiz-mail-note {
  margin: 0;
  font-size: var(--fs-small);
  color: rgba(45, 42, 62, 0.75);
  animation: none;
}
.quiz-link { background-size: 100% 1.5px; }
.quiz-mail-note { max-width: 36rem; }

/* ---------- Result links, round 4 (10.10.): always stacked. Air after the button, retake at the very end ---------- */
.quiz-result-actions { gap: 0; }
.quiz-secondary { display: block; margin-top: 2rem; }
.quiz-mail-note { margin-top: 0.75rem; }
.quiz-again { margin-top: 2rem; }

/* ---------- Embedded on Working Together (19.10.): a block inside the page, no own screen height ---------- */
.section.quiz {
  min-height: 0;
  padding-block: clamp(2.5rem, 5vw, 4.25rem);  /* (14.11.) same section spacing as everywhere */
  scroll-margin-top: 5rem;
}
.quiz-body { max-width: 46rem; }
.quiz-result h3 { font-size: var(--fs-h3); }
.quiz-result h3:focus { outline: none; }

/* ---------- Answers (25.10.): all four boxes of a question share one height (the tallest), content centered in the box.
   The letter stays on the first line of its answer ---------- */
.quiz-options {
  display: grid;
  grid-auto-rows: 1fr;
}
.quiz-option {
  display: grid;
  grid-template-columns: 1.1rem minmax(0, 1fr);
  align-items: baseline;
  align-content: center;
}

/* ---------- Result (25.10.): no mail line any more. Button, then the retake link.
   The result title is THE Magenta statement of the result screen ---------- */
.quiz-result h3 { color: var(--magenta); }
.quiz-result-actions .quiz-again { margin-top: 2rem; }
/* Result title one step bigger (between body text and the section headline), and close to "Here's your result:" so both read as one unit */
.quiz-result h3 {
  font-size: clamp(1.625rem, 1.35rem + 1vw, 2.125rem);
  line-height: 1.2;
  letter-spacing: var(--tracking-tight);
}
.quiz-results { gap: 0.75rem; }
.quiz-result { gap: 1.5rem; }
.quiz-results .quiz-result-actions { margin-top: 2rem; }

/* Culture Check intro (30.10.): stacked, line, plain fact list, button last. Fills the height next to the headline */
.quiz-intro {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 1.25rem;
}
.quiz-intro .btn { margin-top: 0.5rem; }
/* Quiet reassurance under the start button (30.10.) */
/* (03.11.) Size and colour now come from .legal-note (components.css), same as the note under the contact form */

/* Result text in several short paragraphs: extra lines after a weak answer on question 4 or 5 (31.10.) */
.quiz-takeaway p + p { margin-top: 1rem; }

/* New question lands right under the fixed header, not behind it (Mira, 31.10.) */
.quiz-progress { scroll-margin-top: 7rem; }

/* Culture Check teaser (03.11., approved by Franzi). The first question in one Petrol frame gives the section substance,
   the facts sit in one quiet line next to the button */
.quiz-teaser { gap: 1rem; }
.quiz-teaser .eyebrow { margin: 0; }
.quiz-teaser-q {
  font-size: var(--fs-lead);
  font-weight: 500;
  line-height: 1.5;
}
.quiz-teaser-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 0.5rem;
}
.quiz-teaser-foot .btn { margin-top: 0; }
.quiz-teaser-facts {
  font-size: var(--fs-small);
  color: var(--tinte-soft);
}
.quiz-teaser-facts { font-size: var(--fs-body); color: var(--tinte); }
.quiz-teaser .quiz-privacy { margin-top: 0.25rem; }
/* Button and its line stay side by side, also on phones (the text wraps next to the button) */
.quiz-teaser-foot { flex-wrap: nowrap; }
.quiz-teaser-foot .btn { flex: none; }
.quiz-teaser .quiz-privacy { margin-top: 0.75rem; }

/* (03.11.) Line above the teaser box: same size as "I follow people, not frameworks." and the result titles */
.quiz-teaser-lead { margin: 0 0 0.5rem; }

/* (15.11., Franzi) Healthy result: quiet "Want to keep it that way? Let's talk*" instead of the big button.
   The button sets its own display, so [hidden] needs to win explicitly */
.quiz-result-actions .btn[hidden] { display: none; }
.quiz-soft-cta { margin-top: 1.25rem; font-size: var(--fs-lead); }

/* (15.11., Franzi) Retake link closer: 24px under the button, and 24px under "Want to keep it that way?" when there is no button */
.quiz-result-actions .quiz-again { margin-top: 1.5rem; }
.quiz-results .quiz-result-actions:has(> .btn[hidden]) { margin-top: 0; }
.quiz-result-actions:has(> .btn[hidden]) .quiz-again { margin-top: 0.75rem; }
