/* Shared stylesheet for /audit/* self-audit sheets.
   Each audit page sets --audit-accent per topic (blue for security & privacy,
   green for automation, yellow for cloud & saas). All accent-driven surfaces
   read from --audit-accent so a new audit is one variable + content away. */
:root {
  --ink: #08090d;
  --ink-2: #1a1c22;
  --paper: #ffffff;
  --paper-2: #f6f7f9;
  --line: #e6e8ec;
  --muted: #4a4d55;
  --accent-blue: #5C7CFA;
  --accent-green: #51CF66;
  --accent-yellow: #FCC419;
  --accent-red: #FF6B6B;
  --score-green: #2f9e44;
  --score-amber: #e67700;
  --score-red: #c92a2a;
  --brand: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Per-audit accent, overridden inline per file. Defaults to blue for safety. */
  --audit-accent: var(--accent-blue);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { font-family: var(--brand); color: var(--ink); background: var(--paper-2); -webkit-font-smoothing: antialiased; }
body { padding: 24px 0; }
a { color: var(--audit-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.sheet {
  background: var(--paper);
  width: 200mm;
  min-height: 287mm;
  margin: 0 auto 24px;
  padding: 0 12mm 10mm;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  page-break-after: always;
  display: flex;
  flex-direction: column;
}
.sheet:last-child { page-break-after: auto; margin-bottom: 0; }

.title-bar {
  background: var(--ink);
  color: var(--paper);
  margin: 0 -12mm 0;
  padding: 5mm 12mm;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark img { width: 28px; height: 28px; }
.brand-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--paper);
}
.brand-motto {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: -0.005em;
  margin-left: 4px;
}
.brand-motto .m-blue   { color: var(--accent-blue); }
.brand-motto .m-green  { color: var(--accent-green); }
.brand-motto .m-yellow { color: var(--accent-yellow); }
.doc-meta {
  text-align: right;
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  line-height: 1.4;
}
.doc-meta strong { color: var(--paper); }
.doc-meta .eyebrow { color: var(--audit-accent); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

.accent-strip {
  height: 6px;
  width: calc(100% + 24mm);
  display: flex;
  margin: 0 -12mm 6mm;
}
.accent-strip .seg { flex: 1; }
.accent-strip .seg-blue   { background: var(--accent-blue); }
.accent-strip .seg-green  { background: var(--accent-green); }
.accent-strip .seg-yellow { background: var(--accent-yellow); }

.body-top { padding-top: 2mm; }

h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 4mm;
}
h1 em { color: var(--audit-accent); font-style: normal; font-weight: inherit; }

.lede {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 165mm;
  margin-bottom: 4mm;
}
.lede strong { color: var(--ink); }

.how-to {
  background: var(--paper-2);
  border-left: 3px solid var(--audit-accent);
  padding: 3mm 4mm;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 6mm;
  border-radius: 0 3px 3px 0;
}
.how-to strong { color: var(--ink); }

.section { margin-bottom: 5mm; }
.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--audit-accent);
  margin-bottom: 2mm;
  padding-bottom: 1mm;
  border-bottom: 1px solid var(--line);
}
.section-title .n {
  display: inline-block;
  width: 6mm;
  color: var(--muted);
}
.section-title .count {
  float: right;
  color: var(--muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.item {
  display: grid;
  grid-template-columns: 6mm 1fr auto;
  gap: 3mm;
  align-items: start;
  padding: 1.6mm 0;
  border-bottom: 1px dashed var(--line);
  font-size: 12.5px;
  line-height: 1.35;
}
.item:last-child { border-bottom: none; }
.item .idx { color: var(--muted); font-weight: 500; font-size: 12px; padding-top: 0.5mm; }
.item .txt { padding-right: 4mm; }

.checkboxes {
  display: flex;
  gap: 2mm;
  align-items: center;
  flex-shrink: 0;
}
.checkboxes label {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8mm;
  cursor: pointer;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  width: 15mm;
  text-align: center;
  white-space: nowrap;
}
.checkboxes .box {
  width: 5mm;
  height: 5mm;
  border: 1.5px solid var(--muted);
  border-radius: 1px;
  display: inline-block;
}

.score-total {
  margin-top: 4mm;
  padding: 3mm 4mm;
  background: var(--ink);
  color: var(--paper);
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.score-total .label {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.score-total .label small {
  display: block;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11.5px;
  color: rgba(255,255,255,0.7);
  margin-top: 0.5mm;
}
.score-box {
  width: 32mm;
  height: 12mm;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--paper);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  gap: 2mm;
}
.score-box .write-area {
  width: 13mm;
  border-bottom: 2px solid var(--ink);
  height: 7mm;
}
.score-box .of { font-weight: 500; font-size: 14px; color: var(--muted); }

.footer {
  margin-top: auto;
  padding-top: 4mm;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
  color: var(--muted);
}
.footer .page-num { font-weight: 600; }

h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 3mm;
}
h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 1.5mm;
  display: flex;
  align-items: center;
  gap: 2mm;
}

.band-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2mm; margin-bottom: 4mm; }
.band { padding: 3mm 3.5mm; border-radius: 4px; border-top: 3px solid; }
.band--green { background: #ebfbee; border-color: var(--score-green); }
.band--amber { background: #fff4e6; border-color: var(--score-amber); }
.band--red   { background: #fff5f5; border-color: var(--score-red); }
.band h3 {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 1.5mm;
  display: block;
}
.band--green h3 { color: var(--score-green); }
.band--amber h3 { color: var(--score-amber); }
.band--red   h3 { color: var(--score-red); }
.band .range {
  display: block;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  font-size: 11.5px;
  margin: 0.5mm 0 0 0;
}
.band p { font-size: 11.5px; line-height: 1.45; color: var(--ink); }

.next-steps {
  background: var(--paper-2);
  padding: 3mm 4mm;
  border-radius: 4px;
  margin-bottom: 3mm;
}
.next-steps h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--audit-accent); margin-bottom: 2mm; }
.next-steps ol { padding-left: 5mm; font-size: 12px; line-height: 1.45; }
.next-steps li { margin-bottom: 1.5mm; }
.next-steps li:last-child { margin-bottom: 0; }
.next-steps strong { color: var(--ink); }

.cta-band {
  background: var(--ink);
  color: var(--paper);
  padding: 4mm 5mm;
  border-radius: 4px;
  margin-bottom: 3mm;
}
.cta-band .eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--audit-accent); margin-bottom: 1.5mm; }
.cta-band h2 { color: var(--paper); font-size: 17px; margin-bottom: 2mm; }
.cta-band h2 em { color: var(--audit-accent); font-style: normal; font-weight: inherit; }
.cta-band p { font-size: 12px; line-height: 1.45; color: rgba(255,255,255,0.85); margin-bottom: 2.5mm; max-width: 155mm; }
.cta-band .btn {
  display: inline-block;
  padding: 2.5mm 5mm;
  background: var(--audit-accent);
  color: var(--ink);
  font-weight: 600;
  font-size: 12.5px;
  border-radius: 3px;
  letter-spacing: 0.02em;
}
.cta-band .url { display: block; font-size: 11.5px; color: rgba(255,255,255,0.6); margin-top: 2mm; }

