/* Candidate portal.
   One column, quiet chrome, big unmistakable answers. The only colour accent
   is the ochre "horizon": the rule under the header, progress, and focus. */

:root {
  --ink: #16303f;
  --ink-soft: #2b4757;
  --paper: #f3f5f4;
  --surface: #ffffff;
  --line: #cbd3d0;
  --line-strong: #97a4a0;
  --muted: #56666d;
  --horizon: #c28a2c;
  --selected: #e4ecef;
  --danger: #a4262c;
  --danger-bg: #fbeeee;
  --ok: #2f6b4f;
  --on-ink: #ffffff;

  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --measure: 40rem;
  --radius-control: 10px;
  --radius-small: 6px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e3ebee;
    --ink-soft: #c5d2d7;
    --paper: #0f1a20;
    --surface: #16242c;
    --line: #2d3f48;
    --line-strong: #4d626b;
    --muted: #9aabb1;
    --horizon: #d9a441;
    --selected: #20343e;
    --danger: #f08a8f;
    --danger-bg: #2c1a1c;
    --ok: #7cc3a0;
    --on-ink: #0f1a20;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--horizon);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--on-ink);
  border-radius: var(--radius-small);
  z-index: 10;
}
.skip-link:focus { top: 0.75rem; }

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

/* -- header ------------------------------------------------------------ */

.site-header {
  background: var(--surface);
  border-bottom: 3px solid var(--horizon);
}

.site-header__inner,
.site-main__inner,
.site-footer__inner {
  width: 100%;
  max-width: calc(var(--measure) + 2rem);
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  min-width: 0;
}

.brand__mark {
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
}

.brand__product {
  color: var(--muted);
  font-size: 0.9375rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  overflow: hidden;
}

.lang-switch button {
  font: inherit;
  font-size: 0.875rem;
  padding: 0.3rem 0.55rem;
  min-height: 2.25rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.lang-switch button + button { border-left: 1px solid var(--line); }
.lang-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 500;
}

.link-button {
  font: inherit;
  font-size: 0.875rem;
  background: none;
  border: 0;
  padding: 0.35rem 0.25rem;
  min-height: 2.25rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

@media (max-width: 30rem) {
  .brand__product { display: none; }
}

/* -- main ---------------------------------------------------------------- */

.site-main { flex: 1; }

.site-main__inner {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

h1, h2, h3 {
  line-height: 1.25;
  margin: 0 0 0.75rem;
  font-weight: 600;
  text-wrap: balance;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }

.lead {
  font-size: 1.125rem;
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
  max-width: 34em;
}

.prose { max-width: 38em; }
.prose p { margin: 0 0 0.75rem; }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 0.75rem; }
.prose table { border-collapse: collapse; margin: 0 0 0.75rem; }
.prose td, .prose th { border: 1px solid var(--line); padding: 0.25rem 0.5rem; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 1.5rem;
}

.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }

@media (max-width: 30rem) {
  .panel { padding: 1.125rem; }
  h1 { font-size: 1.5rem; }
}

.steps-list {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
}
.steps-list li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1rem 2.5rem;
}
.steps-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 1.5px solid var(--horizon);
  display: grid;
  place-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.note {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* -- forms --------------------------------------------------------------- */

.field { margin: 0 0 1.25rem; }

.field__label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.375rem;
}

.field__hint {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0.375rem 0 0;
}

.input,
.textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-small);
  padding: 0.625rem 0.75rem;
  min-height: 2.875rem;
}
.textarea { min-height: 8rem; resize: vertical; line-height: 1.5; }
.input:focus-visible, .textarea:focus-visible { border-color: var(--ink); }

.input--password {
  font-size: 1.375rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  max-width: 14rem;
}

[aria-invalid="true"] { border-color: var(--danger); }

.button {
  font: inherit;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-control);
  border: 1.5px solid var(--ink);
  cursor: pointer;
  text-decoration: none;
}
.button--primary { background: var(--ink); color: var(--on-ink); }
.button--primary:hover { background: var(--ink-soft); border-color: var(--ink-soft); }
.button--secondary { background: transparent; color: var(--ink); }
.button[disabled] { opacity: 0.6; cursor: progress; }

