/* Harrap Cyber Security Self-Assessment
   Colours and type follow the Harrap brand guidelines (April 2026). */
:root {
  --blue: #556dd6;        /* Logo blue: headers and backgrounds */
  --blue-dark: #4459b8;
  --coral: #fe5f55;       /* Logo red: accents */
  --ink: #383f51;         /* Dark grey: text */
  --light: #d8e4ff;       /* Light blue */
  --chalk: #f7f7ff;       /* Chalk: web forms */
  --grey: #abb8c3;        /* Mid grey: outlines */
  --green: #06ba63;       /* Bold green: buttons */
  --rag-red: #cf2e2e;
  --rag-amber: #ff6900;
  --rag-green: #06ba63;
  --mint: #dff3e6;
  --btn-radius: 5px 5px 20px 5px;
  --wrap: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: #fff; color: var(--ink);
  font-family: Roboto, Arial, sans-serif; font-weight: 300; font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
strong, b { font-weight: 500; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0 0 .6em; text-wrap: balance; }
h1 { font-weight: 300; font-size: clamp(2rem, 5vw, 3.25rem); }
h1 strong { font-weight: 500; }
h2 { font-weight: 300; font-size: clamp(1.6rem, 3.2vw, 2.25rem); }
h2 strong { font-weight: 500; }
h3 { font-weight: 500; font-size: 1.15rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 860px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none; text-align: center;
  font: 500 1rem/1.2 Roboto, Arial, sans-serif; padding: 13px 24px; border-radius: var(--btn-radius);
  background: var(--green); color: #fff; transition: filter .15s, transform .15s;
}
.btn:hover { filter: brightness(.93); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-dark { background: var(--ink); }
.btn-blue { background: var(--blue); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--grey); }
.btn-ghost:hover { color: var(--ink); background: var(--chalk); filter: none; }
.btn-danger { background: var(--rag-red); }
.btn-sm { padding: 8px 14px; font-size: .9rem; }

/* ---------- Header ---------- */
.site-header { background: var(--blue); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand svg { height: 36px; width: auto; display: block; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a:not(.btn) { color: #fff; text-decoration: none; font-weight: 400; font-size: .95rem; }
.nav a:not(.btn):hover { text-decoration: underline; }
.nav .btn { padding: 9px 16px; font-size: .95rem; }
@media (max-width: 760px) { .nav a:not(.btn) { display: none; } }

/* ---------- Hero ---------- */
.hero-shell { padding: 12px 12px 0; background: linear-gradient(#d8e4ff, #fff 70%); }
.hero {
  position: relative; overflow: hidden; border-radius: 12px; background: var(--blue); color: #fff;
  max-width: 1400px; margin: 0 auto; padding: clamp(48px, 9vw, 110px) clamp(20px, 6vw, 80px);
}
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.12); pointer-events: none; }
.hero::before { width: 520px; height: 520px; right: -140px; top: -220px; }
.hero::after { width: 420px; height: 420px; left: -210px; bottom: -260px; }
.hero .dot { position: absolute; right: 7%; bottom: 14%; width: 64px; height: 64px; border-radius: 50%; background: var(--coral); }
.hero .dot.small { right: auto; left: 5%; bottom: 10%; width: 26px; height: 26px; background: rgba(255,255,255,.6); }
.hero > * { position: relative; z-index: 1; }
.hero h1 { color: #fff; max-width: 15em; margin-bottom: .4em; }
.hero p { font-size: clamp(1.05rem, 2vw, 1.3rem); max-width: 34em; margin-bottom: 1.4em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero .btn-ghost { color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.7); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.14); color: #fff; }

/* ---------- Sections ---------- */
section { padding: clamp(40px, 7vw, 80px) 0; scroll-margin-top: 64px; }
.section-tint { background: var(--chalk); }
.lede { font-size: 1.15rem; max-width: 46em; }
.eyebrow { color: var(--blue); font-weight: 500; letter-spacing: .04em; text-transform: uppercase; font-size: .8rem; margin-bottom: .6em; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 24px; margin-top: 28px; }
.card { border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; background: var(--light); }
.card-art { background: linear-gradient(var(--mint), #f6fbf7); padding: 28px; display: flex; justify-content: center; }
.card-art svg { height: 120px; width: auto; }
.card-body { padding: 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body h3 { font-size: 1.35rem; margin: 0; }
.card-body ul { margin: 0 0 8px; padding-left: 1.1em; }
.card-body .btn { align-self: flex-start; margin-top: auto; }
.tag { display: inline-block; align-self: flex-start; background: #fff; color: var(--blue); font-weight: 500; font-size: .8rem; padding: 3px 10px; border-radius: 99px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 24px; margin-top: 28px; counter-reset: step; padding: 0; list-style: none; }
.steps li { counter-increment: step; background: #fff; border-radius: 8px; padding: 24px; border-left: 5px solid var(--coral); box-shadow: 0 1px 0 var(--light); }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 500; margin-bottom: 12px; }
.steps h3 { margin-bottom: .3em; }
.steps p { margin: 0; }

.area-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 28px; padding: 0; list-style: none; }
.area-grid li { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 8px; background: var(--chalk); }
.area-grid .num { flex: none; width: 34px; height: 34px; border-radius: 8px; background: var(--light); color: var(--blue); font-weight: 500; display: grid; place-items: center; }
.area-grid b { display: block; }
.area-grid span.d { font-size: .92rem; }

.callout { background: var(--chalk); border-left: 6px solid var(--blue); padding: 16px 20px; border-radius: 0 6px 6px 0; margin: 1.2em 0; }
.callout.coral { border-left-color: var(--coral); }
.callout p:last-child { margin-bottom: 0; }

.rag-key { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 1.2em 0; border-radius: 6px; overflow: hidden; }
.rag-key div { color: #fff; padding: 12px 16px; font-weight: 400; }
.rag-key b { font-weight: 700; margin-right: 6px; }
.bg-red { background: var(--rag-red); } .bg-amber { background: var(--rag-amber); } .bg-green { background: var(--rag-green); } .bg-na { background: var(--grey); }

/* ---------- Footer ---------- */
.site-footer { background: var(--chalk); border-top: 4px solid var(--light); padding: 36px 0; font-size: .9rem; }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 24px 60px; justify-content: space-between; }
.site-footer svg { height: 34px; width: auto; }
.site-footer p { margin: 0 0 .5em; }
.legal { color: #6b7385; font-size: .82rem; margin-top: 20px; }

/* ---------- Assessment form ---------- */
.form-page { background: #fff; min-height: 70vh; }
.form-head { background: var(--blue); color: #fff; padding: 28px 0 56px; }
.form-head h1 { color: #fff; font-size: clamp(1.5rem, 3.4vw, 2.2rem); margin: 0 0 .2em; }
.form-head p { margin: 0; opacity: .92; }
.panel { background: var(--chalk); border-radius: 10px; padding: clamp(18px, 4vw, 36px); margin-top: -34px; position: relative; border: 1px solid var(--light); }
.progress { height: 8px; background: var(--light); border-radius: 99px; overflow: hidden; margin: 6px 0 22px; }
.progress i { display: block; height: 100%; width: 0; background: var(--green); border-radius: 99px; transition: width .3s; }
.step-meta { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; font-weight: 400; color: var(--blue); }
.step-title { border-left: 6px solid var(--coral); background: var(--blue); color: #fff; padding: 14px 18px; border-radius: 0 6px 6px 0; margin: 0 0 6px; font-weight: 500; font-size: 1.4rem; }
.step-intro { margin: 10px 0 20px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 500; margin-bottom: 6px; }
.field .opt { font-weight: 300; color: #6b7385; }
.field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=password], .field select, .field textarea {
  width: 100%; font: inherit; font-weight: 400; color: var(--ink); background: #fff;
  border: 1.5px solid var(--grey); border-radius: 6px; padding: 11px 12px;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); outline: 3px solid var(--light); }
.field .err { color: var(--rag-red); font-weight: 400; font-size: .9rem; margin-top: 4px; display: none; }
.field.invalid .err { display: block; }
.field.invalid input, .field.invalid select { border-color: var(--rag-red); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 20px; }
.hp { position: absolute; left: -9999px; }

.consent { background: #fff; border: 1.5px solid var(--light); border-radius: 8px; padding: 16px 18px; margin: 8px 0 18px; }
.consent label { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.consent input { width: 22px; height: 22px; flex: none; margin-top: 3px; accent-color: var(--blue); }
.consent.invalid { border-color: var(--rag-red); }

.q { background: #fff; border-radius: 8px; padding: 18px 20px; margin-bottom: 14px; border: 1.5px solid transparent; }
.q.invalid { border-color: var(--rag-red); }
.q fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.q legend { padding: 0; font-weight: 400; font-size: 1.05rem; margin-bottom: 4px; }
.q legend b { display: block; color: var(--blue); font-size: .85rem; letter-spacing: .02em; }
.q .help { font-size: .92rem; color: #5d6578; margin: 2px 0 0; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.opts label { position: relative; cursor: pointer; }
.opts input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.opts span { display: block; padding: 9px 16px; border-radius: 99px; background: var(--chalk); border: 1.5px solid var(--light); font-weight: 400; font-size: .95rem; user-select: none; }
.opts label:hover span { border-color: var(--blue); }
.opts input:focus-visible + span { outline: 3px solid var(--coral); outline-offset: 2px; }
.opts input:checked + span { color: #fff; border-color: transparent; background: var(--blue); }
.opts input[value=yes]:checked + span { background: var(--rag-green); }
.opts input[value=partly]:checked + span { background: var(--rag-amber); }
.opts input[value=no]:checked + span { background: var(--rag-red); }
.opts input[value=unsure]:checked + span, .opts input[value=na]:checked + span { background: var(--ink); }

.form-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.form-msg { color: var(--rag-red); font-weight: 400; margin-top: 12px; min-height: 1.4em; }
.notice { background: #fff4e5; border-left: 6px solid var(--rag-amber); padding: 12px 16px; border-radius: 0 6px 6px 0; margin-bottom: 18px; font-weight: 400; }

/* ---------- Results ---------- */
.overall { display: flex; align-items: stretch; border-radius: 8px; overflow: hidden; background: #fff; margin: 18px 0; }
.overall .badge { color: #fff; padding: 22px 26px; font-weight: 700; font-size: 1.5rem; display: grid; place-items: center; min-width: 150px; text-align: center; }
.overall .txt { padding: 16px 22px; }
.overall .txt b { font-size: 1.15rem; }
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; background: #fff; font-size: .95rem; }
table.data th { background: var(--ink); color: #fff; font-weight: 500; text-align: left; padding: 10px 12px; white-space: nowrap; }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--light); vertical-align: top; font-weight: 400; }
table.data tbody tr:nth-child(even) td { background: var(--chalk); }
.chip { display: inline-block; min-width: 68px; text-align: center; color: #fff; font-weight: 700; font-size: .78rem; letter-spacing: .04em; padding: 4px 10px; border-radius: 4px; }
.result-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 6px; }

/* ---------- Prose (terms) ---------- */
.prose h2 { font-size: 1.5rem; font-weight: 500; color: var(--blue); margin-top: 1.6em; padding-bottom: .3em; border-bottom: 3px solid var(--light); }
.prose h3 { margin-top: 1.4em; }
.prose li { margin-bottom: .4em; }
.page-title { border-left: 8px solid var(--coral); background: var(--blue); color: #fff; padding: 22px 26px; font-weight: 500; font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin: 0 0 24px; }

/* ---------- Admin ---------- */
.admin { background: var(--chalk); font-size: 15px; font-weight: 400; min-height: 100vh; }
.admin .site-header { position: static; }
.admin main { padding: 26px 0 60px; }
.admin h1 { font-size: 1.7rem; font-weight: 500; }
.admin .box { background: #fff; border: 1px solid var(--light); border-radius: 8px; padding: 20px; margin-bottom: 20px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--light); border-radius: 8px; padding: 14px 16px; border-top: 5px solid var(--blue); }
.stat b { display: block; font-size: 1.8rem; font-weight: 500; line-height: 1.1; }
.stat.red { border-top-color: var(--rag-red); } .stat.amber { border-top-color: var(--rag-amber); } .stat.green { border-top-color: var(--rag-green); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters .field { margin: 0; min-width: 150px; flex: 1; }
.filters .field label { font-size: .85rem; }
.filters .field input, .filters .field select { padding: 8px 10px; }
.login-box { max-width: 420px; margin: 8vh auto; }
.flash { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; background: #e6f8ef; border-left: 6px solid var(--green); }
.flash.error { background: #fdeaea; border-left-color: var(--rag-red); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.kv dt { color: #6b7385; } dl.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.muted { color: #6b7385; }
.pager { display: flex; gap: 10px; align-items: center; margin-top: 14px; }

/* ---------- Digital standards additions ---------- */
.core-tag { display: inline-block; background: var(--coral); color: #fff; font-weight: 500; font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; padding: 3px 10px; border-radius: 99px; vertical-align: middle; }
.core-tag.wider { background: var(--blue); }
.std-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 12px 0 0; font-size: .92rem; font-weight: 400; }
.std-meta .due { color: #5d6578; }
.overall.secondary { margin-top: -6px; }
.overall.secondary .badge { font-size: 1.15rem; padding: 14px 20px; }
.overall.secondary .txt b { font-size: 1rem; }
table.data tr.group td { background: var(--light) !important; color: var(--blue); font-weight: 500; padding: 8px 12px; }

.group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 34px 0 0; }
.group-head h3 { margin: 0; font-size: 1.3rem; }
.area-grid.core li { background: #fff; border-left: 5px solid var(--coral); box-shadow: 0 1px 0 var(--light); }
.area-grid.core .num { background: var(--coral); color: #fff; }
.area-grid a.more { display: inline-block; margin-top: 4px; font-size: .85rem; font-weight: 400; }
.area-grid .due { display: block; font-size: .8rem; color: var(--blue); font-weight: 500; margin-top: 2px; }

.countdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 28px; }
.countdown div { background: #fff; border-radius: 8px; padding: 22px; border-top: 5px solid var(--blue); }
.countdown div.hl { border-top-color: var(--coral); }
.countdown b { display: block; font-size: 2.2rem; font-weight: 500; color: var(--blue); line-height: 1.1; margin-bottom: 6px; }
.countdown div.hl b { color: var(--coral); }
