/* ============================================================
   Public site design system — Temporary Works Consulting & Design Ltd
   Original identity. Layout patterns adapted from leading ISO consultancy
   sites; no third-party branding, colours copied, or trade dress.

   Contrast: all text colours here meet WCAG AA on their backgrounds.
   Measured: #16202c on #fff 14.9:1 · #47535f on #fff 7.4:1 ·
   #0b6cb3 on #fff 5.5:1 · #0b6b72 on #fff 6.0:1 · #b45309 on #fff 4.6:1 ·
   #fff on #0b2c4d 12.5:1 · #dbe6f2 on #0b2c4d 9.8:1 · #16202c on #f2a71b 9.4:1
   ============================================================ */

:root {
  --navy: #0b2c4d;          /* headers, primary surfaces */
  --navy-deep: #071b31;     /* header bar */
  --ink: #16202c;           /* body text */
  --muted: #47535f;         /* secondary text (7.4:1 on white) */
  --teal: #0b6b72;          /* support/compliance accent (text-safe) */
  --teal-soft: #e3f2f3;
  --blue-link: #0b6cb3;     /* links (5.5:1, AA) */
  --amber: #f2a71b;         /* action fills; always with --ink text */
  --amber-text: #b45309;    /* amber as text (4.6:1) */
  --red-text: #a02525;      /* urgent/non-compliant text */
  --red-soft: #fae3e3;
  --green-text: #0a6b0a;    /* verified completion only */
  --green-soft: #e2f4e2;
  --bg: #f4f7fb;            /* page background */
  --bg-alt: #eef2f7;        /* catalogue background */
  --card: #ffffff;
  --line: #d9e1ea;
  --shadow: 0 1px 2px rgba(11, 44, 77, .06), 0 8px 24px rgba(11, 44, 77, .07);
  --radius: 14px;
  --radius-lg: 20px;
  --max: 1180px;
  --header-h: 64px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1rem/1.6 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-text-size-adjust: 100%;
}
body.text-lg { font-size: 1.125rem; }

img, svg { max-width: 100%; height: auto; }
a { color: var(--blue-link); }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--blue-link); outline-offset: 2px; border-radius: 4px; }
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 300;
  background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 0 0 10px 0;
}
.skip:focus { left: 0; }

