/* =========================================================================
   Traffic Defence Kits — "Signal & Slate" design system
   Deep navy authority + signal-amber traffic cue + controlled stoplight green.
   ========================================================================= */

:root {
  --ink:        #0E1B2E;  /* deep navy — primary text + authority surfaces */
  --ink-soft:   #2A3B52;  /* secondary text */
  --ink-dim:    #5B6B82;  /* captions, muted */
  --canvas:     #F7F9FC;  /* page background (cool off-white) */
  --surface:    #FFFFFF;  /* cards */
  --surface-2:  #EEF2F8;  /* subtle fill / hover */

  --amber:      #E8920C;  /* signal amber — the traffic cue, accents */
  --amber-soft: #FDF3E2;
  --amber-deep: #C2780A;

  --go:         #1F8A4C;  /* stoplight green — go / free / success */
  --go-soft:    #E5F4EC;
  --stop:       #C8341F;  /* stoplight red — warnings ONLY */
  --stop-soft:  #FBEAE7;

  --line:       #E2E8F0;  /* borders / dividers */
  --line-strong:#CBD5E1;

  --radius:     14px;
  --radius-sm:  10px;
  --shadow-sm:  0 1px 2px rgba(14,27,46,.06), 0 1px 3px rgba(14,27,46,.08);
  --shadow-md:  0 8px 24px rgba(14,27,46,.10);
  --shadow-lg:  0 24px 60px rgba(14,27,46,.16);

  --maxw: 1140px;
  --font-body: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: 'Sora', var(--font-body);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,h2,h3,h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }
p  { margin: 0 0 1rem; }
a  { color: var(--amber-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--ink-dim); }
.center { text-align: center; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff;
  padding: 10px 16px; z-index: 100; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: .98rem;
  padding: .8rem 1.5rem; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .18s ease, background .18s ease;
  text-decoration: none; line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--amber); color: #fff; box-shadow: 0 6px 18px rgba(232,146,12,.32); }
