@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

/* Great Haven Academy — one compact design system for learner pages. */
:root{
  --bg:#F7F7F4;
  --surface:#FFFFFF;
  --ink:#14214A;
  --ink2:#3F4A63;
  --muted:#6B7385;
  --line:#E4E4DC;
  --lineStrong:#D3D3C8;
  --accent:#CDD12F;
  --accentHover:#BFC322;
  --accentInk:#4F5600;
  --accentSoft:#F4F5D6;
  --danger:#B42318;
  --dangerSoft:#FEF0EE;
  --ok:#2F6B1F;
  --okSoft:#EDF6E8;
  --radius:12px;
  --radiusSm:8px;
  --font:Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

*{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }
body{
  margin:0;
  min-height:100vh;
  background:var(--bg);
  color:var(--ink);
  font:400 15px/1.6 var(--font);
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4{ margin:0; color:var(--ink); font-weight:700; line-height:1.25; letter-spacing:-.01em; }
p{ margin:0; }
a{ color:inherit; }
img,iframe,video{ max-width:100%; }
[hidden]{ display:none !important; }
.srOnly{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }

/* ---------- App bar ---------- */
.appbar{ background:var(--surface); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:20; }
.appbarInner{ max-width:1080px; margin:0 auto; padding:0 20px; height:60px; display:flex; align-items:center; justify-content:space-between; gap:16px; }
.brand{ display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--ink); font-weight:700; font-size:15px; white-space:nowrap; }
.mark{ width:32px; height:32px; display:block; flex:0 0 auto; }
.badge{ width:88px; height:88px; display:block; }
.nav{ display:flex; align-items:center; gap:4px; }
.nav a,.navBtn{
  padding:8px 12px; border-radius:var(--radiusSm); border:0; background:none;
  color:var(--ink2); font:500 14px/1 var(--font); text-decoration:none; cursor:pointer; white-space:nowrap;
}
.nav a:hover,.navBtn:hover{ background:var(--bg); color:var(--ink); }
.nav a[aria-current="page"]{ color:var(--ink); font-weight:600; background:var(--bg); }
.nav .navCta{ background:var(--accent); color:var(--ink); font-weight:600; }
.nav .navCta:hover{ background:var(--accentHover); }

/* ---------- Page layout ---------- */
.page{ max-width:1080px; margin:0 auto; padding:36px 20px 64px; }
.page.narrow{ max-width:760px; }
.pageHead{ display:flex; align-items:flex-end; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:24px; }
.pageHead h1{ font-size:28px; }
.pageHead p,.lead{ color:var(--ink2); margin-top:6px; max-width:62ch; }
.crumb{ display:inline-block; margin-bottom:8px; color:var(--muted); font-size:13px; font-weight:500; text-decoration:none; cursor:pointer; }
.crumb:hover{ color:var(--ink); }
.section{ margin-top:36px; }
.sectionTitle{ font-size:13px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; margin-bottom:12px; }
.footer{ max-width:1080px; margin:0 auto; padding:24px 20px 40px; color:var(--muted); font-size:13px; display:flex; gap:16px; flex-wrap:wrap; justify-content:space-between; border-top:1px solid var(--line); }
.footer a{ color:var(--muted); text-decoration:none; }
.footer a:hover{ color:var(--ink); }

/* ---------- Surfaces ---------- */
.card{ background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:24px; }
.list{ background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; }
.row{ display:flex; align-items:center; gap:16px; padding:16px 20px; border-top:1px solid var(--line); }
.row:first-child{ border-top:0; }
.rowMain{ flex:1; min-width:0; }
.rowMain h3{ font-size:16px; font-weight:600; }
.rowMain p{ color:var(--muted); font-size:14px; margin-top:2px; }
.rowNum{ width:28px; height:28px; border-radius:999px; background:var(--bg); border:1px solid var(--line); display:grid; place-items:center; font-size:13px; font-weight:600; color:var(--ink2); flex:0 0 auto; }
.grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:16px; }
.divider{ height:1px; background:var(--line); border:0; margin:24px 0; }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:40px; padding:0 16px; border-radius:var(--radiusSm);
  border:1px solid var(--lineStrong); background:var(--surface); color:var(--ink);
  font:600 14px/1 var(--font); text-decoration:none; cursor:pointer; white-space:nowrap;
  transition:background-color .12s, border-color .12s;
}
.btn:hover:not(:disabled){ border-color:var(--ink2); }
.btnPrimary{ background:var(--accent); border-color:var(--accent); color:var(--ink); }
.btnPrimary:hover:not(:disabled){ background:var(--accentHover); border-color:var(--accentHover); }
.btnLink{ border:0; background:none; padding:0; min-height:0; color:var(--ink2); font-weight:500; text-decoration:underline; text-underline-offset:3px; }
.btn:disabled,.btn[aria-disabled="true"]{ opacity:.5; cursor:not-allowed; }
.btnBlock{ width:100%; }
.actions{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-top:20px; }
:focus-visible{ outline:2px solid var(--ink); outline-offset:2px; }

