/* Money Cat Type quiz – builds on ../styles.css (same colours and buttons). */

.quiz { padding-top: 1.75rem; padding-bottom: 3rem; }
.quiz h1, .quiz h2 { color: #1f2a44; } /* navy headings, as on the ebook cover */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Start screen */
.quiz-hero { width: min(170px, 45vw); margin: 0 auto 1rem; }
#screen-start h1 { text-align: center; }
#screen-start .lead { text-align: center; }
.quiz-notice {
  text-align: center;
  font-weight: 700;
  background: var(--bg-alt);
  border-radius: 999px;
  padding: 0.5rem 1rem;
}
.quiz-edu {
  font-weight: 700;
  border-left: 4px solid var(--primary);
  background: var(--surface);
  padding: 0.75rem 1rem;
  border-radius: 0 10px 10px 0;
}
.quiz-start-btn { margin-top: 0.5rem; font-size: 1.1rem; }

/* Question screen */
.quiz-gulu {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-style: italic;
  color: var(--muted);
}
.quiz-part-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--primary-dark) !important;
  margin: 0 0 0.25rem;
}
.quiz-progress-label { margin: 0 0 0.4rem; font-size: 0.95rem; color: var(--muted); }
.quiz-progress {
  height: 10px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.quiz-progress-fill {
  height: 100%;
  width: 0;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.quiz-question { border: 0; margin: 0; padding: 0; min-width: 0; }
.quiz-question legend { padding: 0; margin-bottom: 1rem; width: 100%; }
.quiz-question legend h2 { font-size: clamp(1.2rem, 2.5vw + 0.6rem, 1.6rem); margin: 0; }
.quiz-question legend h2:focus { outline: none; }
.quiz-question legend h2:focus-visible { outline: 3px solid var(--focus); }

.quiz-options { display: flex; flex-direction: column; gap: 0.75rem; }
.quiz-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 60px;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.quiz-option:hover { border-color: var(--accent); }
/* The real radio stays in the page for keyboards and screen readers, but is drawn as the letter badge. */
.quiz-option input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  margin: 0;
}
.quiz-letter {
  flex: 0 0 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--primary);
  color: var(--primary-dark);
  font-weight: 700;
}
.quiz-option-text { flex: 1; }
.quiz-option:has(input:checked) { border-color: var(--primary); background: var(--bg-alt); }
.quiz-option input:checked + .quiz-letter { background: var(--primary); color: #fff; }
.quiz-option:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
/* Fallback focus ring for browsers without :has() */
.quiz-option input:focus-visible + .quiz-letter { outline: 3px solid var(--focus); outline-offset: 2px; }

.quiz-error:empty { display: none; }
.quiz-error { margin: 1rem 0 0; }

.quiz-nav {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.quiz-nav .btn { flex: 1; }
.quiz-nav #next-btn { flex: 2; }

/* Result screen */
#r-name { margin-bottom: 0.25rem; }
#r-name:focus { outline: none; }
.quiz-type-desc { font-weight: 700; color: var(--primary-dark); }
.quiz-result-actions { margin-top: 1.25rem; }
.quiz-more {
  margin-top: 2rem;
  padding: 1.25rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
}
.quiz-more .btn { width: 100%; margin-bottom: 1rem; }
.quiz-more span.btn[aria-disabled="true"] { opacity: 0.75; cursor: default; }
.quiz-more p { margin: 0 0 0.5rem; }
.quiz-more p a { display: inline-block; padding: 0.4rem 0; min-height: 44px; }
.quiz-edu-small { margin-top: 1.5rem; }
/* Full Report teaser, preview image and value line (v10) */
.quiz-more .quiz-teaser { margin: 0 0 1rem; font-weight: 600; overflow-wrap: anywhere; }
.quiz-inside-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.quiz-more .quiz-value { margin: -0.25rem 0 0.25rem; font-size: 0.95rem; color: var(--muted); }

@media (min-width: 600px) {
  .quiz-more .btn { width: auto; }
}

/* v8 */
.quiz-lang-note:empty { display: none; }
.quiz-lang-note { margin: 1rem 0 0; padding: .5rem .8rem; border-radius: 8px; background: #fbeee2; color: #6b4a3a; font-size: .95rem; text-align: center; }
.quiz-retake { margin-top: 2rem; text-align: center; font-size: .95rem; }
.quiz-retake p { margin: .5rem 0; }
.link-btn { background: none; border: 0; padding: .4rem .2rem; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; min-height: 44px; }
.link-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