.btn-primary:hover { background: var(--amber-deep); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #06101d; color: #fff; }
.btn-go { background: var(--go); color: #fff; }
.btn-go:hover { background: #166e3c; color:#fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-lg { padding: 1rem 1.9rem; font-size: 1.05rem; }
.btn-block { display: flex; width: 100%; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.88); backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 70px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .65rem; font-weight: 800; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-name { font-family: var(--font-display); font-size: 1.12rem; letter-spacing: -.02em; }
.brand-mark {
  display: inline-flex; flex-direction: column; gap: 3px; padding: 5px 4px;
  background: var(--ink); border-radius: 7px;
}
.brand-light { width: 9px; height: 9px; border-radius: 50%; opacity: .35; }
.brand-light--red { background: var(--stop); }
.brand-light--amber { background: var(--amber); opacity: 1; box-shadow: 0 0 8px rgba(232,146,12,.8); }
.brand-light--green { background: var(--go); }

.primary-nav { display: flex; align-items: center; gap: .35rem; }
.primary-nav a {
  color: var(--ink-soft); font-weight: 500; padding: .55rem .8rem; border-radius: 8px; font-size: .96rem;
}
.primary-nav a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.nav-ghost { border: 1.5px solid var(--line-strong); }
.nav-cta {
  background: var(--ink) !important; color: #fff !important; font-weight: 600 !important;
  font-family: var(--font-display); padding: .55rem 1.2rem !important;
}
.nav-cta:hover { background: #06101d !important; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; }

/* ---------- Flash messages ---------- */
.flash-stack { margin-top: 16px; display: grid; gap: 8px; }
.flash { padding: .8rem 1.1rem; border-radius: var(--radius-sm); font-weight: 500; border: 1px solid; }
.flash-success { background: var(--go-soft); border-color: #B6E0C6; color: #145c33; }
.flash-info { background: var(--amber-soft); border-color: #F4DBA8; color: #8a5a06; }
.flash-warning { background: var(--stop-soft); border-color: #F2C2BA; color: #8d2417; }
.flash-error { background: var(--stop-soft); border-color: #F2C2BA; color: #8d2417; }

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section-tight { padding: 48px 0; }
.section-ink { background: var(--ink); color: #E8EEF6; }
.section-ink h1, .section-ink h2, .section-ink h3 { color: #fff; }
.section-ink .muted { color: #9DB0C6; }
.eyebrow {
  display: inline-block; font-family: var(--font-display); font-weight: 700; font-size: .78rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--amber-deep);
  background: var(--amber-soft); padding: .35rem .8rem; border-radius: 999px; margin-bottom: 1rem;
}
.section-ink .eyebrow { background: rgba(232,146,12,.16); color: #F6B65A; }
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 60ch; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background:
  radial-gradient(1200px 520px at 80% -10%, rgba(232,146,12,.10), transparent 60%),
  linear-gradient(180deg, #fff, var(--canvas)); padding: 84px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.hero h1 { margin-bottom: .4em; }
.hero .lead { margin-bottom: 1.8rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 1.4rem; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 1.4rem; color: var(--ink-dim); font-size: .92rem; }
.hero-trust strong { color: var(--ink); }
.hero-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-lg); padding: 28px; position: relative;
}
.hero-card .pill-row { display: flex; gap: .5rem; margin-bottom: 1rem; }

/* ---------- Pills / chips ---------- */
.pill { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600;
  padding: .35rem .7rem; border-radius: 999px; background: var(--surface-2); color: var(--ink-soft); }
.pill-free { background: var(--go-soft); color: #145c33; }
.pill-amber { background: var(--amber-soft); color: var(--amber-deep); }

/* ---------- Grid + cards ---------- */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .2s ease, border-color .2s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }

/* Kit card */
.kit-card .kit-badge {
  width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center;
  font-size: 1.5rem; background: var(--ink); color: #fff; margin-bottom: 1rem;
}
.kit-card h3 { margin-bottom: .25rem; }
.kit-card .kit-offence { font-size: .85rem; color: var(--ink-dim); font-weight: 600; margin-bottom: .6rem; }
.kit-card p { color: var(--ink-soft); font-size: .96rem; flex: 1; }
.kit-card .kit-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 1.2rem; }
.kit-price { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; color: var(--ink); }
.kit-price.is-free { color: var(--go); }
.kit-stats { display: flex; gap: 1rem; margin: .4rem 0 0; flex-wrap: wrap; }
.kit-stats .stat { font-size: .8rem; color: var(--ink-dim); }
.kit-stats .stat strong { display: block; color: var(--ink); font-size: .95rem; }

/* ---------- Steps list ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.step-row {
  display: flex; align-items: center; gap: 1rem; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.step-row:hover { border-color: var(--line-strong); }
.step-num {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: #fff; font-weight: 700; font-family: var(--font-display); font-size: .95rem;
}
.step-row.done .step-num { background: var(--go); }
.step-row.locked { opacity: .62; }
.step-body { flex: 1; }
.step-body .step-title { font-weight: 600; color: var(--ink); }
.step-body .step-sum { font-size: .88rem; color: var(--ink-dim); }
.step-lock { font-size: .8rem; color: var(--ink-dim); }

/* ---------- Step / lesson reader ---------- */
.reader { display: grid; grid-template-columns: 260px 1fr; gap: 40px; align-items: start; }
.reader-side { position: sticky; top: 90px; }
.reader-side ol { list-style: none; padding: 0; margin: 0; counter-reset: s; display: grid; gap: 4px; }
.reader-side li a { display: block; padding: .55rem .7rem; border-radius: 8px; color: var(--ink-soft); font-size: .92rem; }
.reader-side li a:hover { background: var(--surface-2); text-decoration: none; }
.reader-side li.active a { background: var(--ink); color: #fff; }
.reader-side li.done a::before { content: "✓ "; color: var(--go); font-weight: 700; }
.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.6em; }
.video-wrap { position: relative; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden;
  margin: 0 0 1.5rem; box-shadow: var(--shadow-md); background: #000; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.reader-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem;
  border-top: 1px solid var(--line); padding-top: 1.5rem; }

/* ---------- Resources / docs ---------- */
.resource-row, .doc-row {
  display: flex; align-items: center; gap: 1rem; padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px;
}
.resource-ic { width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center;
  background: var(--amber-soft); color: var(--amber-deep); font-weight: 700; font-size: .8rem; }
.doc-row .resource-ic { background: var(--go-soft); color: #145c33; }
.resource-row .meta, .doc-row .meta { flex: 1; }
.resource-row .meta strong, .doc-row .meta strong { display: block; }
.resource-row .meta span, .doc-row .meta span { font-size: .85rem; color: var(--ink-dim); }

/* ---------- Forms ---------- */
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 32px; max-width: 560px; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .35rem; color: var(--ink); }
.field .help { font-size: .82rem; color: var(--ink-dim); margin-top: .25rem; }
input[type=text], input[type=email], input[type=date], input[type=number],
input[type=password], select, textarea {
  width: 100%; padding: .8rem .9rem; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 1rem; color: var(--ink); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(232,146,12,.18); }
textarea { resize: vertical; }
.errorlist { color: var(--stop); font-size: .85rem; list-style: none; padding: 0; margin: .3rem 0 0; }

/* Document preview */
.doc-preview { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 40px; box-shadow: var(--shadow-md); white-space: pre-wrap; font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.7; color: #16202e; }

/* ---------- Banner / access gate ---------- */
.gate { background: var(--ink); color: #E8EEF6; border-radius: var(--radius); padding: 28px 30px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.2rem; }
.gate h3 { color: #fff; margin: 0; }
.gate .muted { color: #9DB0C6; }

/* progress bar */
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--go); border-radius: 999px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #B7C4D6; margin-top: 80px; padding: 56px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
.footer-brand { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; color: #fff; margin-bottom: .6rem; }
.site-footer a { color: #CBD7E6; }
.footer-h { font-family: var(--font-display); font-weight: 700; color: #fff; margin-bottom: .8rem; font-size: .95rem; }
.footer-nav { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.footer-disclaimer { margin-top: 36px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12);
  font-size: .82rem; color: #8FA0B6; line-height: 1.6; }
.footer-disclaimer strong { color: #D7E0EC; }
.footer-bottom { margin-top: 16px; font-size: .85rem; color: #7C8DA4; }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--line); margin: 2rem 0; }
.tag-list { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .reader, .grid-3, .grid-2, .footer-grid { grid-template-columns: 1fr; }
  .reader-side { position: static; }
  .nav-toggle { display: flex; }
  .primary-nav {
    position: absolute; top: 70px; left: 0; right: 0; background: #fff; flex-direction: column;
    align-items: stretch; padding: 12px 24px 20px; gap: 4px; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md); display: none;
  }
  .primary-nav.open { display: flex; }
  .primary-nav a { padding: .8rem .6rem; }
  .nav-cta { text-align: center; }
}
