/* Ennerdale Consulting training — palette taken from the induction deck (Style B) */
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("../fonts/Poppins-Regular.ttf") format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("../fonts/Poppins-Medium.ttf") format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("../fonts/Poppins-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url("../fonts/Poppins-Bold.ttf") format("truetype"); }
@font-face { font-family: "Rubik"; font-weight: 300 900; font-display: swap; src: url("../fonts/Rubik-VariableFont_wght.ttf") format("truetype"); }

:root {
  --charcoal: #3f3f3f;
  --ink: #262626;
  --sage: #8a9a5b;
  --olive: #6b7b47;
  --forest: #3d524d;
  --sage-light: #cdd3c3;
  --sage-pale: #eef1e8;
  --lime: #c6ce85;
  --line: #e2e5dc;
  --muted: #6f7268;
  --red: #a3443a;
  --red-pale: #f7e9e6;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(38, 38, 38, .07);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #fff; color: var(--charcoal); font: 16px/1.6 "Rubik", system-ui, sans-serif; display: flex; flex-direction: column; min-height: 100vh; }
h1, h2, h3, legend, .brand-name, .btn, .stat-num { font-family: "Poppins", system-ui, sans-serif; color: var(--ink); }
h1 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.2; font-weight: 600; margin: .2em 0 .4em; }
h2 { font-size: 1.25rem; font-weight: 600; margin: .2em 0 .5em; }
a { color: var(--olive); }
a:hover { color: var(--forest); }
p { margin: 0 0 .8em; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
main.wrap { flex: 1; padding-top: 28px; padding-bottom: 48px; }
main.wide, .wrap.wide { max-width: 1280px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.lead { font-size: 1.1rem; max-width: 70ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 600; color: var(--olive); margin-bottom: .3em; }
.crumbs { font-size: .875rem; color: var(--muted); margin-bottom: 1em; }
.crumbs a { color: var(--muted); }
.section-title { margin-top: 2em; padding-bottom: .3em; border-bottom: 2px solid var(--sage-light); }

/* Header & footer */
.site-header { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { text-decoration: none; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 8px 0; }
.brand-name { font-weight: 600; font-size: 1.2rem; color: var(--ink); }
.brand-sub { font-size: .85rem; color: var(--olive); border-left: 2px solid var(--sage); padding-left: 10px; }
.header-nav { display: flex; align-items: center; gap: 18px; font-size: .95rem; flex-wrap: wrap; }
.header-nav a { text-decoration: none; color: var(--charcoal); }
.header-nav a:hover { color: var(--olive); }
.header-nav .who { color: var(--muted); }
.inline { display: inline; margin: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--olive); font: inherit; cursor: pointer; text-decoration: underline; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; padding: 18px 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--olive); }
.privacy { max-width: 70ch; }
.privacy p { margin: 0 0 1em; }

/* Buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 22px; border-radius: 999px; border: 2px solid transparent; font-weight: 500; font-size: .95rem; text-decoration: none; cursor: pointer; line-height: 1.2; transition: background .15s, border-color .15s, color .15s; }
.btn-primary { background: var(--olive); color: #fff; }
.btn-primary:hover { background: var(--forest); color: #fff; }
.btn-secondary { background: #fff; color: var(--forest); border-color: var(--sage); }
.btn-secondary:hover { background: var(--sage-pale); color: var(--forest); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-block { width: 100%; margin-top: 18px; }
label { display: block; font-weight: 500; margin: 14px 0 6px; color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=search], select {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--sage-light); border-radius: 8px; font: inherit; color: var(--ink); background: #fff; }
input:focus, select:focus, .btn:focus-visible, .option:focus-within { outline: 3px solid var(--lime); outline-offset: 1px; border-color: var(--sage); }
.alert { background: var(--red-pale); border-left: 4px solid var(--red); padding: 10px 14px; border-radius: 6px; margin-bottom: 8px; }
.alert p { margin: 0; }
.flash { background: var(--sage-pale); border-left: 4px solid var(--sage); padding: 10px 14px; border-radius: 6px; margin-bottom: 18px; }
.field-error { color: var(--red); font-weight: 500; margin: 10px 0 0; }

/* Cards */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.narrow { max-width: 460px; margin: 30px auto; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #f0f0ee; color: var(--muted); white-space: nowrap; }
.badge-pass { background: var(--sage-pale); color: var(--forest); border: 1px solid var(--sage-light); }
.badge-fail { background: var(--red-pale); color: var(--red); }

/* Welcome */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; padding: 20px 0; }
.hero h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.steps { list-style: none; padding: 0; margin: 24px 0 0; }
.steps li { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.steps span { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--sage); color: #fff; font-family: "Poppins"; font-weight: 600; font-size: .9rem; flex: none; }
.signin-card { border-top: 6px solid var(--sage); }

/* Courses */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; margin-top: 20px; }
.course-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.course-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-bottom: 1px solid var(--line); display: block; }
.course-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.course-body .btn { align-self: flex-start; margin-top: auto; }
.course-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 20px; }
.step-card { position: relative; border-top: 5px solid var(--sage); }
.step-num { position: absolute; top: 18px; right: 20px; font-family: "Poppins"; font-size: 2.2rem; font-weight: 700; color: var(--sage-light); line-height: 1; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; background: var(--sage-pale); color: var(--forest); font-family: "Poppins"; font-weight: 600; font-size: .82rem; padding: 10px 12px; white-space: nowrap; }
.table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.table tbody tr:hover td { background: #fafbf8; }

/* Slide viewer */
.viewer { max-width: 1000px; margin: 0 auto; }
.viewer-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.viewer-title { font-size: clamp(1.2rem, 2.6vw, 1.6rem); margin: 0; }
.viewer-count { font-family: "Poppins"; font-weight: 500; color: var(--olive); white-space: nowrap; }
.progress { height: 8px; background: var(--sage-pale); border-radius: 999px; overflow: hidden; margin: 12px 0 18px; }
.progress-bar { height: 100%; background: var(--sage); border-radius: 999px; transition: width .25s; }
.slide-frame { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 6px 24px rgba(38,38,38,.10); background: #fff; }
.slide-frame img { display: block; width: 100%; height: auto; }
.viewer-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; flex: 1; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sage-light); }
.dot.done { background: var(--sage); }
.dot.active { background: var(--forest); transform: scale(1.3); }

