/* assets/css/audit-readiness.css - Audit readiness check and assessment (CR-039). Loaded only by the three audit readiness views.
   Uses the site's tokens from style.css (--bg-surface, --text-main, --text-muted, --border-light, --primary, --radius-*). Colour is never the only signal:
   every bar, cell and tag also carries words. */

:root {
    --ar-strong:      #047857;   /* strong coverage */
    --ar-strong-bg:   #d1fae5;
    --ar-some:        #b45309;   /* some gaps */
    --ar-some-bg:     #fef3c7;
    --ar-signif:      #b91c1c;   /* significant gaps */
    --ar-signif-bg:   #fee2e2;
    --ar-na:          #6b7280;
    --ar-na-bg:       #f3f4f6;
}

/* intro and notes */
.ar-intro p { max-width: 760px; margin-bottom: 12px; }
.ar-note { color: var(--text-main); max-width: 760px; margin-bottom: 12px; }
.ar-fine { color: var(--text-muted); font-size: 14px; max-width: 640px; margin: 12px 0 16px; }
.ar-assure { margin: 20px 0 12px; padding: 10px 14px; border-left: 4px solid var(--primary); background: var(--bg-surface); color: var(--text-main); font-weight: 600; max-width: 760px; }
.ar-member-note { max-width: 760px; }
.ar-stored { max-width: 760px; margin: 16px 0; padding: 14px 18px; border: 1px solid var(--border-light); border-radius: var(--radius-md); background: var(--bg-surface); }
.ar-stored-title { font-size: 17px; margin-bottom: 6px; }
.ar-stored p { margin: 0; color: var(--text-main); }
.ar-draft-note { margin: 0 0 18px; padding: 12px 16px; border: 1px dashed var(--ar-some); background: var(--ar-some-bg); color: var(--text-main); border-radius: var(--radius-md); max-width: 760px; }
.ar-page-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.ar-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* honeypot: off screen, not display:none, so simple bots still fill it */
.ar-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* progress */
.ar-progress-wrap { margin: 0 0 20px; max-width: 760px; }
.ar-progress { margin: 6px 0 0; color: var(--text-main); font-weight: 600; }
.ar-band--progress { background: var(--primary); }

/* tabs and area list */
.ar-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.ar-tabs a { padding: 8px 14px; border: 1px solid var(--border-light); border-radius: var(--radius-md); background: var(--bg-surface); color: var(--text-main); text-decoration: none; font-weight: 600; }
.ar-tabs a[aria-current="page"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.ar-areas { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; padding: 0; }
.ar-areas a { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 12px; border: 1px solid var(--border-light); border-radius: var(--radius-md); background: var(--bg-surface); color: var(--text-main); text-decoration: none; font-size: 15px; }
.ar-areas a[aria-current="page"] { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); font-weight: 700; }
.ar-count { color: var(--text-muted); font-size: 13px; margin-left: 4px; }
.ar-steps { max-width: 760px; margin: 0 0 20px 20px; display: grid; gap: 8px; }

