/* Pathway Quiz — bespoke dark theme.
   Ported from the original single-file prototype; fonts are self-hosted
   (see static/css/fonts.css) rather than loaded from a CDN. */

:root {
  --mgmt: #C1521F;
  --creative: #3B3486;
  --technical: #8C1F28;
  --audience: #0F6E6E;
  --ethics: #1F5B3A;
  --ink: #17181C;
  --ink-soft: #212228;
  --paper: #F3EFE6;
  --paper-dim: #E7E1D2;
  --text-hi: #F6F3EC;
  --text-mid: rgba(190, 240, 240, 0.82);
  --text-low: rgba(190, 240, 240, 0.56);
  --sans: 'Century Gothic', 'OpenDyslexic', 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Century Gothic', 'OpenDyslexic', 'Fraunces', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--text-hi);
}

body {
  font-family: var(--sans);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

.app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 22px 40px;
  position: relative;
}

h1, h2, h3 { font-family: var(--serif); margin: 0; }

.mono { font-family: var(--mono); letter-spacing: 0.02em; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-low);
}

.screen { display: none; flex: 1; flex-direction: column; }
.screen.active { display: flex; }
.grow { flex: 1; }

/* ---------- intro ---------- */
#intro .badge-row { display: flex; gap: 8px; margin: 22px 0 24px; flex-wrap: wrap; }

#intro .chip {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}

#intro .chip svg { width: 18px; height: 18px; stroke: var(--ink); stroke-width: 1.9; fill: none; }

h1.title { font-size: 32px; line-height: 1.1; font-weight: 600; margin-top: 8px; }

#intro p.lede { color: var(--text-mid); font-size: 15px; line-height: 1.6; margin: 14px 0 0; }
#intro p.lede + p.lede { margin-top: 12px; }

.field { margin-top: 24px; }

.field label {
  display: block;
  font-size: 12px;
  color: var(--text-low);
  margin-bottom: 7px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
}

.field input[type=text] {
  width: 100%;
  background: var(--ink-soft);
  border: 1px solid rgba(246, 243, 236, 0.14);
  border-radius: 10px;
  padding: 14px;
  color: var(--text-hi);
  font-size: 16px;
  font-family: var(--sans);
}

.field input[type=text]:focus { outline: none; border-color: rgba(246, 243, 236, 0.4); }
.field input[type=text].invalid { border-color: var(--technical); }

.field-error {
  margin: 8px 0 0;
  min-height: 15px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--technical);
}

.btn-primary {
  margin-top: 26px;
  width: 100%;
  background: var(--text-hi);
  color: var(--ink);
  border: none;
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 15.5px;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
}

.btn-primary:active { transform: scale(0.99); }
.btn-primary[disabled] { opacity: 0.55; cursor: progress; }

.btn-ghost {
  margin-top: 14px;
  width: 100%;
  background: transparent;
  color: var(--text-mid);
  border: 1px solid rgba(246, 243, 236, 0.18);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 14.5px;
  font-family: var(--sans);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: block;
}

.staff-link {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.22;
  background: none;
  border: none;
  padding: 0;
}

.staff-link svg { width: 14px; height: 14px; stroke: var(--text-hi); fill: none; stroke-width: 1.6; }

/* ---------- quiz ---------- */
.progress-track {
  width: 100%;
  height: 3px;
  background: rgba(246, 243, 236, 0.12);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill { height: 100%; background: var(--text-hi); border-radius: 3px; transition: width 0.35s ease; }

.qcount { margin-top: 12px; }

#qtext { font-size: 23px; line-height: 1.28; font-weight: 500; margin: 22px 0 26px; }

.rate-btn {
  width: 100%;
  text-align: left;
  border-radius: 12px;
  padding: 16px 17px;
  margin-bottom: 10px;
  font-family: var(--sans);
  cursor: pointer;
  line-height: 1.35;
}

/* All three options are weighted identically: a filled button reads as an
   answer already chosen, and nothing should look pre-selected. */
.rate-confident,
.rate-growing,
.rate-skip {
  background: transparent;
  color: var(--text-hi);
  border: 1.5px solid rgba(246, 243, 236, 0.28);
  font-size: 15px;
  font-weight: 500;
}

.rate-btn:hover { border-color: rgba(246, 243, 236, 0.6); background: rgba(246, 243, 236, 0.04); }
.rate-btn:focus-visible { outline: 2px solid var(--text-hi); outline-offset: 2px; }
.rate-btn:active { transform: scale(0.99); background: rgba(246, 243, 236, 0.08); }

.qnav { margin-top: 6px; }

.back-link {
  background: none;
  border: none;
  color: var(--text-low);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  padding: 6px 0;
  text-decoration: none;
}

/* ---------- results ---------- */
#results .badge-wrap { display: flex; justify-content: center; margin: 8px 0 6px; }
#results .badge-wrap svg { width: 168px; height: 168px; }
#results h2 { text-align: center; font-size: 29px; font-weight: 600; margin-top: 14px; }
#results .subtitle { text-align: center; margin-top: 6px; min-height: 16px; }

#results .subtitle span {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mid);
}