/* ---------- Chips & status ---------- */
.meta{ display:flex; gap:6px; flex-wrap:wrap; margin:10px 0 0; }
.meta:empty{ display:none; }
.chip{ display:inline-flex; align-items:center; padding:2px 8px; border-radius:999px; background:var(--bg); border:1px solid var(--line); color:var(--ink2); font-size:12px; font-weight:500; line-height:18px; }
.chipAccent,.chipGold{ background:var(--accentSoft); border-color:transparent; color:var(--accentInk); }
.chipOk{ background:var(--okSoft); border-color:transparent; color:var(--ok); }
.chipDanger,.chipWarn{ background:var(--dangerSoft); border-color:transparent; color:var(--danger); }
.chipWarn{ background:var(--bg); border-color:var(--line); color:var(--ink2); }
.status{ font-size:13px; font-weight:500; color:var(--muted); white-space:nowrap; }

/* ---------- Progress ---------- */
.progress{ height:6px; border-radius:999px; background:var(--line); overflow:hidden; }
.progress > div{ height:100%; width:0; background:var(--accent); border-radius:inherit; transition:width .3s; }

/* ---------- Forms ---------- */
label{ display:block; margin:16px 0 6px; font-size:13px; font-weight:600; color:var(--ink); }
input,textarea,select{
  width:100%; min-height:42px; padding:10px 12px; border-radius:var(--radiusSm);
  border:1px solid var(--lineStrong); background:var(--surface); color:var(--ink);
  font:400 15px/1.4 var(--font);
}
textarea{ min-height:110px; resize:vertical; }
input:focus,textarea:focus,select:focus{ outline:none; border-color:var(--ink); box-shadow:0 0 0 3px rgba(20,33,74,.08); }
input[readonly]{ background:var(--bg); color:var(--muted); }
input[type="checkbox"],input[type="radio"]{ width:18px; height:18px; min-height:0; padding:0; margin:2px 0 0; accent-color:var(--ink); flex:0 0 auto; box-shadow:none; }
.choice{ display:flex; align-items:flex-start; gap:10px; margin:10px 0 0; font-weight:400; font-size:14px; color:var(--ink); cursor:pointer; }
.choices{ display:flex; gap:20px; flex-wrap:wrap; }
.choices .choice{ margin-top:4px; }
fieldset{ border:0; padding:0; margin:28px 0 0; min-width:0; }
legend{ padding:0; font-size:13px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; }
.hint{ margin-top:6px; font-size:13px; color:var(--muted); font-weight:400; }
.two{ display:grid; grid-template-columns:1fr 1fr; gap:0 16px; }
.formFoot{ margin-top:28px; }
.formFoot .btn{ min-width:200px; }
.hide,.hidden{ display:none !important; }
.callout{ margin-top:20px; padding:14px 16px; border-radius:var(--radiusSm); background:var(--bg); font-size:14px; color:var(--ink2); }
.callout.warn{ background:var(--dangerSoft); color:var(--danger); }
.revealOnSuccess{ display:none; }
.revealOnSuccess.isVisible{ display:block; }
.dl{ display:grid; grid-template-columns:140px 1fr; gap:8px 16px; margin:0; font-size:14px; }
.dl dt{ color:var(--muted); }
.dl dd{ margin:0; }
.prose ul{ margin:8px 0 0; padding-left:20px; color:var(--ink2); font-size:14px; }
.prose li{ margin:4px 0; }
.prose h3{ font-size:15px; margin-top:20px; }
.prose h3:first-child{ margin-top:0; }
.split{ display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:24px; align-items:start; }
@media (max-width:820px){ .split{ grid-template-columns:1fr; } }
@media (max-width:560px){ .two{ grid-template-columns:1fr; } .dl{ grid-template-columns:1fr; gap:2px; } .dl dd{ margin-bottom:8px; } }

