/* ============ /checklist: the quiz and its report card ============
   checklists/new and checklist_quiz_controller.js. Without the script it is a
   list of question cards with the email band (newsletter.css's dark band) at
   the foot; with it (.is-quiz) one card shows at a time under an Ember
   (--ember) progress bar, and the report card replaces them at the end.
   Ember here is the approved mockup's (checklist-quiz-20261107, directions A
   and C; DESIGN.md 2026-11-07): the bar and the "Most urgent" tag, with ink
   type on it as on .plan-badge. */

.cq-intro { padding-top: 48px; padding-bottom: 8px; max-width: 768px; }
.cq-intro h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.15; margin: 14px 0 12px; }
.cq-lead { color: var(--muted); font-size: 1.05rem; margin: 0; }

.cq-pill, .cq-chip {
  display: inline-block; font-weight: 500; color: var(--muted);
  background: var(--tint); border: 1px solid var(--line); border-radius: 999px;
}
.cq-pill { font-size: .8125rem; padding: 4px 12px; margin: 0; }
.cq-chip { font-size: .75rem; padding: 3px 10px; }

/* ---------- The questions ---------- */
.cq-quiz { max-width: 768px; padding-top: 24px; padding-bottom: 56px; scroll-margin-top: 64px; }
.cq-cards { list-style: none; display: grid; gap: 16px; }
.cq-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 36px 40px; min-width: 0;
}
/* A legend can't be laid out like a block until it floats. */
.cq-legend { float: left; width: 100%; padding: 0; }
.cq-q { font-size: 1.5rem; line-height: 1.25; margin: 14px 0 8px; }
.cq-q:focus { outline: none; }
.cq-hint { clear: both; color: var(--muted-2); margin: 0 0 24px; }
.cq-opts { display: grid; gap: 12px; }
.cq-opt {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 0 20px;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--card);
  font-weight: 500; font-size: 1.05rem; color: var(--navy); cursor: pointer;
  transition: background var(--ease), border-color var(--ease), color var(--ease), transform var(--ease);
}
/* The real radio, kept for the keyboard and the form, drawn by its label. */
.cq-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.cq-opt kbd {
  display: none; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px;
  font: 600 .8rem var(--font-body); background: var(--tint); border: 1px solid var(--line-strong);
}
.is-quiz .cq-opt kbd { display: grid; }
.cq-opt:hover, .cq-opt:has(input:checked) {
  background: var(--blue); border-color: var(--blue); color: var(--on-blue); transform: translateY(-1px);
}
.cq-opt:hover kbd, .cq-opt:has(input:checked) kbd { background: var(--blue-dark); border-color: var(--blue-dark); color: var(--on-blue); }
.cq-opt:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 3px; }
.cq-note {
  margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; font-size: .9rem;
  background: var(--warn-soft); color: var(--amber-dark);
}

/* ---------- One at a time ---------- */
.cq-top { display: grid; gap: 10px; margin-bottom: 18px; }
.cq-count { color: var(--muted-2); font-size: .9rem; font-weight: 500; }
.cq-bar { display: block; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.cq-bar i { display: block; height: 100%; width: 0; background: var(--ember); transition: width .4s; }
.is-quiz .cq-card { animation: cq-in .25s ease-out; }
@keyframes cq-in { from { opacity: 0; transform: translateY(8px); } }
.cq-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  margin-top: 18px; color: var(--muted-2); font-size: .9rem;
}
.cq-back {
  min-height: 44px; padding: 0 4px; border: 0; background: none; cursor: pointer;
  font: 500 .9rem var(--font-body); color: var(--navy);
}
.cq-back:disabled { color: var(--faint); cursor: default; }
.cq-dots { display: flex; gap: 6px; }
.cq-dots i { width: 28px; height: 6px; border-radius: 6px; background: var(--line-strong); overflow: hidden; }
.cq-dots b { display: block; height: 100%; width: 0; background: var(--navy); }

/* ---------- The report card ---------- */
/* Under the report card the intro moves to the page's edge, lined up with it;
   its text keeps the quiz column's measure (768px less the padding). */
