/* ============================================================
   Claude Certified Architect – Foundations Course
   Theme: Learn2Exel "ink and ember" (matches learn2exel.com, ai. and finance.)
   ============================================================ */

:root {
  /* Brand palette (Anthropic official) */
  --c-dark:       #0F2440;
  --c-light:      #F6F5F1;
  --c-cream:      #EFEDE7;
  --c-midgray:    #94A3B8;
  --c-lightgray:  #E9E7E0;
  --c-orange:     #C2410C;
  --c-orange-dk:  #9A3412;
  --c-blue:       #6B7F99;
  --c-green:      #788c5d;

  /* Semantic */
  --bg:           #F6F5F1;
  --bg-panel:     #ffffff;
  --bg-sidebar:   #EFEDE7;
  --text:         #0F2440;
  --text-soft:    #334155;
  --text-faint:   #4B5563;
  --border:       #E3E1DA;
  --border-strong:#D6D3CA;
  --accent:       #C2410C;
  --accent-soft:  #FFF4EC;
  --good:         #5c7a4a;
  --good-soft:    #eaf0e2;
  --bad:          #c0533b;
  --bad-soft:     #fbe9e4;
  --shadow-sm:    0 1px 3px rgba(15,36,64,.06), 0 1px 2px rgba(15,36,64,.04);
  --shadow-md:    0 4px 16px rgba(15,36,64,.08);
  --shadow-lg:    0 12px 40px rgba(15,36,64,.12);
  --radius:       14px;
  --radius-sm:    9px;
  --maxw:         900px;
  --font-head: "Sora", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
}

/* ---------- Dark mode ----------
   Same palette as ai.learn2exel.com and learn2exel.com. An inline script in
   <head> resolves the stored choice (localStorage "ai-course-theme") or the OS
   preference to data-theme on <html> before paint; the bar button flips it. */
