/* Pulse Academy. The Pulse HMS colours (navy #16314c, teal #1db1a3) and semantic tokens, light and dark. Mobile first. */
:root {
  --navy: #16314c;
  --teal: #1db1a3;
  --teal-ink: #0c7a70;
  --bg: #f5f7f9;
  --surface: #ffffff;
  --surface-2: #eef2f5;
  --ink: #1b2430;
  --muted: #5b6675;
  --line: #d9dee5;
  --focus: #2563eb;
  --ok: #1d7a46;     --ok-bg: #e5f4ea;
  --warn: #9a6200;   --warn-bg: #fdf1dc;
  --danger: #b3261e; --danger-bg: #fbe7e6;
  --primary: var(--navy);
  --primary-ink: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .10);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419;
    --surface: #161c23;
    --surface-2: #1d252e;
    --ink: #e6e9ee;
    --muted: #9aa5b3;
    --line: #2a333e;
    --teal-ink: #4fd1c3;
    --ok: #5fcf8d;     --ok-bg: #0f2a1b;
    --warn: #e7b04c;   --warn-bg: #2b1f07;
    --danger: #f08a83; --danger-bg: #331412;
    --primary: var(--teal);
    --primary-ink: #0b1c1a;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
img, video { max-width: 100%; height: auto; }
a { color: var(--teal-ink); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 1.4em 0 .5em; }
h1 { font-size: 1.75rem; margin-top: .6em; }
h2 { font-size: 1.3rem; }
h3, .h3 { font-size: 1.1rem; }
p { margin: 0 0 .9em; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-bottom: 48px; min-height: 60vh; }
.narrow { max-width: 460px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: var(--radius); }

/* Header and footer */
.site-header { background: var(--navy); color: #fff; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 1.1rem; }
.brand-mark { display: inline-grid; place-items: center; background: #fff; border-radius: 8px; width: 36px; height: 36px; }
.site-nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 6px 0; }
.site-nav a, .site-nav .link-button { color: #fff; }
.site-nav a.active { text-decoration-thickness: 2px; text-decoration-color: var(--teal); }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; padding: 20px 0; }

/* Buttons and forms */
.button { display: inline-block; background: var(--primary); color: var(--primary-ink); border: 0; border-radius: var(--radius);
  padding: 11px 18px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; min-height: 44px; }
.button:hover { filter: brightness(1.1); }
.button-secondary { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.button-small { padding: 6px 12px; min-height: 36px; font-size: .95rem; }
.site-nav .button { background: var(--teal); color: #0b1c1a; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--teal-ink); text-decoration: underline; cursor: pointer; }
.inline-form { display: inline; margin: 0; }
label { font-weight: 600; }
input, select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; min-height: 44px; width: 100%; }
.stack { display: grid; gap: 10px; margin-bottom: 18px; }
.stack .button { justify-self: start; }
.error { color: var(--danger); background: var(--danger-bg); padding: 8px 12px; border-radius: var(--radius); margin: 0; }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); background: var(--warn-bg); padding: 8px 12px; border-radius: var(--radius); }

