/* ============================================================
   Excel Caregiver — Memory Care LMS
   Design language: "clinical calm meets warmth."
   Signature motif: the forget-me-not (dementia-awareness flower).
   Palette: sage + pine ink, periwinkle "memory" accent, warm sand,
   gold reserved for earned/certificate moments only.
   ============================================================ */

:root {
  --sand:      #F6F3EC;
  --sand-2:    #EFEADD;
  --surface:   #FFFFFF;
  --surface-2: #FBF9F4;
  --line:      #E3DCCC;
  --line-soft: #EDE7D9;
  --ink:       #1B2B2A;
  --ink-2:     #3F514E;
  --muted:     #7C857F;
  --sage:      #4C7A6D;
  --sage-deep: #35594E;
  --sage-tint: #E7F0EC;
  --peri:      #6E7FD6;   /* forget-me-not blue — the "memory" accent */
  --peri-tint: #EAECFB;
  --gold:      #C6A15B;   /* earned / certificate only */
  --gold-tint: #F6EEDC;
  --danger:    #C05B4D;
  --danger-tint:#F7E6E2;
  --ok:        #4C7A6D;

  --shadow-sm: 0 1px 2px rgba(27,43,42,.06), 0 1px 3px rgba(27,43,42,.05);
  --shadow-md: 0 6px 18px rgba(27,43,42,.09), 0 2px 6px rgba(27,43,42,.06);
  --shadow-lg: 0 20px 50px rgba(27,43,42,.16), 0 6px 16px rgba(27,43,42,.08);

  --radius:   14px;
  --radius-lg:22px;
  --radius-sm:9px;

  --display: "Fraunces", ui-serif, Georgia, "Times New Roman", serif;
  --body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;

  --page-bg: var(--sand);
  --header-bg: rgba(246,243,236,.82);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --sand:      #10201D;
  --sand-2:    #16292545;
  --surface:   #17282480;
  --surface-2: #1B2E2A;
  --line:      #2C433D;
  --line-soft: #263A35;
  --ink:       #ECF3EF;
  --ink-2:     #C2D2CC;
  --muted:     #8CA39B;
  --sage:      #7FB5A4;
  --sage-deep: #A6D0C3;
  --sage-tint: #1E332E;
  --peri:      #97A5EA;
  --peri-tint: #212C4A;
  --gold:      #DDB871;
  --gold-tint: #2E2716;
  --danger:    #E28A7D;
  --danger-tint:#3A241F;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,.45);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.55);

  --page-bg: #0C1917;
  --header-bg: rgba(12,25,23,.82);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  background: var(--page-bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
body.no-scroll { overflow: hidden; }

h1,h2,h3,h4 { font-family: var(--display); font-weight: 560; line-height: 1.15; color: var(--ink); margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; color: var(--ink-2); }
a { color: var(--sage-deep); text-decoration: none; }
a:hover { color: var(--sage); }
.muted { color: var(--muted); }
strong { color: var(--ink); font-weight: 620; }

.wrap { width: min(1120px, 92vw); margin-inline: auto; }
.narrow { width: min(560px, 92vw); margin-inline: auto; }
.mid { width: min(820px, 92vw); margin-inline: auto; }
.eyebrow { font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; color: var(--sage); margin: 0 0 .8rem; }
.center { text-align: center; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: saturate(1.4) blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line-soft);
}
.site-header .bar { display: flex; align-items: center; gap: 1rem; height: 68px; }
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--display); font-weight: 600; font-size: 1.15rem; color: var(--ink); }
.brand .flower { width: 30px; height: 30px; flex: none; }
.brand small { display: block; font-family: var(--body); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-top: -2px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.nav a.link { padding: .5rem .8rem; border-radius: 9px; color: var(--ink-2); font-weight: 500; font-size: .95rem; }
.nav a.link:hover { background: var(--sand-2); color: var(--ink); }
.nav .who { font-size: .9rem; color: var(--muted); padding-inline: .4rem; }

.theme-toggle {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; display: grid; place-items: center;
  transition: transform .2s, background .2s, border-color .2s;
}
.theme-toggle:hover { transform: translateY(-1px); border-color: var(--sage); }
.theme-toggle svg { width: 19px; height: 19px; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
:root:not([data-theme="dark"]) .theme-toggle .i-sun { display: none; }

.hamburger { display: none; width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--sage-deep); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.35rem; border-radius: 11px; border: 1px solid transparent;
  background: var(--bg); color: var(--fg); font-family: var(--body); font-weight: 600; font-size: .96rem;
  cursor: pointer; transition: transform .16s ease, box-shadow .2s, filter .2s, background .2s; text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--fg); }
