/* Matches the new norcotech.com: deep green and gold, Poppins headings over Source Sans 3,
   green utility bar and footer bands, soft bordered cards.
   A client brand overrides only --accent / --on-accent / --accent-soft / --accent-text (see /brand/:id.css). */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --wash: #f3f6f4;
  --ink: #123a28;
  --muted: #4b5a51;
  --line: #e1e8e3;
  --band: #123a28;
  --band-deep: #0f2f21;
  --on-band: #d2e3d8;
  --gold: #d4a72c;
  --gold-bright: #f2c14e;
  --accent: #d4a72c;
  --on-accent: #123a28;
  --accent-soft: #fbf3dd;
  --accent-text: #8a6400;
  --good: #1d6b45;  --good-bg: #e3f1e8;
  --warn: #8a5a00;  --warn-bg: #fdf2d8;
  --bad: #b3361f;   --bad-bg: #fbe8e4;
  --info: #2b5c78;  --info-bg: #e6f0f4;
  --shadow: 0 8px 22px rgba(18, 58, 40, .06);
  --display: "Poppins", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Sans 3", "Helvetica Neue", "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1611; --surface: #11211a; --wash: #0e1c15; --ink: #e7efea; --muted: #a3beae; --line: #23392d;
    --band: #0f2f21; --band-deep: #0a2218; --on-band: #d2e3d8;
    --accent-soft: #2a2410; --accent-text: #f2c14e;
    --good: #6fd3a0; --good-bg: #123323; --warn: #f2c14e; --warn-bg: #33290f;
    --bad: #f08a76;  --bad-bg: #3a1b16;  --info: #9cc6e0; --info-bg: #142b38;
    --shadow: 0 8px 22px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--body); }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--gold); text-decoration-thickness: 2px; }
