/* ==========================================================================
   Lumen Academy — Design System
   Plain CSS3. No frameworks.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  --bg: #f6f4ef;
  --bg-alt: #efece5;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink: #16202a;
  --ink-soft: #3c4a57;
  --muted: #6b7784;
  --line: #e4e0d8;
  --line-strong: #d3cdc1;

  --accent: #1d4e7c;
  --accent-strong: #163c61;
  --accent-soft: #e9f1f8;
  --accent-contrast: #ffffff;

  --gold: #b7822f;
  --success: #1f7a52;
  --success-soft: #e7f5ee;
  --danger: #b3382f;
  --danger-soft: #fbeceb;
  --warning: #a86a12;
  --warning-soft: #fdf3e2;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(22, 32, 42, 0.06);
  --shadow-sm: 0 2px 8px rgba(22, 32, 42, 0.06);
  --shadow: 0 10px 30px rgba(22, 32, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(22, 32, 42, 0.14);

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

  --container: 1200px;
  --header-h: 72px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.1rem, 4.4vw, 3.35rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: clamp(1.15rem, 1.8vw, 1.45rem); }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1rem; color: var(--ink-soft); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
img { max-width: 100%; display: block; }
ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; color: var(--ink-soft); }
li { margin-bottom: 0.35rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
small { font-size: 0.82rem; }

:focus-visible {
  outline: 3px solid rgba(29, 78, 124, 0.4);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

::selection { background: var(--accent); color: #fff; }

/* --------------------------------------------------------------------------
   3. Layout helpers
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}
.container-narrow { max-width: 820px; }

.section { padding: 84px 0; }
.section-sm { padding: 56px 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-tight { padding: 40px 0; }

.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 8px; }
.stack-lg { display: grid; gap: 28px; }

.row { display: flex; gap: 16px; align-items: center; }
.row-between { display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.row-wrap { flex-wrap: wrap; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; } .mt-6 { margin-top: 48px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }
.hidden { display: none !important; }
.grow { flex: 1 1 auto; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 0.88rem; }
.text-accent { color: var(--accent); }
.no-wrap { white-space: nowrap; }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head.center { margin-inline: auto; }
.lead { font-size: 1.12rem; color: var(--ink-soft); }

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--accent);
  --btn-fg: var(--accent-contrast);
  --btn-border: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-body);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
    background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.btn:hover { color: var(--btn-fg); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary { --btn-bg: var(--accent); }
.btn-primary:hover { --btn-bg: var(--accent-strong); }
.btn-secondary {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-border: var(--line-strong);
}
.btn-secondary:hover { --btn-bg: var(--surface-2); --btn-border: var(--accent); color: var(--accent); }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--ink-soft); }
.btn-ghost:hover { --btn-bg: var(--accent-soft); --btn-fg: var(--accent-strong); box-shadow: none; }
.btn-danger { --btn-bg: var(--danger); }
.btn-danger:hover { --btn-bg: #982e26; }
.btn-success { --btn-bg: var(--success); }
.btn-gold { --btn-bg: var(--gold); }

.btn-sm { padding: 8px 14px; font-size: 0.84rem; }
.btn-lg { padding: 15px 30px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 9px; border-radius: var(--radius-sm); }

.btn-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn-link:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   5. Header / navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header.scrolled { box-shadow: var(--shadow-sm); }

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-head);
  font-size: 1.22rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), #3a7bb0);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-size: 1.15rem;
  box-shadow: var(--shadow-xs);
}
.brand-sub {
  display: block;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  list-style: none;
  padding: 0;
}
.nav-links a {
  display: block;
  padding: 9px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.nav-links a:hover { background: var(--bg-alt); color: var(--ink); }
.nav-links a.active { color: var(--accent); background: var(--accent-soft); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}
.nav-toggle span + span { margin-top: 4px; }

/* Account items that only appear inside the mobile menu */
.nav-mobile-only { display: none; }
.nav-mobile-label {
  display: block;
  padding: 16px 14px 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-links .nav-link-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.nav-links .nav-link-btn:hover { background: var(--bg-alt); color: var(--ink); }
.nav-links .nav-cta { color: var(--accent); font-weight: 600; }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2c618f, #4d8bbd);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}
.avatar-lg { width: 64px; height: 64px; font-size: 1.3rem; }
.avatar-xl { width: 96px; height: 96px; font-size: 2rem; }

.user-menu { position: relative; }
.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  padding: 4px;
  cursor: pointer;
  border-radius: var(--radius-pill);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
}
.user-menu-trigger:hover { background: var(--bg-alt); }
.user-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 230px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
}
.user-menu-panel.open { display: block; }
.user-menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.user-menu-head strong { display: block; font-size: 0.92rem; }
.user-menu-head span { font-size: 0.8rem; color: var(--muted); }
.user-menu-panel a,
.user-menu-panel button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: 0;
  background: none;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.user-menu-panel a:hover,
