/* ==========================================================================
   Indikator — candidate flow

   A person answering these questions is often applying for a job they want.
   The screen's whole job is to stay out of the way: one set of items, no
   ornament, no countdown, nothing that reads as a game. Calm is the feature.
   ========================================================================== */

.test-body {
  background: var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Header: identity and progress, nothing else --------------------------- */

.test-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--mist);
}

.test-head__bar {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-5) var(--space-3);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
}

.test-head__step {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: right;
  /* Must be allowed to shrink: the longest step label is wider than a phone,
     and an unshrinkable flex item here pushes the whole page sideways. */
  min-width: 0;
}

/* The progress rail is the only moving thing on the page. */
.progress {
  height: 3px;
  background: var(--mist);
  overflow: hidden;
}
.progress__fill {
  height: 100%;
  background: var(--petrol);
  transition: width 0.5s var(--ease);
}

/* --- Page body ------------------------------------------------------------ */

.test-main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-7) var(--space-5) var(--space-8);
}

.test-intro h1 {
  font-size: var(--t-2xl);
  margin-bottom: var(--space-4);
}
.test-intro .lede { margin-bottom: var(--space-5); }

.test-instruction {
  font-size: var(--t-sm);
  color: var(--ink-muted);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--mist);
  margin-bottom: var(--space-2);
}

/* --- The item -------------------------------------------------------------
   Items are set in the display face at reading size. They are statements about
   the person answering, so they get the weight of prose, not of form labels.
   -------------------------------------------------------------------------- */

.item {
  border: 0;
  margin: 0;
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--mist);
}
.item:last-of-type { border-bottom: 0; }

.item__text {
  display: block;
  padding: 0;
  font-family: var(--display);
  font-size: var(--t-lg);
  font-weight: 400;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: var(--space-4);
  max-width: 46ch;
}

.item__no {
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--ink-faint);
  margin-right: 0.6em;
  font-variant-numeric: tabular-nums;
}

/* --- The scale ------------------------------------------------------------
   Six points. Size encodes distance from the midpoint, so the strength of an
   answer is visible before the labels are read. Both ends are the same colour:
   there is no better answer, and the control must not suggest one.
   -------------------------------------------------------------------------- */

.scale {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-4);
}

.scale__end {
  font-size: var(--t-xs);
  color: var(--ink-faint);
  white-space: nowrap;
  line-height: 1.2;
}
.scale__end--right { text-align: right; }

.scale__points {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.pt {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  /* A tall invisible hit area — comfortable on a phone without visual bulk. */
  min-height: 52px;
  cursor: pointer;
}

.pt input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.pt__dot {
  display: block;
  border: 1.5px solid var(--mist-strong);
  border-radius: 50%;
  background: var(--paper-raised);
  transition: border-color 0.12s var(--ease), background 0.12s var(--ease), transform 0.12s var(--ease);
}

/* Graduated sizes: strongest at the ends, smallest either side of the midpoint.
   The steps have to be far enough apart to read as deliberate at a glance —
   a couple of pixels just looks like sloppy rendering. */
.pt--far  .pt__dot { width: 34px; height: 34px; border-width: 2px; }
.pt--mid  .pt__dot { width: 25px; height: 25px; }
.pt--near .pt__dot { width: 17px; height: 17px; }

.pt:hover .pt__dot { border-color: var(--petrol-lift); }

.pt input:checked + .pt__dot {
  background: var(--petrol);
  border-color: var(--petrol);
}
.pt input:focus-visible + .pt__dot {
  outline: 2px solid var(--petrol);
  outline-offset: 3px;
}

/* An unanswered item is only marked once the reader tries to move on. */
.item[data-missing='1'] { background: var(--clay-wash); }
.item[data-missing='1'] .pt__dot { border-color: var(--clay); }

/* --- Forced-choice blocks -------------------------------------------------
   Three statements, one "most like me" and one "least like me". Rendered as a
   grid so the two columns line up and the choice reads as a single decision.
   -------------------------------------------------------------------------- */

.block {
  border: 0;
  margin: 0 0 var(--space-6);
  padding: 0;
}

.block__head {
  display: grid;
  grid-template-columns: 1fr 76px 76px;
  gap: var(--space-3);
  align-items: end;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--mist);
  margin-bottom: var(--space-2);
}
.block__colhead {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
}

.block__row {
  display: grid;
  grid-template-columns: 1fr 76px 76px;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--mist);
}
.block__row:last-child { border-bottom: 0; }

