@import url("/fonts/outfit.css");

/* ------------------------------------------------------------------
   MDriven Bootcamp — design tokens
   Palette sourced from MDriven's own stylesheets:
     #f6821f  brand orange  · mdriven.net/Content/tkusercss.css
     #f59c1a  amber         · wiki.mdriven.net site.styles
     #112b3c  ink navy      · wiki.mdriven.net site.styles
     #0b5461  deep teal     · mdriven.net/Content/theme-default.css
     #1a50ad  link blue     · mdriven.net/Content/tkusercss.css
     #5db85b / #d32e2e      · success / danger
   Typeface: Outfit (self-hosted; the wiki declares font-family:'Outfit')
------------------------------------------------------------------ */
:root {
  --orange: #f6821f;
  --orange-dark: #d96d10;
  --orange-soft: #fff3e7;
  --amber: #f59c1a;
  --ink: #112b3c;
  --ink-soft: #24384a;
  --teal: #0b5461;
  --steel: #215b7d;
  --blue: #1a50ad;
  --green: #3f9c3d;
  --green-soft: #eaf6ea;
  --red: #d32e2e;
  --red-soft: #fdecec;

  --bg: #f3f6f9;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --border: #dde4ea;
  --text: #112b3c;
  --muted: #5d7080;
  --shadow: 0 1px 2px rgba(17, 43, 60, .06), 0 8px 24px rgba(17, 43, 60, .06);
  --shadow-sm: 0 1px 2px rgba(17, 43, 60, .07);
  --radius: 10px;
  --radius-lg: 14px;
  --maxw: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --orange-soft: #3a250f;
    --bg: #0e1a24;
    --surface: #16242f;
    --surface-2: #1b2c39;
    --border: #273d4e;
    --text: #e6eef5;
    --muted: #9db0c0;
    --green-soft: #14301b;
    --red-soft: #3a1a1a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.22; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 1.05rem + 1vw, 1.65rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1rem; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 2px; }
@media (prefers-color-scheme: dark) { a { color: #7fb0ff; } }
a:hover { color: var(--orange-dark); }
small { font-size: .82rem; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 460px; }
.stack > * + * { margin-top: 1rem; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------------------------------------------------------- header */
.site-header {
  background: var(--ink);
  border-bottom: 3px solid var(--orange);
  position: sticky; top: 0; z-index: 20;
}
.site-header .wrap {
  display: flex; align-items: center; gap: 18px;
  min-height: 62px; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand-mark { width: 9px; height: 24px; background: var(--orange); border-radius: 2px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { color: #fff; font-weight: 700; font-size: 1.16rem; letter-spacing: -.02em; }
.brand-sub { color: #a8bccc; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; }
.nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav a, .nav button {
  color: #d3e0ea; text-decoration: none; font-size: .92rem;
  padding: 7px 12px; border-radius: 7px; background: none; border: 0;
  font-family: inherit; cursor: pointer;
}
.nav a:hover, .nav button:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav a.active { background: rgba(246,130,31,.18); color: #ffc98d; }

/* ---------------------------------------------------------- layout */
main { padding: 32px 0 72px; }
.page-head { margin-bottom: 24px; }
.eyebrow {
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--orange); font-weight: 600; margin-bottom: 6px;
}

/* ----------------------------------------------------------- cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ----------------------------------------------------------- stats */
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; position: relative; overflow: hidden;
}
.stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--orange); }
.stat .label { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat .value { font-size: 1.85rem; font-weight: 700; letter-spacing: -.02em; }

/* -------------------------------------------------------- progress */
.bar { height: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--amber)); }

/* --------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: .95rem; font-weight: 600;
  padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-soft); color: #fff; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 600; letter-spacing: .04em;
  padding: 3px 9px; border-radius: 99px; border: 1px solid transparent; white-space: nowrap;
}
.badge-pass { background: var(--green-soft); color: var(--green); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.badge-fail { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.badge-open { background: var(--orange-soft); color: var(--orange-dark); border-color: color-mix(in srgb, var(--orange) 35%, transparent); }
.badge-lock { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.badge-level { background: var(--surface-2); color: var(--steel); border-color: var(--border); text-transform: uppercase; }

/* -------------------------------------------------------- chapters */
.level-head { display: flex; align-items: baseline; gap: 12px; margin: 34px 0 10px; flex-wrap: wrap; }
.level-head h2 { margin: 0; }
.chapter-list { display: grid; gap: 10px; }
.chapter-row {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
  text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s;
}
.chapter-row:hover { border-color: var(--orange); box-shadow: var(--shadow-sm); color: inherit; }
.chapter-row.locked { opacity: .62; }
.chapter-num {
  flex: none; width: 40px; height: 40px; border-radius: 9px;
  display: grid; place-items: center; font-weight: 700; font-size: 1rem;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.chapter-row.done .chapter-num { background: var(--green); color: #fff; border-color: var(--green); }
.chapter-row.current .chapter-num { background: var(--orange); color: #fff; border-color: var(--orange); }
.chapter-body { min-width: 0; flex: 1; }
.chapter-title { font-weight: 600; }
.chapter-sub { font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-meta { flex: none; display: flex; align-items: center; gap: 10px; }

/* ------------------------------------------------------------ quiz */
.question { border-top: 1px solid var(--border); padding: 22px 0; }
.question:first-of-type { border-top: 0; padding-top: 4px; }
.q-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.q-num {
  flex: none; width: 26px; height: 26px; border-radius: 7px; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-size: .78rem; font-weight: 700; margin-top: 2px;
}
.q-prompt { font-weight: 500; font-size: 1.03rem; }
.q-hint { font-size: .78rem; color: var(--muted); margin-top: 3px; }
.options { display: grid; gap: 8px; margin-left: 38px; }
.option {
  display: flex; gap: 11px; align-items: flex-start;
  border: 1px solid var(--border); border-radius: 9px; padding: 11px 14px;
  cursor: pointer; background: var(--surface); transition: border-color .12s, background .12s;
}
.option:hover { border-color: var(--orange); background: var(--surface-2); }
.option input { margin: 4px 0 0; accent-color: var(--orange); flex: none; }
.option.correct { border-color: var(--green); background: var(--green-soft); }
.option.wrong { border-color: var(--red); background: var(--red-soft); }
.text-answer {
  margin-left: 38px; width: 100%; max-width: 380px;
}

/* ---------------------------------------------------------- inputs */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: .84rem; font-weight: 600; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password] {
  width: 100%; font-family: inherit; font-size: .97rem;
  padding: 10px 13px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
input:focus-visible, .option:focus-within, .btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--orange); outline-offset: 2px;
}

/* --------------------------------------------------------- notices */
.notice { border-radius: var(--radius); padding: 14px 18px; border: 1px solid var(--border); background: var(--surface-2); }
.notice-error { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 32%, transparent); color: var(--red); }
.notice-ok { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 32%, transparent); color: var(--green); }
.notice-info { background: var(--orange-soft); border-color: color-mix(in srgb, var(--orange) 32%, transparent); }

/* ----------------------------------------------------------- score */
.score-hero { text-align: center; padding: 28px 20px; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.score-hero.pass { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 32%, transparent); }
.score-hero.fail { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 32%, transparent); }
.score-num { font-size: 3.4rem; font-weight: 700; line-height: 1; letter-spacing: -.03em; }

/* ----------------------------------------------------- certificate */
.cert-preview {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow);
}
.cert-band { background: var(--ink); border-bottom: 4px solid var(--orange); padding: 16px 22px; display: flex; align-items: center; gap: 10px; }
.cert-band .brand-name { font-size: 1.05rem; }
.cert-body { padding: 30px 24px; text-align: center; }
.cert-name { font-size: clamp(1.5rem, 1rem + 2.4vw, 2.2rem); font-weight: 700; letter-spacing: -.02em; margin: 8px 0; }
.cert-id {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.15rem; font-weight: 600; letter-spacing: .04em;
}
.verify-mark {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  margin: 0 auto 12px; font-size: 1.7rem; color: #fff;
}
.verify-mark.ok { background: var(--green); }
.verify-mark.no { background: var(--red); }

/* ---------------------------------------------------------- footer */
.site-footer {
  border-top: 1px solid var(--border); background: var(--surface);
  padding: 26px 0; color: var(--muted); font-size: .87rem;
}
.site-footer .wrap { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--orange); }

/* ------------------------------------------------------------ hero */
.hero { padding: 46px 0 30px; }
.hero h1 { max-width: 15ch; }
.hero p.lead { font-size: 1.12rem; color: var(--muted); max-width: 58ch; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 26px; }
.pill { font-size: .8rem; padding: 5px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); }