/* ---------- Messages ---------- */
.msg,.formMessage{ font-size:14px; white-space:pre-wrap; }
.msg:empty,.formMessage:empty{ display:none; }
.msg:not(:empty),.formMessage:not(:empty){ margin-top:14px; padding:10px 12px; border-radius:var(--radiusSm); background:var(--bg); color:var(--ink2); }
.msg.error,.formMessage.error{ background:var(--dangerSoft); color:var(--danger); }
.msg.ok,.msg.success,.formMessage.ok,.formMessage.success{ background:var(--okSoft); color:var(--ok); }
.empty{ padding:32px 20px; text-align:center; color:var(--muted); background:var(--surface); border:1px dashed var(--lineStrong); border-radius:var(--radius); }
.note{ font-size:13px; color:var(--muted); }
.note a{ color:var(--ink2); }

/* ---------- Auth / status card pages ---------- */
.authPage{ min-height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:32px 16px; }
.authPage > .brand{ flex-direction:column; gap:10px; margin-bottom:24px; font-size:16px; }
.authCard{ width:100%; max-width:400px; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:32px; }
.authCard h1{ font-size:22px; }
.authCard > p{ color:var(--ink2); margin-top:6px; }
.authCard form .btn{ width:100%; margin-top:24px; }
.authLinks{ display:flex; justify-content:space-between; gap:12px; margin-top:20px; font-size:14px; }
.authLinks a,.textLink{ color:var(--ink2); text-decoration:none; font-weight:500; }
.authLinks a:hover,.textLink:hover{ color:var(--ink); text-decoration:underline; }
.authFoot{ margin-top:20px; text-align:center; }