.block__statement {
  font-family: var(--display);
  font-size: var(--t-md);
  line-height: 1.35;
}

.choice {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  cursor: pointer;
}
.choice input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }

.choice__mark {
  width: 24px; height: 24px;
  border: 1.5px solid var(--mist-strong);
  border-radius: 50%;
  background: var(--paper-raised);
  transition: border-color 0.12s var(--ease), background 0.12s var(--ease);
}
.choice:hover .choice__mark { border-color: var(--petrol-lift); }
.choice input:checked + .choice__mark { background: var(--petrol); border-color: var(--petrol); }
.choice input:focus-visible + .choice__mark { outline: 2px solid var(--petrol); outline-offset: 3px; }

/* "Least like me" reads as the opposite pole, so it is hollow rather than filled. */
.choice--least input:checked + .choice__mark {
  background: var(--paper-raised);
  border-color: var(--petrol);
  box-shadow: inset 0 0 0 4px var(--paper-raised), inset 0 0 0 9px var(--petrol);
}

/* --- Open questions ------------------------------------------------------- */

.open-q { margin-bottom: var(--space-6); }
.open-q__text {
  font-family: var(--display);
  font-size: var(--t-lg);
  line-height: 1.35;
  margin-bottom: var(--space-3);
}
.counter {
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--ink-faint);
  text-align: right;
  margin-top: var(--space-2);
}
.counter[data-over='1'] { color: var(--clay); }

/* --- Footer navigation ---------------------------------------------------- */

.test-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--mist);
}
.test-nav--end { justify-content: flex-end; }

.test-foot {
  border-top: 1px solid var(--mist);
  padding: var(--space-5);
  text-align: center;
  font-size: var(--t-xs);
  color: var(--ink-faint);
}

/* --- Consent ------------------------------------------------------------- */

.consent {
  border: 1px solid var(--mist-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  background: var(--paper-raised);
}
.consent__scroll {
  max-height: 320px;
  overflow-y: auto;
  padding-right: var(--space-4);
  font-size: var(--t-sm);
  line-height: 1.65;
  color: var(--ink-muted);
}
.consent__scroll h3 {
  font-family: var(--body);
  font-size: var(--t-sm);
  font-weight: 700;
  color: var(--ink);
  margin: var(--space-4) 0 var(--space-2);
}
.consent__scroll h3:first-child { margin-top: 0; }

.check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  font-size: var(--t-base);
}
.check input {
  width: 20px; height: 20px;
  margin: 2px 0 0;
  accent-color: var(--petrol);
  flex-shrink: 0;
  cursor: pointer;
}

/* --- Facts list (used on the welcome and receipt screens) ------------------ */

.facts { margin: 0; }
.facts div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: var(--space-4);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--mist);
}
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--ink-faint); font-size: var(--t-sm); }
.facts dd { margin: 0; }

/* --- Mobile --------------------------------------------------------------- */

@media (max-width: 620px) {
  .test-head__bar { padding: var(--space-3) var(--space-4) var(--space-2); gap: var(--space-3); }
  .test-head__step { font-size: 0.625rem; letter-spacing: 0.04em; }

  .test-main { padding: var(--space-5) var(--space-4) var(--space-7); }

  .item__text { font-size: var(--t-md); }

  /* One column: the two end labels sit on their own row above the points, so
     the points get the full width and nothing has to be squeezed. */
  .scale {
    display: block;
  }
  .scale__ends {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-1);
  }
  .scale__end {
    font-size: 0.6875rem;
    white-space: normal;
  }
  .scale__points { width: 100%; gap: var(--space-1); }

  .pt { min-height: 56px; }
  .pt--far  .pt__dot { width: 36px; height: 36px; }
  .pt--mid  .pt__dot { width: 28px; height: 28px; }
  .pt--near .pt__dot { width: 20px; height: 20px; }

  .block__head, .block__row { grid-template-columns: 1fr 58px 58px; gap: var(--space-2); }
  .block__statement { font-size: var(--t-base); }
  .block__colhead { font-size: 0.625rem; }

  .facts div { grid-template-columns: 1fr; gap: 0; }
}

/* Above the breakpoint the wrapper is transparent and the three parts take
   explicit columns — the labels sit either side of the points regardless of the
   order they appear in the markup. */
@media (min-width: 621px) {
  .scale__ends { display: contents; }
  .scale__end--left  { grid-column: 1; grid-row: 1; }
  .scale__points     { grid-column: 2; grid-row: 1; }
  .scale__end--right { grid-column: 3; grid-row: 1; }
}