.alert {
  border-left: 4px solid var(--danger);
  background: var(--danger-bg);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
  margin: 0 0 1.25rem;
}
.alert--info { border-left-color: var(--horizon); background: var(--selected); }
.alert h2 { font-size: 1rem; margin: 0 0 0.25rem; }
.alert ul { margin: 0; padding-left: 1.25rem; }

/* -- survey -------------------------------------------------------------- */

.survey-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.9375rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.timer {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--ink);
}
.timer--low { color: var(--danger); }

.progress {
  appearance: none;
  display: block;
  width: 100%;
  height: 4px;
  border: 0;
  border-radius: 2px;
  background: var(--line);
  margin: 0 0 2rem;
  overflow: hidden;
}
.progress::-webkit-progress-bar { background: var(--line); }
.progress::-webkit-progress-value { background: var(--horizon); }
.progress::-moz-progress-bar { background: var(--horizon); }

.page-title { font-size: 1.25rem; margin-bottom: 0.5rem; }

.question {
  border: 0;
  margin: 0 0 2.25rem;
  padding: 0;
  min-width: 0;
}
.question[hidden] { display: none; }

.question__title {
  display: block;
  float: none;
  width: 100%;
  padding: 0;
  font-size: 1.375rem;
  line-height: 1.4;
  font-weight: 500;
  margin: 0 0 0.75rem;
  overflow-wrap: anywhere;
}

@media (max-width: 30rem) {
  .question__title { font-size: 1.1875rem; }
}

.tag {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 0.5rem;
  margin-left: 0.375rem;
  vertical-align: 0.2em;
}

.question__description {
  color: var(--ink-soft);
  margin: 0 0 1rem;
}

.explain {
  margin: 0 0 1.25rem;
  border-left: 3px solid var(--line);
  padding-left: 0.875rem;
}
.explain summary {
  cursor: pointer;
  color: var(--ink-soft);
  font-weight: 500;
  min-height: 2.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}
.explain summary::-webkit-details-marker { display: none; }
/* A chevron that turns when opened: flex layout drops the native marker. */
.explain summary::before {
  content: "";
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 120ms ease;
}
.explain[open] summary::before { transform: rotate(45deg); }
.explain[open] summary { margin-bottom: 0.5rem; }
.explain .prose { font-size: 0.9375rem; color: var(--ink-soft); }
.explain__less { display: none; }
.explain[open] .explain__more { display: none; }
.explain[open] .explain__less { display: inline; }

.question__instruction {
  font-size: 0.9375rem;
  color: var(--muted);
  margin: 0 0 0.625rem;
}

.field-error {
  color: var(--danger);
  font-weight: 500;
  margin: 0 0 0.625rem;
}

/* The answer plates: the one bold element. Full-width, generous targets,
   inked when chosen. */
.plates {
  display: grid;
  gap: 0.625rem;
}

.plates--row {
  grid-template-columns: repeat(auto-fit, minmax(3.25rem, 1fr));
}

.plate {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-height: 3.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-control);
  cursor: pointer;
  overflow-wrap: anywhere;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.plate input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.plate__mark {
  flex: none;
  width: 1.375rem;
  height: 1.375rem;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: border-color 120ms ease;
}
.plate--check .plate__mark { border-radius: 5px; }

.plate__mark::after {
  content: "";
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--on-ink);
  transform: scale(0);
  transition: transform 120ms ease;
}
.plate--check .plate__mark::after {
  width: 0.7rem;
  height: 0.4rem;
  border-radius: 0;
  background: transparent;
  border-left: 2.5px solid var(--on-ink);
  border-bottom: 2.5px solid var(--on-ink);
  transform: rotate(-45deg) scale(0);
  margin-top: -0.15rem;
}

.plate:hover { border-color: var(--ink-soft); }

.plate:has(input:checked) {
  border-color: var(--ink);
  border-width: 2px;
  background: var(--selected);
}
.plate:has(input:checked) .plate__mark {
  border-color: var(--ink);
  background: var(--ink);
}
.plate:has(input:checked) .plate__mark::after { transform: scale(1); }
.plate--check:has(input:checked) .plate__mark::after { transform: rotate(-45deg) scale(1); }

.plate:has(input:focus-visible) {
  outline: 3px solid var(--horizon);
  outline-offset: 2px;
}