/* questions */
.ar-form { max-width: 820px; }
.ar-q { margin: 0 0 20px; padding: 16px 18px; border: 1px solid var(--border-light); border-radius: var(--radius-md); background: var(--bg-surface); min-width: 0; }
.ar-q legend { font-family: 'Outfit', sans-serif; font-size: 18px; font-weight: 600; color: var(--text-main); padding: 0 6px; line-height: 1.35; }
.ar-q-num, .ar-q-id { color: var(--text-muted); font-weight: 600; margin-right: 4px; }
.ar-q-hint, .ar-q-meta { color: var(--text-main); font-size: 15px; margin: 6px 0 10px; }
.ar-choices { display: grid; gap: 8px; margin: 8px 0; }
@media (min-width: 640px) { .ar-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ar-choice, .ar-check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border-light); border-radius: var(--radius-sm); cursor: pointer; background: var(--bg-surface); }
.ar-check { border: 0; padding: 0; margin: 10px 0; }
.ar-choice input, .ar-check input { margin-top: 4px; flex: 0 0 auto; }
.ar-choice:focus-within, .ar-check:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.ar-choice:has(input:checked) { border-color: var(--primary); background: var(--ar-na-bg); font-weight: 600; }
.ar-source { color: var(--text-muted); font-size: 14px; margin-top: 10px; }
.ar-why { margin-top: 12px; }
.ar-why summary { cursor: pointer; font-weight: 600; color: var(--text-main); }
.ar-why p { margin: 8px 0 0; }
.ar-scope { margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--ar-na-bg); color: var(--text-main); font-size: 13px; }
.ar-matrix { margin: 8px 0; }
.ar-matrix th[scope="row"] { text-align: left; font-weight: 600; min-width: 140px; }
.ar-matrix select { min-width: 180px; }
.ar-crit { color: var(--logo-gray); font-size: 13px; font-weight: 400; }   /* browser test CR-039: the muted grey was 4.34:1 on a table header, below 4.5:1 for small text */

/* setup */
.ar-setup { max-width: 820px; }
.ar-rows { margin: 0 0 24px; padding: 14px 18px; border: 1px solid var(--border-light); border-radius: var(--radius-md); background: var(--bg-surface); }
.ar-rows legend { font-family: 'Outfit', sans-serif; font-size: 18px; font-weight: 600; padding: 0 6px; }
.ar-row { display: grid; gap: 10px; margin-bottom: 10px; }
@media (min-width: 640px) { .ar-row { grid-template-columns: 2fr 1fr; } }
.ar-row .form-group { margin: 0; }

/* touch targets: the site's .btn is 42px high; the audit readiness buttons and links are at least 44px (browser test CR-039) */
.ar-form .btn, .ar-setup .btn, .ar-add, .ar-email-form .btn, .ar-delete .btn, .ar-report .btn, .cta-row .btn { min-height: 44px; }
.ar-tabs a { min-height: 44px; display: inline-flex; align-items: center; }

/* result bars */
.ar-bar { margin: 0 0 14px; max-width: 760px; }
.ar-bar-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.ar-bar-label { font-weight: 600; color: var(--text-main); }
.ar-bar-value { color: var(--text-main); }
.ar-bar-track { height: 14px; background: var(--ar-na-bg); border: 1px solid var(--border-light); border-radius: 999px; overflow: hidden; }
.ar-bar-fill { height: 100%; border-radius: 999px; }
.ar-band--strong { background: var(--ar-strong); }
.ar-band--some { background: var(--ar-some); }
.ar-band--significant { background: var(--ar-signif); }
.ar-band--na { background: var(--ar-na); }
.ar-sub { margin: 18px 0 8px; font-size: 18px; }

/* heat map: tinted cells with dark text; the percentage and a word are always printed */
.ar-heat th, .ar-heat td { text-align: center; padding: 8px 10px; }
.ar-heat th[scope="row"] { text-align: left; min-width: 160px; }
.ar-heat td.ar-cell { font-weight: 700; color: var(--text-main); }
.ar-heat td.ar-band--strong { background: var(--ar-strong-bg); }
.ar-heat td.ar-band--some { background: var(--ar-some-bg); }
.ar-heat td.ar-band--significant { background: var(--ar-signif-bg); }
.ar-heat td.ar-band--na { background: var(--ar-na-bg); }
.ar-cell-word { display: block; font-size: 12px; font-weight: 600; color: var(--text-main); }
.ar-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 16px; margin: 12px 0; padding: 0; }
.ar-legend li { display: flex; gap: 6px; align-items: center; }
.ar-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; }
.ar-key { color: var(--text-main); font-size: 14px; }
.ar-key span { margin-right: 14px; display: inline-block; }