.about {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 3mm;
}
.about strong { color: var(--ink); }

.screen-nav {
  max-width: 210mm;
  margin: 0 auto 16px;
  padding: 12px 16px;
  background: var(--paper);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.screen-nav a { color: var(--audit-accent); font-weight: 500; }
.screen-nav button {
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
}

/* Force browsers to print background colors on dark bands and accent surfaces.
   Without this, Chrome/Safari drop the fills to save ink. */
.title-bar,
.accent-strip,
.accent-strip .seg,
.score-total,
.cta-band,
.cta-band .btn,
.band,
.band--green,
.band--amber,
.band--red,
.next-steps,
.how-to {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

@page { size: A4 portrait; margin: 5mm; }
@media print {
  html, body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  body { background: white; padding: 0; }
  .screen-nav { display: none; }
  .sheet {
    box-shadow: none;
    margin: 0;
    width: 100%;
    min-height: 0;
    height: auto;
    page-break-after: always;
    page-break-inside: avoid;
  }
  .sheet:last-child { page-break-after: auto; }
  .section { page-break-inside: avoid; }
  .item { page-break-inside: avoid; }
  .band { page-break-inside: avoid; }
  a { color: var(--ink); text-decoration: none; }
  .cta-band .btn { color: var(--ink); }
  .cta-band a { color: rgba(255,255,255,0.85); }
  .screen-only,
  .audit-liveline,
  .audit-capture,
  .screen-nav { display: none !important; }
}

/* -------- Interactive layer (screen only) -------- */

/* Hidden attribute must always win over any display override below. */
[hidden] { display: none !important; }

/* Visually hide the native radio while keeping it in the a11y tree.
   The paired .box is the visible control. */
.checkboxes input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Filled/ticked state driven by the sibling radio.
   Intentionally NOT gated behind @media screen so a printed
   completed audit still shows the chosen ticks. */
.checkboxes label input[type="radio"]:checked + .box {
  background: var(--audit-accent);
  border-color: var(--audit-accent);
  position: relative;
}
.checkboxes label input[type="radio"]:checked + .box::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 45%;
  width: 2mm;
  height: 1mm;
  border-left: 1.2px solid var(--paper);
  border-bottom: 1.2px solid var(--paper);
  transform: translate(-50%, -50%) rotate(-45deg);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* Keyboard focus ring on the whole option. */
.checkboxes label:focus-within {
  outline: 2px solid var(--audit-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Belt-and-braces cursor for interactivity. */
.checkboxes label { cursor: pointer; }

/* Hover affordance on non-touch pointers only. */
@media (hover: hover) {
  .checkboxes label:hover .box { border-color: var(--audit-accent); }
}

/* .screen-only is a no-op on screen; print block hides it. */
.screen-only { }

/* Live progress + score pill, fixed to viewport bottom-centre on desktop. */
.audit-liveline {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 40;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.audit-liveline .liveline-progress,
.audit-liveline .liveline-score {
  font-variant-numeric: tabular-nums;
}
.audit-liveline .liveline-clear {
  margin-left: 6px;
  background: transparent;
  color: var(--paper);
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  opacity: 0.8;
}
.audit-liveline .liveline-clear:hover {
  text-decoration: underline;
  opacity: 1;
}

/* Collapse into a compact top-right pill on narrow screens. */
@media (max-width: 719px) {
  .audit-liveline {
    bottom: auto;
    top: 12px;
    right: 12px;
    left: auto;
    transform: none;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 11px;
    padding: 8px 12px;
  }
  .audit-liveline .liveline-clear { margin-left: 0; }
}

/* Capture panel: full-bleed dark band, revealed once all questions answered. */
.audit-capture {
  background: var(--ink);
  color: var(--paper);
  padding: 48px 24px;
  opacity: 0;
  transform: translateY(8px);
}
.audit-capture.is-ready {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: no-preference) {
  .audit-capture {
    transition: opacity 300ms ease, transform 300ms ease;
  }
}
@media (max-width: 719px) {
  .audit-capture { padding: 32px 20px; }
}
.audit-capture .capture-inner {
  max-width: 640px;
  margin: 0 auto;
}
.audit-capture h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: var(--paper);
}
.audit-capture p {
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.9);
}
.audit-capture .capture-consent {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 8px;
}
.audit-capture a {
  color: var(--paper);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.4);
}
.audit-capture a:hover { text-decoration-color: var(--audit-accent); }

.audit-capture form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}
.audit-capture form label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}
.audit-capture form input {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 10px 12px;
  background: transparent;
  color: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
}
.audit-capture form input::placeholder { color: rgba(255, 255, 255, 0.4); }
.audit-capture form input:focus {
  outline: none;
  border-color: var(--audit-accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}
/* Neutralise Chrome's yellow autofill background. */
.audit-capture form input:-webkit-autofill {
  -webkit-text-fill-color: var(--paper);
  -webkit-box-shadow: 0 0 0 1000px var(--ink-2) inset;
  box-shadow: 0 0 0 1000px var(--ink-2) inset;
}
.audit-capture .btn-submit {
  align-self: flex-start;
  background: var(--audit-accent);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  padding: 14px 28px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}
.audit-capture .btn-submit:hover { filter: brightness(1.08); }
.audit-capture .btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: none;
}
.audit-capture .capture-status {
  min-height: 20px;
  font-size: 13px;
  color: var(--accent-red);
  margin-top: 4px;
}
.audit-capture .capture-status:empty { visibility: hidden; }

