/* Becoming You course portal (learn.niti8ent.com).
   One deliberate dark look taken from the course animations: warm near-black ground, cream text, clay accent,
   Georgia for titles. No external fonts (strict CSP). */
:root {
  --ground: #0d0c0a;
  --surface: #1a1814;
  --surface2: #221f19;
  --line: #353027;
  --cream: #F2EEE6;
  --muted: #a9a194;
  --clay: #C98B6C;
  --clay-deep: #A55F45;
  --alert: #e39a87;
  --ok: #b9c79a;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--cream); }
body { font-family: var(--sans); font-size: 15px; line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(circle at 85% -10%, rgba(165, 95, 69, .13), transparent 36%), var(--ground); }
[hidden] { display: none !important; }
a { color: var(--clay); text-underline-offset: 3px; }
img { max-width: 100%; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 16px; max-width: 1180px; width: 100%; margin: 0 auto; }
.top .logo { display: block; line-height: 0; }
.top .logo img { height: 40px; width: auto; }
.acct { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); min-width: 0; }
.acct .email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34vw; }
main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px 16px 72px; display: grid; gap: 28px; align-content: start; }
.foot { padding: 28px 16px; text-align: center; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }

/* type */
.eyebrow { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--clay); }
h1, .h1 { margin: 6px 0 0; font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 4.6vw, 52px); line-height: 1.06; letter-spacing: -.02em; text-wrap: balance; }
h1 em, h2 em { color: var(--clay); }
h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.2; }
.lede { margin: 10px 0 0; color: var(--muted); max-width: 60ch; }

/* buttons + forms */
.btn, .btnQuiet, .linkBtn { font: inherit; cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border: 0; border-radius: 4px; background: var(--clay-deep); color: var(--cream); font-size: 14px; font-weight: 600; letter-spacing: .03em; text-decoration: none; }
.btn:hover { background: var(--clay); color: #1a1410; }
.btn[disabled] { opacity: .55; cursor: wait; }
.btnQuiet { display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--cream); font-size: 13px; text-decoration: none; }
.btnQuiet:hover { border-color: var(--clay); }
.linkBtn { padding: 0; border: 0; background: none; color: var(--clay); text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }
.btn:focus-visible, .btnQuiet:focus-visible, .linkBtn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); }
.field input, .field select { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 4px; background: var(--ground); color: var(--cream); font: inherit; font-size: 16px; }
.field input:focus { border-color: var(--clay); }
.codeInput { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace !important; letter-spacing: .14em; text-transform: uppercase; }
.msg { margin: 0; padding: 12px 14px; border-radius: 4px; font-size: 14px; border: 1px solid var(--line); background: var(--surface); }
.msg.err { border-color: rgba(227, 154, 135, .45); color: var(--alert); }
.msg.ok { border-color: rgba(185, 199, 154, .4); color: var(--ok); }

/* auth card */
.authWrap { max-width: 460px; width: 100%; margin: 4vh auto 0; display: grid; gap: 22px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 26px 24px; display: grid; gap: 18px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.tabs button { font: inherit; font-size: 14px; padding: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface2); color: var(--cream); font-weight: 600; }
.small { font-size: 13px; color: var(--muted); margin: 0; }