.user-menu-panel button:hover { background: var(--bg-alt); color: var(--ink); }

/* --------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 88px;
  background:
    radial-gradient(1000px 520px at 88% -10%, rgba(29, 78, 124, 0.14), transparent 60%),
    radial-gradient(700px 420px at -5% 110%, rgba(183, 130, 47, 0.12), transparent 60%),
    var(--bg);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 64px;
  align-items: center;
}
.hero h1 { margin-bottom: 20px; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.hero-meta strong {
  display: block;
  font-family: var(--font-head);
  font-size: 1.55rem;
  color: var(--ink);
}
.hero-meta span { font-size: 0.82rem; color: var(--muted); }

.hero-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.hero-card-top {
  padding: 26px;
  background: linear-gradient(135deg, #1b3b6f, #2f6ca3);
  color: #fff;
  position: relative;
}
.hero-card-top::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.6;
}
.hero-card-top > * { position: relative; }
.hero-card-body { padding: 22px 26px 26px; }

/* Greeting word — inline text with per-letter flip ------------------------ */
.greeting-line {
  /* Block-level flex so the greeting always sits on its own line,
     directly under the eyebrow, never beside it. */
  display: flex;
  flex-wrap: wrap;
  perspective: 700px;
  font-family: var(--font-head);
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 14px;
  min-height: 1.15em;
}
.greeting-letter {
  display: inline-block;
  transform-origin: 50% 55%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 0.18s var(--ease), opacity 0.18s var(--ease);
}
.greeting-letter.flipping {
  transform: rotateX(90deg);
  opacity: 0;
}

/* --------------------------------------------------------------------------
   7. Cards
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.card-pad { padding: 26px; }
.card-hover { transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.22s var(--ease); }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-strong); }

.course-card { display: flex; flex-direction: column; overflow: hidden; }
.course-card .cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  padding: 16px;
}
.course-card .cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 16px 16px;
  opacity: 0.55;
}
.cover-level {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
}
.cover-category {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}
.course-card-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.course-card h3 { margin: 0; font-size: 1.16rem; line-height: 1.25; }
.course-card h3 a { color: inherit; }
.course-card h3 a:hover { color: var(--accent); }
.course-card .desc { margin: 0; font-size: 0.9rem; color: var(--muted); }
.course-card-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.price { font-family: var(--font-head); font-size: 1.3rem; font-weight: 600; color: var(--ink); }
.price-old { font-size: 0.9rem; color: var(--muted); text-decoration: line-through; margin-left: 8px; }

.meta-row { display: flex; flex-wrap: wrap; gap: 14px; font-size: 0.82rem; color: var(--muted); }
.meta-row span { display: inline-flex; align-items: center; gap: 6px; }

.rating { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.stars { color: var(--gold); letter-spacing: 1px; }

/* --------------------------------------------------------------------------
   8. Badges & pills
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: var(--bg-alt);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.badge-accent { background: var(--accent-soft); color: var(--accent-strong); border-color: #cfe0ee; }
.badge-success { background: var(--success-soft); color: var(--success); border-color: #c6e6d6; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: #f0dcb6; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: #f2cbc8; }
.badge-gold { background: #fbf3e4; color: var(--gold); border-color: #efdcb9; }

/* --------------------------------------------------------------------------
   9. Forms
   -------------------------------------------------------------------------- */
