/* NBOP interactive components.
 *
 * Loaded after nbop.css and built entirely on its custom properties, so the
 * palette stays defined in one place. Nothing here introduces a new colour.
 *
 * The restraint is deliberate and is a positioning decision, not a taste one.
 * Notebook of a COO carries the warmth and the personality. A body that says
 * it assesses people and publishes its own pass rates cannot look like a
 * funnel, so there are no gradients, no shadows for their own sake, no
 * animation that exists to feel expensive.
 */

/* ---------- layout ---------- */

.wide { max-width: 62rem; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}
@media (max-width: 44rem) { .grid-2 { grid-template-columns: 1fr; gap: 1.75rem; } }

.stack > * + * { margin-top: 1rem; }
.stack-lg > * + * { margin-top: 2.25rem; }

/* ---------- the criteria strip ---------- */
/* Three published criteria, always visible, updating as the visitor answers.
 * They can see the bar they are being measured against before they have
 * given us anything, which is the whole argument of the page. */

.criteria-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin: 2rem 0;
}
@media (max-width: 40rem) { .criteria-strip { grid-template-columns: 1fr; } }

.criterion {
  background: var(--paper);
  padding: 1rem 1.1rem;
  display: flex;
  gap: .7rem;
  align-items: flex-start;
}
.criterion .mark {
  flex: 0 0 auto;
  width: 1.1rem; height: 1.1rem;
  margin-top: .18rem;
  border: 1.5px solid var(--rule);
  border-radius: 50%;
  position: relative;
}
.criterion.met .mark { border-color: var(--navy); background: var(--navy); }
.criterion.met .mark::after {
  content: '';
  position: absolute; left: .3rem; top: .13rem;
  width: .22rem; height: .48rem;
  border: solid var(--paper);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(42deg);
}
.criterion .label {
  font-family: var(--sans, ui-sans-serif, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: block;
  margin-bottom: .2rem;
}
.criterion.met .label { color: var(--navy); }
.criterion .val { font-size: .95rem; color: var(--ink-soft); line-height: 1.4; }

/* ---------- slider ---------- */

.field { margin: 2rem 0; }
.field > .q {
  font-family: var(--sans, ui-sans-serif, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: .55rem;
}
.field > .help {
  font-size: .95rem;
  color: var(--ink-faint);
  margin-top: .45rem;
  line-height: 1.5;
}

.readout {
  font-size: 1.9rem;
  line-height: 1.2;
  color: var(--navy);
  margin: .3rem 0 .6rem;
}
.readout .unit { font-size: 1rem; color: var(--ink-faint); }

input[type=range] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 2px; background: var(--rule);
}
input[type=range]::-moz-range-track { height: 2px; background: var(--rule); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.15rem; height: 1.15rem;
  margin-top: -.53rem;
  border-radius: 50%;
  background: var(--navy);
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 1px var(--navy);
}
input[type=range]::-moz-range-thumb {
  width: 1.15rem; height: 1.15rem;
  border-radius: 50%;
  background: var(--navy);
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 1px var(--navy);
}
input[type=range]:focus-visible { outline: 2px solid var(--navy); outline-offset: 6px; }

.scale {
  display: flex; justify-content: space-between;
  font-size: .78rem; color: var(--ink-faint);
  margin-top: .4rem;
}

/* ---------- segmented choice ---------- */

.segmented { display: flex; flex-wrap: wrap; gap: .5rem; }
.segmented label {
  border: 1px solid var(--rule);
  padding: .5rem .85rem;
  font-size: .95rem;
  color: var(--ink-soft);
  cursor: pointer;
  background: var(--paper);
}
.segmented input { position: absolute; opacity: 0; width: 0; height: 0; }
.segmented label:hover { border-color: var(--ink-faint); }
.segmented input:checked + span,
.segmented label.on { color: var(--paper); }
.segmented label.on { background: var(--navy); border-color: var(--navy); color: var(--paper); }
.segmented input:focus-visible + span { outline: 2px solid var(--navy); outline-offset: 3px; }

/* ---------- domain picker ---------- */
/* Each domain carries the sentence the visitor is agreeing to. Showing the
 * accountability statement rather than the domain name alone is what stops
 * this being a vanity checklist: it is materially harder to tick "you decide
 * who is accountable for what" than to tick "role design". */

.domains { border-top: 1px solid var(--rule); }
.domain {
  display: block;
  border-bottom: 1px solid var(--rule-soft);
  padding: .95rem 0 .95rem 2.4rem;
  position: relative;
  cursor: pointer;
}
.domain:hover { background: var(--paper-warm); }
.domain input { position: absolute; opacity: 0; width: 0; height: 0; }
.domain .box {
  position: absolute; left: .5rem; top: 1.1rem;
  width: 1.05rem; height: 1.05rem;
  border: 1.5px solid var(--rule);
}
.domain input:checked ~ .box { background: var(--navy); border-color: var(--navy); }
.domain input:checked ~ .box::after {
  content: '';
  position: absolute; left: .32rem; top: .1rem;
  width: .2rem; height: .45rem;
  border: solid var(--paper);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(42deg);
}
.domain input:focus-visible ~ .box { outline: 2px solid var(--navy); outline-offset: 3px; }
.domain .name {
  font-size: 1.02rem;
  color: var(--navy);
  display: block;
  margin-bottom: .15rem;
}
.domain .what { font-size: .93rem; color: var(--ink-faint); line-height: 1.5; }
.domain input:checked ~ .name { font-weight: 600; }

/* ---------- verdict ---------- */

.verdict {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--ink-faint);
  padding: 1.6rem 1.7rem;
  background: var(--paper-warm);
  margin: 2.5rem 0;
}
.verdict.eligible { border-left-color: var(--navy); }
.verdict.not-yet  { border-left-color: #a8703c; }
.verdict h3 {
  font-size: 1.3rem;
  color: var(--navy);
  margin: 0 0 .6rem;
  font-weight: 400;
  line-height: 1.3;
}
.verdict p { margin: .5rem 0; color: var(--ink-soft); font-size: 1rem; }
.verdict ul { margin: .7rem 0 0; padding-left: 1.1rem; }
.verdict li { margin: .4rem 0; color: var(--ink-soft); font-size: 1rem; }

/* ---------- coverage map ---------- */

.coverage { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--rule-soft); border: 1px solid var(--rule-soft); }
@media (max-width: 40rem) { .coverage { grid-template-columns: 1fr; } }
.cov {
  background: var(--paper);
  padding: .8rem .9rem;
  display: flex; gap: .6rem; align-items: baseline;
}
.cov .n {
  font-family: var(--sans, ui-sans-serif, -apple-system, sans-serif);
  font-size: .72rem; font-weight: 600; color: var(--ink-faint);
  flex: 0 0 1.2rem;
}
.cov .t { font-size: .97rem; color: var(--ink-faint); }
.cov.held { background: var(--paper); }
.cov.held .t { color: var(--navy); }
.cov.held .n { color: var(--navy); }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--sans, ui-sans-serif, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif);
  font-size: .86rem;
  font-weight: 600;
  letter-spacing: .04em;
  padding: .78rem 1.5rem;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: var(--paper);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: #0f2338; }