/* ----------------------------------------------------------- branding */
.brand-logo {
  display: block; flex: none;
  /* The MDriven mark includes a white glow in its own artwork, so it sits on a
     light plate rather than floating on the navy header. */
  background: #fff; border-radius: 7px; padding: 3px;
}
.cert-band .brand-logo { padding: 3px; }

/* ------------------------------------------------------ course cards */
.course-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  transition: border-color .15s, box-shadow .15s, transform .06s;
}
.course-card:hover { border-color: var(--orange); box-shadow: var(--shadow); color: inherit; }
.course-card:active { transform: translateY(1px); }
.course-card h3 { margin: 10px 0 4px; }
.course-card-head { display: flex; gap: 8px; justify-content: space-between; align-items: center; }
.course-card-summary { margin: 0 0 12px; }
.course-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.course-credential {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: .9rem;
}
.cert-mini { border-left: 3px solid var(--orange); }

/* ----------------------------------------------------- lesson layout */
.lesson-crumb { margin-bottom: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 268px; gap: 28px; align-items: start; }
.lesson-main { min-width: 0; }
.lesson-aside { display: grid; gap: 14px; }
.lesson-aside .sticky { position: sticky; top: 82px; max-height: calc(100vh - 110px); overflow-y: auto; }
@media (max-width: 940px) {
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-aside .sticky { position: static; max-height: none; }
  .lesson-aside { order: -1; }
}