/* course home */
.homeHead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; }
.homeHead > div { min-width: 0; }
.outline { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.outline li { border-bottom: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 3.4em minmax(0, 1fr) auto; align-items: center; gap: 4px 18px; padding: 16px 8px; color: inherit; text-decoration: none; }
.row:hover { background: var(--surface); }
.row.current { background: var(--surface2); }
.num { font-family: var(--serif); font-size: 22px; color: var(--muted); font-variant-numeric: tabular-nums; }
.row.current .num { color: var(--clay); }
.rowText { display: grid; gap: 3px; min-width: 0; }
.rowText small { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.rowText span { font-family: var(--serif); font-size: 19px; line-height: 1.25; }
.meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.pill { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; padding: 4px 8px; border-radius: 3px; border: 1px solid var(--line); color: var(--muted); }
.pill.done { color: var(--clay); border-color: rgba(201, 139, 108, .45); }
.pill.now { color: var(--cream); }
.bar { grid-column: 2 / -1; height: 2px; background: var(--line); border-radius: 1px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--clay); }

/* player */
.stage { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.screen { position: relative; background: #000; aspect-ratio: 16 / 9; max-width: 100%; }
.screen video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #000; }
.stage:fullscreen { border: 0; border-radius: 0; background: #000; }
.stage:fullscreen .screen { flex: 1; aspect-ratio: auto; }
.overlay { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; text-align: center; background: rgba(8, 7, 6, .9); }
.overlay p { margin: 0; color: var(--muted); max-width: 46ch; }
.overlay .ovTitle { font-family: var(--serif); font-size: clamp(22px, 3.2vw, 38px); line-height: 1.15; color: var(--cream); max-width: 22ch; text-wrap: balance; }
.ovActions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 4px; }
.strip { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; padding: 16px 20px; border-top: 1px solid var(--line); }
.switch { display: flex; align-items: center; gap: 14px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.track { flex: none; position: relative; width: 46px; height: 26px; border-radius: 13px; background: var(--line); transition: background .2s; }
.track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--cream); transition: transform .2s; }
.switch input:checked + .track { background: var(--clay-deep); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid var(--clay); outline-offset: 3px; }
.switchLabel { display: grid; gap: 2px; min-width: 0; }
.switchLabel b { font-size: 15px; font-weight: 600; }
.switchLabel span { font-size: 13px; color: var(--muted); }
.level { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.level input { width: 140px; accent-color: var(--clay); }
.level output { width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; color: var(--cream); }
.level.off { opacity: .4; }
.stripActions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-left: auto; }
.resume { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.resume b { color: var(--cream); font-weight: 600; }
.navRow { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
#nextLink { margin-left: auto; }

/* admin */
.adminGrid { display: grid; gap: 22px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 20px; display: grid; gap: 14px; min-width: 0; }
.panel h2 { font-size: 22px; }
.inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.inline .field { flex: 1 1 180px; }
.tableWrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; background: var(--surface2); }
td.num { font-family: inherit; font-size: 13px; font-variant-numeric: tabular-nums; }
.status { font-weight: 600; }
.status.issued { color: var(--muted); }
.status.redeemed { color: var(--ok); }
.status.disabled { color: var(--alert); }
.status.provisioning { color: var(--clay); }
.stats { display: flex; flex-wrap: wrap; gap: 10px 26px; font-size: 14px; }
.stats b { font-variant-numeric: tabular-nums; }
.check { display: inline-block; min-width: 3.5em; font-weight: 600; }
.check.yes { color: var(--ok); }
.check.no { color: var(--alert); }

/* printable test sheet */
.sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.testCard { background: #fff; color: #111; border-radius: 6px; padding: 16px; display: grid; gap: 8px; justify-items: center; text-align: center; }
.testCard .qr { width: 170px; height: 170px; display: grid; place-items: center; }
.testCard .qr svg, .testCard .qr img { width: 170px; height: 170px; }
.testCard code { font-size: 15px; letter-spacing: .08em; font-weight: 700; }
.testCard small { font-size: 11px; color: #555; word-break: break-all; }

@media (max-width: 700px) {
  .stripActions { margin-left: 0; width: 100%; }
  .level { width: 100%; }
  .level input { flex: 1; width: auto; }
  .row { grid-template-columns: 2.4em minmax(0, 1fr); }
  .meta { grid-column: 2; }
  .acct .email { display: none; }
}
@media (prefers-reduced-motion: reduce) { .track, .track::after { transition: none; } }
@media print {
  body { background: #fff; }
  .top, .foot, .noPrint { display: none !important; }
  main { padding: 0; }
  .testCard { break-inside: avoid; border: 1px solid #999; }
}
