/* CollegeReach Mentor Portal
 * Palette from the CollegeReach Brand Guidelines (02 Color Palette).
 * Display type stands in for NewBlack (see README to swap in the licensed font).
 */
:root {
  /* Brand */
  --cr-navy: #0F285A;      /* Primary — RGB 15 40 90 */
  --cr-blue: #0B6EB2;      /* Secondary — RGB 11 110 178 */
  --cr-sky: #24B7EA;       /* Accent — RGB 36 183 234 */
  --cr-midnight: #06152F;  /* Deep end of the brand gradient */
  --cr-royal: #1F5FBF;     /* Bright end of the brand gradient */

  /* Tints from the palette grid */
  --cr-navy-80: #1C3E7A;
  --cr-blue-60: #2E9AD0;
  --cr-sky-40: #5DD5F0;
  --cr-sky-10: #E6F7FD;
  --cr-blue-10: #E7F1F9;

  --cr-gradient: linear-gradient(120deg, var(--cr-midnight) 0%, var(--cr-navy) 45%, var(--cr-royal) 100%);

  /* Surfaces & text */
  --bg: #F3F7FB;
  --surface: #FFFFFF;
  --border: #DCE6F0;
  --ink: #0F1E36;
  --muted: #5B6B82;

  /* Status */
  --success: #13955A;
  --success-bg: #E5F6EE;
  --danger: #D93B3B;
  --danger-bg: #FCEBEB;

  --font-body: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Archivo", "Montserrat", system-ui, sans-serif;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 40, 90, .06), 0 8px 24px rgba(15, 40, 90, .08);
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}
a { color: var(--cr-blue); }
img { max-width: 100%; display: block; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--cr-sky); outline-offset: 2px; border-radius: 6px; }

.display {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .01em;
  line-height: 1.05;
}
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cr-sky);
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.topbar {
  background: var(--cr-midnight);
  border-bottom: 1px solid rgba(255,255,255,.08);
  position: sticky; top: 0; z-index: 20;
}
.topbar .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand { flex: none; }
.brand img { height: 26px; width: auto; flex: none; } /* never squash the logo (brand guide: Do Not — Sizing) */
.brand .brand-mark { display: none; height: 30px; }
.brand-tag {
  color: rgba(255,255,255,.7); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  padding-left: 14px; border-left: 1px solid rgba(255,255,255,.2);
}
.nav { display: flex; gap: 6px; margin-left: auto; }
.nav a {
  color: rgba(255,255,255,.75); text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 8px 14px; border-radius: 999px;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav a.active { color: #fff; background: rgba(36,183,234,.18); }

.user { position: relative; }
.user summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  color: #fff; font-weight: 600; font-size: 14px; padding: 4px; border-radius: 999px;
}
.user summary::-webkit-details-marker { display: none; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--cr-blue), var(--cr-sky)); color: #fff; font-weight: 700; font-size: 14px;
}
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 6px; display: grid;
}
.user-menu button {
  text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--ink); font-size: 14px;
}
.user-menu button:hover { background: var(--bg); }
.user-menu .danger { color: var(--danger); }