.btn:active { transform: translateY(0); }
.btn.block { width: 100%; }
.btn.lg { padding: 1rem 1.7rem; font-size: 1.02rem; }
.btn.sm { padding: .5rem .85rem; font-size: .86rem; border-radius: 9px; }
.btn.ghost { --bg: transparent; --fg: var(--ink); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--sand-2); border-color: var(--sage); }
.btn.peri { --bg: var(--peri); }
.btn.gold { --bg: var(--gold); --fg: #3a2f15; }
.btn.danger { --bg: var(--danger); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- Cards / surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card.pad { padding: clamp(1.4rem, 3vw, 2.2rem); }
.panel { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 1.2rem 1.4rem; }
.stack > * + * { margin-top: 1rem; }
.grid { display: grid; gap: 1.2rem; }

/* ---------- Forms ---------- */
label.fld { display: block; margin-bottom: 1rem; }
label.fld > span { display: block; font-weight: 600; font-size: .9rem; color: var(--ink); margin-bottom: .4rem; }
.input, select.input, textarea.input {
  width: 100%; padding: .8rem .95rem; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-family: var(--body); font-size: 1rem; transition: border-color .2s, box-shadow .2s;
}
.input:focus, textarea.input:focus, select.input:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px var(--sage-tint); }
textarea.input { min-height: 120px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pw-wrap { position: relative; }
.pw-wrap .toggle-pw { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--muted); cursor: pointer; padding: .35rem .5rem; font-size: .82rem; font-weight: 600; }
.help { font-size: .82rem; color: var(--muted); margin-top: .35rem; }

/* ---------- Flash / alerts ---------- */
.flash { padding: .85rem 1.1rem; border-radius: 12px; margin-bottom: 1.2rem; font-size: .94rem; display: flex; gap: .6rem; border: 1px solid; }
.flash.ok { background: var(--sage-tint); border-color: var(--sage); color: var(--sage-deep); }
.flash.warn { background: var(--gold-tint); border-color: var(--gold); color: #7a5f22; }
.flash.err { background: var(--danger-tint); border-color: var(--danger); color: #8f3b2e; }
:root[data-theme="dark"] .flash.warn { color: var(--gold); }
:root[data-theme="dark"] .flash.err { color: var(--danger); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .65rem; border-radius: 999px; font-size: .76rem; font-weight: 700; letter-spacing: .02em; }
.badge.sage { background: var(--sage-tint); color: var(--sage-deep); }
.badge.peri { background: var(--peri-tint); color: var(--peri); }
.badge.gold { background: var(--gold-tint); color: #7a5f22; }
.badge.gray { background: var(--sand-2); color: var(--muted); }
.badge.danger { background: var(--danger-tint); color: #8f3b2e; }
:root[data-theme="dark"] .badge.gold { color: var(--gold); }
:root[data-theme="dark"] .badge.danger { color: var(--danger); }

/* ---------- Landing ---------- */
.hero { position: relative; padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 5rem); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.hero h1 { margin-bottom: 1rem; }
.hero h1 em { font-style: italic; color: var(--sage); }
.hero .lead { font-size: 1.15rem; max-width: 34ch; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }
.hero-trust { display: flex; gap: 1.6rem; margin-top: 2.4rem; flex-wrap: wrap; }
.hero-trust .t { }
.hero-trust .t b { font-family: var(--display); font-size: 1.6rem; color: var(--ink); display: block; }
.hero-trust .t span { font-size: .82rem; color: var(--muted); }

/* forget-me-not bloom art in hero */
.bloom-stage { position: relative; display: grid; place-items: center; min-height: 340px; }
.bloom-stage .ring { position: absolute; border-radius: 50%; border: 1px solid var(--line); }
.bloom-stage .ring.r1 { inset: 8%; }
.bloom-stage .ring.r2 { inset: 20%; border-style: dashed; opacity: .6; }
.bloom-card { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-md); padding: .7rem .9rem; font-size: .84rem; display: flex; align-items: center; gap: .5rem; }
.bloom-card .dot { width: 9px; height: 9px; border-radius: 50%; }
.bloom-card.c1 { top: 6%; left: -4%; animation: floaty 6s ease-in-out infinite; }
.bloom-card.c2 { bottom: 10%; right: -6%; animation: floaty 7s ease-in-out infinite .8s; }
.bloom-card.c3 { bottom: 30%; left: -8%; animation: floaty 6.5s ease-in-out infinite .4s; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

.section { padding: clamp(2.6rem, 6vw, 4.5rem) 0; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; }
.feature { padding: 1.6rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); transition: transform .25s, box-shadow .25s; }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature .ic { width: 46px; height: 46px; border-radius: 12px; background: var(--sage-tint); display: grid; place-items: center; margin-bottom: .9rem; color: var(--sage-deep); }
.feature .ic svg { width: 24px; height: 24px; }
.feature h3 { margin-bottom: .35rem; }
.feature p { font-size: .95rem; margin: 0; }

.curriculum { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
.mod-row { display: flex; align-items: center; gap: .9rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.mod-row .n { font-family: var(--display); font-size: 1rem; width: 30px; height: 30px; border-radius: 8px; background: var(--peri-tint); color: var(--peri); display: grid; place-items: center; flex: none; font-weight: 600; }
.mod-row .t { font-weight: 600; font-size: .95rem; }

/* ---------- App shell (dashboard/study/exam) ---------- */
.app-main { padding: clamp(1.6rem, 4vw, 3rem) 0 5rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.8rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: clamp(1.6rem, 3.4vw, 2.4rem); }

/* progress bloom: petals fill as modules complete */
.bloom { --pct: 0; display: inline-grid; place-items: center; }
.bloom-num { font-family: var(--display); font-weight: 600; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.stat .k { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.stat .v { font-family: var(--display); font-size: 1.8rem; color: var(--ink); margin-top: .2rem; }

.module-list { display: grid; gap: .8rem; }
.module-item { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.3rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .2s, transform .2s; }
.module-item:hover { border-color: var(--sage); transform: translateX(3px); }
.module-item .idx { font-family: var(--display); font-size: 1.1rem; width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--sage-tint); color: var(--sage-deep); font-weight: 600; }
.module-item .meta { flex: 1; min-width: 0; }
.module-item .meta b { display: block; font-size: 1rem; }
.module-item .meta span { font-size: .86rem; color: var(--muted); }

/* ---------- Reader (protected study) — premium layout ---------- */
.reader-app { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 1.6rem; align-items: start; width: min(1180px, 95vw); margin-inline: auto; }

/* Sidebar: module navigator */
.reader-aside { position: sticky; top: 84px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.1rem 1rem; box-shadow: var(--shadow-sm); }
.reader-aside .ra-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.reader-aside .ra-title { font-family: var(--display); font-size: 1.05rem; color: var(--ink); }
.reader-aside .ra-progress { font-size: .78rem; color: var(--muted); }
.ra-bar { height: 6px; border-radius: 99px; background: var(--sand-2); overflow: hidden; margin: .3rem 0 .9rem; }
.ra-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--sage), var(--peri)); border-radius: 99px; transition: width .5s ease; }
.ra-list { display: flex; flex-direction: column; gap: 2px; max-height: 62vh; overflow-y: auto; margin: 0 -.4rem; padding: 0 .4rem; }
.ra-item { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: .6rem; padding: .6rem .55rem; border-radius: 12px; text-decoration: none; color: var(--ink-2); transition: background .15s, color .15s; }
.ra-item:hover { background: var(--surface-2); color: var(--ink); }
.ra-item.on { background: var(--sage-tint); color: var(--ink); }
.ra-item.on .ra-num { background: var(--sage); color: #fff; border-color: var(--sage); }
.ra-num { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.ra-name { font-size: .86rem; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ra-check { width: 18px; height: 18px; color: var(--sage); opacity: 0; }
.ra-item.done .ra-check { opacity: 1; }
.ra-item.done .ra-num { background: var(--sage-tint); border-color: transparent; color: var(--sage-deep); }

/* Main reader column */
.reader-main { min-width: 0; }
.reader-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.reader-top .lock { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; color: var(--muted); }
.reader-head { margin-bottom: 1.1rem; }
.reader-head .eyebrow { margin-bottom: .35rem; }
.reader-head h1 { font-size: clamp(1.5rem, 3.2vw, 2.05rem); line-height: 1.15; margin: 0 0 .4rem; }
.reader-head .lead { color: var(--ink-2); font-size: 1.02rem; line-height: 1.6; margin: 0; max-width: 68ch; }

/* Document viewer */
.doc-shell { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; }
.doc-bar { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line-soft); background: var(--surface-2); }
.doc-bar .dot-row { display: inline-flex; gap: 6px; }
.doc-bar .dot { width: 10px; height: 10px; border-radius: 99px; background: var(--line); }
.doc-bar .doc-label { font-size: .82rem; color: var(--muted); display: inline-flex; align-items: center; gap: .45rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.doc-tools { display: inline-flex; gap: .4rem; }
.doc-tools button { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 8px; padding: .35rem .6rem; font-size: .78rem; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; }
.doc-tools button:hover { border-color: var(--sage); color: var(--sage-deep); }
.doc-frame { position: relative; width: 100%; height: min(78vh, 900px); background: var(--sand-2); overflow: hidden; }
/* Shift the embedded viewer up so Google's own top toolbar — with its pop-out,
   download, and print controls — is cropped out of view. */
.doc-frame iframe { position: absolute; left: 0; top: -58px; width: 100%; height: calc(100% + 58px); border: 0; }
.doc-mask { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--surface-2); z-index: 3; pointer-events: none; }
.doc-shell.fs { position: fixed; inset: 3vh 3vw; z-index: 120; height: auto; }
.doc-shell.fs .doc-frame { height: calc(94vh - 52px); }
.doc-backdrop { position: fixed; inset: 0; background: rgba(15,25,23,.55); z-index: 110; backdrop-filter: blur(2px); }

/* Optional written material below the document */
.reader-body { margin-top: 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.4rem, 3.5vw, 2.4rem); user-select: none; -webkit-user-select: none; }
.reader-body :is(h1,h2,h3) { user-select: none; }
.reader-body p, .reader-body li { font-size: 1.05rem; line-height: 1.8; color: var(--ink-2); }
.reader-body .note { background: var(--peri-tint); border-left: 3px solid var(--peri); padding: 1rem 1.2rem; border-radius: 10px; color: var(--ink-2); }

/* Footer nav */
.reader-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.6rem; }
.reader-nav .spacer { flex: 1; }

@media (max-width: 900px) {
  .reader-app { grid-template-columns: 1fr; }
  .reader-aside { position: static; top: auto; }
  .ra-list { max-height: none; flex-direction: row; overflow-x: auto; gap: .5rem; padding-bottom: .3rem; }
  .ra-item { grid-template-columns: 26px auto; min-width: 190px; }
  .ra-item .ra-check { display: none; }
  .doc-frame { height: 72vh; }
}

/* ---------- Exam ---------- */
.exam-timer { position: sticky; top: 78px; z-index: 20; display: inline-flex; align-items: center; gap: .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .5rem 1rem; font-weight: 700; font-variant-numeric: tabular-nums; box-shadow: var(--shadow-sm); }
.exam-timer.warn { border-color: var(--danger); color: var(--danger); }
.q-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; margin-bottom: 1.1rem; }
.q-card .qn { font-family: var(--display); color: var(--peri); font-weight: 600; font-size: .9rem; }
.q-card .qtext { font-weight: 600; font-size: 1.08rem; margin: .3rem 0 1rem; color: var(--ink); }
.opt { display: flex; align-items: flex-start; gap: .7rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 11px; margin-bottom: .55rem; cursor: pointer; transition: border-color .18s, background .18s; }
.opt:hover { border-color: var(--sage); background: var(--sage-tint); }
.opt input { margin-top: .25rem; accent-color: var(--sage); width: 18px; height: 18px; flex: none; }
.opt.picked { border-color: var(--sage); background: var(--sage-tint); }
.opt .lab { font-weight: 700; color: var(--sage-deep); margin-right: .2rem; }

/* progress bar */
.pbar { height: 8px; background: var(--sand-2); border-radius: 999px; overflow: hidden; }
.pbar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--sage), var(--peri)); border-radius: 999px; transition: width .5s ease; }

