/* AccessChecked — free check (/scan). Loaded only by scan.html, after site.css;
   uses site.css tokens. Contrast notes: small grey text here uses --muted,
   pinned at #6B665E (at least 4.8:1 on paper, paper-2, and white), and field
   edges use --ink-3 instead of --line so a control's boundary clears 3:1
   against the page. */

[hidden] {
  display: none !important;
}
:root {
  --muted: #6b665e;
}
.muted {
  color: var(--muted);
  font-size: 0.92rem;
}
.scan .note p:last-child {
  margin-bottom: 0;
}

/* ---------- forms on this page ---------- */
.scan .form .hint {
  color: var(--muted);
}
.scan .form input[type="text"],
.scan .form input[type="email"],
.scan .form input[type="tel"],
.scan .form select {
  border-color: var(--ink-3);
}
.scan .form input:focus,
.scan .form select:focus {
  border-color: var(--ink);
}
.scan .form [aria-invalid="true"] {
  border-color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px var(--accent-dark);
}
.scan .form .check label {
  display: block;
  font-weight: 400;
  margin: 0;
}
.scan .form fieldset {
  border: 0;
  padding: 0;
  margin: 1.5rem 0 0;
  min-width: 0;
}
.scan .form legend {
  font-weight: 600;
  padding: 0;
  margin: 0 0 0.3rem;
}
.scan .form .check input[type="radio"] {
  margin-top: 0.2rem;
}
.err {
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0.15rem 0 0.4rem;
}
.scan-fine {
  margin: 0.9rem 0 0;
}

/* error summary: focused on a failed submit, each line links to its field */
.errsum {
  background: #fff;
  border: 3px solid var(--accent-dark);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  margin: 1.25rem 0;
  max-width: 36rem;
}
.errsum:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.errsum h2,
.errsum h3 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}
.errsum ul {
  margin: 0;
  padding-left: 1.2rem;
}
.errsum li {
  margin: 0.25rem 0;
}
.errsum a {
  color: var(--accent-dark);
  font-weight: 600;
}

/* Turnstile: space reserved so the button doesn't jump when it renders */
.ts {
  margin-top: 1.25rem;
}
.ts-box {
  min-height: 65px;
}