/* Home */
.hero { padding: 28px 0 8px; }
.hero h1 { font-size: 2rem; margin-top: .3em; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 46em; }
.start-here { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); max-width: 640px; }
.start-here .row { display: grid; gap: 10px; margin-top: 8px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 28px 0; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stats strong { display: block; font-size: 1.4rem; color: var(--teal-ink); }
.stats span { color: var(--muted); font-size: .95rem; }
.steps { list-style: none; padding: 0; display: grid; gap: 12px; counter-reset: step; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; counter-increment: step; }
.steps h3 { margin: 0 0 .3em; }
.steps h3::before { content: counter(step) ". "; color: var(--teal-ink); }
.steps p { margin: 0; color: var(--muted); }
.callout { background: var(--surface-2); border-left: 4px solid var(--teal); border-radius: var(--radius); padding: 4px 18px 18px; margin: 28px 0; }

/* Catalogue */
.filter { display: grid; gap: 8px; max-width: 520px; margin-bottom: 12px; }
.cards { display: grid; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card h2, .card h3 { margin: .2em 0 .4em; }
.card a { text-decoration: none; }
.card a:hover { text-decoration: underline; }
.card-muted { opacity: .8; box-shadow: none; }
.card-kicker { color: var(--muted); font-size: .9rem; margin: 0; display: flex; gap: 8px; align-items: center; }
.meta { color: var(--muted); font-size: .92rem; display: flex; flex-wrap: wrap; gap: 4px 14px; }
p.meta { display: block; }
.badge { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.level-foundation { color: var(--teal-ink); }
.crumbs { font-size: .92rem; color: var(--muted); margin-top: 16px; }

/* Course and lessons */
.course-action { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 16px 0; }
.course-list, .lesson-list { padding-left: 1.4em; }
.course-list li { margin-bottom: 18px; }
.course-list p { margin: .3em 0; }
.lesson-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.lesson-list li.done::marker { content: "✓  "; color: var(--ok); }
.ticks { padding-left: 1.2em; }
.ticks li::marker { content: "✓  "; color: var(--teal-ink); }
progress.progress { width: 100%; height: 10px; border: 0; border-radius: 999px; background: var(--surface-2); accent-color: var(--teal); margin: 6px 0; }
progress.progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
progress.progress::-webkit-progress-value { background: var(--teal); border-radius: 999px; }
progress.progress::-moz-progress-bar { background: var(--teal); border-radius: 999px; }

.lesson-layout { display: grid; gap: 24px; }
.lesson { min-width: 0; }
.objectives { background: var(--surface-2); border-radius: var(--radius); padding: 2px 16px 8px; margin: 12px 0 20px; }
.objectives h2 { font-size: 1rem; margin-top: .9em; }
.lesson-video { width: 100%; background: #000; border-radius: var(--radius); margin-bottom: 16px; }
.prose { font-size: 1.04rem; }
.prose img { border: 1px solid var(--line); border-radius: 6px; display: block; margin: 12px 0 4px; max-height: 480px; width: auto; }
.prose blockquote { margin: 16px 0; padding: 10px 16px; background: var(--warn-bg); border-left: 4px solid var(--warn); border-radius: 6px; }
.prose blockquote p:last-child { margin: 0; }
.prose code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.prose li { margin-bottom: .3em; }
.table-wrap { overflow-x: auto; margin: 12px 0 18px; }
.table { border-collapse: collapse; width: 100%; font-size: .95rem; background: var(--surface); }
.table th, .table td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.table th { background: var(--surface-2); }
.lesson-footer { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 18px; }
.lesson-nav { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px 12px; align-self: start; }
.lesson-nav h2 { font-size: 1rem; }
.lesson-nav ol { padding-left: 1.3em; margin: 0; }
.lesson-nav li { padding: 4px 0; }
.lesson-nav li.current a { font-weight: 700; color: var(--ink); }
.lesson-nav li.done::marker { content: "✓  "; color: var(--ok); }

/* Practice hotel */
.practice { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: var(--radius); padding: 4px 18px 18px; margin: 28px 0; }
.practice h2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.credentials { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; margin: 14px 0; }
.credentials dt { font-weight: 600; }
.credentials dd { margin: 0; overflow-wrap: anywhere; }
.credentials code { font-size: 1rem; }
.checks { padding-left: 1.2em; margin: 14px 0 6px; }
.checks li { padding: 6px 0; }
.checks li.right::marker { content: "✓  "; color: var(--ok); }
.checks li.wrong::marker { content: "✗  "; color: var(--danger); }
.checks p { margin: .2em 0 0; }
@media (max-width: 480px) { .credentials { grid-template-columns: 1fr; } .credentials dd { margin-bottom: 6px; } }

/* Test */
.facts { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.facts li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; }
.timer { position: sticky; top: 0; z-index: 2; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.timer-low { border-color: var(--danger); background: var(--danger-bg); }
.question { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 16px; }
.question legend { font-weight: 600; padding: 0 4px; float: left; width: 100%; margin-bottom: 10px; }
.question legend + * { clear: both; }
.q-number { display: block; font-size: .85rem; color: var(--muted); font-weight: 500; }
.hint { color: var(--muted); font-size: .92rem; clear: both; }
.option { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; clear: both; }
.option input { width: 22px; height: 22px; min-height: 0; margin-top: 2px; flex: none; accent-color: var(--teal); }
.option label { font-weight: 400; }
.letter { font-weight: 700; color: var(--muted); margin-right: 4px; }
.result { border-radius: var(--radius); padding: 4px 18px 18px; margin: 16px 0; border: 1px solid var(--line); }
.result-pass { background: var(--ok-bg); border-color: var(--ok); }
.result-fail { background: var(--warn-bg); border-color: var(--warn); }
.review { padding-left: 1.4em; }
.review li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.review li.right::marker { color: var(--ok); }
.review li.wrong::marker { color: var(--danger); }

/* Certificates */
.verify-status { border-radius: var(--radius); padding: 10px 16px; margin: 18px 0; border: 1px solid var(--line); }
.verify-status p { margin: 0; }
.status-valid { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.status-expired { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); }
.status-revoked { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.verify-status.status-valid, .verify-status.status-expired, .verify-status.status-revoked { color: var(--ink); }
.certificate { background: #fffdf8; color: #1b2430; border: 10px double #16314c; border-radius: 6px; padding: 28px 22px; text-align: center; margin: 0 auto 24px; max-width: 900px; }
.certificate-head { display: flex; justify-content: center; align-items: center; gap: 12px; }
.certificate-issuer { font-size: 1.5rem; margin: 0; color: #16314c; }
.certificate-lead { color: #5b6675; margin: 18px 0 4px; font-size: 1.05rem; }
.certificate-name { font-family: Georgia, "Times New Roman", serif; font-size: 2.1rem; margin: 0; color: #16314c; overflow-wrap: anywhere; }
.certificate-credential { font-size: 1.5rem; font-weight: 700; color: #0c7a70; margin: 0; }
.certificate-detail { color: #5b6675; margin: 10px auto 0; max-width: 34em; }
.certificate-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-top: 26px; text-align: left; flex-wrap: wrap; }
.certificate-foot dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: .92rem; }
.certificate-foot dt { color: #5b6675; }
.certificate-foot dd { margin: 0; overflow-wrap: anywhere; }
.certificate-qr svg { width: 112px; height: 112px; display: block; }
.certificate-actions .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.certificate-earned { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.certificates, .teams, .assigned { list-style: none; padding: 0; }
.certificates li, .teams li, .assigned li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.assigned li.overdue .meta { color: var(--danger); }
.assigned li.done .meta { color: var(--ok); }

/* Team dashboard */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 18px 18px; margin: 20px 0; }
.copy-row { display: flex; gap: 8px; flex-wrap: wrap; }
.copy-row input { flex: 1 1 280px; }
.assign-form { display: grid; gap: 8px; max-width: 520px; margin-bottom: 14px; }
.assign-form .button { justify-self: start; }
.tabs { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.tabs a[aria-current="page"] { font-weight: 700; color: var(--ink); }
tr.overdue td { background: var(--danger-bg); }
.team-table .badge { text-decoration: none; }
.row-actions { white-space: nowrap; }
.row-actions form { display: inline; margin-right: 10px; }

.staff-number { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; width: 100%; }
.staff-number input { width: auto; flex: 0 1 180px; min-height: 36px; padding: 6px 10px; }
.funnel { list-style: none; padding: 0; margin: 0 0 12px; }
.funnel li { display: grid; grid-template-columns: minmax(0, 1fr) 2fr 3em; gap: 10px; align-items: center; padding: 3px 0; }
.funnel-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 640px) { .stats.wide { grid-template-columns: repeat(4, 1fr); } }
.receipt { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 18px 14px; margin: 16px 0; }
.receipt dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; }
.receipt dd { margin: 0; overflow-wrap: anywhere; }
.pay h2 { margin-top: .8em; }

@media print {
  .site-header, .site-footer, .verify-status, .no-print, .skip, .ok-text { display: none !important; }
  body, main.wrap { background: #fff; padding: 0; }
  .certificate { border-width: 12px; margin: 0; max-width: none; page-break-inside: avoid; }
  @page { size: A4 landscape; margin: 12mm; }
}

@media (min-width: 640px) {
  .start-here .row { grid-template-columns: 1fr auto; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .filter { grid-template-columns: auto 1fr auto; align-items: center; }
}
@media (min-width: 960px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
  .lesson-layout { grid-template-columns: minmax(0, 1fr) 280px; }
  .hero h1 { font-size: 2.4rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