#results p.desc { margin-top: 20px; font-size: 15.5px; line-height: 1.6; color: var(--text-mid); text-align: center; }

#results p.depth-note { margin-top: 10px; font-size: 12.5px; line-height: 1.5; color: var(--text-low); text-align: center; }

.toggle-breakdown {
  margin-top: 26px;
  width: 100%;
  background: none;
  border: 1px dashed rgba(246, 243, 236, 0.22);
  border-radius: 12px;
  padding: 13px;
  color: var(--text-mid);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.breakdown { display: none; margin-top: 18px; }
.breakdown.open { display: block; }
.breakdown-legend { display: flex; gap: 16px; margin-bottom: 14px; justify-content: center; }

.breakdown-legend span {
  font-size: 11px;
  color: var(--text-low);
  font-family: var(--mono);
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

.brow { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

.brow .blabel {
  width: 92px;
  font-size: 12px;
  color: var(--text-mid);
  font-family: var(--mono);
  flex-shrink: 0;
}

.btrack {
  flex: 1;
  height: 9px;
  background: rgba(246, 243, 236, 0.09);
  border-radius: 5px;
  overflow: hidden;
  display: flex;
}

.bseg-confident { height: 100%; }
.bseg-growing { height: 100%; opacity: 0.45; }

.bval { width: 48px; text-align: right; font-size: 11px; color: var(--text-low); font-family: var(--mono); }

.save-status {
  margin-top: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-low);
  font-family: var(--mono);
  min-height: 16px;
}

.signoff { margin-top: 22px; text-align: center; font-size: 12px; color: var(--text-low); line-height: 1.6; }

/* ---------- staff results ---------- */
.staff { max-width: 560px; }
.staff .arow { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px; }
.staff h2 { font-size: 22px; }

.staff table.plist { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.staff table.plist td { padding: 9px 0; border-bottom: 1px solid rgba(246, 243, 236, 0.08); vertical-align: top; }
.staff table.plist td.tname { color: var(--text-hi); font-weight: 500; }
.staff table.plist td.tresult { color: var(--text-mid); text-align: right; }
.staff table.plist td.tts { color: var(--text-low); font-size: 11px; font-family: var(--mono); }

.agg-block { margin-top: 26px; }

.agg-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-low);
  margin-bottom: 14px;
}

.staff-btns { display: flex; gap: 10px; }
.staff-btns .btn-ghost { flex: 1; }

/* ---------- staff: per-participant detail ---------- */
.presponse { border-bottom: 1px solid rgba(246, 243, 236, 0.08); }

.presponse > summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 11px 0;
  cursor: pointer;
  font-size: 13px;
  list-style: none;
}

.presponse > summary::-webkit-details-marker { display: none; }

.presponse > summary::after {
  content: "▸";
  color: var(--text-low);
  font-size: 11px;
  flex-shrink: 0;
}

.presponse[open] > summary::after { content: "▾"; }
.presponse > summary:hover { color: var(--text-hi); }
.presponse .tname { color: var(--text-hi); font-weight: 500; }
.presponse .tts { display: block; color: var(--text-low); font-size: 11px; font-family: var(--mono); }
.presponse .tresult { color: var(--text-mid); text-align: right; margin-left: auto; }

.pdetail {
  padding: 6px 0 20px;
  border-top: 1px dashed rgba(246, 243, 236, 0.1);
  margin-top: 2px;
}

.pnote { color: var(--text-mid); font-size: 13px; line-height: 1.5; margin: 14px 0 0; }

.answers { list-style: none; margin: 0; padding: 0; }

.answer {
  display: grid;
  grid-template-columns: 82px 1fr auto;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid rgba(246, 243, 236, 0.06);
  font-size: 12.5px;
  line-height: 1.4;
}

.apathway { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; }
.atext { color: var(--text-mid); }

.arating {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-low);
  text-align: right;
  white-space: nowrap;
}

/* The rating carries the meaning, so weight it rather than relying on colour. */
.answer--confident .arating { color: var(--text-hi); font-weight: 500; }
.answer--growing .arating { color: var(--text-mid); }

@media (max-width: 560px) {
  .answer { grid-template-columns: 1fr; gap: 3px; }
  .arating { text-align: left; }
}