/* gaps */
.ar-gaps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; max-width: 820px; }
.ar-gap { padding: 16px 18px; border: 1px solid var(--border-light); border-radius: var(--radius-md); background: var(--bg-surface); break-inside: avoid; }
.ar-gap-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.ar-gap-id { font-weight: 700; color: var(--text-main); }
.ar-gap-area { color: var(--text-muted); font-size: 14px; }
.ar-gap-title { font-size: 18px; margin: 4px 0 8px; }
.ar-gap p { margin: 0 0 8px; color: var(--text-main); }
.ar-gap .ar-source { color: var(--text-muted); }
.ar-weight { padding: 2px 8px; border-radius: 999px; font-size: 13px; font-weight: 700; border: 1px solid transparent; }
.ar-weight--H { background: var(--ar-signif-bg); color: #7f1d1d; border-color: var(--ar-signif); }
.ar-weight--M { background: var(--ar-some-bg); color: #78350f; border-color: var(--ar-some); }
.ar-weight--L { background: var(--ar-na-bg); color: #374151; border-color: var(--ar-na); }

/* look-ahead */
.ar-la-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-width: 820px; }
.ar-la-list li { display: flex; gap: 10px; align-items: flex-start; }
.ar-la-status { flex: 0 0 auto; padding: 2px 8px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--ar-na-bg); color: var(--text-main); border: 1px solid var(--border-light); white-space: nowrap; }
.ar-la--yes { background: var(--ar-strong-bg); }
.ar-la--partly { background: var(--ar-some-bg); }
.ar-la--no { background: var(--ar-signif-bg); }

/* email step, delete box, admin helpers */
.ar-email-form { max-width: 560px; }
.ar-delete { max-width: 560px; margin-top: 24px; }
.ar-danger { border-color: var(--ar-signif); color: #7f1d1d; }
.ar-grid2 { display: grid; gap: 12px; }
@media (min-width: 720px) { .ar-grid2 { grid-template-columns: 1fr 1fr; } }
.ar-inline { display: inline; }
.ar-live { margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--ar-strong-bg); color: #064e3b; font-size: 13px; font-weight: 700; }
.ar-report-meta { color: var(--text-main); margin-bottom: 12px; }

/* print: the report only */
@media print {
    .main-header, .main-footer, .hamburger, .ar-noprint, .cta-row, #newsletter-signup, nav { display: none !important; }
    body { background: #fff; display: block; }
    .container, .main-content { max-width: none; padding: 0; margin: 0; }
    .block { margin-bottom: 18px; }
    .ar-gap, .ar-bar, .ar-heat tr { break-inside: avoid; }
    .ar-bar-track, .ar-heat td, .ar-weight, .ar-la-status, .ar-swatch { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    a { color: #000; text-decoration: none; }
    details.ar-why { display: none; }
}

/* CR-039 design review A1: a long question in a fieldset legend sat on the card's top border (the browser centres a legend on the border).
   Floating it full width puts it inside the card, under the card's own padding; the next element clears it. */
.ar-q legend { float: left; width: 100%; padding: 0; margin: 0 0 8px; }
.ar-q legend + * { clear: both; }
/* B1: the gap card's links, one labelled line each, like Evidence and Next step */
.ar-fix { font-size: 15px; }
/* C1: areas with no answers are listed once instead of as empty bars */
.ar-unanswered { max-width: 760px; margin: 12px 0; color: var(--text-main); }
/* C2: the admin question column keeps a readable width, the table scrolls sideways inside its wrapper */
.ar-bank-table td:nth-child(2) { min-width: 260px; }
.ar-bank-table td:nth-child(3) { white-space: nowrap; }

/* Owner report 2026-11-10: the Systems and Suppliers box titles also sat on the card border. Same fix as .ar-q: the title goes inside the card. */
.ar-rows legend { float: left; width: 100%; padding: 0; margin: 0 0 12px; }
.ar-rows legend + * { clear: both; }
