/* ==========================================================================
   Field Readiness Assessment — quiz + results visuals
   Loaded only on /assessment so other pages stay lean.

   Chart decisions (per dataviz method):
   - Dimension scores: horizontal bars, nominal categories, ONE hue.
     Bar length encodes the score. Colour is NOT mapped to value (that would
     re-encode what length already shows). The weakest bar uses the EMPHASIS
     form: crimson accent, everything else navy, so "fix this first" is the
     visual point.
   - Total score: a meter (single ratio against a limit) with the two band
     thresholds marked, so the reader sees where they sit.
   - Contrast on white: navy 18.5:1, crimson 11.8:1. Marks need 3:1.
   - Every bar carries a visible text state, so meaning is never colour alone.
   ========================================================================== */

/* ---- Assessment hero ---- */
.a-hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 52px; align-items: center; }

/* Icon chips live in site.css (shared with the program pages) */

/* The six dimensions, shown up front so the framework is visible */
.dims-preview { margin-top: 30px; }
.dims-preview .dims-label {
  font-family: var(--head); font-weight: 700; font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 10px;
}
.dims-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.dims-list li {
  font-size: .82rem; color: var(--muted); background: #fff;
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 11px;
}

/* Sample result preview: shows the payoff before they start */
.sample {
  background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--crimson);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); position: relative;
}
.sample-tag {
  position: absolute; top: -11px; right: 18px; background: var(--navy); color: #fff;
  font-family: var(--head); font-weight: 700; font-size: .62rem; letter-spacing: .12em;
  text-transform: uppercase; padding: 4px 11px; border-radius: 999px;
}
.sample-band { font-family: var(--head); font-weight: 800; color: var(--navy); font-size: 1.3rem; margin: 0; }
.sample-score { display: flex; align-items: baseline; gap: 6px; margin: 2px 0 14px; }
.sample-score b { font-family: var(--head); font-weight: 800; font-size: 2.4rem; color: var(--navy); line-height: 1; }
.sample-score span { font-family: var(--head); font-weight: 700; color: var(--muted); font-size: .85rem; }
.sample-meter { height: 10px; background: var(--wash2); border-radius: 999px; overflow: hidden; margin-bottom: 18px; }
.sample-meter i { display: block; height: 100%; width: 63%; background: var(--navy); border-radius: 999px; }
.sample-row { margin-bottom: 12px; }
.sample-row .r-top { display: flex; justify-content: space-between; font-size: .76rem; margin-bottom: 5px; }
.sample-row .r-name { font-family: var(--head); font-weight: 700; color: var(--navy); }
.sample-row .r-val { font-family: var(--head); font-weight: 800; color: var(--muted); }
.sample-row .r-track { height: 7px; background: var(--wash2); border-radius: 4px; overflow: hidden; }
.sample-row .r-fill { display: block; height: 100%; background: var(--navy); border-radius: 4px; }
.sample-row.is-focus .r-name { color: var(--crimson); }
.sample-row.is-focus .r-fill { background: var(--crimson); }
.sample-flag {
  display: inline-block; background: var(--crimson); color: #fff; font-family: var(--head);
  font-weight: 700; font-size: .58rem; letter-spacing: .1em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; margin-left: 7px; vertical-align: middle;
}
.sample-foot { margin: 16px 0 0; font-size: .76rem; color: var(--muted); }

@media (max-width: 900px) {
  .a-hero { grid-template-columns: 1fr; gap: 36px; }
}

/* ---- Stepper ---- */
/* The quiz sits in a card so it reads as the thing to act on */
.quiz-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 34px; box-shadow: var(--shadow);
}
@media (max-width: 680px) { .quiz-card { padding: 22px 18px; } }
.quiz-head { margin-bottom: 28px; }
.quiz-count {
  font-family: var(--head); font-weight: 700; font-size: .74rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--crimson); margin-bottom: 10px;
}
.quiz-track { height: 6px; background: var(--wash2); border-radius: 999px; overflow: hidden; }
.quiz-fill {
  height: 100%; width: 0; background: var(--crimson); border-radius: 999px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}

.quiz-q {
  font-family: var(--head); font-weight: 800; color: var(--navy);
  font-size: clamp(1.35rem, 2.6vw, 1.7rem); line-height: 1.2; margin: 0 0 22px;
}

/* Option cards: large hit targets, keyboard reachable */
.opt {
  display: flex; align-items: flex-start; gap: 14px; width: 100%; text-align: left;
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 16px 18px; margin-bottom: 10px; cursor: pointer; font-family: var(--body);
  font-size: 1rem; color: var(--ink); line-height: 1.45;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.opt:hover { border-color: var(--crimson); background: var(--wash); }
.opt:focus-visible { outline: 3px solid rgba(183,16,35,.35); outline-offset: 2px; }
.opt.is-picked { border-color: var(--crimson); background: rgba(113,9,48,.05); }
.opt-key {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--line); display: flex; align-items: center; justify-content: center;
  font-family: var(--head); font-weight: 700; font-size: .78rem; color: var(--muted);
  margin-top: 1px; transition: .15s ease;
}
.opt:hover .opt-key, .opt.is-picked .opt-key { border-color: var(--crimson); color: #fff; background: var(--crimson); }

.quiz-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.quiz-nav .fine { margin: 0; }
#q-back[hidden] { display: none; }

/* Step transition */
.step-anim { animation: stepIn .28s ease both; }
@keyframes stepIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .step-anim { animation: none; }
  .quiz-fill, .meter-fill, .dimbar-fill { transition: none; }
}

