/* Ruqyah Pro — quiz UI styles (free self-assessment).
   Calm palette only: emerald + gold + cream. No alarm red/amber. */

.quiz-section { padding: 56px 0 76px; }
.quiz-shell { max-width: 760px; margin: 0 auto; }

.quiz-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 44px 42px;
}

.quiz-eyebrow {
  display: inline-block;
  font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--emerald-700);
  margin-bottom: 14px;
}

.quiz-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 38px);
  color: var(--emerald-950);
  line-height: 1.2;
  margin-bottom: 14px;
}
.quiz-title:focus { outline: none; }

.quiz-lead { color: var(--ink-600); font-size: 17px; margin-bottom: 14px; }
.quiz-note {
  font-size: 14.5px; color: var(--ink-400); font-style: italic;
  margin-bottom: 26px;
}

/* Progress */
.quiz-progress-track {
  height: 6px; background: var(--cream-100);
  border-radius: 999px; overflow: hidden; margin-bottom: 10px;
}
.quiz-progress-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--emerald-700), var(--gold-500));
  border-radius: 999px;
  transition: width 0.3s ease;
}
.quiz-step-label {
  font-size: 12.5px; color: var(--ink-400);
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 18px;
}

/* Question */
.quiz-q {
  font-family: var(--font-serif);
  font-size: clamp(22px, 3.2vw, 27px);
  color: var(--emerald-950);
  line-height: 1.35;
  margin-bottom: 8px;
}
.quiz-q:focus { outline: none; }
.quiz-q-sub { color: var(--ink-400); font-size: 14.5px; margin-bottom: 20px; }

.quiz-options { display: grid; gap: 12px; border: none; padding: 0; margin: 0 0 6px; }
.quiz-options legend { padding: 0; margin-bottom: 18px; }

.quiz-opt {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 18px;
  border: 2px solid rgba(11, 46, 35, 0.12);
  border-radius: 12px;
  cursor: pointer;
  font-size: 16.5px; color: var(--ink-900);
  transition: border-color 0.15s ease, background 0.15s ease;
  background: var(--white);
}
.quiz-opt:hover { border-color: var(--emerald-700); }
.quiz-opt.selected {
  border-color: var(--emerald-800);
  background: rgba(27, 101, 78, 0.06);
}
.quiz-opt input {
  width: 20px; height: 20px; flex-shrink: 0;
  accent-color: var(--emerald-800); cursor: pointer;
}
.quiz-opt:focus-within {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

/* Nav buttons */
.quiz-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 30px; gap: 12px; flex-wrap: wrap;
}
.quiz-nav .btn { border: none; font-family: var(--font-sans); }
.quiz-nav .btn-outline { border: 2px solid var(--emerald-900); }

.quiz-hint {
  margin-top: 14px; font-size: 14.5px; color: var(--emerald-800);
  background: var(--gold-100);
  border-radius: 10px; padding: 12px 16px;
}

/* Email */
.quiz-field { margin-bottom: 18px; }
.quiz-field label {
  display: block; font-weight: 600; color: var(--emerald-950);
  margin-bottom: 8px; font-size: 16px;
}
.quiz-field input[type="email"] {
  width: 100%; padding: 15px 18px; font-size: 16.5px;
  font-family: var(--font-sans);
  border: 2px solid rgba(11, 46, 35, 0.15);
  border-radius: 12px; background: var(--white); color: var(--ink-900);
}
.quiz-field input[type="email"]:focus {
  outline: 2px solid var(--gold-500); outline-offset: 2px;
  border-color: var(--emerald-800);
}
.quiz-privacy { font-size: 14px; color: var(--ink-400); margin: 16px 0 24px; }

/* Submitting */
.quiz-submitting { text-align: center; padding: 40px 0; }
.quiz-spinner {
  width: 46px; height: 46px; margin: 0 auto 20px;
  border: 4px solid var(--cream-100);
  border-top-color: var(--emerald-700);
  border-radius: 50%;
  animation: quiz-spin 0.9s linear infinite;
}
@keyframes quiz-spin { to { transform: rotate(360deg); } }

/* Result */
.quiz-safety { margin-bottom: 26px; }
.quiz-safety strong { color: var(--emerald-900); }

.quiz-report { margin: 8px 0 26px; }

.quiz-reflection-note {
  font-size: 14.5px; color: var(--ink-600); font-style: italic;
  border-top: 1px solid rgba(11, 46, 35, 0.1);
  padding-top: 20px; margin-top: 8px;
}
.quiz-record {
  font-size: 12.5px; color: var(--ink-400); margin-top: 14px;
}
.quiz-result-actions { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }

.quiz-dev-badge {
  display: inline-block; font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-400); border: 1px dashed rgba(122, 138, 131, 0.6);
  border-radius: 999px; padding: 5px 14px; margin-bottom: 18px;
}

@media (max-width: 640px) {
  .quiz-card { padding: 30px 22px; }
  .quiz-section { padding: 36px 0 56px; }
  .quiz-nav .btn { width: 100%; text-align: center; }
  .quiz-nav { flex-direction: column-reverse; align-items: stretch; }
}

/* ---- UI enhancement pass (Oct 26) ---- */
/* Report typography: the report container previously had no type rules, so
   server prose rendered as one dense wall. */
.quiz-report .report-header { margin-bottom: 26px; padding-bottom: 22px; border-bottom: 1px solid rgba(11, 46, 35, 0.12); }
.quiz-report .report-header h1 { font-family: var(--font-serif); font-size: clamp(32px, 4.6vw, 44px); color: var(--emerald-950); line-height: 1.15; margin-bottom: 10px; }
.quiz-report .report-subtitle { color: var(--ink-600); font-size: 16px; margin-bottom: 4px; }
.quiz-report p { margin-bottom: 14px; line-height: 1.75; }
.quiz-report h2 { font-family: var(--font-serif); font-size: clamp(24px, 3.4vw, 30px); color: var(--emerald-950); line-height: 1.25; margin: 26px 0 12px; }
.quiz-report h2:first-child { margin-top: 0; }
.quiz-report h3 { font-family: var(--font-serif); font-size: 21px; color: var(--emerald-950); line-height: 1.3; margin: 20px 0 10px; }
.quiz-report ul { margin: 0 0 14px 22px; }
.quiz-report li { margin-bottom: 6px; line-height: 1.7; }
.quiz-report blockquote.ayah, .quiz-report blockquote.dua { background: var(--cream-50); border-left: 3px solid var(--gold-500); border-radius: 0 10px 10px 0; padding: 16px 20px; margin: 0 0 16px; }
.quiz-report blockquote.ayah p, .quiz-report blockquote.dua p { margin-bottom: 8px; }
.quiz-report blockquote cite { font-size: 13.5px; color: var(--ink-400); font-style: normal; }
.quiz-report p.ar { font-family: var(--font-arabic); font-size: 21px; line-height: 1.9; }

/* Report sections: overview first, details on demand. Each module becomes one
   collapsible section headed by its own title plus a preview line taken from
   the section's own first sentence — no new copy. */
.report-expand-all { background: none; border: none; cursor: pointer; color: var(--emerald-800); font-weight: 600; font-size: 14.5px; padding: 0 0 16px; }
.report-expand-all:hover { text-decoration: underline; }
.report-section { border: 1px solid rgba(11, 46, 35, 0.12); border-radius: 12px; margin-bottom: 12px; overflow: hidden; background: var(--white); }
.report-section-head { display: flex; flex-direction: column; gap: 6px; width: 100%; background: none; border: none; cursor: pointer; text-align: left; padding: 18px 20px; }
.report-section-head:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; }
.report-section-head-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.report-section-title { font-family: var(--font-serif); font-size: 21px; font-weight: 700; color: var(--emerald-950); line-height: 1.3; }
.report-section-chev { display: inline-block; flex-shrink: 0; font-size: 18px; color: var(--gold-600); transition: transform 0.2s ease; }
.report-section-head[aria-expanded="true"] .report-section-chev { transform: rotate(180deg); }
.report-section-preview { color: var(--ink-600); font-size: 14.5px; line-height: 1.6; }
.report-section-body { padding: 2px 20px 20px; }
.report-section-body p:last-child { margin-bottom: 0; }

/* Intro notes: full body styling — these are instructions, not fine print. */
.quiz-note { color: var(--ink-900); font-size: 16.5px; font-style: normal; }

/* Focus/scroll targets clear the sticky header instead of sliding under it. */
.quiz-q, .quiz-card, .report-section-head { scroll-margin-top: 90px; }

@media (max-width: 640px) {
  /* Room for the fixed question nav so it never covers an answer. */
  .quiz-section { padding-bottom: 120px; }
  .quiz-nav.quiz-nav-fixed {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    flex-direction: row; align-items: center;
    background: rgba(250, 246, 236, 0.97);
    border-top: 1px solid rgba(11, 46, 35, 0.12);
    box-shadow: 0 -6px 18px rgba(11, 46, 35, 0.08);
    padding: 12px 4% calc(12px + env(safe-area-inset-bottom));
    margin-top: 0; gap: 10px;
  }
  .quiz-nav.quiz-nav-fixed .btn { width: auto; padding: 12px 22px; }
  .quiz-nav.quiz-nav-fixed .btn-primary { flex: 1; text-align: center; }
}