.form-grid { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 0.88rem; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 0.8rem; color: var(--muted); }
.field .error-text { font-size: 0.8rem; color: var(--danger); min-height: 1em; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease), background 0.16s var(--ease);
}
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(29, 78, 124, 0.13);
}
input::placeholder, textarea::placeholder { color: #a6adb5; }
input.invalid, select.invalid, textarea.invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(179, 56, 47, 0.1); }

.checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 0.88rem; color: var(--ink-soft); }
.checkbox input { width: auto; margin-top: 3px; accent-color: var(--accent); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-card { max-width: 460px; margin: 0 auto; }

.alert {
  display: flex;
  gap: 10px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-soft);
}
.alert-success { background: var(--success-soft); border-color: #c6e6d6; color: var(--success); }
.alert-danger { background: var(--danger-soft); border-color: #f2cbc8; color: var(--danger); }
.alert-info { background: var(--accent-soft); border-color: #cfe0ee; color: var(--accent-strong); }
.alert-warning { background: var(--warning-soft); border-color: #f0dcb6; color: var(--warning); }

/* --------------------------------------------------------------------------
   10. Auth pages
   -------------------------------------------------------------------------- */
.auth-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  background: var(--bg);
}
.auth-aside {
  background: linear-gradient(160deg, #163c61, #1d4e7c 45%, #2f6ca3);
  color: #fff;
  padding: 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-aside::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.5;
}
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside h2 { color: #fff; }
.auth-aside p { color: rgba(255, 255, 255, 0.82); }
.auth-aside .quote { font-family: var(--font-head); font-size: 1.3rem; line-height: 1.4; color: #fff; }
.auth-main { display: grid; place-items: center; padding: 48px 24px; }
.auth-box { width: 100%; max-width: 440px; }
.auth-switch { text-align: center; font-size: 0.9rem; color: var(--muted); margin-top: 22px; }
.demo-accounts {
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 0.84rem;
}
.demo-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.demo-account:last-child { border-bottom: 0; }
.demo-account code { font-size: 0.8rem; color: var(--ink); }
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }

/* --------------------------------------------------------------------------
   11. Catalog: filters
   -------------------------------------------------------------------------- */
.filter-bar {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr auto;
  gap: 14px;
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
}
.filter-bar .field { gap: 5px; }
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 26px 0 20px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.16s var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.empty-state {
  text-align: center;
  padding: 72px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

/* --------------------------------------------------------------------------
   12. Course landing page
   -------------------------------------------------------------------------- */
.course-hero {
  background: linear-gradient(150deg, #142f4d, #1d4e7c 55%, #356f9f);
  color: #fff;
  padding: 68px 0;
  position: relative;
  overflow: hidden;
}
.course-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.5;
}
.course-hero .container { position: relative; z-index: 1; }
.course-hero h1 { color: #fff; max-width: 780px; }
.course-hero p { color: rgba(255, 255, 255, 0.85); max-width: 660px; }
.course-hero .meta-row { color: rgba(255, 255, 255, 0.82); }
.breadcrumb { font-size: 0.84rem; color: rgba(255, 255, 255, 0.7); margin-bottom: 18px; }
.breadcrumb a { color: rgba(255, 255, 255, 0.9); }

.course-layout { display: grid; grid-template-columns: 1fr 380px; gap: 48px; align-items: start; }
.purchase-card { position: sticky; top: calc(var(--header-h) + 24px); }

.curriculum { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.curriculum-item { border-bottom: 1px solid var(--line); }
.curriculum-item:last-child { border-bottom: 0; }
.curriculum-head {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
.curriculum-head:hover { background: var(--surface-2); }
.curriculum-head .idx {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  display: grid; place-items: center;
  font-size: 0.82rem; font-weight: 700;
  flex: 0 0 auto;
}
.curriculum-head .ttl { font-weight: 600; flex: 1; }
.curriculum-head .chev { color: var(--muted); transition: transform 0.2s var(--ease); }
.curriculum-item.open .chev { transform: rotate(180deg); }
.curriculum-body { display: none; padding: 0 18px 18px 62px; }
.curriculum-item.open .curriculum-body { display: block; }
.lesson-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px dashed var(--line);
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.lesson-line .lock { color: var(--muted); font-size: 0.8rem; }
.lesson-line .dur { margin-left: auto; color: var(--muted); font-size: 0.82rem; }

.included-list { list-style: none; padding: 0; display: grid; gap: 12px; }
.included-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 0.92rem; color: var(--ink-soft); }
.included-list .tick {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--success-soft); color: var(--success);
  display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; flex: 0 0 auto;
}

.feature-tile { display: flex; gap: 16px; align-items: flex-start; }
.feature-ico {
  width: 46px; height: 46px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  display: grid; place-items: center;
  font-size: 1.15rem;
  flex: 0 0 auto;
}
.feature-tile h4 { margin: 0 0 4px; }
.feature-tile p { margin: 0; font-size: 0.9rem; }

/* --------------------------------------------------------------------------
   13. Teacher presentation
   -------------------------------------------------------------------------- */
.teacher-block {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 56px;
  align-items: center;
}
.teacher-photo {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: linear-gradient(150deg, #1d4e7c, #4d8bbd);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-lg);
}
.teacher-photo span {
  font-family: var(--font-head);
  font-size: 7rem;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.02em;
}
.teacher-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.55;
}
.credential-list { list-style: none; padding: 0; display: grid; gap: 12px; margin-top: 22px; }
.credential-list li { display: flex; gap: 12px; align-items: center; font-size: 0.94rem; }
.credential-list .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: 0 0 auto;
}

.testimonial { display: flex; flex-direction: column; gap: 16px; }
.testimonial blockquote { margin: 0; font-family: var(--font-head); font-size: 1.06rem; line-height: 1.5; color: var(--ink); }
.testimonial-author { display: flex; align-items: center; gap: 12px; }

.trust-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  align-items: center;
  justify-content: center;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.trust-bar .trust-item { display: inline-flex; align-items: center; gap: 10px; font-size: 0.88rem; color: var(--ink-soft); font-weight: 500; }

/* --------------------------------------------------------------------------
   14. Accordion (FAQ)
   -------------------------------------------------------------------------- */
.accordion { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.accordion-item { border-bottom: 1px solid var(--line); }
.accordion-item:last-child { border-bottom: 0; }
.accordion-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
}
.accordion-head:hover { background: var(--surface-2); }
.accordion-head .chev { color: var(--muted); transition: transform 0.2s var(--ease); }
.accordion-item.open .chev { transform: rotate(180deg); }
.accordion-body { display: none; padding: 0 20px 20px; color: var(--ink-soft); }
.accordion-item.open .accordion-body { display: block; }

/* --------------------------------------------------------------------------
   15. Dashboard shell
   -------------------------------------------------------------------------- */
.dash {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: calc(100vh - var(--header-h));
  align-items: start;
}
.dash-side {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 26px 18px;
}
.dash-side-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 12px;
  margin: 22px 0 8px;
}
.dash-side nav { display: grid; gap: 2px; }
.dash-side button,
.dash-side a {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  background: none;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.91rem;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.dash-side button:hover,
.dash-side a:hover { background: var(--bg-alt); color: var(--ink); }
.dash-side button.active { background: var(--accent); color: #fff; }
.dash-side .side-note { font-size: 0.78rem; color: var(--muted); padding: 0 12px; }
.dash-main { padding: 32px 36px 72px; min-width: 0; }
.dash-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; }
.dash-head h1 { font-size: clamp(1.6rem, 2.6vw, 2.15rem); margin-bottom: 4px; }
.dash-panel { display: none; }
.dash-panel.active { display: block; animation: fade 0.25s var(--ease); }

@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.stat-card { padding: 22px; display: grid; gap: 6px; }
.stat-card .stat-label { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.stat-card .stat-value { font-family: var(--font-head); font-size: 1.95rem; color: var(--ink); line-height: 1.1; }
.stat-card .stat-delta { font-size: 0.82rem; color: var(--success); }

.progress-track { height: 8px; border-radius: var(--radius-pill); background: var(--bg-alt); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #3a7bb0); border-radius: inherit; transition: width 0.4s var(--ease); }

/* --------------------------------------------------------------------------
   16. Tables
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
thead th {
  text-align: left;
  padding: 13px 16px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--ink-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td .cell-strong { color: var(--ink); font-weight: 600; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   17. Course player
   -------------------------------------------------------------------------- */
.player {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  min-height: calc(100vh - var(--header-h));
}
.player-side {
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  height: calc(100vh - var(--header-h));
  position: sticky;
  top: var(--header-h);
}
.player-side-head { padding: 20px; border-bottom: 1px solid var(--line); }
.player-lesson {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 13px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  font: inherit;
  cursor: pointer;
  color: var(--ink-soft);
  transition: background 0.16s var(--ease);
}
.player-lesson:hover { background: var(--surface-2); }
.player-lesson.active { background: var(--accent-soft); color: var(--accent-strong); }
.player-lesson .n {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-alt); color: var(--muted);
  display: grid; place-items: center;
  font-size: 0.76rem; font-weight: 700; flex: 0 0 auto;
}
.player-lesson.active .n { background: var(--accent); color: #fff; }
.player-lesson.done .n { background: var(--success); color: #fff; }
.player-lesson .lt { flex: 1; font-size: 0.88rem; font-weight: 500; line-height: 1.35; }
.player-lesson .lm { font-size: 0.76rem; color: var(--muted); }
.player-main { padding: 28px 34px 72px; min-width: 0; }
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #10202f;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.video-frame video { width: 100%; height: 100%; object-fit: cover; display: block; background: #10202f; }
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
/* The free intro is shown whole, never cropped. */
.video-frame .intro-video { object-fit: contain; }
.video-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  color: rgba(255, 255, 255, 0.82);
  padding: 24px;
  background: radial-gradient(600px 300px at 50% 40%, rgba(61, 122, 172, 0.5), transparent 70%);
}
.text-lesson {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  line-height: 1.7;
}
.text-lesson h2 { margin-top: 0; }

.doc-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.doc-row:hover { border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.doc-ico {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.02em;
  background: var(--accent-soft); color: var(--accent-strong);
  flex: 0 0 auto;
}
.doc-ico.pdf { background: var(--danger-soft); color: var(--danger); }
.doc-ico.video { background: #ede9fb; color: #5b46c4; }
.doc-ico.zip { background: var(--warning-soft); color: var(--warning); }
.doc-ico.sheet { background: var(--success-soft); color: var(--success); }

/* --------------------------------------------------------------------------
   18. Modal & toast
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(16, 32, 47, 0.55);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-backdrop.open { display: flex; animation: fade 0.2s var(--ease); }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  animation: pop 0.22s var(--ease);
}
.modal-lg { max-width: 760px; }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 0;
}
.modal-head h3 { margin: 0; }
.modal-body { padding: 20px 24px; }
.modal-foot {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 24px 24px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
  flex-wrap: wrap;
}
.modal-close {
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
}
.modal-close:hover { background: var(--bg-alt); color: var(--ink); }

@keyframes pop { from { opacity: 0; transform: scale(0.97) translateY(8px); } to { opacity: 1; transform: none; } }

.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: grid;
  gap: 10px;
  max-width: min(380px, calc(100vw - 44px));
}
.toast {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 13px 16px;
  font-size: 0.89rem;
  color: var(--ink-soft);
  animation: slideIn 0.24s var(--ease);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast strong { display: block; color: var(--ink); font-size: 0.9rem; margin-bottom: 2px; }
@keyframes slideIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   19. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: #101f2e;
  color: rgba(255, 255, 255, 0.72);
  padding: 64px 0 28px;
  margin-top: 0;
}
.site-footer a { color: rgba(255, 255, 255, 0.82); }
.site-footer a:hover { color: #fff; }
.site-footer .brand { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.footer-grid h4 {
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer-links { list-style: none; padding: 0; display: grid; gap: 9px; font-size: 0.9rem; }
.footer-links li { margin: 0; }
.footer-bottom {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
}
.social-row { display: flex; gap: 10px; }
.social-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}
.social-btn:hover { background: var(--accent); color: #fff; }

/* --------------------------------------------------------------------------
   20. Misc
   -------------------------------------------------------------------------- */
.pill-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 600;
}
.skeleton { background: linear-gradient(90deg, #eee 25%, #f6f6f6 50%, #eee 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   21. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .teacher-block { grid-template-columns: 1fr; gap: 36px; }
  .teacher-photo { max-width: 340px; }
  .course-layout { grid-template-columns: 1fr; }
  .purchase-card { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .nav-links {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 14px 18px 22px;
    margin: 0;
    display: none;
    gap: 2px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; }
  /* Menu button sits at the top right; the profile is hidden on phones and
     its links move into the menu instead. */
  .nav-toggle { display: block; margin-left: auto; }
  .nav-actions { display: none; }
  .nav-mobile-only { display: block; }
  .nav { gap: 12px; }

  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-bar .filter-search { grid-column: 1 / -1; }
  .filter-bar .filter-actions { grid-column: 1 / -1; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash { grid-template-columns: 1fr; }
  .dash-side {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 16px;
  }
  .dash-side nav { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  .dash-side-title, .dash-side .side-note { display: none; }
  .dash-main { padding: 24px 20px 64px; }
  .player { grid-template-columns: 1fr; }
  .player-side { position: static; height: auto; max-height: 340px; border-right: 0; border-bottom: 1px solid var(--line); }
  .player-main { padding: 20px 18px 64px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}

@media (max-width: 620px) {
  .section { padding: 56px 0; }
  .container { padding-inline: 18px; }
  .grid-2, .grid-3, .grid-4, .grid-auto { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .dash-head { flex-direction: column; }
  .hero { padding: 64px 0 56px; }
  .course-hero { padding: 48px 0; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* --------------------------------------------------------------------------
   22. Legal documents (Terms, Privacy, Refunds, Cookies)
   -------------------------------------------------------------------------- */
.legal-hero {
  padding: 56px 0 30px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.legal-hero h1 { margin-bottom: 8px; }
.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 16px;
}
.legal-meta strong { color: var(--ink-soft); font-weight: 600; }

.legal-layout {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  padding: 48px 0 88px;
}

.legal-toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 16px;
  box-shadow: var(--shadow-xs);
}
.legal-toc h2 {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
  padding: 0 10px;
}
.legal-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.legal-toc li { margin: 0; }
.legal-toc a {
  display: block;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.87rem;
  color: var(--ink-soft);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.legal-toc a:hover { background: var(--bg-alt); color: var(--ink); }
.legal-toc a.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }

.legal-body { max-width: 780px; }
.legal-body > .lead { margin-bottom: 24px; }
.legal-body h2 {
  margin-top: 2.6rem;
  padding-top: 1.7rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.legal-body h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.legal-body h3 { margin-top: 1.7rem; scroll-margin-top: calc(var(--header-h) + 24px); }
.legal-body p, .legal-body li { color: var(--ink-soft); }
.legal-body ol, .legal-body ul { padding-left: 1.35rem; }
.legal-body li { margin-bottom: 0.55rem; }
.legal-body strong { color: var(--ink); }
.legal-body code {
  font-size: 0.85em;
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--ink);
}

.legal-note {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin: 22px 0;
  font-size: 0.92rem;
}
.legal-note p:last-child { margin-bottom: 0; }
.legal-note--caps { border-left-color: var(--gold); background: #fbf7ef; }

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.89rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 18px 0;
}
.legal-table th, .legal-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.legal-table thead th {
  background: var(--surface-2);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.legal-table tbody tr:last-child td { border-bottom: 0; }
.legal-table td:first-child { color: var(--ink); font-weight: 500; }
.legal-table--wrap td, .legal-table--wrap th { white-space: normal; }

.legal-foot {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--muted);
}
.legal-related { display: flex; flex-wrap: wrap; gap: 10px; }
.legal-related a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  color: var(--ink-soft);
}
.legal-related a:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 900px) {
  .legal-layout { grid-template-columns: 1fr; gap: 28px; padding: 32px 0 64px; }
  .legal-toc { position: static; max-height: none; }
  .legal-toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .legal-toc ol { grid-template-columns: 1fr; }
  .legal-hero { padding: 40px 0 26px; }
}

/* --------------------------------------------------------------------------
   23. Promo banners, promo codes and per-student access
   -------------------------------------------------------------------------- */
.promo-banners { display: grid; }

.promo-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 10px 18px;
  background: linear-gradient(90deg, #163c61, #2f6ca3);
  color: #fff;
  font-size: 0.9rem;
  text-align: center;
}
.promo-banner-code {
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 11px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.16);
  border: 1px dashed rgba(255, 255, 255, 0.55);
}
.promo-banner-text { color: rgba(255, 255, 255, 0.94); }
.promo-banner-cta { color: #fff; font-weight: 600; text-decoration: underline; }
.promo-banner-cta:hover { color: #fff; }
.promo-banner-close {
  margin-left: 4px;
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.25rem;
  line-height: 1;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
}
.promo-banner-close:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

.code-pill {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 8px;
  background: var(--bg-alt);
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

.promo-row { display: flex; gap: 10px; align-items: flex-start; }
.promo-row .field { flex: 1; }
.promo-applied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--success-soft);
  border: 1px solid #c6e6d6;
  color: var(--success);
  font-size: 0.9rem;
}
.discount-line { color: var(--success); }

/* Access manager (admin modal) ------------------------------------------- */
.access-course {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.access-course-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.access-lessons { display: grid; gap: 6px; margin-top: 12px; padding-left: 20px; }
.access-lessons .checkbox { font-size: 0.86rem; }
.access-note { font-size: 0.8rem; color: var(--muted); }

/* Locked lessons in the player ------------------------------------------- */
.player-lesson.locked { opacity: 0.65; }
.player-lesson.locked .lm { color: var(--muted); }
.locked-panel {
  text-align: center;
  padding: 64px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.locked-panel .lock-ico { font-size: 2rem; margin-bottom: 10px; }
.locked-panel h2 { margin-bottom: 6px; }

/* Live-session popup (students) ------------------------------------------ */
.live-popup {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 120;
  width: min(320px, calc(100vw - 44px));
  padding: 16px 16px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: livePop 0.3s var(--ease);
}
.live-popup.is-live { border-left-color: var(--danger); }
.live-popup h4 { margin: 6px 0 4px; font-size: 1.02rem; padding-right: 22px; }
.live-popup-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.live-popup.is-live .live-popup-head { color: var(--danger); }
.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
}
.live-popup.is-live .live-dot { background: var(--danger); animation: livePulse 1.4s infinite; }
.live-popup-meta { margin: 0 0 8px; font-size: 0.82rem; color: var(--muted); }
.live-popup-desc { margin: 0 0 10px; font-size: 0.85rem; color: var(--ink-soft); }
.live-popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: 0;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
}
.live-popup-close:hover { background: var(--bg-alt); color: var(--ink); }

@keyframes livePop { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(179, 56, 47, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(179, 56, 47, 0); }
  100% { box-shadow: 0 0 0 0 rgba(179, 56, 47, 0); }
}

@media (max-width: 620px) {
  .live-popup { right: 12px; bottom: 12px; width: calc(100vw - 24px); }
}
