/* NCYSA Learn — design system
   Look & feel modeled on modern course platforms (Thinkific/Teachable):
   clean white surfaces, one strong brand color, generous spacing,
   card-based catalog, player with dark curriculum sidebar. */

:root {
  --brand: #10045a;          /* NCYSA navy */
  --brand-dark: #0a0340;
  --accent: #b82f2f;         /* NCYSA swoosh red (calls to action) */
  --accent-dark: #8f1f1f;
  --success: #2eaf6d;        /* completed states */
  --success-dark: #1f8a52;
  --ink: #1d1a18;
  --ink-soft: #6b645e;
  --ink-body: #3d3833;
  --line: #e9e4dd;
  --bg: #f9f7f7;
  --card: #ffffff;
  --danger: #b82f2f;
  --gold: #edc32c;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(18, 40, 66, 0.08);
  font-size: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- top nav ---------- */
.topnav {
  position: sticky; top: 0; z-index: 20;
  background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; flex-wrap: nowrap;
  padding: 0 24px; height: 64px;
}
.topnav .logo {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  font-weight: 800; font-size: 1.15rem; color: var(--brand-dark);
  letter-spacing: -0.01em;
}
.topnav .logo > span { min-width: 0; }
.topnav .logo .ball { font-size: 1.4rem; }
.topnav .logo .sub {
  font-size: 0.68rem; font-weight: 600; color: var(--ink-soft);
  display: block; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
}
.topnav .spacer { flex: 1; }
/* Nav items never wrap their own text — when space is tight they hide (see the
   responsive rules below) rather than breaking onto two lines. */
.topnav .navlink, .topnav .btn, .topnav .greeting { white-space: nowrap; flex: none; }
.topnav .navlink { font-weight: 600; color: var(--ink-soft); padding: 8px 10px; border-radius: 8px; }
.topnav .navlink:hover { background: var(--bg); text-decoration: none; color: var(--ink); }

/* Tablet / zoomed-in: drop the non-essential chrome so the bar stays on one
   clean line instead of collapsing into stacked, wrapped text. */
@media (max-width: 1080px) {
  .topnav { gap: 10px; padding: 0 16px; }
  .topnav .logo .sub { display: none; }
  .topnav .greeting { display: none; }
  .topnav .navlink { padding: 8px 7px; }
}
@media (max-width: 900px) {
  .topnav .nav-help { display: none; }        /* Help is reachable in-app */
  .topnav .nav-training { display: none; }     /* Staff Training reachable from the dashboard */
}

.bell { position: relative; cursor: pointer; font-size: 1.25rem; padding: 6px 10px; border-radius: 8px; background: none; border: none; }
.bell:hover { background: var(--bg); }
.bell .dot {
  position: absolute; top: 2px; right: 4px;
  background: var(--danger); color: #fff; font-size: 0.62rem; font-weight: 700;
  border-radius: 999px; padding: 0 5px; min-width: 16px; text-align: center; line-height: 16px;
}

.btn {
  display: inline-block; border: none; cursor: pointer; font: inherit; font-weight: 700;
  border-radius: 10px; padding: 10px 20px; transition: all 0.15s ease;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); text-decoration: none; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
.btn-ghost:hover { background: var(--brand); color: #fff; text-decoration: none; }
.btn:disabled, .btn-disabled[disabled] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn-disabled { opacity: 0.45; cursor: not-allowed; } /* for <a> buttons that gate on JS */
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }

/* ---------- hero / landing ---------- */
.hero {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 55%, #2d1f8f 100%);
  color: #fff; padding: 72px 24px 84px; text-align: center;
}
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 3.1rem); letter-spacing: -0.02em; line-height: 1.15; max-width: 780px; margin: 0 auto 18px; }
.hero p { font-size: 1.15rem; max-width: 640px; margin: 0 auto 30px; color: #d9d4f2; }
.hero .cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.7); }
.hero .btn-ghost:hover { background: rgba(255,255,255,0.14); color: #fff; }

.feature-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px; max-width: 1020px; margin: -46px auto 0; padding: 0 24px;
}
.feature {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; text-align: left;
}
.feature .fi { font-size: 1.6rem; }
.feature h3 { font-size: 1rem; margin: 8px 0 4px; }
.feature p { font-size: 0.9rem; color: var(--ink-soft); }

