/* Check page: light, neutral, mobile first (Direction 3 light rules, 32hb). No outside fonts, no images beyond the favicon.
   Colours are tested for WCAG AA contrast in test/unit/palette.test.ts. */
:root {
  /* Direction 3 light rules (decision 32hb); source of truth: marketing/brand-kit/TOKENS.md, light theme. */
  --bg: #ffffff;
  --panel: #f1f5f9;
  --text: #0b2545;
  --muted: #475569;
  --line: #cbd5e1;
  --line-strong: #64748b;
  --accent: #1d4ed8;
  --on-accent: #ffffff;
  --ok-bg: #f0fdf4;
  --ok: #166534;
  --warn-bg: #fffbeb;
  --warn: #92400e;
  --err-bg: #fef2f2;
  --err: #b91c1c;
  --focus: #1d4ed8;
  --radius: 8px;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    400 1rem / 1.5 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
}

.check {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1rem 1rem 6rem;
}

.checkhead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.5rem;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 3px solid var(--accent);
}
.checkhead .brand {
  font-weight: 700;
  font-size: 1.125rem;
}
.checkhead .powered {
  color: var(--muted);
  font-size: 0.875rem;
}

h1 {
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 0 0 0.75rem;
}
h2 {
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 1.75rem 0 0.5rem;
}
p {
  margin: 0 0 0.75rem;
}

.muted {
  color: var(--muted);
}
.note {
  background: var(--panel);
  border-left: 4px solid var(--accent);
  padding: 0.625rem 0.75rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.labels {
  color: var(--muted);
  font-size: 0.9375rem;
  font-style: italic;
}

.consent {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.875rem;
  margin: 1rem 0;
  background: var(--panel);
  cursor: pointer;
}
.consent input {
  width: 1.375rem;
  height: 1.375rem;
  margin: 0.125rem 0 0;
  flex: none;
  accent-color: var(--accent);
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
fieldset.questions > legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
fieldset.q {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin: 0 0 0.75rem;
}
fieldset.q > legend {
  font-weight: 600;
  padding: 0 0.25rem;
}
.hint {
  color: var(--muted);
  font-size: 0.9375rem;
  margin: 0.25rem 0 0.5rem;
}

.opt {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  padding: 0.375rem 0.5rem;
  margin: 0.25rem 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
}
.opt input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  flex: none;
  accent-color: var(--accent);
}
.opt:has(input:checked) {
  border-color: var(--accent);
  background: var(--panel);
  font-weight: 600;
}
fieldset:disabled .opt {
  cursor: not-allowed;
  color: var(--muted);
  background: var(--bg);
}

.locked-hint {
  color: var(--muted);
  font-style: italic;
}
fieldset.questions:not(:disabled) + .locked-hint,
.locked-hint[hidden] {
  display: none;
}

.progress {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 0.625rem 0;
  margin: 1rem 0 0;
}
.progress progress {
  flex: 1;
  height: 0.75rem;
  accent-color: var(--accent);
}
.progress output {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

button {
  font: inherit;
  font-weight: 600;
  min-height: 2.75rem;
  padding: 0.625rem 1.125rem;
  margin: 0.25rem 0.5rem 0.25rem 0;
  border-radius: var(--radius);
  border: 2px solid var(--accent);
  cursor: pointer;
}
button.primary {
  background: var(--accent);
  color: var(--on-accent);
}
button.secondary {
  background: var(--bg);
  color: var(--accent);
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

.headline {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0.25rem 0 0.5rem;
}
.gaps {
  padding-left: 1.25rem;
}
.gaps li {
  margin-bottom: 0.625rem;
}
.gaps .fix {
  display: block;
}
.gaps .ans {
  display: block;
  color: var(--muted);
  font-size: 0.9375rem;
}

.status {
  border-radius: var(--radius);
  padding: 0.75rem;
  margin: 0.75rem 0;
}
.status:empty {
  display: none;
}
.status.ok {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid var(--ok);
}
.status.warn {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid var(--warn);
}
.status.err {
  background: var(--err-bg);
  color: var(--err);
  border: 1px solid var(--err);
}

.error-page h1 {
  color: var(--err);
}

[hidden] {
  display: none !important;
}

@media (min-width: 40rem) {
  .check {
    padding: 2rem 1.5rem 6rem;
  }
  h1 {
    font-size: 1.875rem;
  }
}

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

@media (forced-colors: active) {
  .opt:has(input:checked) {
    outline: 2px solid CanvasText;
  }
}

/* 32hz A2: the MSP's booking link after the result (lane aa-quick-web). */
a.button {
  display: inline-block;
  font-weight: 600;
  min-height: 2.75rem;
  padding: 0.625rem 1.125rem;
  margin: 0.25rem 0.5rem 0.25rem 0;
  border-radius: var(--radius);
  border: 2px solid var(--accent);
  background: var(--bg);
  color: var(--accent);
  text-decoration: none;
}
a.button.primary {
  background: var(--accent);
  color: var(--on-accent);
}

/* 32hz A1: the email-security grade widget (lane aa-quick-web). */
.grade .field {
  display: block;
  font-weight: 600;
  margin: 1rem 0 0.25rem;
}
.grade input[type="text"] {
  font: inherit;
  width: 100%;
  max-width: 28rem;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  margin: 0 0.5rem 0.5rem 0;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--bg);
}
.grade-head {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.grade-letter {
  font-size: 2.5rem;
  font-weight: 800;
  min-width: 3.5rem;
  text-align: center;
  border: 3px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
}
.grade-lines {
  list-style: none;
  padding: 0;
}
.grade-lines .gl {
  border-left: 4px solid var(--line-strong);
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 0;
  background: var(--panel);
}
.grade-lines .gl-good {
  border-left-color: var(--ok);
}
.grade-lines .gl-partial,
.grade-lines .gl-missing {
  border-left-color: var(--warn);
}
.grade-lines .gl > span {
  display: block;
}
.grade-lines .gl-status {
  font-weight: 600;
}