/* Quiz */
.quiz { max-width: 820px; margin: 0 auto; }
.quiz-head { max-width: 820px; margin: 0 auto; }
.js-only { display: none; }
body.js .js-only { display: revert; }
body.js .quiz-progress.js-only { display: block; }
.qnav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.qchip { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--sage-light); background: #fff; color: var(--charcoal); font: 500 .85rem "Poppins", sans-serif; cursor: pointer; }
.qchip.answered { background: var(--sage-pale); border-color: var(--sage); color: var(--forest); }
.qchip.current { background: var(--olive); border-color: var(--olive); color: #fff; }
fieldset.question { margin: 0 0 18px; min-width: 0; }
fieldset.question.missing { border-color: var(--red); }
.q-label { font-family: "Poppins"; font-size: .85rem; font-weight: 600; color: var(--olive); text-transform: uppercase; letter-spacing: .06em; padding: 0; }
.q-text { font-family: "Poppins"; font-size: 1.2rem; font-weight: 500; color: var(--ink); line-height: 1.4; margin: 6px 0 16px; }
.options { display: grid; gap: 10px; }
.option { display: flex; align-items: center; gap: 14px; margin: 0; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 400; transition: border-color .15s, background .15s; }
.option:hover { border-color: var(--sage); background: #fafbf8; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.opt-key { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--sage-pale); color: var(--forest); font: 600 .95rem "Poppins", sans-serif; }
.option:has(input:checked) { border-color: var(--olive); background: var(--sage-pale); }
.option:has(input:checked) .opt-key { background: var(--olive); color: #fff; }
.quiz-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
body:not(.js) .quiz-nav { justify-content: flex-end; }

/* Results */
.result-banner { display: flex; gap: 28px; align-items: center; border-top: 6px solid var(--sage); }
.result-banner.fail { border-top-color: var(--red); }
.result-banner h1 { margin-top: 0; }
.score-ring { flex: none; width: 128px; height: 128px; border-radius: 50%; display: grid; place-items: center; background: var(--sage-pale); border: 8px solid var(--sage); }
.result-banner.fail .score-ring { background: var(--red-pale); border-color: var(--red); }
.score-ring span { font: 700 1.8rem "Poppins", sans-serif; color: var(--ink); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.review { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.review-item { border-left: 5px solid var(--sage); padding: 18px 22px; }
.review-item.wrong { border-left-color: var(--red); }
.review-head { display: flex; justify-content: space-between; align-items: center; }
.review-item .q-text { font-size: 1.05rem; margin: 6px 0 10px; }
.review-item p { margin: 0 0 6px; }
.lbl { color: var(--muted); }
.explain { background: var(--sage-pale); padding: 10px 14px; border-radius: 8px; margin-top: 8px !important; }

/* Admin */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 16px 0 6px; }
.stat { display: flex; flex-direction: column; padding: 18px 20px; border-top: 4px solid var(--sage); }
.stat-num { font-size: 2rem; font-weight: 600; line-height: 1.1; }
.stat-lbl { color: var(--muted); font-size: .9rem; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters select, .filters input { width: auto; min-width: 180px; padding: 8px 12px; }
.filters .btn { padding: 8px 18px; }
.bar-col { min-width: 170px; }
.meter { height: 10px; background: #f0f0ee; border-radius: 999px; overflow: hidden; margin: 4px 0 2px; }
.meter > div { height: 100%; background: var(--sage); }
.meter.mid > div { background: #c9a227; }
.meter.low > div { background: var(--red); }
.qstats .ok { font-weight: 600; color: var(--forest); }

/* Mobile */
@media (max-width: 760px) {
  .hero, .two-col { grid-template-columns: 1fr; gap: 22px; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .result-banner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .score-ring { width: 100px; height: 100px; }
  .card { padding: 18px; }
  .dots { order: 3; flex-basis: 100%; }
  .viewer-nav .btn { flex: 1; }
  .header-inner { padding-top: 6px; padding-bottom: 6px; }
  .brand-sub { display: none; }
  .course-grid { grid-template-columns: 1fr; }
}