/* ---------- Lesson reading ---------- */
.lessonLayout{ max-width:760px; margin:0 auto; }
.lessonBar{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:8px; }
.media{ border-radius:var(--radius); overflow:hidden; background:#0E1530; margin-bottom:28px; }
.media iframe,.media video{ display:block; width:100%; aspect-ratio:16/9; border:0; }
.mediaNote{ font-size:13px; color:var(--muted); margin:-18px 0 28px; }
.lessonBody{ font-size:17px; line-height:1.75; color:#22293A; }
.lessonBody > *:first-child{ margin-top:0; }
.lessonBody h1,.lessonBody h2{ font-size:22px; margin:36px 0 12px; }
.lessonBody h3{ font-size:18px; margin:28px 0 8px; }
.lessonBody h4{ font-size:16px; margin:24px 0 8px; }
.lessonBody p{ margin:0 0 16px; }
.lessonBody ul,.lessonBody ol{ margin:0 0 16px; padding-left:22px; }
.lessonBody li{ margin:4px 0; }
.lessonBody a{ color:var(--ink); text-decoration-color:var(--accent); text-decoration-thickness:2px; text-underline-offset:3px; }
.lessonBody strong{ color:var(--ink); font-weight:600; }
.lessonBody blockquote,.lessonBody .scripture,.lessonBody .scripture-callout{
  margin:20px 0; padding:4px 0 4px 18px; border-left:3px solid var(--accent); color:var(--ink2); font-style:italic; background:none;
}
.lessonBody .key-truth,.lessonBody .highlight,.lessonBody .application,.lessonBody .takeaway-card{
  margin:20px 0; padding:16px 18px; border-radius:var(--radiusSm); background:var(--accentSoft); border:0; color:var(--ink);
}
.lessonBody code{ font-size:.9em; padding:1px 5px; border-radius:4px; background:var(--bg); }
.lessonBody img{ border-radius:var(--radiusSm); height:auto; }

.reflections{ margin-top:36px; padding-top:28px; border-top:1px solid var(--line); }
.reflections h2{ font-size:18px; }
.refQ{ margin-top:20px; }
.refQHead{ display:flex; align-items:center; gap:8px; }
.refQLabel{ font-size:12px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; }
.refQText{ margin:6px 0 10px; font-weight:500; color:var(--ink); }

.lessonFooter{ margin-top:36px; padding-top:24px; border-top:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.lessonFooter .grow{ flex:1; display:flex; justify-content:center; }

/* ---------- Course drawer ---------- */
.courseMenuOverlay{ position:fixed; inset:0; background:rgba(14,21,48,.35); z-index:40; }
.courseMenuDrawer{
  position:fixed; top:0; right:0; bottom:0; z-index:50; width:min(380px,100%);
  background:var(--surface); border-left:1px solid var(--line); overflow-y:auto;
  transform:translateX(100%); transition:transform .2s ease; visibility:hidden;
}
.courseMenuDrawer.isOpen{ transform:none; visibility:visible; }
body.courseMenuOpen{ overflow:hidden; }
.drawerHeader{ display:flex; justify-content:space-between; align-items:flex-start; gap:12px; padding:20px; border-bottom:1px solid var(--line); position:sticky; top:0; background:var(--surface); }
.drawerHeader h2{ font-size:17px; }
.drawerHeader p{ font-size:13px; color:var(--muted); margin-top:2px; }
.drawerClose{ width:32px; height:32px; border-radius:var(--radiusSm); border:1px solid var(--line); background:none; font-size:20px; line-height:1; color:var(--ink2); cursor:pointer; flex:0 0 auto; }
.drawerSection{ padding:16px 20px; border-bottom:1px solid var(--line); }
.drawerSection:last-child{ border-bottom:0; }
.drawerSection p{ font-size:13px; color:var(--muted); margin-top:8px; }
.sessionItem + .sessionItem{ margin-top:18px; }
.sessionTop{ display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:6px; }
.sessionTop .sessionTitle{ font-size:13px; font-weight:600; color:var(--ink2); }
.sessionTop .chip{ display:none; }
.miniBtn{ display:flex; align-items:center; gap:10px; padding:8px 10px; margin:0 -10px; border-radius:var(--radiusSm); text-decoration:none; color:var(--ink); font-size:14px; }
.miniBtn:hover{ background:var(--bg); }
.miniBtn[aria-current="page"]{ background:var(--accentSoft); font-weight:600; }
.miniBtn[aria-disabled="true"]{ color:var(--muted); cursor:not-allowed; }
.lessonNavMarker{ width:22px; height:22px; border-radius:999px; border:1px solid var(--lineStrong); display:grid; place-items:center; font-size:11px; font-weight:600; color:var(--ink2); flex:0 0 auto; }
.lessonNavText{ flex:1; min-width:0; }
.lessonNavTitle{ display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lessonNavState{ display:none; }
.lessonNavStatus{ font-size:12px; color:var(--muted); }
.drawerOption{ background:none; border:0; padding:0; color:var(--danger); font:500 14px var(--font); cursor:pointer; }

/* ---------- Course syllabus ---------- */
.sessionGroup{ margin-top:28px; }
.sessionGroup .sessionHeader{ margin-bottom:10px; }
.sessionGroup .sessionTitle{ font-size:13px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; }
.sessionGroup .sessionDesc{ display:none; }
.sessionLessons{ background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; }
.lessonRow{ display:flex; align-items:center; gap:14px; padding:14px 18px; border-top:1px solid var(--line); text-decoration:none; color:var(--ink); }
.lessonRow:first-child{ border-top:0; }
a.lessonRow:hover{ background:#FBFBF8; }
.lessonRow .rowMain h3{ font-size:15px; font-weight:600; }
.lessonRow.isLocked{ color:var(--muted); }
.lessonRow.isLocked h3{ color:var(--muted); }
.lessonRow.isDone .rowNum{ background:var(--accent); border-color:var(--accent); color:var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width:640px){
  .appbarInner{ padding:0 14px; }
  .brand .brandName{ display:none; }
  .nav a,.navBtn{ padding:8px 9px; font-size:13px; }
  .page{ padding:24px 16px 48px; }
  .pageHead h1{ font-size:24px; }
  .row{ flex-wrap:wrap; padding:14px 16px; }
  .row .btn{ width:100%; }
  .authCard{ padding:24px 20px; }
  .lessonBody{ font-size:16px; }
  .lessonFooter > *{ flex:1 1 100%; }
  .lessonFooter .btn{ width:100%; }
}
@media (prefers-reduced-motion:reduce){ *{ transition:none !important; } }

/* ---------- Lesson notes (course-authored) ---------- */
.lessonBody .lessonByline{ font-size:14px; color:var(--muted); margin-bottom:20px; }
.lessonBody .lessonNote{ font-size:14px; color:var(--muted); padding:10px 14px; border-radius:var(--radiusSm); background:var(--bg); }
.lessonBody .scriptureList{ list-style:none; padding:0; }
.lessonBody .scriptureList li{ padding:8px 0; border-top:1px solid var(--line); margin:0; font-size:16px; }
.lessonBody .scriptureList li:first-child{ border-top:0; }
.lessonBody .takeaway-card ul{ margin:8px 0 0; }
.lessonBody .key-truth strong:first-child,.lessonBody .takeaway-card > strong{ font-size:13px; text-transform:uppercase; letter-spacing:.06em; color:var(--accentInk); }
.lessonBody blockquote strong{ font-style:normal; font-size:14px; }
.courseMenuDrawer .sessionLessons{ border:0; background:none; border-radius:0; overflow:visible; }