/* ---------- catalog ---------- */
.section { max-width: 1020px; margin: 0 auto; padding: 56px 24px; }
.section > h2 { font-size: 1.7rem; letter-spacing: -0.01em; margin-bottom: 6px; }
.section > .lead { color: var(--ink-soft); margin-bottom: 28px; }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 24px; }
.course-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column; transition: transform 0.15s ease;
}
.course-card:hover { transform: translateY(-3px); }
.course-card .thumb {
  background: linear-gradient(135deg, #0a0340, var(--brand));
  color: #fff; height: 150px; display: flex; align-items: center; justify-content: center;
  font-size: 3.4rem; position: relative;
}
.course-card .badge {
  position: absolute; top: 12px; left: 12px; background: var(--gold); color: #5b4708;
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  border-radius: 999px; padding: 3px 10px;
}
.course-card .body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.course-card h3 { font-size: 1.12rem; line-height: 1.35; }
.course-card .meta { font-size: 0.82rem; color: var(--ink-soft); }
.course-card .desc { font-size: 0.9rem; color: var(--ink-soft); flex: 1; }
.course-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pill-done { background: #e7f6ee; color: var(--success-dark); font-weight: 700; font-size: 0.8rem; border-radius: 999px; padding: 4px 12px; }

.progress-track { background: var(--line); border-radius: 999px; height: 8px; overflow: hidden; }
.progress-fill { background: var(--gold); height: 100%; border-radius: 999px; transition: width 0.4s ease; }

/* ---------- auth card ---------- */
.auth-wrap { max-width: 420px; margin: 60px auto; padding: 0 20px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; }
.card h2 { margin-bottom: 4px; }
.card .sub { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 20px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 5px; }
.field input {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 9px;
  font: inherit; background: #fbfdff; color: var(--ink); caret-color: var(--ink);
}
.field input::placeholder { color: var(--ink-soft); }
.field input:focus { outline: none; border-color: var(--brand); }

/* Ensure every text input's typed text is theme-aware and legible (no UA-default
   black text on a dark field in dark mode). */
input, textarea, select { color: var(--ink); caret-color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--ink-soft); }
.form-error { color: var(--danger); font-size: 0.88rem; margin: 8px 0; min-height: 1.2em; }
.auth-alt { text-align: center; margin-top: 16px; font-size: 0.9rem; color: var(--ink-soft); }

/* ---------- course player ---------- */
.player-layout { display: grid; grid-template-columns: 320px 1fr; min-height: calc(100vh - 64px); }
/* Module lessons: slim our course-nav sidebar so the module app gets more width. */
.player-layout.player-wide { grid-template-columns: 232px 1fr; }
/* When the player stacks (tablet portrait + phone), show the lesson content
   first and the curriculum below it — never make the learner scroll past the
   whole lesson list to reach the lesson. */
@media (max-width: 860px) {
  .player-layout { display: flex; flex-direction: column; }
  .lesson-pane { order: -1; }
  .curriculum { padding-bottom: 24px; }
}

.curriculum {
  background: #120b3d; color: #d4d0e8; padding: 20px 0 40px;
}
.curriculum .course-head { padding: 6px 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.09); }
/* Per-course co-branding (e.g. NCYSA + NCSRA) — only shown when a course sets it */
.cobrand { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.12); }
.cobrand-logo { height: 42px; width: auto; background: #fff; border-radius: 6px; padding: 3px 5px; flex: none; }
.cobrand-name { font-size: 0.82rem; font-weight: 800; color: #fff; letter-spacing: 0.02em; }
.curriculum .course-head h2 { color: #fff; font-size: 1.02rem; line-height: 1.4; }
.curriculum .course-head .prog-label { font-size: 0.78rem; margin: 10px 0 6px; color: #a9a3cf; }
.curriculum .progress-track { background: rgba(255,255,255,0.15); }
.lesson-item {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  padding: 13px 20px; border: none; background: none; color: inherit; font: inherit;
  cursor: pointer; border-left: 3px solid transparent;
}
.lesson-item:hover { background: rgba(255,255,255,0.06); }
.lesson-item.active { background: rgba(255,255,255,0.1); border-left-color: var(--gold); color: #fff; }
.lesson-item.locked { opacity: 0.45; cursor: not-allowed; }
.lesson-item .stat { font-size: 1rem; width: 22px; flex: none; text-align: center; }
.lesson-item .stat.done { color: var(--success); }
.lesson-item .l-title { font-size: 0.9rem; line-height: 1.35; }
.lesson-item .l-type { display: block; font-size: 0.72rem; color: #9b95c4; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

.lesson-pane { padding: 40px clamp(20px, 5vw, 64px); max-width: 860px; }
.lesson-pane .lesson-kind { color: var(--brand); font-weight: 700; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.08em; }
.lesson-kind-row { display: flex; align-items: center; gap: 14px; }
.lesson-cobrand-logo { height: 40px; width: auto; }
.lesson-pane h1 { font-size: 1.75rem; letter-spacing: -0.01em; margin: 6px 0 20px; }
/* Keep whatever a course designer pastes in — images, embeds, long links —
   inside the screen on phones instead of forcing horizontal scroll. */
.lesson-content { overflow-wrap: break-word; }
.lesson-content img { max-width: 100%; height: auto; border-radius: 8px; }
.lesson-content iframe { max-width: 100%; }
.lesson-content h2 { font-size: 1.3rem; margin: 22px 0 10px; }
.lesson-content h3 { font-size: 1.08rem; margin: 18px 0 8px; }
.lesson-content p, .lesson-content li { color: var(--ink-body); }
.lesson-content ul, .lesson-content ol { padding-left: 24px; margin: 10px 0; }
.lesson-content li { margin: 6px 0; }
.lesson-content blockquote {
  border-left: 4px solid var(--gold); background: #fdf7e6; padding: 12px 16px;
  border-radius: 0 8px 8px 0; margin: 16px 0; font-style: italic;
}
.lesson-content table { border-collapse: collapse; margin: 14px 0; width: 100%; font-size: 0.92rem; }
.lesson-content th, .lesson-content td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.lesson-content th { background: var(--bg); }

.lesson-actions { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.gate-note { font-size: 0.88rem; color: var(--ink-soft); }
.gate-note.err { color: var(--danger); font-weight: 600; }

/* ---------- video player ---------- */
.video-shell { background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.video-shell video { width: 100%; display: block; }
.scorm-shell { background: #0b1020; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
/* These modules are self-contained apps (their own header, sidebar and internal
   scroll), so give them a big fixed stage that fills most of the window and let
   the module manage its own scrolling inside. */
.scorm-frame { width: 100%; height: 85vh; min-height: 600px; border: 0; display: block; }
/* Module lessons use a wider pane than reading lessons. */
/* Modules fill the whole content area (no reading-width cap) and use slim
   padding, so app-style modules render in their full-width desktop layout
   instead of a cramped narrow one. */
.lesson-pane.scorm-lesson { max-width: none; padding: 24px clamp(10px, 1.5vw, 28px); }
@media (max-width: 640px) {
  .scorm-frame { height: 80vh; min-height: 480px; }
}
.v-controls { display: flex; align-items: center; gap: 12px; background: #0d0a24; padding: 10px 14px; color: #e7eef5; }
.v-controls button { background: none; border: none; color: inherit; font-size: 1.2rem; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.v-controls button:hover { background: rgba(255,255,255,0.12); }
.v-track { flex: 1; height: 8px; background: rgba(255,255,255,0.2); border-radius: 999px; position: relative; overflow: hidden; }
.v-track .v-fill { height: 100%; background: var(--gold); border-radius: 999px; width: 0; }
.v-time { font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.v-sound { font-size: 1.1rem; padding: 4px 8px; opacity: 0.85; cursor: default; }
.watch-meter { margin-top: 14px; display: flex; align-items: center; gap: 12px; font-size: 0.9rem; }
.watch-meter .progress-track { flex: 1; height: 10px; }
.watch-meter .ok { color: var(--success-dark); font-weight: 700; }
.no-skip-tip { margin-top: 8px; font-size: 0.8rem; color: var(--ink-soft); }

/* ---------- quiz ---------- */
.quiz-q { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 16px 0; }
.quiz-q h3 { font-size: 1rem; margin-bottom: 12px; }
.quiz-opt { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 9px; cursor: pointer; }
.quiz-opt:hover { background: var(--bg); }
.quiz-opt input { margin-top: 5px; }
.quiz-result { border-radius: var(--radius); padding: 18px 22px; margin: 18px 0; font-weight: 600; }
.quiz-result.pass { background: #e7f6ee; color: var(--success-dark); }
.quiz-result.fail { background: #fdecea; color: var(--danger); }

/* ---------- completion / certificate ---------- */
.complete-hero { text-align: center; padding: 46px 20px; }
.complete-hero .big { font-size: 4rem; }
.complete-logo { max-width: 150px; max-height: 92px; margin: 0 auto 14px; display: block; object-fit: contain; }
.complete-hero h1 { font-size: 2rem; margin: 12px 0 8px; }
.complete-hero p { color: var(--ink-soft); max-width: 560px; margin: 0 auto 8px; }
.notice-sent {
  display: inline-flex; align-items: center; gap: 8px; margin: 18px auto 8px;
  background: #efedf7; color: var(--brand-dark); border: 1px solid #d5d0ea;
  border-radius: 999px; padding: 8px 18px; font-size: 0.9rem; font-weight: 600;
}

.certificate {
  max-width: 720px; margin: 48px auto; background: #fffdf6;
  border: 3px double var(--cert-border, var(--gold)); border-radius: 6px; padding: 56px 40px; text-align: center;
  box-shadow: var(--shadow);
}
.certificate .org { text-transform: uppercase; letter-spacing: 0.25em; font-size: 0.78rem; color: var(--ink-soft); }
.certificate h1 { font-size: 2rem; color: var(--cert-title, var(--brand-dark)); margin: 10px 0 26px; }
.certificate .learner-name { font-size: 2.2rem; font-family: Georgia, serif; font-style: italic; color: var(--ink); margin: 8px 0; }
.certificate .course-name { font-size: 1.2rem; font-weight: 700; margin: 8px 0 20px; }
.certificate .cert-meta { color: var(--ink-soft); font-size: 0.9rem; }
.certificate .seal { font-size: 2.6rem; margin-top: 18px; }

/* ---------- notifications & admin ---------- */
.notif-list { max-width: 720px; margin: 40px auto; padding: 0 20px; }
.notif {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 22px; margin-bottom: 14px; border-left: 4px solid var(--gold);
}
.notif.unread { border-left-color: var(--danger); }
.notif h3 { font-size: 1rem; }
.notif time { font-size: 0.78rem; color: var(--ink-soft); }
.notif p { font-size: 0.92rem; color: var(--ink-body); margin-top: 6px; }

.admin-wrap { max-width: 1020px; margin: 36px auto; padding: 0 20px; }
.admin-wrap h1 { margin-bottom: 4px; }
.admin-grid { display: grid; gap: 22px; margin-top: 24px; }
.admin-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; overflow-x: auto; }
.admin-card h2 { font-size: 1.1rem; margin-bottom: 14px; }
.course-intro { background: #eef3fa; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px; padding: 12px 18px; margin: 0 0 16px; }
.course-intro > summary { font-weight: 700; cursor: pointer; color: var(--brand); list-style: none; }
.course-intro > summary::-webkit-details-marker { display: none; }
.course-intro > summary::before { content: '▸ '; }
.course-intro[open] > summary::before { content: '▾ '; }
.course-intro-body { margin-top: 10px; }
.catalog-group { margin: 26px 0 12px; font-size: 1.05rem; color: var(--ink-soft); }
.catalog-group:first-of-type { margin-top: 10px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th, .admin-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.admin-table th { color: var(--ink-soft); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.mail { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; font-size: 0.88rem; }
.mail .mail-head { color: var(--ink-soft); font-size: 0.8rem; margin-bottom: 6px; }
.mail pre { white-space: pre-wrap; font: inherit; color: var(--ink-body); }
.empty { color: var(--ink-soft); font-size: 0.9rem; }

/* ---------- toast ---------- */
#toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; border-radius: 10px; padding: 12px 22px;
  font-size: 0.92rem; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease; z-index: 50; max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; }
#toast.error { background: var(--danger); }

.footer { text-align: center; color: var(--ink-soft); font-size: 0.85rem; padding: 40px 20px; }

/* ---------- brand mark ---------- */
.topnav .logo .brandmark {
  height: 50px; width: auto; max-width: 180px; object-fit: contain; display: block;
  background: var(--logo-plate, transparent); border-radius: 6px; padding: 2px;
}
.certificate .cert-logo { height: 116px; margin-bottom: 16px; }
.hero-logo { height: 132px; margin-bottom: 20px; filter: drop-shadow(0 4px 14px rgba(0,0,0,0.35)); }
.course-card .thumb .thumb-logo { height: 84px; margin-top: 12px; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3)); }

/* ---------- role split (coach vs referee) ---------- */
.role-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.role-card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px 24px; text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; gap: 6px; transition: transform 0.15s ease, border-color 0.15s ease;
}
.role-card:hover { transform: translateY(-3px); border-color: var(--brand); text-decoration: none; }
.role-icon {
  width: 60px; height: 60px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1b0a7a, var(--brand-dark));
  box-shadow: 0 4px 12px rgba(10, 3, 64, 0.28);
}
.role-icon svg { width: 33px; height: 33px; display: block; }
.role-icon.big { width: 88px; height: 88px; margin: 0 auto; }
.role-icon.big svg { width: 48px; height: 48px; }

/* Monochrome line-icon sizing (replaces the decorative emoji) */
.feature .fi { font-size: 0; color: var(--brand); }
.feature .fi svg { width: 32px; height: 32px; }
.bell svg { width: 22px; height: 22px; color: var(--ink); vertical-align: middle; }
.lesson-item .stat svg { width: 13px; height: 13px; display: block; margin: 0 auto; color: var(--ink-soft); }
.v-sound svg { width: 18px; height: 18px; vertical-align: middle; }
.complete-hero .big.award { font-size: 0; }
.complete-hero .big.award svg { width: 74px; height: 74px; color: #c9a227; }
.certificate .seal svg { width: 54px; height: 54px; color: var(--cert-seal, #c9a227); }
.role-card h3 { font-size: 1.25rem; color: var(--ink); margin-top: 4px; }
.role-card p { color: var(--ink-soft); font-size: 0.95rem; }
.role-card .role-go { margin-top: 10px; font-weight: 700; color: var(--accent); }

.role-hero { text-align: center; margin-bottom: 24px; }
.referee-portal-logo { height: 116px; width: auto; max-width: 240px; object-fit: contain; display: block; margin: 0 auto 6px; }
.role-hero h2 { margin-top: 12px; }
.notice-card { max-width: 640px; margin: 0 auto; }
.notice-card h3 { color: var(--ink); margin-bottom: 10px; }
.notice-card p { color: var(--ink-body); }
.resource-links { margin: 14px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.resource-links li { color: var(--ink-body); }
.back-link { display: inline-block; margin-bottom: 18px; font-weight: 600; }

/* Admin: test-email control */
.test-email { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.test-email input { flex: 1 1 200px; min-width: 160px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--card); }
.test-email-result { flex-basis: 100%; font-size: 0.85rem; color: var(--ink-soft); }
.test-email-result.ok { color: var(--success-dark); font-weight: 600; }
.test-email-result.warn { color: #9a6a00; font-weight: 600; }
.test-email-result.err { color: var(--danger); font-weight: 600; }

/* Help / Knowledge Base */
.kb-heading { margin: 28px 0 12px; color: var(--brand); font-size: 1.1rem; }
.kb-list { display: flex; flex-direction: column; gap: 10px; }
.kb-item {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); overflow: hidden;
}
.kb-item > summary {
  cursor: pointer; padding: 14px 16px; font-weight: 600; color: var(--ink);
  list-style: none; position: relative; padding-right: 42px;
}
.kb-item > summary::-webkit-details-marker { display: none; }
.kb-item > summary::after {
  content: '+'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-size: 1.2rem; color: var(--brand); font-weight: 700; line-height: 1;
}
.kb-item[open] > summary::after { content: '–'; }
.kb-item > summary:hover { color: var(--brand); }
.kb-item:focus-within { border-color: var(--brand); }
.kb-body { padding: 0 16px 14px; color: var(--ink-body); }
.kb-body p { margin: 0; line-height: 1.6; }
.kb-resources { margin-top: 4px; }
.kb-resources > p { color: var(--ink-body); }
.kb-downloads { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.kb-reminders { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.kb-reminders li { color: var(--ink-body); line-height: 1.5; }

.auth-note {
  margin-top: 14px; font-size: 0.82rem; color: var(--ink-soft);
  background: var(--bg); border-radius: 9px; padding: 10px 12px; line-height: 1.5;
}

/* Links inside lesson reading content */
.lesson-content a { font-weight: 600; text-decoration: underline; }
.lesson-content a:hover { text-decoration: none; }

/* Staff sign-in link on the learner login card */
.staff-link { display: inline-block; margin-top: 10px; font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.staff-link:hover { color: var(--brand); }

/* ---------- resume-where-you-left-off banner ---------- */
.resume-strip { background: linear-gradient(135deg, var(--brand-dark), var(--brand)); color: #fff; }
.resume-inner {
  max-width: 1020px; margin: 0 auto; padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.resume-text { display: flex; flex-direction: column; gap: 4px; min-width: 240px; flex: 1; }
.resume-kicker { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold); font-weight: 700; }
.resume-title { font-size: 1.15rem; font-weight: 700; }
.resume-track { background: rgba(255,255,255,0.22); border-radius: 999px; height: 7px; overflow: hidden; max-width: 340px; margin-top: 4px; }
.resume-fill { background: var(--gold); height: 100%; border-radius: 999px; }
.resume-meta { font-size: 0.82rem; color: #dcd7f5; }
.resume-btn { white-space: nowrap; }

/* ============================================================
   Mobile responsiveness (phones ~390px and up)
   ============================================================ */
@media (max-width: 600px) {
  :root { font-size: 15px; }

  /* Nav: one row, inside the viewport. The brand may shrink/ellipsize so the
     action buttons are never clipped, even with a long co-brand name. */
  .topnav { padding: 0 10px; gap: 6px; height: 56px; flex-wrap: nowrap; }
  .topnav .logo { flex: 0 1 auto; min-width: 0; }
  .topnav .logo .sub { display: none; }          /* drop subtitle on phones */
  .topnav .logo > span { font-size: 0.9rem; line-height: 1.05; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topnav .spacer { flex: 1 1 8px; }
  .topnav .navlink, .topnav .btn { flex: none; }
  .topnav .brandmark { height: 34px; max-width: 100px; padding: 2px 3px; flex: none; }
  .topnav .navlink, .topnav .btn { white-space: nowrap; }
  .topnav .navlink { padding: 6px 5px; font-size: 0.9rem; }
  .topnav .greeting { display: none; }            /* greeting is non-essential */
  /* Coaches + Referees are the core navigation — keep them; drop the rest. */
  .topnav .nav-help { display: none; }            /* Help reachable in-app; saves room */
  .topnav .btn { padding: 8px 13px; font-size: 0.88rem; border-radius: 9px; }
  .topnav .bell { padding: 4px 6px; }

  /* Generic section padding */
  .section { padding: 36px 16px; }
  .hero { padding: 48px 18px 60px; }
  .feature-strip { margin-top: -30px; padding: 0 16px; gap: 12px; }

  /* Resume banner stacks */
  .resume-inner { padding: 16px; }
  .resume-btn { width: 100%; text-align: center; }

  /* Course player: tighter padding on phones (stacking handled at ≤860px) */
  .lesson-pane { padding: 26px 18px; }
  .lesson-pane h1 { font-size: 1.4rem; }
  .curriculum { padding: 8px 0 20px; }

  /* Video controls comfortable to tap */
  .v-controls button { font-size: 1.4rem; padding: 8px 10px; }

  /* Certificate fits the screen */
  .certificate { padding: 32px 20px; margin: 24px auto; }
  .certificate h1 { font-size: 1.5rem; }
  .certificate .learner-name { font-size: 1.7rem; }
  .certificate .course-name { font-size: 1.05rem; }

  /* Auth + notifications full-bleed-ish */
  .auth-wrap { margin: 32px auto; }
  .admin-wrap, .notif-list { padding: 0 14px; }

  /* Wide tables scroll inside their card, never the page body */
  .admin-card { padding: 16px; }
  .lesson-content table { font-size: 0.85rem; }
}

/* Larger tap targets on any touch device */
@media (hover: none) {
  .btn, .lesson-item, .bell, .v-controls button, .quiz-opt { min-height: 44px; }
  .quiz-opt { align-items: center; }
}

/* ---------- admin course editor ---------- */
.admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.btn-sm { padding: 7px 12px; font-size: 0.85rem; }
.editor-msg { min-height: 1.2em; font-weight: 600; font-size: 0.9rem; margin: 6px 0; }
.editor-msg.ok { color: var(--success-dark); }
.editor-msg.err { color: var(--danger); }
.course-admin-list { display: flex; flex-direction: column; gap: 18px; margin-top: 16px; }
.course-admin-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.course-admin-head h2 { font-size: 1.15rem; margin: 4px 0; }
.course-admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.badge-inline { display: inline-block; background: var(--gold); color: #5b4708; font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; border-radius: 999px; padding: 2px 9px; }
.admin-lessons { margin: 14px 0 6px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.admin-lessons li { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.admin-lesson-actions { display: flex; gap: 12px; flex: none; }
.linkbtn { background: none; border: none; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; padding: 2px; }
.linkbtn.danger { color: var(--danger); }
.linkbtn:hover { text-decoration: underline; }
.editor-form { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.editor-form h3 { font-size: 1rem; }
.editor-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 0.85rem; }
.editor-form input, .editor-form textarea, .editor-form select { padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; font-weight: 400; background: var(--card); color: var(--ink); }
.editor-form .form-row { display: flex; gap: 12px; }
.editor-form .form-row label { flex: 1; }
.editor-form .form-actions { margin-top: 4px; }
.quiz-edit { border: 1px dashed var(--line); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.quiz-edit .opt-row { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.quiz-edit .opt-row input[type="radio"] { flex: none; }

/* Course draft/live status pills + form hint */
.pill-live, .pill-draft { display: inline-block; font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; border-radius: 999px; padding: 2px 9px; margin-left: 6px; vertical-align: middle; }
.pill-live { background: #e7f6ee; color: var(--success-dark); }
.pill-draft { background: #fdecea; color: var(--danger); }
.form-hint { font-size: 0.84rem; color: var(--ink-soft); margin-top: 8px; background: var(--bg); border-radius: 8px; padding: 9px 12px; }
.co-brand-fields { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 4px; margin: 6px 0; }
.co-brand-fields legend { font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); padding: 0 6px; }
.bulk-list { margin: 10px 0; padding-left: 22px; font-size: 0.9rem; }
.bulk-list li { margin: 2px 0; }
.bulk-log { margin-top: 12px; font-size: 0.88rem; line-height: 1.7; max-height: 260px; overflow-y: auto; }
.bulk-log div { padding: 1px 0; }
.admin-lesson-actions .linkbtn[disabled] { opacity: 0.3; cursor: default; }

/* ---------- rich-text (visual) lesson editor ---------- */
.rte-field { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 0.85rem; }
.rte { border: 1.5px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; background: var(--bg); border-bottom: 1px solid var(--line); }
.rte-btn {
  font: inherit; font-weight: 600; font-size: 0.82rem; line-height: 1;
  border: 1px solid transparent; background: transparent; color: var(--ink);
  padding: 6px 9px; border-radius: 6px; cursor: pointer; min-height: 32px;
}
.rte-btn:hover { background: var(--card); border-color: var(--line); }
.rte-btn:active { background: var(--bg); }
.rte-btn b, .rte-btn i { pointer-events: none; }
.rte-sep { width: 1px; background: var(--line); margin: 4px 3px; }
.rte-area {
  padding: 14px 16px; font-weight: 400; outline: none;
  max-height: 460px; overflow-y: auto; animation: none;
}
.rte-area:empty::before { content: attr(data-placeholder); color: var(--ink-soft); font-weight: 400; }
.rte-area:focus-within, .rte:focus-within { }
.rte:focus-within { border-color: var(--brand); }

/* ---------- admin dashboard filters + CSV ---------- */
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-bar input, .filter-bar select { padding: 8px 11px; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; background: var(--card); color: var(--ink); }
.filter-bar #fltSearch { flex: 1; min-width: 180px; }
.date-flt { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--ink-soft); }
.filter-count { margin-top: 10px; font-size: 0.82rem; color: var(--ink-soft); }

/* ============================================================
   Item 10 — loading states, transitions, accessibility
   ============================================================ */

/* Top route-loading bar */
#loadbar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  z-index: 100; opacity: 0; transition: width 0.3s ease, opacity 0.3s ease;
}
#loadbar.active { opacity: 1; }

/* Skip-to-content link (appears on keyboard focus) */
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 200;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 8px;
  font-weight: 700; transition: top 0.15s ease;
}
.skip-link:focus { top: 0; text-decoration: none; }

/* Smooth content transitions between views/lessons */
@keyframes fadeSlide { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.lesson-pane, .section, .admin-wrap, .auth-wrap, .certificate, .notif-list, .resume-strip, .role-hero {
  animation: fadeSlide 0.25s ease both;
}
.lesson-content { animation: fadeSlide 0.22s ease both; }

/* Inline loading spinner */
.loading-state { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 80px 20px; color: var(--ink-soft); }
.spinner { width: 38px; height: 38px; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Visible keyboard focus everywhere (doesn't affect mouse users) */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, .lesson-item:focus-visible, .role-card:focus-visible, .quiz-opt:focus-within {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 6px;
}
.curriculum .lesson-item:focus-visible { outline-offset: -3px; }

@media (prefers-reduced-motion: reduce) {
  #loadbar { transition: opacity 0.15s ease; }
  .lesson-pane, .section, .admin-wrap, .auth-wrap, .certificate, .notif-list,
  .resume-strip, .role-hero, .lesson-content, .spinner { animation: none; }
}

/* Staff Training + dashboard header actions */
.admin-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.topnav .nav-training { display: inline-block; }
@media (max-width: 600px) { .topnav .nav-training { display: none; } }

/* Module storage panel */
.storage-stats { display:flex; gap:22px; flex-wrap:wrap; margin:6px 0 14px; }
.storage-stats > div { display:flex; flex-direction:column; }
.storage-stats strong { font-size:1.15rem; }
.storage-list { max-height:280px; overflow:auto; }
.storage-list li { display:flex; justify-content:space-between; gap:12px; padding:6px 10px; border-radius:8px; }
.storage-list li.orphan { background:rgba(220,80,80,.10); }
.storage-list code { font-size:.82rem; word-break:break-all; }

/* Portal chooser (landing page) — two separate front doors under one app */
.home-hero h1 { font-size: 2.4rem; }
.portal-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 26px; max-width: 900px; margin: 0 auto; }
.portal-card {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 12px; padding: 40px 28px 34px; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.portal-card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(18,40,66,.14); text-decoration: none; border-color: var(--brand); }
.portal-card h2 { color: var(--ink); margin: 0; }
.portal-card p { color: var(--ink-soft); font-size: .98rem; max-width: 320px; }
.portal-card .btn { margin-top: 8px; }
.portal-badge { display: flex; align-items: center; justify-content: center; }
.portal-badge img { width: auto; }
.portal-badge-ref img { height: 104px; }        /* NCSRA crest */
.portal-badge-coach img { height: 84px; }        /* NCYSA mark */
.portal-referees { border-top: 4px solid var(--brand); }
.portal-coaches { border-top: 4px solid var(--accent); }
.portal-staff { border-top: 4px solid var(--gold); }
.portal-hero-logo { max-height: 60px; width: auto; margin: 0 auto 4px; display: block; }

/* Tip above a module: point learners to the module's collapse (☰) control */
.scorm-tip { font-size: .9rem; color: var(--ink-soft); background: #fff7e0; border: 1px solid #f0e2b8;
  border-radius: 8px; padding: 8px 12px; margin: 0 0 10px; }
/* On phones the module already collapses its own sidebar, so the desktop
   "click the ☰ menu" tip isn't relevant — hide it. */
@media (max-width: 640px) { .scorm-tip { display: none; } }

/* Bunny CDN box in the Module storage panel */
.cdn-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 4px 0 14px; background: #f6f8fc; }
.cdn-box.ok { background: #eef7f0; border-color: #cfe8d6; }
.cdn-box p { font-size: .9rem; color: var(--ink-soft); margin: 6px 0 10px; }
.cdn-box code { font-size: .82rem; }
