/* ============================================================
   CROWN & CORE - IT ATTRITION RISK SCORECARD
   Page-specific styles for /it-attrition-scorecard. Loaded after the shared
   stylesheets and built only from their tokens. Everything is namespaced
   .sc-* so nothing leaks into other pages.
   ============================================================ */

.page-hero--scorecard h1 { max-width: 24ch; }

/* The fixed header is ~5rem tall; keep scrolled-to content clear of it. */
#sc-app { scroll-margin-top: 6rem; }
.sc-wrap { max-width: 860px; }

.sc-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}
@media (max-width: 640px) {
  .sc-card { padding: var(--space-4) var(--space-3); }
}

.sc-card h2:focus,
.sc-focus:focus { outline: none; }

.sc-noscript p + p { margin-top: var(--space-3); }

/* ---------------- Intro ---------------- */
.sc-intro > * + * { margin-top: var(--space-4); }
.sc-intro__how { font-size: var(--fs-base); line-height: var(--lh-body); }
.sc-intro__disclaimer { font-size: var(--fs-sm); color: var(--ink-muted); }
.sc-intro__actions { padding-top: var(--space-2); }

/* ---------------- Progress ---------------- */
.sc-progress { margin-bottom: var(--space-5); }
.sc-progress__label {
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: var(--space-2);
}
.sc-progress__bar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.sc-progress__bar span {
  height: 4px;
  border-radius: 2px;
  background: var(--paper-3);
}
.sc-progress__bar span.is-done { background: var(--accent); }
.sc-progress__bar span.is-current { background: var(--ink); }

/* ---------------- Step ---------------- */
.sc-step__title { font-size: var(--fs-xl); }
.sc-step__lead { margin-top: var(--space-2); color: var(--ink-muted); max-width: 60ch; }
.sc-questions { margin-top: var(--space-5); }

.sc-q { border: 0; padding: 0; margin: 0; min-width: 0; }
.sc-q + .sc-q {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
}
.sc-q legend {
  display: block;
  width: 100%;
  padding: 0;
  margin-bottom: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: var(--lh-snug);
  color: var(--ink);
}

/* ---------------- Slider ---------------- */
.sc-slider {
  --r: 15px;                       /* thumb radius */
  --v: 2;                          /* current value 0-4, set from JS */
  position: relative;
  height: 44px;
}
.sc-slider__ticks {
  position: absolute;
  left: var(--r);
  right: var(--r);
  top: 50%;
  height: 0;
  pointer-events: none;
}
.sc-slider__ticks i {
  position: absolute;
  top: -5px;
  width: 2px;
  height: 10px;
  margin-left: -1px;
  background: var(--line);
}
.sc-slider__ticks i:nth-child(1) { left: 0; }
.sc-slider__ticks i:nth-child(2) { left: 25%; }
.sc-slider__ticks i:nth-child(3) { left: 50%; }
.sc-slider__ticks i:nth-child(4) { left: 75%; }
.sc-slider__ticks i:nth-child(5) { left: 100%; }

.sc-range {
  --fill: calc(var(--r) + (100% - 2 * var(--r)) * var(--v) / 4);
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}
.sc-range:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 8px; }

.sc-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--accent) 0 var(--fill), var(--paper-3) var(--fill) 100%);
}
.sc-range::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--accent) 0 var(--fill), var(--paper-3) var(--fill) 100%);
}
.sc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  margin-top: -12px;
  border-radius: 50%;
  background: var(--ink);
  border: 4px solid var(--accent-bright);
  box-shadow: var(--shadow-sm);
}
.sc-range::-moz-range-thumb {
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  border: 4px solid var(--accent-bright);
  box-shadow: var(--shadow-sm);
}