.btn.ghost { background: transparent; color: var(--navy); }
.btn.ghost:hover { background: var(--paper-warm); }
.btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.btn-row { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; margin-top: 1.5rem; }

/* ---------- registry ---------- */

.searchbar { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1.5rem 0; }
.searchbar input, .searchbar select {
  font: inherit;
  font-size: 1rem;
  padding: .6rem .7rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  min-width: 0;
}
.searchbar input { flex: 1 1 14rem; }
.searchbar input:focus, .searchbar select:focus { outline: 2px solid var(--navy); outline-offset: -1px; }

.result {
  border-bottom: 1px solid var(--rule-soft);
  padding: 1.1rem 0;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.result .who { font-size: 1.1rem; color: var(--navy); }
.result .meta { font-size: .88rem; color: var(--ink-faint); margin-top: .2rem; }
.result .cert {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem; color: var(--ink-faint);
}

.status {
  display: inline-block;
  font-family: var(--sans, ui-sans-serif, -apple-system, sans-serif);
  font-size: .68rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  padding: .2rem .5rem;
  border: 1px solid currentColor;
}
.status.active   { color: #1d6b45; }
.status.expired  { color: #8a6a2f; }
.status.revoked  { color: #97321f; }
.status.suspended{ color: #8a6a2f; }

/* ---------- misc ---------- */

.note {
  font-size: .93rem;
  color: var(--ink-faint);
  border-left: 2px solid var(--rule);
  padding-left: .9rem;
  margin: 1.4rem 0;
  line-height: 1.55;
}

.spinner { font-size: .9rem; color: var(--ink-faint); }

.err {
  border: 1px solid #d9b8b0;
  background: #fdf6f4;
  padding: .9rem 1.1rem;
  color: #7a3527;
  font-size: .95rem;
  margin: 1.2rem 0;
}

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