:root[data-theme='dark'] {
  --c-dark:       #EEF2F7;   /* headings: light on dark */
  --c-light:      #0B1526;
  --c-cream:      #1A2C48;
  --c-midgray:    #7F8FA6;
  --c-lightgray:  #1A2C48;
  --c-orange:     #F2A25C;
  --c-orange-dk:  #F7B97F;
  --c-blue:       #8FB3E6;
  --c-green:      #7CC49A;
  --bg:           #0B1526;
  --bg-panel:     #13223A;
  --bg-sidebar:   #0F1C31;
  --text:         #EEF2F7;
  --text-soft:    #AEBBCC;
  --text-faint:   #8E9DB3;
  --border:       #243A5C;
  --border-strong:#2F4A6D;
  --accent:       #F2A25C;
  --accent-soft:  #2A1A0E;
  --good:         #7CC49A;
  --good-soft:    #0C2A1A;
  --bad:          #F28B82;
  --bad-soft:     #2A1414;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow-md:    0 4px 12px rgba(0,0,0,.45), 0 2px 4px rgba(0,0,0,.3);
  --shadow-lg:    0 10px 30px rgba(0,0,0,.5), 0 4px 8px rgba(0,0,0,.35);
  color-scheme: dark;
}
/* --c-dark doubles as a background in a few places; keep those dark */
:root[data-theme='dark'] .brand-mark { background: #15304F; }
:root[data-theme='dark'] .exam-bar { background: #15304F; }
:root[data-theme='dark'] .toast { background: #EEF2F7; color: #0B1526; }
/* ember buttons: light ember needs dark text */
:root[data-theme='dark'] .btn-primary,
:root[data-theme='dark'] .btn-primary:hover,
:root[data-theme='dark'] .ctrl-btn.play { color: #0B1526; }
:root[data-theme='dark'] .topbar { background: rgba(11,21,38,.92); }
:root[data-theme='dark'] code, :root[data-theme='dark'] kbd { color: #F7B97F; }
:root[data-theme='dark'] .stage { box-shadow: 0 0 0 1px #243A5C, var(--shadow-lg); }
:root[data-theme='dark'] .callout.blue,
:root[data-theme='dark'] .explain { background: #14233F; }
:root[data-theme='dark'] .explain.right { background: var(--good-soft); }
:root[data-theme='dark'] .explain.wrong-ex { background: var(--bad-soft); }
:root[data-theme='dark'] .pill.blue { background: #14233F; color: #8FB3E6; }
:root[data-theme='dark'] .nav-lesson.complete .tick,
:root[data-theme='dark'] .opt.correct .key,
:root[data-theme='dark'] .opt.wrong .key { color: #0B1526; }

/* Light/dark toggle in the Learn2Exel bar (same look as the hub and AI course) */
.theme-toggle-inline { width: 34px; height: 34px; margin-left: 6px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 6px; color: var(--text-soft); cursor: pointer; padding: 0; }
.theme-toggle-inline:hover { color: var(--text); border-color: var(--text-faint); }
.theme-toggle-inline .ic-sun { display: none; }
:root[data-theme='dark'] .theme-toggle-inline .ic-sun { display: block; }
:root[data-theme='dark'] .theme-toggle-inline .ic-moon { display: none; }
@media (max-width: 520px) { .theme-toggle-inline { margin-left: 2px; flex: none; } }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,h2,h3,h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.22; color: var(--c-dark); letter-spacing: -.01em; }
a { color: var(--accent-dk, var(--c-orange-dk)); text-decoration: none; }
a:hover { text-decoration: underline; }
code, kbd { font-family: var(--font-mono); font-size: .9em; background: var(--c-lightgray); color: #9A3412; padding: .12em .4em; border-radius: 5px; }
pre { background: #0F2440; color: #F6F5F1; padding: 16px 18px; border-radius: var(--radius-sm); overflow-x: auto; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.55; }
pre code { background: none; color: inherit; padding: 0; }

/* ---------- App layout ---------- */
.app { display: grid; grid-template-columns: 312px 1fr; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { padding: 22px 22px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg-sidebar); z-index: 5; }
.brand-logo { display: flex; align-items: center; gap: 11px; cursor: pointer; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--c-dark); display: grid; place-items: center; color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 18px; flex: 0 0 auto; box-shadow: var(--shadow-sm); }
.brand-text { font-family: var(--font-head); font-weight: 600; font-size: 15px; color: var(--c-dark); line-height: 1.2; }
.brand-text small { display:block; font-weight: 500; color: var(--text-faint); font-size: 11.5px; letter-spacing: .03em; text-transform: uppercase; margin-top: 2px; }

.progress-wrap { padding: 14px 22px 4px; }
.progress-label { display:flex; justify-content: space-between; font-size: 12px; color: var(--text-faint); margin-bottom: 6px; }
.progress-bar { height: 7px; background: var(--c-lightgray); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--c-orange), var(--c-orange-dk)); width: 0%; transition: width .4s ease; }

.nav { padding: 8px 12px 40px; }
.nav-module { margin-bottom: 4px; }
.nav-module-head {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 10px 11px; border: none; background: none; cursor: pointer;
  font-family: var(--font-head); font-weight: 600; font-size: 13.5px; color: var(--c-dark);
  text-align: left; border-radius: var(--radius-sm);
}
.nav-module-head:hover { background: var(--c-lightgray); }
.nav-module-head .chev { margin-left: auto; transition: transform .2s; color: var(--text-faint); font-size: 11px; }
.nav-module.open .chev { transform: rotate(90deg); }
.nav-module-num { width: 22px; height: 22px; flex:0 0 auto; border-radius: 6px; background: var(--c-lightgray); display:grid; place-items:center; font-size: 11px; font-weight: 600; color: var(--text-soft); }
.nav-module.done .nav-module-num { background: var(--good-soft); color: var(--good); }
.nav-lessons { display: none; padding: 2px 0 6px 14px; }
.nav-module.open .nav-lessons { display: block; }
.nav-lesson {
  display: flex; align-items: center; gap: 9px; padding: 7px 11px; border-radius: 8px;
  cursor: pointer; font-size: 12.8px; color: var(--text-soft); line-height: 1.35;
}
.nav-lesson:hover { background: var(--c-lightgray); color: var(--text); }
.nav-lesson.active { background: var(--accent-soft); color: var(--c-orange-dk); font-weight: 600; }
.nav-lesson .tick { width: 16px; height: 16px; flex:0 0 auto; border-radius: 50%; border: 1.5px solid var(--border-strong); display:grid; place-items:center; font-size: 9px; }
.nav-lesson.complete .tick { background: var(--good); border-color: var(--good); color: #fff; }
.nav-lesson .type-ic { flex: 0 0 auto; font-size: 12px; opacity: .7; }

/* ---------- Main ---------- */
.main { min-height: 100vh; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 13px 30px; border-bottom: 1px solid var(--border); background: rgba(246,245,241,.88); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; }
.topbar .crumb { font-size: 13px; color: var(--text-faint); }
.topbar .crumb b { color: var(--text); font-weight: 600; }
.topbar .spacer { flex: 1; }
.btn { font-family: var(--font-head); font-weight: 500; font-size: 13.5px; border: 1px solid var(--border-strong); background: var(--bg-panel); color: var(--text); padding: 8px 15px; border-radius: 9px; cursor: pointer; transition: all .15s; display:inline-flex; align-items:center; gap:7px; }
.btn:hover { border-color: var(--c-orange); color: var(--c-orange-dk); }
.btn-primary { background: var(--c-orange); border-color: var(--c-orange); color: #fff; }
.btn-primary:hover { background: var(--c-orange-dk); border-color: var(--c-orange-dk); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.view { max-width: var(--maxw); margin: 0 auto; padding: 38px 30px 90px; }
.view.wide { max-width: 1080px; }

/* ---------- Generic content ---------- */
.eyebrow { font-family: var(--font-head); font-weight: 600; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--c-orange); margin-bottom: 10px; }
.lead { font-size: 18px; color: var(--text-soft); line-height: 1.6; }
.card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 18px; }
.muted { color: var(--text-faint); }
.pill { display:inline-flex; align-items:center; gap:6px; font-family: var(--font-head); font-weight:500; font-size: 11.5px; padding: 4px 11px; border-radius: 99px; background: var(--c-lightgray); color: var(--text-soft); }
.pill.orange { background: var(--accent-soft); color: var(--c-orange-dk); }
.pill.blue   { background: #E9EEF5; color:#0F2440; }
.pill.green  { background: var(--good-soft); color: var(--good); }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.callout { border-left: 4px solid var(--c-orange); background: var(--accent-soft); padding: 14px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 18px 0; }
.callout.blue { border-color: var(--c-blue); background: #E9EEF5; }
.callout.green { border-color: var(--c-green); background: var(--good-soft); }
.callout .ttl { font-family: var(--font-head); font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }

/* ---------- Hero (home) ---------- */
.hero { text-align: center; padding: 30px 0 10px; }
.hero h1 { font-size: 40px; margin: 14px 0 14px; }
.hero .lead { max-width: 640px; margin: 0 auto 26px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.stat-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 34px 0; }
.stat { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; min-width: 130px; box-shadow: var(--shadow-sm); }
.stat .n { font-family: var(--font-head); font-weight: 700; font-size: 26px; color: var(--c-orange); }
.stat .l { font-size: 12.5px; color: var(--text-faint); margin-top: 2px; }

/* domain weight bars */
.weights { margin-top: 8px; }
.weight-row { display:flex; align-items:center; gap: 12px; margin: 10px 0; }
.weight-row .nm { width: 280px; font-size: 13.5px; font-weight: 500; }
.weight-row .track { flex:1; height: 12px; background: var(--c-lightgray); border-radius: 99px; overflow:hidden; }
.weight-row .fillb { height:100%; background: var(--c-orange); border-radius: 99px; }
.weight-row .pc { width: 42px; text-align: right; font-weight:600; font-size: 13px; color: var(--text-soft); }

/* ---------- Lesson player ---------- */
.player-shell { }
.stage { position: relative; background: #0F2440; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 16 / 9; }
.slide { position:absolute; inset:0; padding: 38px 46px; display:flex; flex-direction: column; justify-content:center; opacity:0; transition: opacity .4s ease; color: #F6F5F1; overflow: hidden; }
.slide.show { opacity: 1; }
.slide .s-kicker { font-family: var(--font-head); font-weight:600; font-size: 12.5px; letter-spacing:.08em; text-transform: uppercase; color: #F2A25C; margin-bottom: 12px; }
.slide h2 { color: #fff; font-size: 27px; line-height:1.18; margin: 0 0 16px; }
.slide h3 { color: #fff; font-size: 22px; margin: 0 0 12px; }
.slide ul { margin: 0; padding: 0; list-style: none; }
.slide li { font-size: 16.5px; line-height: 1.45; margin: 8px 0; padding-left: 26px; position: relative; color: #DCE3EC; }
.slide li::before { content:"▸"; position:absolute; left:0; color: #F2A25C; }
.slide p { font-size: 17px; color: #DCE3EC; }
.slide .big { font-size: 26px; font-family: var(--font-head); font-weight:600; color:#fff; line-height:1.32; }
.slide code { background: rgba(255,255,255,.12); color: #ffd9c4; }
.slide .s-tag { position:absolute; top: 20px; right: 24px; font-size: 12px; color: var(--c-midgray); font-family: var(--font-head); }
.slide.center { align-items:center; text-align:center; }
.slide-counter { position:absolute; bottom: 14px; right: 18px; font-size: 12px; color: var(--c-midgray); font-family: var(--font-mono); z-index: 3; }
.captions { margin-top: 14px; padding: 13px 18px 13px 16px; background: var(--bg-panel); border: 1px solid var(--border); border-left: 4px solid var(--c-orange); border-radius: var(--radius-sm); color: var(--text-soft); font-size: 15px; line-height: 1.6; box-shadow: var(--shadow-sm); }
.captions:empty { display: none; }
.captions .cc-label { display:inline-block; font-family: var(--font-head); font-weight:600; font-size: 10.5px; letter-spacing:.06em; text-transform:uppercase; color: var(--c-orange); margin-right: 9px; vertical-align: 1px; }

.controls { display:flex; align-items:center; gap: 14px; padding: 14px 6px 2px; }
.ctrl-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--bg-panel); cursor:pointer; display:grid; place-items:center; font-size: 16px; color: var(--text); transition: all .15s; }
.ctrl-btn:hover { border-color: var(--c-orange); color: var(--c-orange-dk); }
.ctrl-btn.play { width: 52px; height: 52px; background: var(--c-orange); border-color: var(--c-orange); color:#fff; font-size: 19px; }
.ctrl-btn.play:hover { background: var(--c-orange-dk); }
.scrub { flex:1; height: 6px; -webkit-appearance:none; appearance:none; background: var(--c-lightgray); border-radius: 99px; outline:none; cursor:pointer; }
.scrub::-webkit-slider-thumb { -webkit-appearance:none; width: 15px; height:15px; border-radius:50%; background: var(--c-orange); cursor:pointer; }
.time { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-faint); min-width: 86px; text-align:center; }
.speed-sel { font-family: var(--font-head); font-size: 12.5px; border:1px solid var(--border-strong); border-radius: 8px; padding: 6px 8px; background: var(--bg-panel); cursor:pointer; }
.player-meta { display:flex; align-items:center; gap: 12px; margin-bottom: 16px; }

.tabs { display:flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 26px 0 18px; }
.tab { font-family: var(--font-head); font-weight:500; font-size: 13.5px; padding: 9px 16px; border:none; background:none; cursor:pointer; color: var(--text-faint); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--c-orange-dk); border-bottom-color: var(--c-orange); }
.tab-panel { display:none; }
.tab-panel.active { display:block; }
.transcript p { margin: 0 0 14px; line-height: 1.7; }
.transcript .ts { color: var(--c-orange); font-family: var(--font-mono); font-size: 12px; margin-right: 8px; }

.lesson-foot { display:flex; justify-content: space-between; margin-top: 34px; gap: 12px; }

/* ---------- Quiz ---------- */
.q-card { background: var(--bg-panel); border:1px solid var(--border); border-radius: var(--radius); padding: 26px 28px; box-shadow: var(--shadow-sm); }
.q-scenario { background: var(--c-cream); border:1px solid var(--border); border-radius: var(--radius-sm); padding: 13px 16px; font-size: 13.5px; color: var(--text-soft); margin-bottom: 18px; }
.q-scenario b { color: var(--text); }
.q-stem { font-size: 17px; font-weight: 500; line-height: 1.55; margin-bottom: 20px; }
.opt { display:flex; gap: 12px; align-items:flex-start; border:1.5px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin: 10px 0; cursor:pointer; transition: all .12s; background: var(--bg-panel); }
.opt:hover { border-color: var(--c-midgray); background: var(--c-cream); }
.opt.sel { border-color: var(--c-orange); background: var(--accent-soft); }
.opt.correct { border-color: var(--good); background: var(--good-soft); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt .key { width:26px; height:26px; flex:0 0 auto; border-radius:7px; background: var(--c-lightgray); display:grid; place-items:center; font-family: var(--font-head); font-weight:600; font-size: 13px; }
.opt.correct .key { background: var(--good); color:#fff; }
.opt.wrong .key { background: var(--bad); color:#fff; }
.opt .otext { font-size: 14.5px; line-height: 1.5; }
.explain { margin-top: 18px; border-left: 4px solid var(--c-blue); background: #E9EEF5; padding: 14px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 14px; line-height: 1.6; display:none; }
.explain.show { display:block; }
.explain .ex-verdict { font-family: var(--font-head); font-weight:600; margin-bottom:6px; }
.explain.right { border-color: var(--good); background: var(--good-soft); }
.explain.wrong-ex { border-color: var(--bad); background: var(--bad-soft); }
.q-progress { display:flex; align-items:center; gap: 14px; margin-bottom: 20px; }
.q-progress .bar { flex:1; height: 7px; background: var(--c-lightgray); border-radius:99px; overflow:hidden; }
.q-progress .bar i { display:block; height:100%; background: var(--c-orange); }
.q-foot { display:flex; justify-content: space-between; align-items:center; margin-top: 22px; }
.q-meta { font-size: 12.5px; color: var(--text-faint); }

/* results */
.result-hero { text-align:center; padding: 20px 0; }
.score-ring { width: 150px; height: 150px; margin: 0 auto 18px; position:relative; }
.score-ring .val { position:absolute; inset:0; display:grid; place-items:center; font-family: var(--font-head); font-weight:700; font-size: 34px; }
.verdict-pass { color: var(--good); }
.verdict-fail { color: var(--bad); }
.domain-break { margin-top: 26px; }
.domain-break .weight-row .pc { width: 64px; }

/* mock timer */
.exam-bar { display:flex; align-items:center; gap: 16px; background: var(--c-dark); color:#F6F5F1; padding: 11px 22px; border-radius: var(--radius); margin-bottom: 22px; }
.exam-bar .timer { font-family: var(--font-mono); font-size: 18px; font-weight:600; }
.exam-bar .timer.warn { color: #F2A25C; }
.exam-bar .q-count { font-size: 13.5px; opacity:.85; }
.flag-btn { margin-left:auto; }

/* tables */
table.tbl { width:100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th, table.tbl td { text-align:left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.tbl th { font-family: var(--font-head); font-size: 12px; text-transform: uppercase; letter-spacing:.04em; color: var(--text-faint); }
table.tbl tr:last-child td { border-bottom:none; }

/* week plan */
.week { display:flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.week .wn { flex:0 0 auto; width: 54px; height: 54px; border-radius: 12px; background: var(--accent-soft); color: var(--c-orange-dk); display:grid; place-items:center; font-family: var(--font-head); font-weight:700; font-size: 13px; text-align:center; line-height:1.1; }
.week .wbody h4 { margin: 2px 0 6px; font-size: 15px; }
.week .wbody p { margin: 0; font-size: 13.5px; color: var(--text-soft); }

/* misc */
.hidden { display:none !important; }
.spin { display:inline-block; width:16px;height:16px;border:2px solid var(--c-lightgray);border-top-color:var(--c-orange);border-radius:50%;animation:sp .7s linear infinite;}
@keyframes sp { to { transform: rotate(360deg);} }
.toast { position:fixed; bottom: 24px; left:50%; transform: translateX(-50%); background: var(--c-dark); color:#fff; padding: 11px 20px; border-radius: 99px; font-size: 13.5px; box-shadow: var(--shadow-lg); z-index: 100; opacity:0; transition: opacity .3s, transform .3s; pointer-events:none; }
.toast.show { opacity:1; transform: translateX(-50%) translateY(0); }

/* responsive */
.menu-toggle { display:none; }
@media (max-width: 920px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left:0; top:0; width: 300px; z-index: 50; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .menu-toggle { display: grid; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .slide { padding: 26px 28px; }
  .slide h2 { font-size: 23px; } .slide li, .slide p { font-size: 15px; }
  .weight-row .nm { width: 150px; font-size: 12px; }
  .scrim { position:fixed; inset:0; background: rgba(0,0,0,.35); z-index: 40; }
}
