/* Black Boots Trades Academy: Bagley navy and gold, safety orange for calls to action. */
:root {
  --navy: #0F1D2E; --navy-2: #1B2F47; --gold: #C9A84C; --gold-ink: #8A6B14; --orange: #D9661F;
  --bg: #F6F3EC; --panel: #FFFFFF; --ink: #1A222C; --muted: #5C6672; --line: #E0D9C9;
  --ok: #2F7A4B; --bad: #B3261E; --warn: #A26A00; --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--navy-2); }
img, video, iframe { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: 1.4rem; margin-top: 1.4em; }
h3 { font-size: 1.12rem; margin-top: 1.2em; }
p { margin: 0 0 1em; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
[hidden] { display: none !important; }

/* Header */
.topbar { background: var(--navy); color: #fff; }
.topbar-row { display: flex; align-items: center; gap: 16px; padding: 12px 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; margin-right: auto; }
.brand-mark { width: 38px; height: 38px; border-radius: 8px; background: var(--gold); color: var(--navy);
  display: grid; place-items: center; font-weight: 800; letter-spacing: -1px; }
.brand-name { font-weight: 800; font-size: 1.1rem; line-height: 1.1; }
.brand-name small { display: block; font-weight: 500; font-size: .74rem; color: #C9D2DD; letter-spacing: .02em; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.nav a, .nav button { color: #E6ECF2; text-decoration: none; padding: 8px 10px; border-radius: 6px; font-size: .95rem;
  background: none; border: 0; cursor: pointer; font: inherit; }
.nav a:hover, .nav button:hover { background: var(--navy-2); }
.nav a[aria-current="page"] { color: var(--gold); }
.nav .cta { background: var(--orange); color: #fff; font-weight: 700; }
.nav form { display: inline; }

/* Messages */
.flash { background: #FFF6DA; border: 1px solid #EBD38A; border-radius: var(--radius); padding: 10px 14px; margin: 16px 0; }
.error { background: #FCE8E6; border: 1px solid #F1B5AE; color: #7A1A13; border-radius: var(--radius);
  padding: 10px 14px; margin: 0 0 16px; }
.callout { background: #FFF1E6; border-left: 4px solid var(--orange); padding: 10px 14px; border-radius: 0 8px 8px 0; }

main { padding: 24px 0 56px; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; padding: 48px 0 40px; }
.hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.1rem); max-width: 16ch; }
.hero p { color: #D6DEE8; font-size: 1.15rem; max-width: 60ch; }
.hero .kicker { color: var(--gold); text-transform: uppercase; letter-spacing: .12em; font-weight: 700; font-size: .85rem; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 28px; color: #C9D2DD; font-size: .95rem; }
.hero-stats b { display: block; color: #fff; font-size: 1.6rem; }

/* Buttons and forms */
.btn { display: inline-block; background: var(--navy); color: #fff; border: 0; border-radius: 8px; padding: 11px 18px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; text-align: center; }
.btn:hover { background: var(--navy-2); }
.btn.gold { background: var(--gold); color: var(--navy); }
.btn.orange { background: var(--orange); }
.btn.ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); }
.hero .btn.ghost { color: #fff; border-color: #4A5E78; }
.btn.small { padding: 6px 12px; font-size: .9rem; }
.btn.danger { background: var(--bad); }
.btn[disabled] { opacity: .6; cursor: default; }
form.stack { display: grid; gap: 14px; }
label { font-weight: 600; font-size: .95rem; display: block; margin-bottom: 4px; }
.hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date],
input[type=search], select, textarea { width: 100%; padding: 10px 12px; border: 1px solid #CFC6B2; border-radius: 8px;
  background: #fff; font: inherit; color: var(--ink); }
textarea { min-height: 120px; resize: vertical; }
textarea.tall { min-height: 320px; font-family: ui-monospace, Consolas, monospace; font-size: .92rem; }
input[type=file] { width: 100%; padding: 10px; border: 2px dashed #CFC6B2; border-radius: 8px; background: #fff; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 5px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.hp { position: absolute; left: -9999px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
legend { font-weight: 700; padding: 0 6px; }

/* Cards and grids */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card h3 { margin: 0; }
.card .meta { color: var(--muted); font-size: .88rem; }
.card .spacer { flex: 1; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 8px; border-radius: 99px; background: #EFE7D2; color: var(--gold-ink); }
.tag.licensed { background: #E3ECF7; color: var(--navy-2); }
.tag.pending { background: #FFF3D6; color: var(--warn); }
.tag.published { background: #E3F2E8; color: var(--ok); }
.tag.rejected, .tag.failed { background: #FCE8E6; color: var(--bad); }
.tag.draft, .tag.processing { background: #ECEFF3; color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; counter-reset: s; }
.steps div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.steps div::before { counter-increment: s; content: counter(s); display: inline-grid; place-items: center; width: 30px;
  height: 30px; border-radius: 50%; background: var(--gold); color: var(--navy); font-weight: 800; margin-bottom: 8px; }

/* Course outline */
.progress { height: 10px; background: #E9E2D2; border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--ok); }
.outline { list-style: none; padding: 0; margin: 0; }
.outline > li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.outline .mod-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.outline .mod-head h3 { margin: 0; }
.outline ol { list-style: none; margin: 0; padding: 6px 0; }
.outline ol li { display: flex; align-items: center; gap: 10px; padding: 8px 16px; }
.outline ol li a { flex: 1; min-width: 0; }
.dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #CFC6B2; flex: none; }
.dot.done { background: var(--ok); border-color: var(--ok); }
.test-row { background: #FBF8F1; }

/* Lesson */
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
@media (max-width: 860px) { .lesson-layout { grid-template-columns: 1fr; } .lesson-side { order: 2; } }
.lesson-body { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.lesson-body ul, .lesson-body ol { padding-left: 1.3em; }
.lesson-body li { margin-bottom: .3em; }
.video-wrap { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.video-wrap video { display: block; width: 100%; max-height: 70vh; }
.video-wrap iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.video-note { background: #ECEFF3; border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }
.lesson-side .panel { position: sticky; top: 12px; }
.side-list { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.side-list li { padding: 5px 0; display: flex; gap: 8px; align-items: center; }
.side-list .current { font-weight: 700; }
.pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* Questions */
.question { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.question p.prompt { font-weight: 700; }
.choices { display: grid; gap: 8px; margin: 0 0 12px; }
.choices label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: #FDFCF9; }
.choices label:has(input:checked) { border-color: var(--navy); background: #EEF2F7; }
.choices input { margin-top: 4px; }
.feedback { border-radius: 8px; padding: 10px 12px; margin-top: 8px; }
.feedback.right { background: #E3F2E8; color: #1D4F31; }
.feedback.wrong { background: #FCE8E6; color: #7A1A13; }
.result-right { border-left: 4px solid var(--ok); }
.result-wrong { border-left: 4px solid var(--bad); }
.at { font-size: .8rem; color: var(--muted); font-weight: 600; }
.overlay { position: fixed; inset: 0; background: rgba(15, 29, 46, .75); display: grid; place-items: center; padding: 16px; z-index: 50; }
.overlay .question { width: min(560px, 100%); margin: 0; max-height: 90vh; overflow: auto; }

/* Score */
.score { font-size: 3rem; font-weight: 800; }
.score.pass { color: var(--ok); }
.score.fail { color: var(--bad); }

/* Certificate */
.certificate { background: #fff; border: 10px double var(--gold); padding: 40px 28px; text-align: center; max-width: 820px; margin: 0 auto; }
.certificate .kicker { letter-spacing: .25em; text-transform: uppercase; color: var(--gold-ink); font-weight: 700; }
.certificate .name { font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 800; color: var(--navy); margin: 12px 0; }
.certificate .course { font-size: 1.3rem; font-weight: 700; }
.certificate .fine { font-size: .82rem; color: var(--muted); max-width: 60ch; margin: 20px auto 0; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--panel); font-size: .93rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #F1ECDF; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
td.num { font-variant-numeric: tabular-nums; text-align: right; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; letter-spacing: .12em; background: #F1ECDF;
  padding: 4px 10px; border-radius: 6px; }

/* Upload progress */
.upload-progress { margin-top: 10px; }
.upload-progress .progress span { background: var(--orange); transition: width .2s; }

/* Footer */
footer { background: var(--navy); color: #C9D2DD; padding: 32px 0; font-size: .92rem; }
footer a { color: #fff; }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
footer .foot-head { color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; }

@media print {
  .topbar, footer, .no-print { display: none !important; }
  body { background: #fff; }
}

/* More videos and links */
.resource { border-bottom: 1px solid var(--line); padding: 8px 0; }
.resource summary { cursor: pointer; font-weight: 600; }

/* Analytics (admin only) */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 12px 0 20px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.stat-value { font-size: 1.55rem; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.chart-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; color: var(--orange); overflow-x: auto; }
.analytics-chart { width: 100%; height: 200px; display: block; min-width: 480px; }
.analytics-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 28px; }
.analytics-cols > section { min-width: 0; }
.analytics-cols td.path { word-break: break-all; }
.analytics-cols meter { width: 100%; height: 6px; }