h1, h2, h3 { line-height: 1.2; color: var(--navy); margin: 0 0 .5em; font-weight: 800; }
/* Clamped so long standard names never become six-line banners on a phone */
h1 { font-size: clamp(1.65rem, 4.5vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.9rem); }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
section { padding: 48px 0; }
.section-alt { background: var(--bg-alt); }
.section-navy { background: var(--navy); color: #fff; }
.section-navy h2, .section-navy h3 { color: #fff; }
.section-navy p { color: #dbe6f2; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--navy-deep); color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.header-bar {
  max-width: var(--max); margin: 0 auto; padding: 0 16px;
  min-height: var(--header-h);
  display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand img { width: 38px; height: 38px; flex: none; }
.brand b { font-size: .95rem; line-height: 1.15; display: block; }
.brand .sub { font-size: .72rem; color: #b8c8da; display: block; }
.header-spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px; border-radius: 999px;
  font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: filter .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); }
.btn-quote { background: var(--amber); color: var(--ink); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: .875rem; }

.header-login { color: #fff; border-color: rgba(255,255,255,.55); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 10px; border: 0;
  background: transparent; color: #fff; cursor: pointer; flex: none;
}
.icon-btn:hover { background: rgba(255,255,255,.1); }

.main-nav { display: flex; gap: 2px; align-items: center; }
.main-nav a {
  color: #e6edf5; text-decoration: none; font-weight: 600; font-size: .93rem;
  padding: 10px 12px; border-radius: 8px; min-height: 44px; display: inline-flex; align-items: center;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { background: rgba(255,255,255,.1); color: #fff; }

/* Mobile menu */
.menu-toggle { display: none; }
@media (max-width: 980px) {
  .main-nav, .header-login, .btn-quote.header-cta { display: none; }
  .menu-toggle { display: inline-flex; }
  /* Keep the header to one compact line on phones: tagline goes, name shrinks.
     The 180px headers in the reference screenshots are the failure to avoid. */
  .brand .sub { display: none; }
  .brand b { font-size: .82rem; max-width: 46vw; }
}
.mobile-menu {
  position: fixed; inset: 0; z-index: 200; display: none;
}
.mobile-menu.open { display: block; }
.mobile-menu .backdrop { position: absolute; inset: 0; background: rgba(7, 27, 49, .6); border: 0; width: 100%; height: 100%; }
.mobile-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(84vw, 360px);
  background: var(--navy-deep); color: #fff; padding: 16px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
}
.mobile-panel a {
  color: #fff; text-decoration: none; font-weight: 600; font-size: 1.05rem;
  padding: 12px 14px; border-radius: 10px; min-height: 48px; display: flex; align-items: center;
}
.mobile-panel a:hover { background: rgba(255,255,255,.1); }
.mobile-panel .menu-group { color: #8fa5bb; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; margin: 14px 14px 4px; }
.mobile-panel .btn { margin: 6px 8px; }

/* ---------- Search ---------- */
.search-box { position: relative; }
.search-panel {
  position: fixed; top: 0; left: 0; right: 0; z-index: 210;
  background: var(--navy-deep); padding: 14px 16px 18px; display: none;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.search-panel.open { display: block; }
.search-row { max-width: 720px; margin: 0 auto; display: flex; gap: 8px; }
.search-row input {
  flex: 1; min-height: 48px; border-radius: 10px; border: 0; padding: 0 16px;
  font: inherit; font-size: 1.05rem;
}
.search-results {
  max-width: 720px; margin: 10px auto 0; background: #fff; border-radius: 12px;
  max-height: min(60vh, 480px); overflow-y: auto; box-shadow: var(--shadow);
}
.search-results:empty { display: none; }
.search-results a {
  display: flex; gap: 10px; align-items: baseline; padding: 12px 16px;
  text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line);
}
.search-results a:hover, .search-results a:focus { background: var(--bg); }
.search-results .r-title { font-weight: 600; }
.search-results .r-note { color: var(--muted); font-size: .85rem; }

/* ---------- Badges & chips ---------- */
.badge {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; letter-spacing: .01em;
}
.badge-ok { background: var(--green-soft); color: var(--green-text); }
.badge-info { background: var(--teal-soft); color: var(--teal); }
.badge-warn { background: var(--red-soft); color: var(--red-text); }
.badge-type { background: #e6edf5; color: var(--navy); }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(160deg, var(--navy-deep) 0%, var(--navy) 70%, #123d68 100%); color: #fff; padding: 56px 0 60px; }
.hero h1 { color: #fff; max-width: 18ch; }
.hero .lead { color: #dbe6f2; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.trust-strip { background: var(--navy); border-top: 1px solid rgba(255,255,255,.12); }
.trust-strip ul {
  max-width: var(--max); margin: 0 auto; padding: 14px 20px;
  display: flex; flex-wrap: wrap; gap: 8px 28px; list-style: none;
  color: #dbe6f2; font-size: .875rem;
}
.trust-strip li { display: flex; gap: 8px; align-items: center; }
.trust-strip svg { flex: none; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border-radius: var(--radius-lg); padding: 24px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px;
  border: 1px solid rgba(217, 225, 234, .6);
}
.card .icon-ring {
  width: 52px; height: 52px; border-radius: 14px; background: var(--teal-soft);
  color: var(--teal); display: grid; place-items: center; flex: none;
}
.card h3 a { color: var(--navy); text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card .card-text { color: var(--muted); font-size: .93rem; flex: 1; }
.card .card-cta { margin-top: auto; align-self: flex-start; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* stretched-link cards stay accessible: the whole card is clickable but the
   link keeps its name; focus ring shows on the card */
.card { position: relative; }
.card a.stretch::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg); }
.card:has(a.stretch:focus-visible) { outline: 3px solid var(--blue-link); outline-offset: 2px; }

/* ---------- Steps ---------- */
.steps { counter-reset: step; }
.step { display: flex; gap: 16px; align-items: flex-start; }
.step-num {
  counter-increment: step; flex: none; width: 44px; height: 44px; border-radius: 50%;
  background: var(--amber); color: var(--ink); font-weight: 800; font-size: 1.15rem;
  display: grid; place-items: center;
}
.step-num::before { content: counter(step); }

/* ---------- Preview tiles (illustrative, built from real module data) ---------- */
.preview { border-radius: var(--radius); background: #fff; border: 1px solid var(--line); padding: 16px; }
.preview .p-head { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.preview .p-big { font-size: 1.7rem; font-weight: 800; color: var(--navy); }
.meter { height: 8px; border-radius: 999px; background: var(--bg-alt); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--teal); }

/* ---------- Tables ---------- */
.table-wrap { max-width: 100%; overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
table.site { border-collapse: collapse; width: 100%; font-size: .93rem; }
table.site th { text-align: left; background: var(--bg-alt); color: var(--navy); padding: 10px 14px; }
table.site td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: top; }

/* ---------- Notices ---------- */
.notice {
  border-radius: var(--radius); padding: 16px 20px; margin: 0 0 20px;
  border-left: 5px solid var(--teal); background: var(--teal-soft);
}
.notice-warn { border-left-color: var(--red-text); background: var(--red-soft); }
.notice-warn b { color: var(--red-text); }
.notice p:last-child { margin: 0; }

/* ---------- Checklists ---------- */
.checklist { list-style: none; padding: 0; margin: 0 0 20px; counter-reset: item; }
.checklist li {
  counter-increment: item; display: flex; gap: 14px; padding: 12px 0;
  border-bottom: 1px solid var(--line); align-items: flex-start;
}
.checklist li::before {
  content: counter(item); flex: none; width: 30px; height: 30px; border-radius: 8px;
  background: var(--bg-alt); color: var(--navy); font-weight: 700; font-size: .9rem;
  display: grid; place-items: center;
}

/* ---------- Accordions (FAQ) ---------- */
details.faq { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 10px; }
details.faq summary {
  cursor: pointer; font-weight: 700; color: var(--navy); padding: 14px 18px;
  list-style: none; display: flex; justify-content: space-between; gap: 10px; min-height: 48px; align-items: center;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-size: 1.3rem; color: var(--teal); flex: none; }
details.faq[open] summary::after { content: "–"; }
details.faq .faq-body { padding: 0 18px 16px; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: #b8c8da; font-size: .9rem; margin-top: 40px; }
.site-footer a { color: #dbe6f2; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; padding: 44px 0 24px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h3 { color: #fff; font-size: .95rem; margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.footer-legal { border-top: 1px solid rgba(255,255,255,.12); padding: 18px 0 26px; font-size: .82rem; }

/* ---------- Support panel (never obstructs content) ---------- */
.support-tab {
  position: fixed; right: 14px; bottom: 14px; z-index: 90;
  min-height: 48px; border-radius: 999px; padding: 10px 18px;
  background: var(--teal); color: #fff; font-weight: 700; border: 0; cursor: pointer;
  box-shadow: var(--shadow); display: inline-flex; align-items: center; gap: 8px;
}
.support-panel {
  position: fixed; right: 14px; bottom: 72px; z-index: 95; width: min(92vw, 320px);
  background: #fff; border-radius: var(--radius-lg); box-shadow: 0 12px 40px rgba(7,27,49,.25);
  padding: 18px; display: none;
}
.support-panel.open { display: block; }
.support-panel h3 { font-size: 1rem; }
.support-panel .btn { width: 100%; margin-top: 8px; }
.support-panel .a11y-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
/* Reading columns keep clear of the tab: matching padding, so the tab never
   sits over the last line of content (the reference screenshots' failure). */
main { padding-bottom: 84px; }
@media (max-width: 620px) {
  /* Icon-only on phones so the tab never covers a form field's full width */
  .support-tab { padding: 0; width: 52px; height: 52px; justify-content: center; }
  .support-tab .support-label { position: absolute; left: -9999px; }
}

/* ---------- Print: resource checklists print as the download ---------- */
@media print {
  .site-header, .site-footer, .support-tab, .support-panel, .no-print, .search-panel, .mobile-menu { display: none !important; }
  body { background: #fff; }
  main { padding-bottom: 0; }
  .card, .table-wrap { box-shadow: none; border: 1px solid #999; }
  .checklist li { break-inside: avoid; }
  .checklist li::after { content: ""; flex: none; width: 18px; height: 18px; border: 1.5px solid #333; border-radius: 4px; margin-left: auto; }
  a[href^="http"]::after { content: ""; }
}
