/*
  Phase-4 T3 / D9 -- the /review page.

  No url() to any origin and no @import: `style-src 'self'` / `default-src 'self'` would refuse them, and an
  outbound request from a stylesheet on a page holding two live secrets is a channel worth not having. The
  only images here are inline data: URIs, which `img-src 'self' data:` permits.

  Every screen is a <section> toggled with the `hidden` attribute, so "one state at a time" is the browser's
  own behaviour rather than something CSS has to be trusted for.

  The page is deliberately quiet. A reviewer is making one irreversible decision about a client document,
  and a busy interface competes with that.
*/

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

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

body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── page furniture ──────────────────────────────────────────────────────────────────────────── */

.masthead {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.masthead__inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--s4) var(--s5);
  display: flex;
  align-items: baseline;
  gap: var(--s3);
}

.masthead__mark {
  font-weight: 650;
  letter-spacing: -0.01em;
}

.masthead__context {
  color: var(--ink-faint);
  font-size: var(--text-sm);
}

.shell {
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--s6) var(--s5) var(--s7);
}

.colophon {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--s5) var(--s6);
  color: var(--ink-faint);
  font-size: var(--text-xs);
}

/* `hidden` must beat any display rule a card carries. */
[hidden] {
  display: none !important;
}

/* ── cards ───────────────────────────────────────────────────────────────────────────────────── */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--s6);
  box-shadow: var(--shadow-sm);
}

.card--quiet {
  box-shadow: none;
  text-align: center;
  padding-block: var(--s7);
}

h1 {
  margin: 0 0 var(--s2);
  font-size: var(--text-2xl);
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 650;
}

h2 {
  margin: 0 0 var(--s2);
  font-size: var(--text-lg);
  font-weight: 620;
  letter-spacing: -0.01em;
}

.lede {
  margin: 0 0 var(--s5);
  color: var(--ink-soft);
}

.card--quiet .lede {
  margin-bottom: 0;
}

/* ── step indicator ──────────────────────────────────────────────────────────────────────────── */

.steps {
  display: flex;
  gap: var(--s2);
  margin: 0 0 var(--s5);
  padding: 0;
  list-style: none;
  font-size: var(--text-xs);
  color: var(--ink-faint);
}

.steps li {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.steps li + li::before {
  content: "";
  width: 1.25rem;
  height: 1px;
  background: var(--line-strong);
}

.steps [aria-current="step"] {
  color: var(--accent);
  font-weight: 600;
}

.steps__num {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-variant-numeric: tabular-nums;
}

.steps [aria-current="step"] .steps__num {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

/* ── the download ────────────────────────────────────────────────────────────────────────────── */

.doc {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: var(--s4);
  margin-bottom: var(--s5);
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.doc__icon {
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--accent-wash);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.doc__meta {
  flex: 1;
  min-width: 0;
}

.doc__name {
  font-weight: 600;
}

.doc__hint {
  color: var(--ink-faint);
  font-size: var(--text-sm);
}

/* ── form groups ─────────────────────────────────────────────────────────────────────────────── */

.group {
  display: block;
  margin: 0 0 var(--s6);
  padding: 0;
  border: 0;
}

.group:last-of-type {
  margin-bottom: var(--s5);
}

legend,
.group > .group__label {
  padding: 0;
  margin-bottom: var(--s1);
  font-size: var(--text-base);
  font-weight: 620;
  letter-spacing: -0.01em;
}

.hint {
  display: block;
  margin-bottom: var(--s3);
  color: var(--ink-faint);
  font-size: var(--text-sm);
  font-weight: 400;
}

/* ── the verdict choice ──────────────────────────────────────────────────────────────────────── */

.choices {
  display: grid;
  gap: var(--s2);
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.choice:hover {
  border-color: var(--line-strong);
  background: var(--sunken);
}

.choice input {
  margin: 0.35rem 0 0;
  accent-color: var(--accent);
  flex: none;
}

.choice__body {
  display: grid;
  gap: 2px;
}

.choice__title {
  font-weight: 600;
}

.choice__note {
  color: var(--ink-faint);
  font-size: var(--text-sm);
}

.choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-wash);
}

/* ── the rubric ──────────────────────────────────────────────────────────────────────────────── */

.rubric {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.rubric thead th {
  padding: 0 0 var(--s2);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--line);
}

.rubric thead th:last-child {
  text-align: right;
}

.rubric tbody th {
  padding: var(--s3) var(--s3) var(--s3) 0;
  text-align: left;
  font-weight: 500;
  font-size: var(--text-base);
  border-bottom: 1px solid var(--line);
}

.rubric tbody td {
  padding: var(--s2) 0;
  text-align: right;
  border-bottom: 1px solid var(--line);
}

.rubric tbody tr:last-child th,
.rubric tbody tr:last-child td {
  border-bottom: 0;
}

/* ── controls ────────────────────────────────────────────────────────────────────────────────── */

textarea,
select,
input[type="text"] {
  width: 100%;
  padding: var(--s3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

textarea {
  resize: vertical;
  min-height: 7rem;
  line-height: 1.55;
}

select {
  width: auto;
  min-width: 7.5rem;
  padding-block: var(--s2);
}

input[type="text"] {
  max-width: 12rem;
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  letter-spacing: 0.18em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s5);
  padding-top: var(--s5);
  border-top: 1px solid var(--line);
}

.button {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3) var(--s5);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease;
}

.button:hover {
  background: var(--accent-hover);
}

.button--secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--line-strong);
}

.button--secondary:hover {
  background: var(--sunken);
}

/* Visible focus stays: the verdict is irreversible and a keyboard user must see exactly what they are
   about to activate. */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── messages ────────────────────────────────────────────────────────────────────────────────── */

.error {
  margin: var(--s4) 0 0;
  min-height: 1.5em;
  color: var(--danger);
  font-size: var(--text-sm);
  font-weight: 500;
}

.error:not(:empty) {
  padding: var(--s3) var(--s4);
  background: var(--danger-wash);
  border-radius: var(--radius-sm);
}

.seal {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: var(--s4);
  border-radius: 50%;
  background: var(--good-wash);
  color: var(--good);
  font-size: var(--text-xl);
  font-weight: 700;
}

.seal--muted {
  background: var(--sunken);
  color: var(--ink-faint);
}

/* ── small screens ───────────────────────────────────────────────────────────────────────────── */

@media (max-width: 34rem) {
  .shell {
    padding: var(--s5) var(--s4) var(--s6);
  }

  .card {
    padding: var(--s5) var(--s4);
    border-radius: var(--radius);
  }

  .actions .button {
    flex: 1 1 auto;
    justify-content: center;
  }

  .steps {
    font-size: 0.7rem;
  }

  .steps li + li::before {
    width: 0.75rem;
  }
}

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