/* ---------- Hero bands ---------- */
.hero {
  background: var(--cr-gradient);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero::after { /* graduation-cap watermark, as used throughout the brand guide */
  content: ""; position: absolute; right: -60px; bottom: -110px; width: 460px; height: 310px;
  background: url("../img/logo-mark.png") no-repeat center / contain;
  filter: brightness(0) invert(1); opacity: .06; pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.hero-dash .wrap { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; padding-top: 56px; padding-bottom: 64px; }
.hero h1 { margin: 10px 0 14px; font-size: clamp(34px, 5vw, 56px); }
.hero p.lead { margin: 0; max-width: 560px; color: rgba(255,255,255,.82); font-size: 17px; }
.hero-module .wrap { padding-top: 36px; padding-bottom: 40px; }
.hero-module h1 { font-size: clamp(26px, 3.6vw, 38px); margin: 8px 0 10px; }
.crumbs { font-size: 13px; color: rgba(255,255,255,.7); }
.crumbs a { color: rgba(255,255,255,.85); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.ring { position: relative; width: 156px; height: 156px; }
.ring svg { transform: rotate(-90deg); }
.ring .track { stroke: rgba(255,255,255,.14); }
.ring .bar { stroke: var(--cr-sky); transition: stroke-dashoffset .6s ease; }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label strong { font-family: var(--font-display); font-stretch: 125%; font-size: 34px; line-height: 1; }
.ring-label span { font-size: 12px; color: rgba(255,255,255,.75); margin-top: 6px; }

/* ---------- Layout ---------- */
main { padding: 40px 0 72px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 18px; }
.section-head h2 { margin: 0; font-size: 22px; color: var(--cr-navy); }
.section-head .meta { color: var(--muted); font-size: 14px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}

/* Continue card */
.continue {
  display: flex; align-items: center; gap: 22px; padding: 22px 26px; margin: -36px 0 40px; position: relative; z-index: 2;
}
.continue .icon-tile { flex: none; }
.continue .text { flex: 1; min-width: 0; }
.continue .text small { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.continue .text div { font-weight: 700; font-size: 18px; color: var(--cr-navy); }

.icon-tile {
  width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center;
  background: var(--cr-blue-10); color: var(--cr-blue);
}
.icon-tile.done { background: var(--success-bg); color: var(--success); }
.icon { width: 22px; height: 22px; flex: none; }
.icon-sm { width: 16px; height: 16px; flex: none; }

/* Module grid */
.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.module-card {
  display: flex; flex-direction: column; padding: 24px; text-decoration: none; color: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
a.module-card:hover { transform: translateY(-2px); border-color: var(--cr-sky); }
.module-card.locked { opacity: .62; }
.module-card .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.module-num { font-family: var(--font-display); font-stretch: 125%; font-weight: 800; font-size: 30px; color: var(--cr-blue); line-height: 1; }
.module-card h3 { margin: 0 0 8px; font-size: 18px; color: var(--cr-navy); line-height: 1.3; }
.module-card p { margin: 0 0 18px; color: var(--muted); font-size: 14px; flex: 1; }
.module-meta { display: flex; gap: 14px; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.module-meta span { display: inline-flex; align-items: center; gap: 6px; }

.progress { height: 6px; background: var(--cr-blue-10); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--cr-blue), var(--cr-sky)); border-radius: inherit; transition: width .4s ease; }
.hero .progress { background: rgba(255,255,255,.16); max-width: 420px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
  background: var(--bg); color: var(--muted);
}
.pill.progressing { background: var(--cr-sky-10); color: var(--cr-blue); }
.pill.complete { background: var(--success-bg); color: var(--success); }
.pill.locked { background: #EEF1F5; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease, opacity .15s ease;
}
.btn-primary { background: var(--cr-blue); color: #fff; }
.btn-primary:hover { background: var(--cr-navy); }
.btn-accent { background: var(--cr-sky); color: var(--cr-midnight); }
.btn-accent:hover { background: var(--cr-sky-40); }
.btn-ghost { background: transparent; color: var(--cr-blue); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--cr-blue); }
.btn-success { background: var(--success); color: #fff; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- Module page ---------- */
.module-layout { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; }
.steps { padding: 10px; position: sticky; top: 92px; }
.steps h4 { margin: 10px 12px 8px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.step-link {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.35;
}
.step-link:hover { background: var(--bg); }
.step-link.active { background: var(--cr-blue-10); color: var(--cr-navy); }
.step-link.locked, .step-link.soon { color: var(--muted); }
.step-link .state {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center;
  border: 1.5px solid var(--border); color: var(--cr-blue); background: var(--surface);
}
.step-link.done .state { background: var(--success); border-color: var(--success); color: #fff; }
.step-link .sub { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.steps .module-switch { border-top: 1px solid var(--border); margin-top: 8px; padding: 12px; font-size: 13px; }
.steps .module-switch a { text-decoration: none; font-weight: 600; }

.panel { padding: 0; overflow: hidden; }
.panel-head { padding: 22px 32px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 16px; }
.panel-head h2 { margin: 2px 0 0; font-size: 22px; color: var(--cr-navy); line-height: 1.25; }
.panel-head .kind { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--cr-blue); }
.panel-body { padding: 28px 32px; }
.panel-foot {
  padding: 18px 32px; border-top: 1px solid var(--border); background: #FAFCFE;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.panel-foot .hint { color: var(--muted); font-size: 14px; }

/* Document viewer */
.doc-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.doc-file { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.doc-body {
  max-width: 720px; font-size: 16px; line-height: 1.75;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 36px 40px; background: #fff;
  overflow-x: auto; overflow-wrap: break-word;
}
.doc-body h1 { font-family: var(--font-display); font-stretch: 125%; font-weight: 800; text-transform: uppercase; font-size: 26px; line-height: 1.15; color: var(--cr-navy); margin: 0 0 18px; }
.doc-body h2 { font-size: 19px; color: var(--cr-blue); margin: 30px 0 8px; }
.doc-body h3 { font-size: 16px; color: var(--cr-navy); margin: 22px 0 6px; }
.doc-body p { margin: 0 0 14px; }
.doc-body ul, .doc-body ol { padding-left: 22px; margin: 0 0 16px; }
.doc-body li { margin-bottom: 6px; }
.doc-body li::marker { color: var(--cr-blue); }
.doc-body table { width: 100%; border-collapse: collapse; margin: 6px 0 20px; font-size: 14px; }
.doc-body td, .doc-body th { border: 1px solid var(--border); padding: 10px 12px; vertical-align: top; text-align: left; font-weight: inherit; }
.doc-body td p, .doc-body th p { margin: 0; }
.doc-body tr:nth-child(even):not(.head-row) { background: #F7FAFD; }
.doc-body tr.head-row > * { background: var(--cr-navy); border-color: var(--cr-navy); color: #fff; font-weight: 700; }
.doc-body img { height: auto; }
.doc-pdf { width: 100%; height: 75vh; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.doc-end { height: 1px; }
.loading { color: var(--muted); display: flex; align-items: center; gap: 10px; padding: 24px 0; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--cr-blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.alert { padding: 16px 18px; border-radius: var(--radius-sm); background: var(--danger-bg); color: #8A1F1F; font-size: 14px; }
.alert code { background: rgba(0,0,0,.06); padding: 1px 6px; border-radius: 4px; }

/* Video */
.video-frame { position: relative; aspect-ratio: 16 / 9; background: var(--cr-midnight); border-radius: var(--radius-sm); overflow: hidden; }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-soon {
  aspect-ratio: 16 / 9; border-radius: var(--radius-sm); background: var(--cr-gradient); color: #fff;
  display: grid; place-content: center; text-align: center; padding: 24px; position: relative; overflow: hidden;
}
.video-soon .play {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center;
  border: 2px solid rgba(255,255,255,.35); color: var(--cr-sky);
}
.video-soon h3 { margin: 0 0 6px; font-size: 22px; }
.video-soon p { margin: 0; color: rgba(255,255,255,.75); font-size: 14px; }

/* Quiz */
.quiz-intro { color: var(--muted); margin: 0 0 24px; }
.question { margin: 0 0 26px; padding: 0; border: 0; }
.question legend { font-weight: 700; color: var(--cr-navy); margin-bottom: 12px; font-size: 16px; line-height: 1.45; padding: 0; }
.question legend .qn { color: var(--cr-blue); margin-right: 6px; }
.option {
  display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px; margin-bottom: 8px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: #fff;
  transition: border-color .12s ease, background .12s ease;
}
.option:hover { border-color: var(--cr-blue-60); }
.option input { margin: 4px 0 0; accent-color: var(--cr-blue); flex: none; }
.option:has(input:checked) { border-color: var(--cr-blue); background: var(--cr-blue-10); }
.option.correct { border-color: var(--success); background: var(--success-bg); }
.option.wrong { border-color: var(--danger); background: var(--danger-bg); }
.option.disabled { cursor: default; }
.explain { font-size: 14px; color: var(--muted); margin: 6px 2px 0; display: flex; gap: 8px; }
.explain strong { color: var(--ink); }

.result {
  display: flex; align-items: center; gap: 22px; padding: 22px 24px; border-radius: var(--radius-sm); margin-bottom: 28px;
}
.result.pass { background: var(--success-bg); }
.result.fail { background: var(--danger-bg); }
.result .score { font-family: var(--font-display); font-stretch: 125%; font-weight: 800; font-size: 40px; line-height: 1; }
.result.pass .score { color: var(--success); }
.result.fail .score { color: var(--danger); }
.result h3 { margin: 0 0 4px; font-size: 18px; color: var(--ink); }
.result p { margin: 0; color: var(--muted); font-size: 14px; }

.locked-box { text-align: center; padding: 48px 24px; color: var(--muted); }
.locked-box .icon-tile { margin: 0 auto 16px; }
.locked-box h3 { color: var(--cr-navy); margin: 0 0 6px; }

/* ---------- Welcome ---------- */
.welcome {
  min-height: 100vh; background: var(--cr-gradient); color: #fff; display: grid; place-items: center; padding: 32px 16px;
  position: relative; overflow: hidden;
}
.welcome::after {
  content: ""; position: absolute; left: -40px; bottom: -80px; width: 420px; height: 290px;
  background: url("../img/logo-mark.png") no-repeat center / contain; filter: brightness(0) invert(1); opacity: .06;
}
.welcome-card { position: relative; z-index: 1; width: 100%; max-width: 520px; }
.welcome-card .brand img { height: 34px; }
.welcome-card h1 { font-size: clamp(36px, 7vw, 54px); margin: 40px 0 14px; }
.welcome-card p { color: rgba(255,255,255,.82); margin: 0 0 32px; font-size: 17px; }
.welcome-form label { display: block; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.75); margin-bottom: 8px; }
.welcome-form .row { display: flex; gap: 10px; flex-wrap: wrap; }
.welcome-form input {
  flex: 1 1 240px; min-width: 0; padding: 14px 18px; border-radius: 999px; border: 1.5px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08); color: #fff; font: inherit; font-size: 16px;
}
.welcome-form input::placeholder { color: rgba(255,255,255,.5); }
.welcome-form input:focus { outline: none; border-color: var(--cr-sky); background: rgba(255,255,255,.12); }
.welcome-note { margin-top: 18px; font-size: 13px; color: rgba(255,255,255,.55); }

/* Auth forms (on the dark welcome background) */
.auth-form { display: grid; gap: 14px; }
.auth-form .field label { display: block; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.75); margin-bottom: 6px; }
.auth-form input {
  width: 100%; padding: 13px 18px; border-radius: 12px; border: 1.5px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08); color: #fff; font: inherit; font-size: 16px;
}
.auth-form input[readonly] { opacity: .7; }
.auth-form input:focus { outline: none; border-color: var(--cr-sky); background: rgba(255,255,255,.12); }
.auth-form .btn { justify-self: start; margin-top: 6px; }
.auth-form .form-error { background: rgba(217,59,59,.18); color: #FFD6D6; }
.form-error { margin: 0; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--danger-bg); color: #8A1F1F; font-size: 14px; }
.form-error[hidden] { display: none; }

/* Light forms (admin) */
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.invite-form { display: grid; gap: 14px; margin-top: 18px; }
.invite-form input, .invite-form select {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: #fff; color: var(--ink); font: inherit; font-size: 15px;
}
.invite-form input:focus, .invite-form select:focus { outline: none; border-color: var(--cr-blue); box-shadow: 0 0 0 3px rgba(36,183,234,.2); }
.invite-form .btn { justify-self: start; }

/* ---------- Certificate ---------- */
.cert {
  max-width: 880px; margin: 0 auto; padding: 56px; text-align: center; position: relative; overflow: hidden;
  border: 1px solid var(--border); background: #fff;
}
.cert::before { content: ""; position: absolute; inset: 14px; border: 2px solid var(--cr-sky); border-radius: 8px; pointer-events: none; }
.cert .logo { height: 34px; margin: 0 auto 36px; }
.cert .eyebrow { color: var(--cr-blue); }
.cert h1 { color: var(--cr-navy); font-size: clamp(28px, 4.4vw, 44px); margin: 12px 0 24px; }
.cert .name { font-size: clamp(26px, 4vw, 38px); font-weight: 700; color: var(--cr-blue); border-bottom: 2px solid var(--border); display: inline-block; padding: 0 24px 8px; margin: 6px 0 22px; }
.cert p { color: var(--muted); margin: 0 auto; max-width: 560px; }
.cert .date { margin-top: 30px; font-weight: 600; color: var(--ink); }
.cert-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }

/* ---------- Account menu ---------- */
.user-menu-head { display: grid; gap: 2px; padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.user-menu-head strong { color: var(--ink); font-size: 14px; }
.user-menu-head .pill { justify-self: start; margin-top: 6px; }

/* ---------- Roles & shared bits ---------- */
.pill.role-admin { background: var(--cr-navy); color: #fff; }
.pill.role-learner { background: var(--cr-sky-10); color: var(--cr-blue); }
.pill.invited { background: #FFF4DE; color: #8A5A00; }
.pill.overdue { background: var(--danger-bg); color: #A12A2A; }
.pill.due-soon { background: #FFF4DE; color: #8A5A00; }
.pill.due { background: var(--cr-blue-10); color: var(--cr-blue); }
.hero .pill.due { background: rgba(255,255,255,.14); color: #fff; }
.hero-due { margin-top: 14px; }
.due-row { margin-bottom: 12px; }
.course-due { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -6px 0 14px; font-size: 13px; }
.course-due .btn { margin-left: auto; }
.section-head .meta .btn { margin-right: 10px; }

/* Sign-off steps */
.ack-statement { max-width: 720px; padding: 22px 26px; border-left: 4px solid var(--cr-sky); background: #F7FBFE; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 16px; line-height: 1.7; }
.ack-statement p { margin: 0 0 12px; }
.ack-statement p:last-child { margin-bottom: 0; }
.ack-agree { margin-top: 22px; font-weight: 600; }
.ack-name { max-width: 420px; margin-top: 14px; }
.ack-name input { font-size: 17px; }
.signed-box { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--success-bg); color: var(--success); font-size: 14px; }
.signed-box span { color: var(--ink); }
.signed-record { flex-basis: 100%; margin: 2px 0 4px 38px; font-size: 13px; }
.signed-record summary { cursor: pointer; color: var(--cr-blue); font-weight: 600; }
.signed-record blockquote { margin: 8px 0; padding: 10px 14px; border-left: 3px solid var(--cr-sky); background: #F7FBFE; color: var(--ink); }
.signed-record small { color: var(--muted); }
.user-steps li { flex-wrap: wrap; }
.muted { color: var(--muted); }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.avatar.sm { width: 34px; height: 34px; font-size: 13px; flex: none; }
.avatar.lg { width: 72px; height: 72px; font-size: 26px; flex: none; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }

/* ---------- Admin: team ---------- */
.admin-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; margin-bottom: 40px; align-items: start; }
.invite-card { padding: 26px 28px; }
.invite-card h2 { margin: 0; font-size: 20px; color: var(--cr-navy); }
.invite-card > p { margin: 4px 0 0; font-size: 14px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat { padding: 20px 22px; display: grid; gap: 2px; }
.stat span { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat strong { font-family: var(--font-display); font-stretch: 125%; font-size: 36px; line-height: 1.1; color: var(--cr-navy); }
.stat small { color: var(--muted); font-size: 13px; }

.link-box { margin-top: 20px; padding: 18px; border-radius: var(--radius-sm); background: var(--cr-sky-10); border: 1px solid #BFE9F8; }
.link-box-head { display: flex; align-items: center; gap: 8px; color: var(--cr-navy); }
.link-box p { margin: 4px 0 12px; font-size: 14px; color: var(--muted); }
.link-row { display: flex; gap: 8px; flex-wrap: wrap; }
.link-row input { flex: 1 1 220px; min-width: 0; padding: 10px 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); font: inherit; font-size: 13px; color: var(--ink); background: #fff; }
.link-row .btn { padding: 10px 16px; font-size: 14px; }

.table-card { overflow-x: auto; }
.team-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.team-table th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 14px 18px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.team-table td { padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.team-table tbody tr:last-child td { border-bottom: 0; }
.team-table tbody tr { cursor: pointer; transition: background .12s ease; }
.team-table tbody tr:hover, .team-table tbody tr:focus-visible { background: #F7FAFD; }
.person { display: flex; align-items: center; gap: 12px; }
.person strong { display: block; color: var(--cr-navy); }
.person small { color: var(--muted); }
.you { color: var(--muted); font-weight: 500; }
.progress-cell { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.progress-cell .progress { flex: 1; }
.progress-cell span { font-size: 13px; color: var(--muted); font-weight: 600; }
.col-go { width: 32px; color: var(--muted); }

/* ---------- Admin: one person ---------- */
.profile-head { display: flex; align-items: center; gap: 20px; margin-top: 10px; }
.profile-head h1 { margin: 0 0 4px; }
.profile-head .lead { margin: 0; }
.profile-layout { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; }
.profile-side { padding: 24px; position: sticky; top: 92px; }
.profile-ring { display: flex; justify-content: center; }
.profile-ring .ring .track { stroke: var(--cr-blue-10); }
.profile-ring .ring .bar { stroke: var(--cr-blue); }
.profile-ring .ring-label strong { color: var(--cr-navy); }
.profile-ring .ring-label span { color: var(--muted); }
.profile-side > p { margin: 8px 0 0; font-size: 14px; }
.facts { margin: 20px 0; display: grid; gap: 0; }
.facts div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }
.profile-actions { display: grid; gap: 10px; }
.profile-actions .btn { width: 100%; }

.user-module { padding: 18px 22px; margin-bottom: 14px; }
.user-module-head { display: flex; align-items: center; gap: 14px; }
.user-module-head h3 { margin: 0; font-size: 16px; color: var(--cr-navy); flex: 1; }
.module-num.sm { font-size: 20px; }
.user-steps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.user-steps li { display: flex; align-items: center; gap: 12px; font-size: 14px; padding: 6px 0; }
.user-steps .title { flex: 1; }
.user-steps .state { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--border); color: var(--cr-blue); flex: none; }
.user-steps li.done .state { background: var(--success); border-color: var(--success); color: #fff; }
.user-steps li.soon { color: var(--muted); }
.user-steps .muted { font-size: 13px; text-align: right; }

/* ---------- Shared form controls (light surfaces) ---------- */
.field :where(input:not([type="checkbox"], [type="radio"], [type="file"]), select, textarea),
.q-card :where(input[type="text"], textarea),
.link-row select, .btn-row select {
  width: 100%; padding: 10px 13px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: #fff; color: var(--ink); font: inherit; font-size: 15px;
}
.btn-row select { width: auto; max-width: 100%; padding: 8px 12px; font-size: 14px; }
.field :where(input, select, textarea):focus, .q-card :where(input, textarea):focus, .link-row select:focus {
  outline: none; border-color: var(--cr-blue); box-shadow: 0 0 0 3px rgba(36,183,234,.2);
}
textarea { resize: vertical; line-height: 1.5; }
fieldset.field { border: 0; padding: 0; margin: 0; }
fieldset.field legend { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 8px; padding: 0; }
.hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--cr-blue); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--muted); display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:hover:not([disabled]) { color: var(--cr-blue); border-color: var(--cr-blue); }
.icon-btn.danger:hover:not([disabled]) { color: var(--danger); border-color: var(--danger); }
.icon-btn[disabled] { opacity: .35; cursor: not-allowed; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; padding: 5px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--cr-blue); margin: 0; }
.check-list { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.warn-note { display: flex; gap: 8px; align-items: center; margin: 10px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: #FFF4DE; color: #8A5A00; font-size: 13px; font-weight: 600; }

/* ---------- Courses list & roles ---------- */
.course-card { display: flex; flex-direction: column; padding: 24px; }
.course-card .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.course-card h3 { margin: 0 0 8px; font-size: 18px; color: var(--cr-navy); }
.course-card > p { margin: 0 0 14px; color: var(--muted); font-size: 14px; flex: 1; }
.course-roles { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; font-size: 13px; }
.course-card .btn-row { margin-top: 6px; }
.new-course { border-style: dashed; box-shadow: none; background: #FAFCFE; }
.new-course .invite-form { margin-top: 0; }
.roles-table tbody tr { cursor: default; }
.roles-table tbody tr:hover { background: none; }
.role-actions { text-align: right; white-space: nowrap; }
.role-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 18px; border-top: 1px solid var(--border); background: #FAFCFE; }
.role-form .field { flex: 1 1 220px; }
.role-form .form-error { flex-basis: 100%; }

/* ---------- Course editor ---------- */
.hero-tight .wrap { padding-top: 26px; padding-bottom: 28px; }
.hero-tight h1 { margin-bottom: 0; }
.editor-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px 12px 20px; margin-bottom: 20px;
  position: sticky; top: 76px; z-index: 10;
}
.editor-bar .btn-row { margin-left: auto; gap: 8px; }
.bar-status { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--success); }
.bar-status.unsaved { color: #8A5A00; }
.bar-status .dot { width: 9px; height: 9px; border-radius: 50%; background: #E3A008; }
.bar-error { flex-basis: 100%; }
.editor-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.outline { padding: 10px; position: sticky; top: 150px; max-height: calc(100vh - 170px); overflow: auto; }
.ol-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 9px 10px; border-radius: 8px; font: inherit; font-size: 14px; color: var(--ink); line-height: 1.3;
}
.ol-item:hover { background: var(--bg); }
.ol-item.active { background: var(--cr-blue-10); color: var(--cr-navy); font-weight: 700; }
.ol-item .icon-sm { color: var(--cr-blue); }
.ol-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-warn { color: #C98A00; display: inline-flex; }
.ol-warn .icon-sm { color: inherit; }
.ol-label { margin: 14px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ol-module { border-top: 1px solid var(--border); padding: 6px 0; }
.ol-mod { font-weight: 700; color: var(--cr-navy); }
.ol-steps { padding-left: 14px; }
.ol-step { font-size: 13px; padding: 7px 10px; }
.ol-empty { margin: 4px 10px 6px 24px; font-size: 13px; color: var(--muted); }
.ol-add { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 2px 4px 6px 12px; font-size: 12px; color: var(--muted); }
.ol-add > span { margin-right: 2px; }
.ol-add button { display: inline-flex; align-items: center; gap: 3px; background: none; border: 1px dashed var(--border); border-radius: 999px; padding: 3px 7px; font: inherit; font-size: 12px; font-weight: 600; color: var(--cr-blue); cursor: pointer; }
.ol-add button:hover { border-color: var(--cr-blue); background: var(--cr-blue-10); }
.ol-add-module { width: 100%; margin-top: 8px; }
.editor-panel { overflow: visible; }
.form-stack { display: grid; gap: 22px; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 14px; }
.inline-field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; margin-top: 8px; }
.inline-field label { font-weight: 600; font-size: 14px; }
.inline-field input { width: 90px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); font: inherit; }
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--cr-blue); background: var(--cr-blue-10); }
.radio-card input { margin-top: 4px; accent-color: var(--cr-blue); }
.radio-card strong { display: block; color: var(--cr-navy); font-size: 14px; }
.radio-card small { color: var(--muted); font-size: 13px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 18px; border: 1px solid #F3C9C9; border-radius: var(--radius-sm); background: #FFFAFA; margin-top: 6px; }
.danger-zone strong { color: var(--ink); font-size: 14px; }
.danger-zone .hint { margin: 2px 0 0; }

.file-current { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg); font-size: 14px; }
.file-current .icon-sm { color: var(--cr-blue); }
.file-name { font-weight: 600; margin-right: auto; word-break: break-all; }
.file-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.file-actions select { flex: 1 1 220px; width: auto; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-status { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.upload-status[hidden] { display: none; }
.upload-status .progress { flex: 0 0 160px; }
.upload-status.error { color: var(--danger); }
.upload-status.error .progress { display: none; }
.doc-preview-box { margin-top: 14px; max-height: 520px; overflow: auto; border-radius: var(--radius-sm); }
#doc-preview .doc-pdf { margin-top: 14px; height: 520px; }

.q-list { display: grid; gap: 14px; }
.q-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; background: #FCFDFF; display: grid; gap: 10px; }
.q-head { display: flex; align-items: center; justify-content: space-between; }
.q-head strong { color: var(--cr-navy); }
.icon-btns { display: flex; gap: 6px; }
.opt-list { display: grid; gap: 8px; }
.opt-row { display: flex; align-items: center; gap: 8px; }
.opt-row input[type="text"] { flex: 1; min-width: 0; }
.opt-row.is-correct input[type="text"] { border-color: var(--success); background: var(--success-bg); }
.opt-correct { display: grid; place-items: center; width: 32px; height: 32px; flex: none; cursor: pointer; }
.opt-correct input { width: 18px; height: 18px; accent-color: var(--success); margin: 0; cursor: pointer; }
.sub-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); }
.sub-label input { display: block; margin-top: 6px; font-weight: 400; }
.opt-list > .link-btn { justify-self: start; margin-left: 40px; }

/* Course downloads (learner course page) */
.downloads-head { margin-top: 40px; }
.downloads { padding: 6px; }
.download-row { display: flex; align-items: center; gap: 16px; padding: 12px 14px; border-radius: var(--radius-sm); text-decoration: none; color: inherit; }
.download-row + .download-row { border-top: 1px solid var(--border); }
.download-row:hover { background: var(--bg); }
.download-row .icon-tile { width: 44px; height: 44px; flex: none; }
.dl-text { flex: 1; min-width: 0; display: grid; }
.dl-text strong { color: var(--cr-navy); }
.dl-text small { color: var(--muted); font-size: 13px; }
.dl-type { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted); background: var(--bg); border-radius: 6px; padding: 3px 7px; }
.dl-action { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--cr-blue); white-space: nowrap; }

/* Course downloads (editor) */
.res-list { display: grid; gap: 10px; margin-bottom: 4px; }
.res-card { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #FCFDFF; }
.res-head { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.res-head .icon-sm { color: var(--cr-blue); }
.res-head .icon-btns { margin-left: 4px; }

.course-head { margin-top: 8px; }
.profile-main .course-head:not(:first-child) { margin-top: 32px; }
.role-change { margin-bottom: 16px; }
.role-change .link-row select { flex: 1 1 140px; }

/* ---------- Footer & toast ---------- */
.footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; padding: 24px 0; }
.footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 50;
  background: var(--cr-navy); color: #fff; padding: 14px 22px; border-radius: 999px; box-shadow: var(--shadow);
  font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px);
}
.toast[hidden] { display: none; }
.toast .icon { color: var(--cr-sky); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .module-layout { grid-template-columns: 1fr; }
  .steps { position: static; }
  .hero-dash .wrap { grid-template-columns: 1fr; }
  .ring { width: 120px; height: 120px; }
  .ring svg { width: 120px; height: 120px; }
  .admin-top, .profile-layout, .editor-layout { grid-template-columns: 1fr; }
  .profile-side, .outline { position: static; max-height: none; }
  .editor-bar { top: 68px; }
  .col-active { display: none; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .topbar .wrap { gap: 12px; }
  .brand-tag, .user-name { display: none; }
  .topbar .brand .brand-full { display: none; }
  .topbar .brand .brand-mark { display: block; }
  .nav a { padding: 8px 10px; }
  .panel-head, .panel-body, .panel-foot { padding-left: 18px; padding-right: 18px; }
  .doc-body { padding: 22px 18px; }
  .continue { flex-wrap: wrap; }
  .cert { padding: 36px 22px; }
  .modules { grid-template-columns: 1fr; }
  .col-progress, .col-role { display: none; }
  .person small { word-break: break-all; }
  .team-table td, .team-table th { padding: 12px; }
  .invite-card { padding: 20px 18px; }
  .stat strong { font-size: 28px; }
  .profile-head { gap: 14px; }
  .avatar.lg { width: 52px; height: 52px; font-size: 18px; }
  .user-steps li { flex-wrap: wrap; }
  .user-steps .muted { flex-basis: 100%; text-align: left; padding-left: 38px; }
  .radio-cards, .field-row { grid-template-columns: 1fr; }
  .download-row { flex-wrap: wrap; gap: 10px 14px; }
  .dl-type { display: none; }
  .editor-bar .btn-row { margin-left: 0; }
  .editor-bar { position: static; }
}

@media print {
  .topbar, .footer, .cert-actions, .toast, .hero { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .cert { border: 0; box-shadow: none; }
  .cert::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