.lesson-index { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.lesson-index li a {
  display: flex; gap: 9px; align-items: baseline;
  padding: 6px 8px; border-radius: 7px; text-decoration: none;
  color: var(--text); font-size: .88rem; line-height: 1.35;
}
.lesson-index li a:hover { background: var(--surface-2); color: var(--text); }
.lesson-index .idx { color: var(--muted); font-size: .78rem; min-width: 1.4em; flex: none; }
.lesson-index li.here a { background: var(--orange-soft); font-weight: 600; }
.lesson-index li.here .idx { color: var(--orange-dark); }

.objectives ul { margin: 0; padding-left: 20px; }
.objectives li + li { margin-top: 4px; }
.assessment-cta { border-left: 3px solid var(--orange); }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

/* --------------------------------------------------------- prose */
.prose { max-width: 68ch; margin: 4px 0 26px; font-size: 1.02rem; }
.prose h2 {
  margin: 34px 0 12px; padding-top: 18px; border-top: 1px solid var(--border);
  font-size: 1.32rem;
}
.prose > h2:first-child { margin-top: 8px; padding-top: 0; border-top: 0; }
.prose h3 { margin: 24px 0 8px; font-size: 1.06rem; }
.prose p { margin: 0 0 1.05em; }
.prose ul, .prose ol { margin: 0 0 1.05em; padding-left: 24px; }
.prose li { margin-bottom: .38em; }
.prose li > p { margin-bottom: .4em; }
.prose strong { font-weight: 600; }
.prose code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .875em; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px;
}
.prose pre {
  background: var(--ink); color: #e6eef5; border-radius: var(--radius);
  padding: 15px 18px; overflow-x: auto; margin: 0 0 1.15em;
  font-size: .875rem; line-height: 1.55;
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: 1em; }
.prose blockquote {
  margin: 0 0 1.1em; padding: 2px 0 2px 16px;
  border-left: 3px solid var(--orange); color: var(--muted);
}
.prose table {
  width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: .93rem;
  display: block; overflow-x: auto;
}
.prose th, .prose td { padding: 9px 13px; text-align: left; border-bottom: 1px solid var(--border); }
.prose thead th {
  background: var(--surface-2); font-size: .74rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 26px 0; }

/* ------------------------------------------------------ admin cards */
.learner-card { padding: 18px; }
.learner-head {
  display: flex; justify-content: space-between; gap: 14px;
  align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px;
}

/* ------------------------------------------------------- accessibility */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--orange); color: #fff; padding: 10px 16px;
  border-radius: 0 0 8px 0; font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 0; color: #fff; }

/* ----------------------------------------------------------- tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.admin-table th, .admin-table td { padding: 13px 16px; text-align: left; vertical-align: top; }
.admin-table thead th {
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.admin-table tbody tr + tr td { border-top: 1px solid var(--border); }
.admin-table tbody tr:hover td { background: var(--surface-2); }
.admin-table .right { text-align: right; }
.admin-table .bar { height: 6px; }

/* ------------------------------------------------- extra button sizes */
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b32424; color: #fff; }

/* ------------------------------------------------------------ share */
.share-row {
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
  margin-top: 22px; text-align: left;
}
.share-row input { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .86rem; }

.answered-count {
  margin: 0 0 4px; font-size: .8rem; letter-spacing: .04em;
  text-transform: uppercase; font-weight: 600; color: var(--muted);
}

@media (max-width: 620px) {
  .site-header .wrap { min-height: 0; padding-top: 10px; padding-bottom: 10px; }
  .nav { width: 100%; gap: 2px; }
  .nav a, .nav button { padding: 6px 9px; font-size: .86rem; }
  .chapter-row { gap: 12px; padding: 12px 14px; }
  .options, .text-answer, .notice { margin-left: 0 !important; }
  .admin-table th, .admin-table td { padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  .site-header, .site-footer, .btn-row, .nav, .skip-link, .share-row { display: none !important; }
  body { background: #fff; }
}