.plate--scale {
  justify-content: center;
  padding: 0.5rem;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.plate--scale .plate__mark { display: none; }

.scale-labels {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.375rem;
}

.matrix-row { margin: 0 0 1.25rem; }
.matrix-row__title { font-weight: 500; margin: 0 0 0.5rem; }

.comment { margin-top: 1rem; }

.nav {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
/* Next comes first in the markup so Enter in a text field means Next;
   it is shown on the right. */
.nav .button--back { order: -1; margin-right: auto; }

@media (max-width: 30rem) {
  .nav {
    position: sticky;
    bottom: 0;
    background: var(--paper);
    margin: 0 -1rem;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  }
  .nav .button--primary { flex: 1; }
}

.done-mark {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: 3px solid var(--ok);
  display: grid;
  place-items: center;
  margin-bottom: 1.25rem;
}
.done-mark::after {
  content: "";
  width: 1.25rem;
  height: 0.7rem;
  border-left: 3px solid var(--ok);
  border-bottom: 3px solid var(--ok);
  transform: rotate(-45deg);
  margin-top: -0.3rem;
}

/* -- footer -------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}
.site-footer__inner { padding-top: 1.25rem; padding-bottom: 1.5rem; }
.site-footer p { margin: 0 0 0.5rem; max-width: 40em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* -- documents ----------------------------------------------------------- */

.doc-position { margin-bottom: 0.25rem; }

.alert--ok { border-left-color: var(--ok); background: var(--selected); }

.doc-list {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: grid;
  gap: 0.875rem;
}

/* The left edge carries the status, so a scan down the list shows what is
   left to do without reading every badge. */
.doc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--radius-control);
  padding: 1rem 1.125rem;
  scroll-margin-top: 1rem;
}
.doc--uploaded { border-left-color: var(--horizon); }
.doc--approved { border-left-color: var(--ok); }
.doc--rejected { border-left-color: var(--danger); }

.doc__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.doc__name {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  overflow-wrap: anywhere;
}

.status {
  flex: none;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.status--uploaded { color: var(--ink); border-color: var(--horizon); }
.status--approved { color: var(--ok); border-color: var(--ok); }
.status--rejected { color: var(--danger); border-color: var(--danger); }

.doc__details {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}
.doc__details p { margin: 0 0 0.25rem; }

.doc__note {
  margin-top: 0.75rem;
  background: var(--danger-bg);
  border-radius: var(--radius-small);
  padding: 0.625rem 0.875rem;
}
.doc__note p { margin: 0; }
.doc__note-title { font-weight: 600; color: var(--danger); }

.upload { margin-top: 0.875rem; }

.upload__picker {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  font-weight: 500;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-control);
  color: var(--ink);
  cursor: pointer;
}
.upload__picker:hover { background: var(--selected); }
.upload__input:focus-visible + .upload__picker { outline: 3px solid var(--horizon); outline-offset: 2px; }
.upload__empty { color: var(--muted); }

.upload__chosen {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}
.upload__chosen:empty { display: none; }

.upload__problem { margin: 0.5rem 0 0; }

.upload__button { margin-top: 0.75rem; }

.finalize h2 { font-size: 1.125rem; }

@media (max-width: 30rem) {
  .doc__head { flex-direction: column; gap: 0.375rem; }
  .upload__button { width: 100%; }
}

/* -- offer --------------------------------------------------------------- */

.offer-facts { margin: 0 0 1.5rem; color: var(--ink-soft); }
.offer-facts p { margin: 0 0 0.25rem; }

.offer-viewer { margin: 0 0 1.5rem; }
.offer-viewer iframe {
  display: block;
  width: 100%;
  height: 72vh;
  min-height: 24rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
}
.offer-viewer p { margin: 0.5rem 0 0; }

.check {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin: 0 0 1.25rem;
  cursor: pointer;
}
.check input {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  accent-color: var(--ink);
}

.outcome h2 { font-size: 1.25rem; }

.decline {
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}
.decline summary {
  cursor: pointer;
  color: var(--ink-soft);
  font-weight: 500;
  min-height: 2.25rem;
}
.decline__form { margin-top: 1rem; }

.button--danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.button--danger:hover { background: var(--danger-bg); }

@media (max-width: 30rem) {
  .offer-viewer iframe { height: 60vh; }
  #accept .button, .decline .button { width: 100%; }
}