a:hover { color: var(--accent-text); }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; text-wrap: balance; margin: 0 0 .45em; color: var(--ink); }
h1 { font-size: clamp(1.9rem, 4.4vw, 2.75rem); font-weight: 800; letter-spacing: -.025em; }
h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .8em; }
.mono, code { font-family: var(--mono); font-size: .9em; font-variant-numeric: tabular-nums; }
.sub { color: var(--muted); font-size: .92rem; }
.eyebrow { font: 700 .8rem/1.3 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); margin-bottom: .9rem; }
.eyebrow a { color: inherit; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.hint { color: var(--muted); font-size: .95rem; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Shell: utility bar, header, footer band */
.util { background: var(--band); color: var(--on-band); font-size: .88rem; }
.util-inner, .top-inner, .main, .foot { max-width: 820px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.util-inner.wide, .top-inner.wide, .main.wide, .foot.wide { max-width: 1200px; }
.util-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 20px; padding-block: 7px; }
.util-phone { color: var(--gold-bright); font-weight: 700; letter-spacing: .02em; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.util-phone:hover { color: var(--gold-bright); text-decoration: underline; }
.util-dot { width: 20px; height: 20px; border-radius: 50%; background: var(--gold); display: inline-grid; place-items: center; flex: none; }
.util-dot svg { width: 11px; height: 11px; }
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; padding-block: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand:hover { color: var(--ink); }
.brand-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.co-logo:empty { display: none; }
.co-logo img { display: block; max-height: 44px; max-width: 150px; object-fit: contain; }
.co-name { font: 800 1.2rem/1.1 var(--display); letter-spacing: -.015em; }
.co-name:empty { display: none; }
.nt { display: flex; align-items: center; gap: 10px; }
.nt-mark { width: 44px; height: 44px; flex: none; }
.nt-mark .ring { stroke: var(--ink); }
.nt-mark .stem { stroke: var(--gold); }
.nt-word { display: flex; flex-direction: column; line-height: 1; }
.nt-name { font: 800 1.85rem/1 var(--display); letter-spacing: -.025em; color: var(--ink); }
.nt-name span { font-weight: 400; color: var(--gold); }
.nt-tag { margin-top: 5px; font: 500 .78rem/1 var(--display); letter-spacing: .06em; color: var(--muted); }
/* With a client logo, Norcotech steps back to a small "by" line */
.co-name:not(:empty) + .nt { gap: 6px; }
.co-name:not(:empty) + .nt .nt-mark { width: 18px; height: 18px; }
.co-name:not(:empty) + .nt .nt-word { flex-direction: row; align-items: baseline; gap: 8px; }
.co-name:not(:empty) + .nt .nt-name { font-size: .95rem; }
.co-name:not(:empty) + .nt .nt-tag { margin: 0; font-size: .72rem; }
.nav { display: flex; align-items: center; gap: 6px 26px; flex-wrap: wrap; font-family: var(--display); }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .93rem; padding: 10px 0; border-bottom: 3px solid transparent; }
.nav a:hover { color: var(--ink); border-bottom-color: var(--gold); }
.nav form { margin: 0; }
.linkbtn { background: var(--band); border: 0; border-radius: 6px; padding: 10px 18px; font: 600 .9rem var(--display); color: #fff; cursor: pointer; }
.linkbtn:hover { background: var(--band-deep); }
.main { padding-block: 48px 64px; display: flex; flex-direction: column; gap: 40px; }
.foot-band { background: var(--band); color: var(--on-band); }
.foot { padding-block: 32px 36px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; font-size: .92rem; }
.foot b { color: #fff; font-family: var(--display); font-weight: 700; }
.foot-phone { display: inline-flex; align-items: center; gap: 10px; padding: 6px 18px 6px 6px; border-radius: 999px; background: var(--band-deep); border: 2px solid var(--gold); color: #fff; font: 700 1rem var(--display); text-decoration: none; white-space: nowrap; }
.foot-phone:hover { color: #fff; }
.foot-phone .util-dot { width: 30px; height: 30px; }
.foot-phone .util-dot svg { width: 15px; height: 15px; }

/* Controls */
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1 1 220px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .95rem; }
input, textarea, select { font: 400 1rem var(--body); color: var(--ink); background: var(--wash); border: 1px solid var(--line); border-radius: 6px; padding: 12px 13px; width: 100%; }
input[type="color"] { padding: 2px; width: 64px; height: 46px; }
input[type="file"] { padding: 9px; }
textarea.mono { font-family: var(--mono); font-size: .82rem; }
input:focus, textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; background: var(--accent); color: var(--on-accent); border: 2px solid var(--accent); border-radius: 6px; padding: 11px 26px; font: 700 1rem var(--display); text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.06); color: var(--on-accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.ghost:hover { background: var(--wash); filter: none; color: var(--ink); }
.btn.small { min-height: 36px; padding: 5px 14px; font-size: .86rem; border-width: 1.5px; }
.btn.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.bad-text { color: var(--bad) !important; border-color: var(--bad) !important; }

/* Surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; min-width: 0; box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card.muted { opacity: .72; box-shadow: none; }
.card.empty { text-align: center; color: var(--muted); padding: 36px 24px; box-shadow: none; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.auth { max-width: 470px; min-width: 0; }
.auth h1 { font-size: clamp(1.8rem, 3.4vw, 2.3rem); }
section > .hint { margin-top: 18px; }
.auth .stack { margin-top: 22px; }
.flash { padding: 13px 16px; border-radius: 10px; font-weight: 600; white-space: pre-line; margin-bottom: 16px; }
.flash-info { background: var(--info-bg); color: var(--info); }
.flash-warn { background: var(--warn-bg); color: var(--warn); }
.flash-bad  { background: var(--bad-bg);  color: var(--bad); }
.pill { display: inline-block; padding: 3px 11px; border-radius: 999px; font: 600 .78rem/1.5 var(--display); white-space: nowrap; }
.pill-good { background: var(--good-bg); color: var(--good); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-bad  { background: var(--bad-bg);  color: var(--bad); }
.pill-info { background: var(--info-bg); color: var(--info); }
.pill-neutral { background: var(--wash); color: var(--muted); border: 1px solid var(--line); }
.tag { display: inline-block; font: 700 .7rem/1.7 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); background: var(--accent-soft); padding: 1px 9px; border-radius: 999px; }

/* Sign-in: form beside a green "what to expect" panel */
.auth-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 48px; align-items: start; }
@media (max-width: 760px) { .auth-wrap { grid-template-columns: 1fr; gap: 32px; } }
.expect { background: var(--band); color: var(--on-band); border-radius: 22px; padding: 30px; box-shadow: 0 20px 44px rgba(18, 58, 40, .22); display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.expect h2 { color: #fff; margin: 0; }
.expect ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.expect li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.expect li span { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: #123a28; display: grid; place-items: center; font: 800 .95rem var(--display); }
.expect li b { color: #fff; font-family: var(--display); font-weight: 600; display: block; line-height: 1.3; }
.expect p { margin: 0; font-size: .95rem; }
.expect .foot-phone { align-self: flex-start; }

/* Learner flow */
.steps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 8px 0 26px; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 9px; padding: 7px 16px 7px 7px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font: 600 .9rem var(--display); color: var(--muted); }
.steps li span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 700 .8rem var(--display); background: var(--wash); }
.steps li.now { color: var(--ink); border-color: var(--ink); }
.steps li.now span { background: var(--accent); color: var(--on-accent); }
.steps li.done span { background: var(--good); color: #fff; }
.video { position: relative; aspect-ratio: 16 / 9; max-width: 100%; background: #0b1611; border-radius: 12px; overflow: hidden; margin-bottom: 18px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video.empty { display: grid; place-items: center; padding: 24px; text-align: center; color: var(--on-band); background: var(--band); }
.result { display: flex; gap: 24px; padding: 26px; border-radius: var(--radius); align-items: flex-start; flex-wrap: wrap; }
.result-bad { background: var(--bad-bg); border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent); }
.result > div { min-width: 0; flex: 1 1 260px; }
.result .score { flex: 0 0 auto; display: flex; flex-direction: column; gap: 4px; color: var(--bad); }
.num { font: 800 2.7rem/1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.num small { font-size: .5em; color: var(--muted); }
.topics { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.done .card { margin-top: 24px; }
.habits, .flow { padding-left: 1.2em; margin: 0; display: grid; gap: 8px; }

/* Lesson */
.lesson { display: flex; flex-direction: column; gap: 4px; }
.lesson > .lede { margin-bottom: 20px; }
.lesson-part { border-top: 1px solid var(--line); padding-top: 26px; margin-top: 14px; max-width: 68ch; }
.lesson-part ul { padding-left: 1.2em; margin: 0 0 1em; display: grid; gap: 6px; }
.phase { display: flex; align-items: baseline; gap: 12px; }
.phase .mono { font-family: var(--display); color: var(--accent-text); font-size: .85rem; font-weight: 700; letter-spacing: .06em; }
.stop { background: var(--good-bg); border-radius: 12px; padding: 15px 18px; color: var(--ink); }
.stop b { color: var(--good); }
.stop ul { margin: 8px 0 0; }
.example { background: var(--wash); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin: 0 0 16px; }
.example .mono { overflow-wrap: anywhere; line-height: 1.7; }
mark { background: var(--accent-soft); color: var(--accent-text); padding: 0 3px; border-radius: 3px; font-weight: 700; }
.golden { background: var(--bad-bg); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); border-radius: var(--radius); padding: 22px 24px; margin: 4px 0 12px; max-width: 68ch; }
.golden p { margin: 0 0 8px; }
.golden p:last-child { margin: 0; }
.golden-label { font: 700 .76rem var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--bad); }
.golden-text { font: 700 1.25rem/1.35 var(--display); letter-spacing: -.01em; color: var(--ink); text-wrap: balance; }
.rule { font-size: 1.15rem; border-left: 4px solid var(--gold); padding: 4px 0 4px 16px; margin-top: 24px; }

/* Quiz */
.quiz { display: flex; flex-direction: column; gap: 20px; }
.q { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 22px; margin: 0; min-width: 0; box-shadow: var(--shadow); }
.q legend { display: contents; }
.q legend > * { display: inline-block; margin-right: 10px; }
.qn { font-family: var(--display); color: var(--accent-text); font-weight: 800; }
.qp { display: block !important; font-weight: 600; font-size: 1.07rem; margin: 10px 0 14px; }
.opt { flex-direction: row; align-items: flex-start; gap: 12px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; font-weight: 400; cursor: pointer; margin-top: 8px; }
.opt:hover { border-color: var(--ink); }
.opt:has(input:checked) { border-color: var(--ink); background: var(--accent-soft); }
.opt input { width: 18px; height: 18px; margin-top: 4px; flex: none; accent-color: var(--ink); }

/* Admin */
.titlerow { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 8px; box-shadow: var(--shadow); }
.stats > div { background: var(--surface); padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; }
.stats .lbl { font: 700 .74rem var(--display); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
@media (max-width: 600px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.grid2 .card + .card { margin-top: 0; }
.span2 { grid-column: 1 / -1; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th { text-align: left; font: 700 .72rem var(--display); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--wash); white-space: nowrap; }
td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td a { color: var(--ink); }
.num-col { text-align: right; font-variant-numeric: tabular-nums; }
.actions { text-align: right; white-space: nowrap; }
.actions form { margin: 0; display: inline; }
.created { border-color: var(--good); }
.created .big { font-size: 1.15rem; background: var(--good-bg); color: var(--good); padding: 4px 10px; border-radius: 6px; }
.created textarea { margin-top: 8px; }
.missed { padding-left: 1.2em; display: grid; gap: 10px; margin: 0; }
.danger .row { margin-top: 8px; }
.danger form { margin: 0; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; border: 1px solid var(--line); }
.preview { border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 12px; padding: 20px; background: var(--wash); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.pv-head { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 1.1rem; }
.pv-logo img { display: block; max-height: 36px; max-width: 120px; }
.pv-btn { background: var(--accent); color: #fff; padding: 8px 18px; border-radius: 6px; font-weight: 700; font-family: var(--display); }

@media (prefers-reduced-motion: no-preference) {
  .btn, .steps li span, .nav a, .opt { transition: background-color .25s ease, border-color .25s ease, color .25s ease; }
}