/* ---------- Certificate ---------- */
.cert-frame { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.certificate {
  position: relative; background: #fffdf7; color: #2a2213; aspect-ratio: 1.414/1; width: 100%;
  padding: clamp(2rem, 5vw, 4rem); border: 10px solid #fff; outline: 2px solid var(--gold);
  outline-offset: -18px; font-family: var(--display); text-align: center; display: flex; flex-direction: column; justify-content: center;
}
.certificate .c-eyebrow { font-family: var(--body); letter-spacing: .32em; text-transform: uppercase; font-size: .72rem; color: #9a7d3f; font-weight: 700; }
.certificate .c-name { font-size: clamp(1.8rem, 5vw, 3rem); margin: .6rem 0; color: #23324a; }
.certificate .c-course { font-size: 1.3rem; color: #35594E; }
.certificate .c-body { font-family: var(--body); color: #5a5442; max-width: 46ch; margin: .6rem auto 1.2rem; font-size: .96rem; }
.certificate .c-foot { font-family: var(--body); display: flex; justify-content: space-between; gap: 1rem; margin-top: auto; font-size: .82rem; color: #6a6250; }
.certificate .c-foot .sig { text-align: center; }
.certificate .c-foot .sig b { font-family: var(--display); font-size: 1.1rem; color: #2a2213; display: block; border-bottom: 1px solid #cdb984; padding-bottom: .2rem; margin-bottom: .2rem; }
.cert-seal { position: absolute; top: clamp(1.4rem,4vw,2.6rem); right: clamp(1.4rem,4vw,2.6rem); width: 78px; height: 78px; }
.cert-watermark { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: .04; }
.cert-watermark svg { width: 60%; }

/* ---------- Tables (admin) ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .7rem .8rem; border-bottom: 1px solid var(--line); }
.table td { padding: .8rem .8rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:hover td { background: var(--surface-2); }

/* ---------- Admin layout ---------- */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; gap: 1.6rem; align-items: start; }
.admin-nav { position: sticky; top: 84px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem; display: grid; gap: .2rem; }
.admin-nav a { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border-radius: 9px; color: var(--ink-2); font-weight: 500; font-size: .92rem; }
.admin-nav a:hover { background: var(--sand-2); color: var(--ink); }
.admin-nav a.on { background: var(--sage-tint); color: var(--sage-deep); font-weight: 700; }
.admin-nav a svg { width: 18px; height: 18px; flex: none; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line-soft); padding: 2.4rem 0; margin-top: 3rem; color: var(--muted); font-size: .9rem; }
.site-footer .row { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; }

/* ---------- Utility ---------- */
.hr { height: 1px; background: var(--line-soft); border: 0; margin: 1.6rem 0; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.text-gold { color: var(--gold); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .bloom-stage { min-height: 260px; }
  .feature-grid { grid-template-columns: 1fr; }
  .curriculum { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav { position: static; display: flex; overflow-x: auto; }
  .field-row { grid-template-columns: 1fr; }
  .nav .link.hide-sm { display: none; }
  .hamburger { display: grid; place-items: center; }
  .nav.mobile-hidden { display: none; }
  .nav { position: absolute; top: 68px; right: 4vw; left: 4vw; flex-direction: column; align-items: stretch; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; box-shadow: var(--shadow-lg); }
  .nav a.link { padding: .8rem 1rem; }
  .nav .who { padding: .5rem 1rem; }
  .nav .theme-toggle, .nav .btn { align-self: stretch; }
}

@media print {
  .site-header, .site-footer, .no-print, .reader-nav, .reader-aside, .theme-toggle, .hamburger { display: none !important; }
  body { background: #fff; }
  .reader-body, .doc-shell { display: none !important; }
  .print-block { display: block !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- Status panel (payment submitted / awaiting approval) ---------- */
.status-panel { display: flex; gap: 1.1rem; align-items: flex-start; background: var(--peri-tint); border: 1px solid var(--peri); border-radius: var(--radius-lg); padding: 1.4rem 1.5rem; box-shadow: var(--shadow-sm); }
.status-panel.wait .sp-icon { color: var(--peri); }
.status-panel .sp-icon { flex: none; width: 46px; height: 46px; border-radius: 12px; background: var(--surface); display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.status-panel .sp-body { min-width: 0; }
.status-panel .sp-body h2 { margin: .5rem 0 .3rem; font-size: 1.35rem; }
.status-panel .sp-body p { margin: 0 0 .9rem; color: var(--ink-2); line-height: 1.6; }
.sp-steps { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; }
.sp-step { display: inline-flex; align-items: center; gap: .5rem; font-size: .86rem; color: var(--muted); }
.sp-step .d { width: 12px; height: 12px; border-radius: 99px; border: 2px solid var(--line); background: var(--surface); }
.sp-step.done { color: var(--sage-deep); }
.sp-step.done .d { background: var(--sage); border-color: var(--sage); }
.sp-step.active { color: var(--ink); font-weight: 600; }
.sp-step.active .d { background: var(--peri); border-color: var(--peri); box-shadow: 0 0 0 4px var(--peri-tint); }
@media (max-width: 620px){ .status-panel { flex-direction: column; } }

/* ---------- Student profile ---------- */
.profile-head { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; flex-wrap: wrap; }
.profile-head .ph-id { display: flex; align-items: center; gap: 1rem; }
.avatar { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--sage), var(--peri)); color: #fff; font-family: var(--display); font-size: 1.4rem; font-weight: 600; flex: none; box-shadow: var(--shadow-sm); }
.ph-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.prog-list { display: flex; flex-direction: column; }
.prog-row { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: .7rem; padding: .55rem 0; border-bottom: 1px solid var(--line-soft); }
.prog-row:last-child { border-bottom: 0; }
.pr-num { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: .8rem; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.pr-num.done { background: var(--sage-tint); border-color: transparent; color: var(--sage-deep); }
.pr-name { font-size: .92rem; color: var(--ink); }
.pay-row { padding: .7rem 0; border-bottom: 1px solid var(--line-soft); }
.pay-row:first-of-type { padding-top: 0; }
.pay-row:last-child { border-bottom: 0; padding-bottom: 0; }
/* clickable table rows */
tr.rowlink { cursor: pointer; }
tr.rowlink:hover { background: var(--surface-2); }