/* ---- Results: score meter ---- */
.result-card {
  border: 1px solid var(--line); border-top: 3px solid var(--crimson);
  border-radius: var(--radius); padding: 32px; background: #fff; box-shadow: var(--shadow);
}
.score-line { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 4px; }
.score-num { font-family: var(--head); font-weight: 800; font-size: 3.6rem; color: var(--navy); line-height: 1; }
.score-den { font-family: var(--head); font-weight: 700; font-size: 1.1rem; color: var(--muted); }

.meter { margin: 22px 0 8px; }
.meter-track {
  position: relative; height: 14px; background: var(--wash2);
  border-radius: 999px; overflow: visible;
}
.meter-fill {
  height: 100%; width: 0; background: var(--navy); border-radius: 999px;
  transition: width .9s cubic-bezier(.4,0,.2,1);
}
/* Band thresholds at 18/30 and 24/30 */
.meter-tick { position: absolute; top: -5px; bottom: -5px; width: 2px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.meter-scale { display: flex; justify-content: space-between; margin-top: 10px; font-size: .74rem; color: var(--muted); }
.meter-scale span { flex: 1; text-align: center; }
.meter-scale span:first-child { text-align: left; }
.meter-scale span:last-child { text-align: right; }

/* ---- Fix this first ---- */
.fix-first {
  margin: 26px 0 0; padding: 20px 22px; border-radius: 12px;
  background: rgba(113,9,48,.05); border-left: 4px solid var(--crimson);
}
.fix-first .fix-label {
  font-family: var(--head); font-weight: 700; font-size: .72rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--crimson); margin: 0 0 6px;
}
.fix-first h4 { font-family: var(--head); font-weight: 800; color: var(--navy); margin: 0 0 6px; font-size: 1.1rem; }
.fix-first p { margin: 0; color: var(--ink); }

/* ---- Dimension bars ---- */
.dimbars { margin-top: 14px; }
.dimbar { position: relative; padding: 14px 0; border-bottom: 1px solid var(--line); }
.dimbar:last-child { border-bottom: 0; }
.dimbar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.dimbar-name { font-family: var(--head); font-weight: 700; color: var(--navy); font-size: .98rem; }
.dimbar-score { font-family: var(--head); font-weight: 800; color: var(--navy); font-size: .9rem; white-space: nowrap; }
/* Track is recessive; the fill carries the signal. 4px rounded data-end. */
.dimbar-track { height: 10px; background: var(--wash2); border-radius: 4px; overflow: hidden; }
.dimbar-fill {
  height: 100%; width: 0; background: var(--navy); border-radius: 4px;
  transition: width .8s cubic-bezier(.4,0,.2,1);
}
.dimbar-state { margin: 7px 0 0; font-size: .85rem; color: var(--muted); }
/* Emphasis: the weakest dimension is the point, the rest are context */
.dimbar.is-focus .dimbar-fill { background: var(--crimson); }
.dimbar.is-focus .dimbar-name { color: var(--crimson); }
.dimbar.is-focus .dimbar-name:after {
  content: "Fix first"; margin-left: 10px; font-size: .62rem; letter-spacing: .1em;
  text-transform: uppercase; background: var(--crimson); color: #fff;
  padding: 3px 8px; border-radius: 999px; vertical-align: middle;
}

/* Hover detail (what a 5 looks like) */
.dimbar-tip {
  display: block; max-height: 0; overflow: hidden; opacity: 0;
  font-size: .84rem; color: var(--muted); border-left: 2px solid var(--line);
  padding-left: 0; margin-top: 0;
  transition: max-height .25s ease, opacity .25s ease, padding .25s ease, margin .25s ease;
}
.dimbar:hover .dimbar-tip, .dimbar:focus-within .dimbar-tip {
  max-height: 90px; opacity: 1; padding-left: 12px; margin-top: 9px;
}

@media (max-width: 680px) {
  .result-card { padding: 24px 20px; }
  .score-num { font-size: 2.8rem; }
}

/* ==========================================================================
   Print / Save as PDF
   The "Save this as a PDF" link calls window.print(). This turns the results
   card into a document worth keeping: no nav, no footer, no capture form, no
   CTAs, and the hover-only "what a 5 looks like" text made permanently
   visible, because on paper there is no hover.
   ========================================================================== */
@media print {
  /* Bars and the meter carry meaning, so their fills must survive the
     browser's default habit of stripping backgrounds to save ink. */
  *, *:before, *:after { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .site-header, .site-footer, .hero, .quiz-card,
  #results .callout, #results .form-success,
  .btn, .dims-preview, .sample { display: none !important; }

  body { background: #fff; }
  section { padding: 0 !important; }
  .wrap, .wrap.narrow { max-width: none; padding: 0; }

  .result-card { box-shadow: none; border: 0; padding: 0; }

  /* Give the printed page a header, since the site chrome is gone and an
     untitled page of scores is not obviously anyone's. */
  #results:before {
    content: "RYZE Partners — Field Readiness Assessment";
    display: block; font-family: var(--head); font-weight: 800;
    color: var(--navy); font-size: 1rem; margin-bottom: 6px;
  }

  /* The tip is a hover tooltip on screen. On paper it is the most useful
     line in the row, so it becomes normal flowing text. */
  .dimbar-tip {
    position: static; opacity: 1; visibility: visible; transform: none;
    display: block; margin-top: 6px; white-space: normal;
    background: none; color: var(--muted); box-shadow: none;
    padding: 0; font-size: .82rem; max-width: none;
  }
  .dimbar { break-inside: avoid; page-break-inside: avoid; }
  .fix-first { break-inside: avoid; page-break-inside: avoid; }

  a[href]:after { content: ""; }
}