/* Unset: no fill, hollow dashed thumb, so it cannot be mistaken for an answer. */
.sc-range.is-unset::-webkit-slider-runnable-track { background: var(--paper-3); }
.sc-range.is-unset::-moz-range-track { background: var(--paper-3); }
.sc-range.is-unset::-webkit-slider-thumb {
  background: var(--paper);
  border: 2px dashed var(--ink-muted);
}
.sc-range.is-unset::-moz-range-thumb {
  background: var(--paper);
  border: 2px dashed var(--ink-muted);
}

/* Statements under the slider: left end, middle, right end. */
.sc-anchors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.sc-anchor {
  padding: 0.6rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
  color: var(--ink-muted);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.sc-anchor:nth-child(2) { text-align: center; }
.sc-anchor:nth-child(3) { text-align: right; }
.sc-anchor.is-active {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent-soft);
}
@media (max-width: 720px) {
  .sc-anchors { grid-template-columns: 1fr; }
  .sc-anchor:nth-child(2),
  .sc-anchor:nth-child(3) { text-align: left; }
}

/* ---------------- Step navigation ---------------- */
.sc-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.sc-nav .btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}
.sc-nav .btn--primary[disabled]:hover { background: var(--ink); }
.sc-nav .btn[disabled]:active { transform: none; }
.sc-hint {
  min-height: 1.5em;
  margin-top: var(--space-3);
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  text-align: right;
}

/* ---------------- Result ---------------- */
.sc-total { display: flex; flex-direction: column; gap: var(--space-2); }
.sc-total__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-3);
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1;
}
.sc-total__score { font-size: clamp(4.5rem, 16vw, 7.5rem); color: var(--ink); }
.sc-total__of { font-size: var(--fs-lg); color: var(--ink-muted); }
.sc-total__band {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-text);
}
.sc-total__text { max-width: 56ch; font-size: var(--fs-base); }

.sc-block { margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--line); }
.sc-block h3 { font-size: var(--fs-lg); margin-bottom: var(--space-4); }

.sc-profile { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
.sc-profile__row-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
  margin-bottom: 0.5rem;
}
.sc-profile__name { font-weight: 600; }
.sc-profile__meta { font-size: var(--fs-sm); color: var(--ink-muted); }
.sc-profile__level { font-weight: 600; color: var(--ink); }
.sc-bar {
  position: relative;
  height: 14px;
  border-radius: 7px;
  background: var(--paper-3);
  overflow: hidden;
}
.sc-bar__fill {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  border-radius: 7px;
  background: var(--ink-muted);
  transition: width 900ms var(--ease-out);
}
.sc-bar__fill.is-watch { background: var(--accent); }
.sc-bar__fill.is-act { background: var(--danger); }
.sc-bar__mark {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--paper);
  opacity: 0.9;
}
.sc-profile.is-pending .sc-bar__fill { width: 0; }
@media (prefers-reduced-motion: reduce) {
  .sc-bar__fill { transition: none; }
}

.sc-top { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
.sc-top li { padding-left: var(--space-3); border-left: 3px solid var(--accent); }
.sc-top strong { display: block; margin-bottom: 0.3rem; }
.sc-top p { color: var(--ink-muted); }
.sc-nostand { color: var(--ink-muted); }

/* Call to action reuses .cta-band; the shared primary button is ink on blue
   and would vanish inside it, so it takes the on-dark treatment here. */
.sc-cta { margin-top: var(--space-6); }
.sc-cta .btn--primary { background: var(--accent-bright); color: var(--charcoal); }
.sc-cta .btn--primary:hover { background: var(--paper); color: var(--charcoal); }
.sc-cta .cta-band { padding: var(--space-7) var(--space-5); }
.sc-cta h2 { font-size: var(--fs-2xl); }

.sc-fine { margin-top: var(--space-5); display: grid; gap: var(--space-2); font-size: var(--fs-sm); color: var(--ink-muted); }
.sc-fine a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.sc-fine__sig { font-weight: 600; color: var(--ink); }
.sc-restart { margin-top: var(--space-5); }