/* ---------- live progress ---------- */
.run {
  margin-top: 2rem;
  max-width: 44rem;
}
.run h2,
.run-error h2 {
  margin-top: 0;
  overflow-wrap: anywhere;
}
.run-state {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--ink-2);
  min-height: 1.4em;
}
.stages {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.stage {
  display: grid;
  grid-template-columns: 1.3rem minmax(0, 1fr);
  gap: 0.8rem;
  align-items: start;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  max-width: none;
}
.st-body {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.75rem;
}
.st-name {
  font-weight: 600;
}
.stage[data-status="pending"] .st-name {
  color: var(--ink-2);
  font-weight: 500;
}
.st-state {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.stage[data-status="running"] .st-state {
  color: var(--accent-dark);
}
.stage[data-status="done"] .st-state {
  color: var(--ok);
}
.st-detail {
  flex-basis: 100%;
  font-size: 0.92rem;
  color: var(--ink-2);
}
.st-detail:empty {
  display: none;
}
/* status icons are decorative: the state is always written out in words */
.st-ico {
  position: relative;
  display: block;
  width: 1.3rem;
  height: 1.3rem;
  margin-top: 0.15rem;
  border: 2px solid var(--ink-3);
  border-radius: 50%;
}
.stage[data-status="running"] .st-ico {
  border-color: var(--line);
  border-top-color: var(--accent-dark);
  animation: scan-spin 0.9s linear infinite;
}
.stage[data-status="done"] .st-ico {
  background: var(--ok);
  border-color: var(--ok);
}
.stage[data-status="done"] .st-ico::after {
  content: "";
  position: absolute;
  left: 0.33rem;
  top: 0.12rem;
  width: 0.3rem;
  height: 0.6rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.stage[data-status="skipped"] .st-ico::after {
  content: "";
  position: absolute;
  left: 0.2rem;
  right: 0.2rem;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: var(--ink-3);
}
@keyframes scan-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  /* no spinning: a still half ring marks the running step */
  .stage[data-status="running"] .st-ico {
    animation: none;
    border-color: var(--accent-dark);
    border-bottom-color: var(--line);
    border-left-color: var(--line);
  }
}
.run-error {
  max-width: 44rem;
}
.run-error h2 {
  font-size: 1.3rem;
}
.run-error-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

/* ---------- results ---------- */
.results {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 2px solid var(--ink);
}
.results > h2 {
  margin-top: 0;
  overflow-wrap: anywhere;
}
.bands {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0.75rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  max-width: 56rem;
}
.band {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: none;
  background: #fff;
  border: 1.5px solid var(--line);
  border-top: 5px solid var(--ink-3);
  border-radius: 8px;
  padding: 1rem 1.1rem;
}
.band-critical {
  border-top-color: var(--accent-dark);
}
.band-serious {
  border-top-color: var(--warn);
}
.band-n {
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}
.band-name {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.band-desc {
  font-size: 0.92rem;
  color: var(--ink-2);
}

.examples {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.5rem;
  display: grid;
  gap: 1.25rem;
  max-width: 56rem;
}
.ex {
  min-width: 0;
  max-width: none;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
}
.ex-tag {
  display: inline-block;
  margin: 0 0 0.5rem;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--paper-2);
  color: var(--ink-2);
}
.ex-tag-critical {
  background: var(--accent-bg);
  color: var(--accent-dark);
}
.ex-tag-serious {
  background: var(--warn-bg);
  color: var(--warn);
}
.ex-title {
  font-size: 1.1rem;
  line-height: 1.3;
  margin: 0 0 0.5rem;
}
.ex-page {
  font-size: 0.92rem;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.ex-k {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.3rem;
}
/* the scanned site's real element, as text (same dark panel as the home page report) */
.ex-code {
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  max-width: 100%;
  background: #1e1c19;
  color: #ede7da;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ex-code code {
  font-size: inherit;
}
.ex-dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.35rem 1rem;
  margin: 0;
}
.ex-dl dt {
  font-weight: 600;
}
.ex-dl dd {
  margin: 0;
  max-width: 60ch;
}

/* ---------- the two paths ---------- */
.paths {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  margin-top: 2.5rem;
}
.path {
  border-radius: 10px;
  padding: 1.75rem;
}
.path > h2 {
  margin-top: 0;
  font-size: 1.45rem;
}
.path-main {
  background: #fff;
  border: 1.5px solid var(--ink);
}
.path-alt {
  background: var(--paper-2);
  border: 1.5px solid var(--line);
}
.path .form,
.path .errsum {
  max-width: none;
}
.handoff h3 {
  margin-top: 0.5rem;
  font-size: 1.25rem;
  line-height: 1.3;
}
/* what Continue leads to, right above the button */
.fix-next {
  margin: 1.5rem 0 0;
}
.path .form .fix-next + .btn {
  margin-top: 0.75rem;
}
/* straight-to-Stripe status (the live region carries it for screen readers) */
.redirect-msg {
  margin-top: 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}
.copy-label {
  display: block;
  font-weight: 600;
  margin: 1rem 0 0.3rem;
}
.copyrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.copyrow input {
  flex: 1 1 12rem;
  min-width: 0;
  font: inherit;
  font-family: var(--mono);
  padding: 0.65rem 0.75rem;
  border: 1.5px solid var(--ink-3);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
}
.copy-status {
  flex-basis: 100%;
  font-size: 0.92rem;
  color: var(--ink-2);
}
/* role="status" must stay rendered (never display:none) or "Copied." may not be
   announced; while empty it is a zero-width item on the input's row */
.copy-status:empty {
  flex-basis: auto;
}
.again {
  margin: 2rem 0 0;
}

/* ---------- who does the fixing ---------- */
.steps-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 1.5rem;
}
.steps-list li {
  max-width: none;
}
.more {
  margin: 0;
}

@media (max-width: 52em) {
  .paths {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 40em) {
  .bands {
    grid-template-columns: 1fr;
  }
  .ex-dl {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
  .ex-dl dd {
    margin-bottom: 0.6rem;
  }
  .path {
    padding: 1.25rem 1rem;
  }
  .ex {
    padding: 1rem;
  }
}