.cq:has(.cq-results:not([hidden])) .cq-intro { max-width: 1200px; }
.cq:has(.cq-results:not([hidden])) .cq-intro > * { max-width: 720px; }
/* Scrolled to at the end, clear of the sticky header. */
.cq-results { padding-top: 32px; padding-bottom: 8px; scroll-margin-top: 64px; }
.cq-results h2:focus { outline: none; }
.cq-report {
  display: grid; grid-template-columns: 320px 1fr; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.cq-grade {
  display: flex; flex-direction: column; justify-content: center; padding: 36px;
  background: var(--tint); border-right: 1px dashed var(--line-strong);
}
.cq-letter { font-size: 9rem; font-weight: 700; line-height: .9; color: var(--navy); }
.cq-letter sup { font-size: 3.5rem; vertical-align: top; position: relative; top: .4em; }
.cq-grade p { margin: 12px 0 0; font-size: 1.05rem; color: var(--navy); }
.cq-grade small { color: var(--muted-2); margin-top: 4px; }
.cq-sections { display: grid; gap: 14px; align-content: center; padding: 34px 40px; }
.cq-section { display: grid; grid-template-columns: 140px 1fr 44px; align-items: center; gap: 14px; font-weight: 500; color: var(--navy); }
.cq-section b { font-weight: 600; text-align: right; }
.cq-track { height: 12px; border-radius: 12px; background: var(--line); overflow: hidden; }
.cq-track i { display: block; height: 100%; width: 0; border-radius: 12px; background: var(--navy); }
.cq-section.is-weak { color: var(--red); }
.cq-section.is-weak .cq-track { background: var(--red-soft); }
.cq-section.is-weak .cq-track i { background: var(--red); }

.cq-gaps-title { font-size: 1.25rem; margin: 28px 0 12px; display: flex; align-items: center; gap: 10px; }
.cq-gaps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cq-gap { position: relative; padding: 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.cq-n {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--blue); color: var(--on-blue); font-weight: 600; font-size: .85rem;
}
.cq-gap h4 { margin: 12px 0 6px; font-size: 1.05rem; font-weight: 600; color: var(--navy); }
.cq-gap p { margin: 0 0 14px; color: var(--muted-2); font-size: .9rem; }
.cq-urgent {
  position: absolute; top: 20px; right: 20px; padding: 3px 10px; border-radius: 999px;
  background: var(--ember); color: var(--navy-2); font-size: .75rem; font-weight: 600;
}
/* The rest of the fix list, shown as shapes until the email brings it. */
.cq-gaps.is-hidden { filter: blur(4px); opacity: .6; user-select: none; pointer-events: none; }

/* ---------- The email band ---------- */
.nl-hero.cq-band { margin-top: 32px; padding: 48px 0; }
.cq-band-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.cq-band h2 { color: var(--on-dark); font-size: 1.9rem; margin: 0 0 6px; }
.cq-band-inner > div > p { color: var(--on-dark-dim); margin: 0; }
.cq-band .nl-hero-note { margin-top: 12px; }
/* The tickbox reads as a note; past phone width the address and its button
   share a row (newsletter.css stacks them below 640px). */
.cq-band .nl-optin { font-weight: 400; margin-top: 4px; }
@media (min-width: 641px) {
  .cq-band .nl-form input[type="email"] { width: auto; flex: 1 1 120px; }
}
/* Without the script the band is the form's foot, under the last question. */
.cq:not(.is-quiz) .cq-band { margin-top: 0; }

/* ---------- Phones ---------- */
@media (max-width: 760px) {
  .cq-intro { padding-top: 32px; }
  .cq-card { padding: 26px 22px; }
  .cq-q { font-size: 1.3rem; }
  .cq-report, .cq-band-inner, .cq-gaps { grid-template-columns: 1fr; }
  .cq-grade { border-right: 0; border-bottom: 1px dashed var(--line-strong); padding: 28px; }
  .cq-letter { font-size: 6.5rem; }
  .cq-letter sup { font-size: 2.5rem; }
  .cq-sections { padding: 24px 22px; }
  .cq-section { grid-template-columns: 110px 1fr 40px; gap: 10px; }
  .cq-band h2 { font-size: 1.5rem; }
  .cq-free { flex-basis: 100%; }
}
