/* =============================================================================
    KAA Learn — Design System
   Light/dark theme, responsive, mobile-first.
   ============================================================================= */

:root {
  --navy-900: #0b1f38;
  --navy-800: #10284a;
  --navy-700: #16345f;
  --navy-600: #1d3f75;
  --navy-100: #e8eef7;
  --navy-50: #f3f6fb;

  --gold-600: #c9a63a;
  --gold-500: #d9b84c;
  --gold-400: #e0c36a;
  --gold-100: #f5ecd4;

  --ink: #17233a;
  --muted: #5b6b85;
  --line: #e2e8f1;
  --bg: #f7f9fc;
  --card: #ffffff;

  --green: #1f9d6a;
  --red: #d64545;
  --amber: #d98e2b;
  --info: #2b6cb0;

  --navy-500: #2c66b8;
  --navy-300: #9db9e8;

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 18px;
  --shadow: 0 6px 24px rgba(16, 40, 74, 0.10);
  --shadow-soft: 0 4px 16px rgba(16, 40, 74, 0.07);
  --shadow-lg: 0 18px 50px rgba(16, 40, 74, 0.16);
  --shadow-pop: 0 24px 60px rgba(16, 40, 74, 0.22);
  --ring: 0 0 0 3px rgba(27, 62, 120, 0.18);

  --grad-brand: linear-gradient(135deg, var(--navy-700), var(--navy-900));
  --grad-gold: linear-gradient(135deg, var(--gold-500), var(--gold-600));

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Poppins", "Inter", system-ui, sans-serif;
}

[data-theme="dark"] {
  --ink: #e7edf7;
  --muted: #93a3bd;
  --line: #23354f;
  --bg: #0b1424;
  --card: #101c30;
  --navy-100: #1c2f4d;
  --navy-50: #0e1a2d;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.5);
  --ring: 0 0 0 3px rgba(150, 180, 230, 0.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(1200px 480px at 85% -5%, rgba(27, 63, 120, 0.07), transparent 60%),
    radial-gradient(900px 420px at -5% 12%, rgba(201, 166, 58, 0.055), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  transition: background 0.25s ease, color 0.25s ease;
}

[data-theme="dark"] body {
  background:
    radial-gradient(1200px 480px at 85% -5%, rgba(46, 108, 201, 0.10), transparent 60%),
    radial-gradient(900px 420px at -5% 12%, rgba(217, 184, 76, 0.045), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0 0 0.5em;
  color: var(--ink);
}

a { color: var(--navy-600); text-decoration: none; }
[data-theme="dark"] a { color: #9db9e8; }
a:hover { color: var(--gold-600); }

img { max-width: 100%; display: block; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.container-fluid { width: 100%; padding: 0 20px; }

.hidden { display: none !important; }

/* ------------------------------------------------------------------ *
 *  Buttons
 * ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
  line-height: 1.4;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy-700); background: linear-gradient(135deg, var(--navy-700), var(--navy-800)); color: #fff !important; box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 4px 12px rgba(16,40,74,0.16); }
.btn-primary:hover { background: linear-gradient(135deg, var(--navy-600), var(--navy-800)); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(16,40,74,0.24); }
.btn-gold { background: var(--gold-600); background: linear-gradient(135deg, var(--gold-500), var(--gold-600)); color: #241a02 !important; box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 4px 12px rgba(201,166,58,0.22); }
.btn-gold:hover { background: linear-gradient(135deg, var(--gold-400), var(--gold-500)); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(201,166,58,0.34); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink) !important; }
.btn-outline:hover { border-color: var(--navy-600); box-shadow: 0 4px 14px rgba(16,40,74,0.1); }
.btn-danger { background: var(--red); color: #fff !important; }
.btn-danger-outline { background: transparent; border-color: var(--red); color: var(--red) !important; }
.btn-sm { padding: 6px 12px; font-size: 13.5px; border-radius: 7px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

/* ------------------------------------------------------------------ *
 *  Forms
 * ------------------------------------------------------------------ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--ink); }
.form-hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.form-control {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  transition: border 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus { outline: none; border-color: var(--navy-600); box-shadow: var(--ring); }
textarea.form-control { resize: vertical; min-height: 110px; }
select.form-control { appearance: auto; }
.form-check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.form-check input { width: 17px; height: 17px; accent-color: var(--navy-600); }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 700px) { .form-row, .form-row-3 { grid-template-columns: 1fr; } }
.password-field { position: relative; }
.password-field .form-control { padding-right: 44px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
  font-size: 15px;
  line-height: 1;
}
.password-toggle:hover { color: var(--ink); }

/* ------------------------------------------------------------------ *
 *  Cards & badges
 * ------------------------------------------------------------------ */
.card {
  background: linear-gradient(160deg, rgba(255,255,255,0.92), rgba(247,250,255,0.84));
  border: 1px solid rgba(226,232,241,0.9);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 8px 28px rgba(16, 40, 74, 0.08), inset 0 1px 0 rgba(255,255,255,0.6);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
[data-theme="dark"] .card {
  background: linear-gradient(160deg, rgba(21,34,58,0.9), rgba(13,22,41,0.86));
  border: 1px solid rgba(35,53,79,0.85);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255,255,255,0.05);
}
.card-hover { transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease, border-color 0.22s ease; }
.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 54px rgba(16, 40, 74, 0.16);
  border-color: rgba(217,184,76,0.45);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.badge-success { background: rgba(31,157,106,.14); color: var(--green); }
.badge-danger  { background: rgba(214,69,69,.14); color: var(--red); }
.badge-warn    { background: rgba(217,142,43,.16); color: var(--amber); }
.badge-info    { background: rgba(43,108,176,.14); color: var(--info); }
.badge-navy    { background: var(--navy-100); color: var(--navy-600); }
.badge-gold    { background: var(--gold-100); color: var(--gold-600); }

/* ------------------------------------------------------------------ *
 *  Grid & layout helpers
 * ------------------------------------------------------------------ */
.grid { display: grid; gap: 22px; }
.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-col { display: flex; flex-direction: column; }
.gap-sm { gap: 8px; }
.gap-md { gap: 14px; }
.wrap { flex-wrap: wrap; }

.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-small { font-size: 13px; }
.text-large { font-size: 18px; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-gold { color: var(--gold-600); }
.font-bold { font-weight: 700; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }
.m-0 { margin: 0; } .p-0 { padding: 0; }

/* ------------------------------------------------------------------ *
 *  Navbar (public)
 * ------------------------------------------------------------------ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card);
  background: color-mix(in srgb, var(--card) 80%, transparent);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 22px rgba(16, 40, 74, 0.06);
}
[data-theme="dark"] .navbar { box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4); }
.navbar-inner { display: flex; align-items: center; gap: 18px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 19px; color: var(--ink) !important; letter-spacing: 0.3px; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
  color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 800;
}
.brand-logo.gold { background: linear-gradient(135deg, var(--gold-600), var(--gold-500)); color: #241a02; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 10px; }
.nav-link {
  padding: 8px 13px; border-radius: 8px; font-weight: 600; font-size: 14.5px; color: var(--ink);
}
.nav-link:hover { background: var(--navy-50); color: var(--navy-600); }
.nav-link.active { color: var(--navy-600); background: var(--navy-100); }
[data-theme="dark"] .nav-link:hover, [data-theme="dark"] .nav-link.active { color: #fff; }

.nav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav-toggle { display: none; }

@media (max-width: 900px) {
  .nav-toggle { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); cursor: pointer; color: var(--ink); }
  .nav-links {
    display: none;
    position: absolute; top: 66px; left: 0; right: 0;
    background: var(--card); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 12px 16px; gap: 4px;
  }
  .nav-links.open { display: flex; }
}

/* ------------------------------------------------------------------ *
 *  Hero
 * ------------------------------------------------------------------ */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 60%, #1a3f72 100%);
  color: #fff;
  padding: 84px 0 96px;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.045) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.045) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.045) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.045) 75%);
  background-size: 44px 44px;
  background-position: 0 0, 0 22px, 22px -22px, -22px 0;
}
.hero-inner { position: relative; z-index: 2; max-width: 820px; }
.hero h1 { color: #fff; font-size: clamp(30px, 5vw, 52px); margin-bottom: 18px; }
.hero h1 .accent { color: var(--gold-500); }
.hero p { color: #c6d3e6; font-size: 18px; max-width: 640px; margin-bottom: 28px; }
.hero-search { display: flex; gap: 0; background: #fff; border-radius: 12px; padding: 6px; max-width: 560px; }
.hero-search input { flex: 1; border: 0; outline: 0; padding: 12px 16px; font-size: 16px; border-radius: 9px; color: #17233a; background: transparent; }
.hero-stats { display: flex; gap: 40px; margin-top: 42px; flex-wrap: wrap; }
.hero-stat b { display: block; font-size: 28px; color: var(--gold-500); font-family: var(--font-display); }
.hero-stat span { color: #aebdd4; font-size: 14px; }

/* ------------------------------------------------------------------ *
 *  Sections
 * ------------------------------------------------------------------ */
.section { padding: 64px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 30px; flex-wrap: wrap; }
.section-kicker { display: inline-block; font-size: 12.5px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold-600); margin-bottom: 12px; position: relative; padding-bottom: 6px; }
.section-kicker::after { content: ""; position: absolute; left: 0; bottom: 0; width: 34px; height: 3px; border-radius: 99px; background: var(--grad-gold); }
.section-title { font-size: clamp(24px, 3vw, 34px); }
.section-sub { color: var(--muted); max-width: 620px; margin-top: 6px; }

/* ------------------------------------------------------------------ *
 *  Course card
 * ------------------------------------------------------------------ */
@keyframes card-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.course-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: 18px;
  animation: card-in 0.5s ease both;
}
.grid-3 .course-card:nth-child(2) { animation-delay: 0.06s; }
.grid-3 .course-card:nth-child(3) { animation-delay: 0.12s; }
.grid-3 .course-card:nth-child(4) { animation-delay: 0.18s; }
.grid-3 .course-card:nth-child(5) { animation-delay: 0.24s; }
.grid-3 .course-card:nth-child(6) { animation-delay: 0.3s; }
@keyframes thumb-shimmer {
  from { background-position: 130% 0; }
  to   { background-position: -70% 0; }
}
.course-thumb {
  position: relative; aspect-ratio: 16 / 9;
  background: linear-gradient(100deg, var(--navy-100) 40%, #f2f6fc 50%, var(--navy-100) 60%);
  background-size: 200% 100%;
  animation: thumb-shimmer 1.5s ease infinite;
  overflow: hidden;
}
[data-theme="dark"] .course-thumb {
  background: linear-gradient(100deg, #16233c 40%, #1e3050 50%, #16233c 60%);
  background-size: 200% 100%;
}
.course-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1); position: relative; }
.course-card:hover .course-thumb img { transform: scale(1.06); }
.course-thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,31,56,0) 55%, rgba(11,31,56,0.28));
  pointer-events: none;
}
.course-thumb .thumb-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--navy-600); font-size: 40px; }
.course-thumb .price-chip {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: rgba(11,31,56,0.82); color: var(--gold-500); font-weight: 800;
  padding: 4px 12px; border-radius: 999px; font-size: 13px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.course-thumb .coming-soon-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(11,31,56,0.82); color: #fff; font-weight: 800;
  padding: 4px 12px; border-radius: 999px; font-size: 12.5px; letter-spacing: 0.4px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.course-thumb .coming-soon-badge i { color: var(--gold-500); }
.course-body { padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.course-title { font-size: 17px; margin: 0; line-height: 1.35; }
.course-title a { color: var(--ink); }
.course-title a:hover { color: var(--gold-600); }
.course-desc {
  margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.course-meta { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.course-meta span { display: inline-flex; align-items: center; gap: 5px; }
.course-meta i { color: var(--gold-600); font-size: 12px; }
.course-cat { font-size: 11.5px; font-weight: 800; color: var(--navy-600); text-transform: uppercase; letter-spacing: 0.7px; }
.course-stats { display: flex; align-items: center; gap: 10px; font-size: 12.5px; flex-wrap: wrap; }
.enrolled-count { color: var(--muted); margin-left: auto; }
.enrolled-count i { margin-right: 4px; color: var(--navy-600); }
.course-footer {
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.course-price { font-weight: 800; font-size: 17px; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.course-price s { font-size: 13px; color: var(--muted); font-weight: 600; }
.coming-soon-price { font-size: 13px; font-weight: 700; color: var(--amber); display: inline-flex; align-items: center; gap: 6px; }
.coming-soon-btn { cursor: default; }
.course-card.is-coming-soon .course-thumb::after {
  background: linear-gradient(180deg, rgba(11,31,56,0) 40%, rgba(11,31,56,0.45));
}

/* Collapsible academy sections on the catalog */
.catalog-group-head { cursor: pointer; user-select: none; border-radius: var(--radius); transition: background 0.2s ease; }
.catalog-group-head:hover { background: rgba(29,63,117,0.05); }
[data-theme="dark"] .catalog-group-head:hover { background: rgba(120,150,200,0.08); }
.catalog-group-head .group-chevron {
  margin-top: 7px; font-size: 15px; color: var(--navy-600);
  transition: transform 0.28s ease;
}
[data-theme="dark"] .catalog-group-head .group-chevron { color: var(--gold-500); }
.catalog-group-head.collapsed .group-chevron { transform: rotate(-90deg); }
.catalog-group-body { overflow: hidden; transition: max-height 0.42s ease, opacity 0.3s ease; }
.catalog-group-head.collapsed + .catalog-group-body { max-height: 0 !important; opacity: 0; pointer-events: none; }

.stars { color: var(--gold-500); font-size: 14px; letter-spacing: 1px; }
.star-empty { color: var(--line); }
.rating-num { font-size: 12.5px; color: var(--muted); }

/* ------------------------------------------------------------------ *
 *  Features / why us
 * ------------------------------------------------------------------ */
.feature-card { padding: 26px; }
.feature-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
  color: var(--gold-500); display: grid; place-items: center; font-size: 22px; margin-bottom: 16px;
}
.feature-card h3 { font-size: 18px; }

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

/* ------------------------------------------------------------------ *
 *  Testimonials
 * ------------------------------------------------------------------ */
.quote-card { padding: 24px; position: relative; }
.quote-mark { color: var(--gold-600); font-size: 34px; line-height: 1; font-family: Georgia, serif; }
.quote-text { color: var(--ink); margin: 10px 0 16px; }
.quote-author { display: flex; align-items: center; gap: 12px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--navy-100); color: var(--navy-600); display: grid; place-items: center; font-weight: 800; font-size: 15px; overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.quote-author b { display: block; font-size: 14.5px; }
.quote-author span { font-size: 12.5px; color: var(--muted); }

/* ------------------------------------------------------------------ *
 *  Footer
 * ------------------------------------------------------------------ */
.footer { background: var(--navy-900); color: #b7c5db; padding: 56px 0 0; margin-top: 40px; }
.footer a { color: #b7c5db; }
.footer a:hover { color: var(--gold-500); }
.footer h4 { color: #fff; font-size: 15px; letter-spacing: 0.5px; margin-bottom: 16px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr; gap: 30px; padding-bottom: 34px; }
.footer .brand-logo { margin-bottom: 14px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 18px 0; font-size: 13px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .footer-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ *
 *  Flash messages
 * ------------------------------------------------------------------ */
.flash { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14.5px; font-weight: 500; }
.flash-success { background: rgba(31,157,106,.12); color: var(--green); border: 1px solid rgba(31,157,106,.35); }
.flash-error { background: rgba(214,69,69,.12); color: var(--red); border: 1px solid rgba(214,69,69,.35); }
.flash-info { background: rgba(43,108,176,.12); color: var(--info); border: 1px solid rgba(43,108,176,.35); }
.flash .flash-close { margin-left: auto; cursor: pointer; border: 0; background: transparent; font-size: 16px; color: inherit; }
.flashes { max-width: 1180px; margin: 18px auto 0; padding: 0 20px; }
.flashes.flashes-inner { max-width: 560px; }

/* ------------------------------------------------------------------ *
 *  Auth layout
 * ------------------------------------------------------------------ */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; background: linear-gradient(135deg, var(--navy-900), var(--navy-700) 70%, #1a3f72); }
.auth-card { width: 100%; max-width: 430px; background: var(--card); border-radius: 20px; padding: 34px; box-shadow: var(--shadow-lg); }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand .brand-logo { margin: 0 auto 10px; width: 52px; height: 52px; font-size: 20px; }
.auth-brand h1 { font-size: 22px; margin: 0; }
.auth-brand p { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }
.auth-alt { margin-top: 16px; text-align: center; font-size: 13.5px; color: var(--muted); }

/* ------------------------------------------------------------------ *
 *  Dashboard shell
 * ------------------------------------------------------------------ */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 252px; flex-shrink: 0;
  background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--line); font-weight: 800; color: var(--ink); font-family: var(--font-display); }
.sidebar-nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.side-nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); font-weight: 700; padding: 14px 12px 6px; }
.side-link { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; font-weight: 600; font-size: 14.5px; color: var(--ink); }
.side-link i { width: 20px; text-align: center; color: var(--muted); font-size: 16px; }
.side-link:hover { background: var(--navy-50); }
.side-link.active { background: var(--navy-700); color: #fff; }
.side-link.active i { color: var(--gold-500); }
.side-link .pill { margin-left: auto; background: var(--gold-600); color: #241a02; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 7px; }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.shell-topbar {
  position: sticky; top: 0; z-index: 40;
  height: 64px; background: var(--card); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
}
.shell-topbar .top-title { font-weight: 700; font-size: 17px; font-family: var(--font-display); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell-content { padding: 26px 22px 60px; flex: 1; }
.shell-content-narrow { max-width: 1000px; }

.sidebar-backdrop { display: none; }
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 100; transform: translateX(-100%); transition: transform 0.25s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open ~ .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; }
  .shell-topbar .sidebar-toggle { display: grid; }
}
.sidebar-toggle { display: none; place-items: center; width: 40px; height: 40px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); cursor: pointer; color: var(--ink); font-size: 17px; }

/* ------------------------------------------------------------------ *
 *  Stats tiles
 * ------------------------------------------------------------------ */
.stat-tile { padding: 18px 20px; display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; }
.stat-icon.navy { background: var(--navy-100); color: var(--navy-600); }
.stat-icon.gold { background: var(--gold-100); color: var(--gold-600); }
.stat-icon.green { background: rgba(31,157,106,.14); color: var(--green); }
.stat-icon.red { background: rgba(214,69,69,.14); color: var(--red); }
.stat-icon.info { background: rgba(43,108,176,.14); color: var(--info); }
.stat-tile b { display: block; font-size: 24px; font-family: var(--font-display); }
.stat-tile span { font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------------ *
 *  Progress
 * ------------------------------------------------------------------ */
.progress { height: 8px; border-radius: 999px; background: var(--navy-100); overflow: hidden; }
.progress-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--navy-600), var(--gold-600)); transition: width 0.4s ease; }
.progress-circle { position: relative; width: 64px; height: 64px; }
.progress-circle svg { transform: rotate(-90deg); }
.progress-circle .track { stroke: var(--navy-100); }
.progress-circle .bar { stroke: var(--navy-600); stroke-linecap: round; transition: stroke-dashoffset 0.5s ease; }
.progress-circle .pct { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 14px; }

/* ------------------------------------------------------------------ *
 *  Tables
 * ------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: var(--navy-50); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); font-weight: 700; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--navy-50); }

/* ------------------------------------------------------------------ *
 *  Pagination
 * ------------------------------------------------------------------ */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 38px; height: 38px; padding: 0 12px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--ink); background: var(--card);
}
.pagination a:hover { border-color: var(--navy-600); }
.pagination .current { background: var(--navy-700); color: #fff; border-color: var(--navy-700); }

/* ------------------------------------------------------------------ *
 *  Course detail hero
 * ------------------------------------------------------------------ */
.course-hero { background: linear-gradient(135deg, var(--navy-900), var(--navy-700)); color: #fff; padding: 48px 0; }
.course-hero h1 { color: #fff; font-size: clamp(24px, 3.5vw, 38px); }
.course-hero .meta-line { display: flex; gap: 18px; flex-wrap: wrap; color: #b7c5db; font-size: 14px; margin-top: 12px; }
.course-hero .enroll-count { color: var(--gold-500); font-weight: 700; }
.course-instructor { display: flex; align-items: center; gap: 12px; margin-top: 18px; color: #dbe4f0; }
.course-instructor .avatar { background: rgba(255,255,255,0.15); color: #fff; }

.purchase-box { position: sticky; top: 90px; }
.purchase-box .price { font-size: 30px; font-weight: 800; font-family: var(--font-display); }
.price { font-size: 30px; font-weight: 800; font-family: var(--font-display); }
.purchase-box .price s { font-size: 18px; color: var(--muted); font-weight: 500; }
.purchase-box .savings { font-size: 13px; color: var(--green); font-weight: 700; }
.purchase-box .bundle-value { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 2px; }

/* ------------------------------------------------------------------ *
 *  Academy hero & bundle chips
 * ------------------------------------------------------------------ */
.academy-hero {
  background:
    radial-gradient(1000px 320px at 85% -10%, rgba(255, 196, 61, 0.16), transparent 60%),
    linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: #fff; padding: 52px 0;
  border-top: 3px solid var(--gold-500);
}
.academy-hero h1 { color: #fff; font-size: clamp(26px, 4vw, 42px); }
.academy-hero .meta-line { display: flex; gap: 18px; flex-wrap: wrap; color: #b7c5db; font-size: 14px; margin-top: 16px; }
.academy-hero .meta-line span { display: inline-flex; align-items: center; gap: 7px; }
.academy-hero .meta-line i { color: var(--gold-500); }
.academy-seal {
  width: 66px; height: 66px; margin: 0 auto 12px; border-radius: 50%;
  display: grid; place-items: center; font-size: 26px; color: #241a02;
  background: linear-gradient(160deg, var(--gold-400), var(--gold-600));
  box-shadow: 0 8px 24px rgba(255, 196, 61, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.bundle-value { font-weight: 700; color: var(--ink); }
.bundle-value .text-muted { font-weight: 600; }
.course-thumb .price-chip.is-bundle {
  background: linear-gradient(160deg, var(--gold-400), var(--gold-600));
  color: #241a02; box-shadow: 0 2px 12px rgba(255, 196, 61, 0.4);
}

/* ------------------------------------------------------------------ *
 *  Lesson player
 * ------------------------------------------------------------------ */
.player-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 0; min-height: 100vh; }
.player-main { min-width: 0; display: flex; flex-direction: column; }
.player-video { position: relative; background: #000; aspect-ratio: 16 / 9; }
.player-video video { width: 100%; height: 100%; object-fit: contain; }
.player-toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--card); flex-wrap: wrap; }
.player-content { padding: 26px 28px; max-width: 860px; }
.player-rail { border-left: 1px solid var(--line); background: var(--card); overflow-y: auto; max-height: 100vh; position: sticky; top: 0; }
.rail-item { display: flex; align-items: center; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink); }
.rail-item:hover { background: var(--navy-50); }
.rail-item.active { background: var(--navy-700); color: #fff; }
.rail-item .rail-num { width: 24px; height: 24px; border-radius: 50%; background: var(--navy-100); color: var(--navy-600); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.rail-item.done .rail-num { background: var(--green); color: #fff; }
.rail-item.active .rail-num { background: var(--gold-500); color: #241a02; }
.rail-module { padding: 12px 16px 6px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); }
@media (max-width: 980px) {
  .player-layout { grid-template-columns: 1fr; }
  .player-rail { position: static; max-height: 60vh; border-left: 0; border-top: 1px solid var(--line); }
}

.complete-bar { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--card); border-bottom: 1px solid var(--line); }

/* ------------------------------------------------------------------ *
 *  Quiz
 * ------------------------------------------------------------------ */
.quiz-option { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; margin-bottom: 10px; transition: border 0.15s ease, background 0.15s ease; font-size: 15px; }
.quiz-option:hover { border-color: var(--navy-600); }
.quiz-option.selected { border-color: var(--navy-600); background: var(--navy-50); }
.quiz-option .opt-key { width: 30px; height: 30px; border-radius: 8px; background: var(--navy-100); color: var(--navy-600); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.quiz-option.selected .opt-key { background: var(--navy-700); color: #fff; }

.answer-correct { border-color: var(--green) !important; background: rgba(31,157,106,.08) !important; }
.answer-wrong { border-color: var(--red) !important; background: rgba(214,69,69,.08) !important; }

/* ------------------------------------------------------------------ *
 *  Misc
 * ------------------------------------------------------------------ */
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--card); border-radius: 9px; cursor: pointer; color: var(--ink); font-size: 15px; position: relative; transition: all 0.15s ease; }
.icon-btn:hover { border-color: var(--navy-600); color: var(--navy-600); }
.icon-btn.active { background: var(--navy-700); color: #fff; border-color: var(--navy-700); }

.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty i { font-size: 46px; opacity: 0.4; display: block; margin-bottom: 12px; }
.empty h3 { color: var(--ink); }

.banner { background: linear-gradient(135deg, var(--gold-600), var(--gold-500)); color: #241a02; padding: 14px 20px; text-align: center; font-weight: 700; font-size: 14.5px; }
.banner a { color: #241a02; text-decoration: underline; }
.banner-promo { display: flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; background: linear-gradient(135deg, var(--navy-800), var(--navy-700)); color: #fff; font-size: 14px; font-weight: 600; padding: 11px 20px; }
.banner-promo:hover { color: var(--gold-400); }
.banner-promo b { color: var(--gold-500); font-weight: 800; }

.notif-item { display: flex; gap: 14px; padding: 16px; border-bottom: 1px solid var(--line); }
.notif-item:last-child { border-bottom: 0; }
.notif-item.unread { background: var(--navy-50); }

.chat-line { display: flex; gap: 12px; margin-bottom: 16px; }
.chat-bubble { background: var(--card); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 12px 16px; flex: 1; }
.chat-meta { font-size: 12.5px; color: var(--muted); }

.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Toggle switch (dark mode) */
.theme-toggle {
  width: 44px; height: 24px; border-radius: 999px; border: 0; cursor: pointer; position: relative;
  background: var(--navy-100); transition: background 0.2s ease;
}
.theme-toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--gold-600); transition: transform 0.2s ease;
}
[data-theme="dark"] .theme-toggle::after { transform: translateX(20px); }

/* Print */
@media print {
  .navbar, .footer, .shell-topbar, .sidebar, .no-print { display: none !important; }
  .shell { display: block; }
  .shell-content { padding: 0; }
}

/* ------------------------------------------------------------------ *
 *  Responsive & mobile polish
 *  ------------------------------------------------------------------ */

/* Inline two-column grids (admin/student/payment pages) must stack on small screens */
@media (max-width: 700px) {
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}

/* Layout helpers used by the views but not previously defined */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(22px, 4vw, 30px); margin: 0; }
.page-head p { margin: 4px 0 0; }

.back-link { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.text-right { text-align: right; }
.text-capitalize { text-transform: capitalize; }
.ml-1 { margin-left: 8px; }
.mr-1 { margin-right: 8px; }

.stat-card { display: flex; align-items: center; gap: 14px; padding: 18px 20px; }
.progress-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--navy-600), var(--gold-600)); }

/* Course rows (student dashboard + my courses) */
.course-row { display: flex; align-items: center; gap: 16px; }
.course-row .course-thumb { flex-shrink: 0; }

/* Curriculum rows (course learn page) */
.curriculum-row { display: flex; align-items: center; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.curriculum-row:hover { background: var(--navy-50); }
.curriculum-row .rail-num { width: 24px; height: 24px; border-radius: 50%; background: var(--navy-100); color: var(--navy-600); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.curriculum-row.done .rail-num { background: var(--green); color: #fff; }

/* Checkout payment tabs */
.pay-tabs { display: flex; gap: 8px; margin: 16px 0 4px; flex-wrap: wrap; }
.pay-tab { flex: 1; min-width: 120px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border: 1.5px solid var(--line); background: var(--card); border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; color: var(--ink); cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; }
.pay-tab:hover { border-color: var(--navy-600); }
.pay-tab.active { border-color: var(--navy-700); background: var(--navy-700); color: #fff; }
.pay-tab.active i { color: var(--gold-500); }

/* Quiz / payment result hero */
.result-hero { text-align: center; }
.result-score { display: grid; place-items: center; }
.score-circle { width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 22px; font-family: var(--font-display); }
.score-circle.pass { background: rgba(31,157,106,.14); color: var(--green); border: 3px solid var(--green); }
.score-circle.fail { background: rgba(214,69,69,.12); color: var(--red); border: 3px solid var(--red); }
.result-pass { border: 2px solid rgba(31,157,106,.35); }
.result-fail { border: 2px solid rgba(214,69,69,.35); }

/* Certificates */
.cert-card { position: relative; overflow: hidden; }
.cert-seal { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--gold-600), var(--gold-500)); color: #241a02; display: grid; place-items: center; font-size: 24px; flex-shrink: 0; }
.cert-mini { position: relative; overflow: hidden; }

/* Learn page hero */
.learn-hero { background: linear-gradient(135deg, var(--navy-900), var(--navy-700)); color: #fff; padding: 32px 0; }
.learn-hero h1 { color: #fff; font-size: clamp(22px, 3.5vw, 32px); }
.learn-hero .text-muted { color: #b7c5db; }
.learn-hero .back-link { color: var(--gold-500); }

/* Mobile auth links inside the public hamburger menu */
.nav-auth-mobile { display: none; flex-direction: column; gap: 8px; padding: 12px 0 4px; margin-top: 10px; border-top: 1px solid var(--line); }

@media (max-width: 900px) {
  .nav-actions > .btn { display: none; }
  .nav-auth-mobile { display: flex; }
}

@media (max-width: 700px) {
  .section { padding: 40px 0; }
}

@media (max-width: 640px) {
  .shell-topbar { padding: 0 12px; }
  .shell-content { padding: 18px 14px 50px; }
  .player-content { padding: 18px 14px; }
  .course-row { flex-direction: column; align-items: stretch; }
  .course-row .course-thumb { width: 100% !important; }
  .learn-cta .progress-bar { width: 100% !important; }
}

@media (max-width: 520px) {
  .auth-card { padding: 24px 18px; }
  .table th, .table td { padding: 10px 12px; font-size: 13px; }
}

@media (max-width: 480px) {
  .container, .container-fluid { padding-left: 14px; padding-right: 14px; }
  .navbar-inner { gap: 10px; }
  .brand { font-size: 16px; }
  .nav-actions .theme-toggle { display: none; }
  .hero { padding: 54px 0 64px; }
  .hero-search { flex-direction: column; gap: 8px; background: transparent; padding: 0; }
  .hero-search input { background: #fff; border-radius: 9px; }
  .hero-search .btn { width: 100%; }
  .hero-stats { gap: 18px; }
  .course-hero { padding: 34px 0; }
}

/* ------------------------------------------------------------------ *
 *  Mobile bottom navigation
 *  ------------------------------------------------------------------ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around;
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  flex: 1;
  max-width: 90px;
}
.bottom-nav a i { font-size: 20px; }
.bottom-nav a.active { color: var(--navy-700); }
.bottom-nav a.active i { color: var(--gold-600); }
[data-theme="dark"] .bottom-nav a.active { color: #9db9e8; }

@media (max-width: 860px) {
  .shell { padding-bottom: 72px; }
  .bottom-nav { display: flex; }
}

/* ------------------------------------------------------------------ *
 *  Mobile-first student pages
 *  ------------------------------------------------------------------ */
.continue-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
  color: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.continue-card:hover { color: #fff; transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.continue-card .continue-icon { width: 52px; height: 52px; border-radius: 14px; background: rgba(255,255,255,0.15); display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.continue-card .continue-body { flex: 1; min-width: 0; }
.continue-card h3 { color: #fff; font-size: 17px; margin: 0 0 4px; }
.continue-card p { color: rgba(255,255,255,0.75); font-size: 13.5px; margin: 0; }
.continue-card .continue-arrow { color: var(--gold-500); font-size: 20px; }

.academy-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.academy-card:hover { color: var(--ink); transform: translateY(-2px); border-color: var(--gold-600); }
.academy-card .academy-icon { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, var(--navy-700), var(--navy-900)); color: var(--gold-500); display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }
.academy-icon { width: 46px; height: 46px; border-radius: 13px; background: linear-gradient(135deg, var(--navy-700), var(--navy-900)); color: var(--gold-500); display: grid; place-items: center; font-size: 19px; }
.academy-card .academy-body { flex: 1; min-width: 0; }
.academy-card h3 { font-size: 15px; margin: 0 0 3px; }
.academy-card p { font-size: 12.5px; color: var(--muted); margin: 0; }
.academy-card .academy-arrow { color: var(--muted); font-size: 16px; }

@media (max-width: 640px) {
  .continue-card { padding: 16px; gap: 12px; }
  .continue-card h3 { font-size: 15px; }
  .continue-card .continue-icon { width: 44px; height: 44px; font-size: 18px; }
  .academy-card { padding: 14px 16px; }
}

/* Lesson player mobile improvements */
@media (max-width: 980px) {
  .player-layout { display: flex; flex-direction: column; }
  .player-rail { 
    position: fixed; top: 0; right: 0; bottom: 0; width: 320px; max-width: 85vw; 
    z-index: 110; transform: translateX(100%); transition: transform 0.25s ease; 
    border-left: 1px solid var(--line); background: var(--card); overflow-y: auto;
  }
  .player-rail.open { transform: translateX(0); }
  .player-rail-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 109; }
  .player-rail-backdrop.open { display: block; }
  .player-video { aspect-ratio: auto; }
  .player-video iframe, .player-video video { position: sticky; top: 0; }
  #rail-toggle { display: grid !important; }
}

@media (max-width: 640px) {
  .player-toolbar { padding: 10px 14px; gap: 8px; }
  .player-content { padding: 18px 14px; }
  .curriculum-row { padding: 14px 14px; }
  .rail-item { padding: 14px; }
  .player-layout { padding-bottom: 0; }
}

/* Large touch targets for mobile */
@media (max-width: 640px) {
  .btn { padding: 12px 20px; font-size: 16px; }
  .btn-sm { padding: 8px 14px; font-size: 14px; }
  .player-toolbar { padding: 10px 14px; gap: 8px; }
  .player-content { padding: 18px 14px; }
  .curriculum-row { padding: 14px 14px; }
  .rail-item { padding: 14px; }
}

/* Hide sidebar on small screens, rely on bottom nav + hamburger */
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .shell-main { margin-left: 0; }
}

/* ------------------------------------------------------------------ *
 *  Lesson content typography + structured segments
 *  ------------------------------------------------------------------ */
.lesson-content { line-height: 1.75; color: var(--ink); }
.lesson-content h2 { font-size: 21px; margin: 26px 0 10px; }
.lesson-content h3 { font-size: 17px; margin: 22px 0 8px; }
.lesson-content h4 { font-size: 15px; margin: 18px 0 6px; }
.lesson-content p { margin: 10px 0; }
.lesson-content ul, .lesson-content ol { margin: 10px 0; padding-left: 22px; }
.lesson-content li { margin: 5px 0; }
.lesson-content table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 14px 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.lesson-content th, .lesson-content td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.lesson-content th { background: var(--navy-50); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); font-weight: 700; }
.lesson-content tr:last-child td { border-bottom: 0; }
.lesson-content pre { background: #0d1b2e; color: #d7e3f4; padding: 14px 16px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 13px; line-height: 1.6; }
.lesson-content code { font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace; }
.lesson-content :not(pre) > code { background: var(--navy-100); color: var(--navy-700); padding: 2px 6px; border-radius: 6px; font-size: 0.9em; }
.lesson-content hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

.lesson-content blockquote { margin: 14px 0; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14.5px; }
.lesson-content blockquote.tip { background: rgba(31,157,106,0.10); border-left: 4px solid var(--green); color: var(--ink); }
.lesson-content blockquote.tip strong { color: var(--green); }
.lesson-content blockquote.warn { background: rgba(217,142,43,0.12); border-left: 4px solid var(--amber); color: var(--ink); }
.lesson-content blockquote.warn strong { color: var(--amber); }

.lesson-content .lesson-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.lesson-content .lesson-meta-item { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--navy-50); border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; color: var(--muted); }
.lesson-content .lesson-meta-item b { color: var(--navy-700); }
[data-theme="dark"] .lesson-content .lesson-meta-item b { color: #9db9e8; }

.lesson-content .lesson-box { margin: 16px 0; padding: 16px 18px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card); }
.lesson-content .lesson-box h4 { margin-top: 0; font-size: 14px; text-transform: uppercase; letter-spacing: 0.8px; display: flex; align-items: center; gap: 8px; }
.lesson-content .lesson-box ul, .lesson-content .lesson-box ol { margin: 8px 0 0; }
.lesson-content .lesson-box.mistakes { background: rgba(214,69,69,0.07); border-color: rgba(214,69,69,0.25); }
.lesson-content .lesson-box.mistakes h4 { color: var(--red); }
.lesson-content .lesson-box.troubleshoot { background: rgba(43,108,176,0.07); border-color: rgba(43,108,176,0.25); }
.lesson-content .lesson-box.troubleshoot h4 { color: var(--info); }
.lesson-content .lesson-box.exercise { background: rgba(31,157,106,0.07); border-color: rgba(31,157,106,0.25); }
.lesson-content .lesson-box.exercise h4 { color: var(--green); }
.lesson-content .lesson-box.exercise h2, .lesson-content .lesson-box.exercise h3 { margin-top: 8px; }
.lesson-content .lesson-box.check { background: rgba(217,142,43,0.07); border-color: rgba(217,142,43,0.25); }
.lesson-content .lesson-box.check h4 { color: var(--amber); }
.lesson-content .lesson-box.check ol { padding-left: 20px; }
.lesson-content .lesson-box.check details { margin: 8px 0; }
.lesson-content .lesson-box.check summary { cursor: pointer; font-weight: 600; }
.lesson-content .lesson-box.check .check-answer { display: block; padding: 8px 12px; margin-top: 6px; background: var(--navy-50); border-radius: var(--radius-sm); font-size: 13.5px; }
.lesson-content .lesson-box.check .check-note { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }

/* ------------------------------------------------------------------ *
 *  Spacing scale (CSS custom properties for consistent spacing)
 *  ------------------------------------------------------------------ */
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
}

/* ------------------------------------------------------------------ *
 *  Additional utility classes
 *  ------------------------------------------------------------------ */
.gap-xs { gap: 4px; }
.gap-lg { gap: 18px; }
.gap-xl { gap: 24px; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.w-full { width: 100%; }
.flex-col { flex-direction: column; }
.text-left { text-align: left; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ *
 *  Form validation states
 *  ------------------------------------------------------------------ */
.form-control.is-invalid { border-color: var(--red); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.18); }
.form-control.is-valid { border-color: var(--green); }
.form-control.is-valid:focus { box-shadow: 0 0 0 3px rgba(31, 157, 106, 0.18); }
.form-error { font-size: 13px; color: var(--red); margin-top: 4px; display: flex; align-items: center; gap: 5px; }
.form-success { font-size: 13px; color: var(--green); margin-top: 4px; display: flex; align-items: center; gap: 5px; }

/* ------------------------------------------------------------------ *
 *  Loading & skeleton states
 *  ------------------------------------------------------------------ */
.spinner {
  width: 20px; height: 20px; border: 2px solid var(--line); border-top-color: var(--navy-600);
  border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }

.skeleton {
  background: linear-gradient(90deg, var(--navy-100) 25%, #e8eef7 50%, var(--navy-100) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s ease infinite; border-radius: var(--radius-sm);
}
[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, #16233c 25%, #1e3050 50%, #16233c 75%);
  background-size: 200% 100%;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ------------------------------------------------------------------ *
 *  Accessibility: focus-visible & reduced motion
 *  ------------------------------------------------------------------ */
:focus-visible {
  outline: 2px solid var(--navy-600);
  outline-offset: 2px;
  border-radius: 4px;
}
[data-theme="dark"] :focus-visible {
  outline-color: var(--gold-500);
}

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

/* ------------------------------------------------------------------ *
 *  Skip to content (accessibility)
 *  ------------------------------------------------------------------ */
.skip-link {
  position: absolute; top: -100%; left: var(--space-4); z-index: 9999;
  background: var(--navy-700); color: #fff; padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm); font-weight: 600; font-size: 14px;
  transition: top 0.2s ease;
}
.skip-link:focus { top: var(--space-4); }

/* ------------------------------------------------------------------ *
 *  Course detail mobile layout fix
 *  ------------------------------------------------------------------ */
@media (max-width: 860px) {
  .course-hero-inner {
    grid-template-columns: 1fr !important;
  }
  .course-hero-inner .purchase-box {
    position: static !important;
    width: 100% !important;
    margin-top: var(--space-6);
  }
}

/* Player rail item text truncation */
.rail-item .rail-title { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Admin stat-icon color variants */
.stat-icon.navy { background: var(--navy-100); color: var(--navy-600); }
.stat-icon.gold { background: var(--gold-100); color: var(--gold-600); }
.stat-icon.green { background: rgba(31,157,106,.14); color: var(--green); }
.stat-icon.red { background: rgba(214,69,69,.14); color: var(--red); }
.stat-icon.info { background: rgba(43,108,176,.14); color: var(--info); }
.stat-icon.purple { background: rgba(58,93,206,.14); color: #3a5dce; }
.stat-icon.teal { background: rgba(31,157,106,.14); color: var(--green); }

/* Video placeholder */
.player-video-placeholder {
  height:100%; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:10px;
}
.player-video-placeholder i { font-size:40px; color:#556; }
.player-video-placeholder span { color:#99a; }
.player-video-iframe { width:100%; height:100%; border:0; }

/* Footer form inline style removal */
.footer .flex { display: flex; align-items: center; gap: 10px; }
.footer .form-control { flex: 1; }

/* Academy card inline style helpers */
.academy-success { font-weight:700; font-size:13px; margin:2px 0 4px; }

/* Course row vertical stacking */
.course-row-stack { flex-direction: column; align-items: stretch; }

/* Progress bar height variants */
.progress-bar-sm { height: 5px; }
.progress-bar-md { height: 7px; }
.progress-bar-lg { height: 8px; }

/* Text link color in course rows */
.course-row h3 a { color: var(--ink); text-decoration: none; }
.course-row h3 a:hover { color: var(--gold-600); }

/* Admin dashboard two-column layout */
.admin-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); gap: 22px; }
@media (max-width: 860px) {
  .admin-grid { grid-template-columns: 1fr !important; }
}

/* List reset for purchase features */
.purchase-features { list-style: none; margin: 18px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; }
.purchase-features li { display: flex; align-items: center; gap: 8px; }
.purchase-features .text-gold { color: var(--gold-600); }

/* Related course card link */
.related-course-link { text-decoration: none; color: var(--ink); }
.related-course-link:hover { color: var(--ink); }

/* ------------------------------------------------------------------ *
 *  Sidebar logout button (remove inline styles)
 *  ------------------------------------------------------------------ */
.side-link.logout-btn {
  width: 100%; background: transparent; border: 0; text-align: left;
  font-family: inherit; cursor: pointer; display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 9px; font-weight: 600; font-size: 14.5px; color: var(--ink);
}
.side-link.logout-btn:hover { background: var(--navy-50); }

/* ------------------------------------------------------------------ *
 *  Course detail purchase box list (remove inline styles)
 *  ------------------------------------------------------------------ */
.purchase-features {
  list-style: none; margin: 18px 0 0; padding: 12px 0 0;
  border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 9px; font-size: 13.5px;
}
.purchase-features li { display: flex; align-items: center; gap: 8px; }
.purchase-features .text-gold { color: var(--gold-600); }

/* ------------------------------------------------------------------ *
 *  Course row thumb (remove inline styles)
 *  ------------------------------------------------------------------ */
.course-row-thumb {
  width: 120px; aspect-ratio: 16/10; border-radius: 10px; flex-shrink: 0; overflow: hidden; background: var(--navy-100);
}
.course-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-row-thumb .thumb-fallback { width: 100%; height: 100%; display: grid; place-items: center; font-size: 28px; color: var(--navy-600); }
@media (max-width: 640px) {
  .course-row-thumb { width: 100% !important; aspect-ratio: 16/9; }
}

/* ------------------------------------------------------------------ *
 *  Section heading helper (remove inline styles)
 *  ------------------------------------------------------------------ */
.section-heading { font-size: 24px; margin-bottom: 14px; }
.section-heading-sm { font-size: 20px; margin-bottom: 14px; }
.section-heading-xs { font-size: 19px; margin-bottom: 14px; }

/* ------------------------------------------------------------------ *
 *  Card content helpers (remove inline styles)
 *  ------------------------------------------------------------------ */
.card-body { padding: 20px; }
.card-body-sm { padding: 14px 16px; }
.card-flush { padding: 0; overflow: hidden; }
.card-flex { display: flex; align-items: center; gap: 12px; padding: 12px; }

/* Additional utilities */
.items-end { align-items: flex-end; }
.items-start { align-items: flex-start; }
.flex-1 { flex: 1; }
.min-w-0 { min-width: 0; }
.min-w-280 { min-width: 280px; }
.max-w-640 { max-width: 640px; }
.max-w-320 { max-width: 320px; }
.w-120 { width: 120px; }
.w-320 { width: 320px; }
.w-74 { width: 74px; }
.rounded-8 { border-radius: 8px; }
.rounded-10 { border-radius: 10px; }
.aspect-16-9 { aspect-ratio: 16 / 9; }
.aspect-16-10 { aspect-ratio: 16 / 10; }
.text-white { color: #fff; }
.text-gold-500 { color: var(--gold-500); }
.leading-tight { line-height: 1.35; }
.gap-9 { gap: 9px; }
.gap-12 { gap: 12px; }
.gap-14 { gap: 14px; }
.p-0 { padding: 0; }
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.pt-6 { padding-top: 24px; }
.pt-9 { padding-top: 36px; }
.overflow-hidden { overflow: hidden; }
.flex-shrink-0 { flex-shrink: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Course detail hero inner grid */
.course-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 34px;
  align-items: start;
}
@media (max-width: 860px) {
  .course-hero-inner {
    grid-template-columns: 1fr !important;
  }
  .course-hero-inner .purchase-box {
    position: static !important;
    width: 100% !important;
    margin-top: 24px;
  }
}

/* Public course curriculum accordion */
.curriculum-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.curriculum-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}
.curriculum-group summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}
.curriculum-group summary::-webkit-details-marker {
  display: none;
}
.curriculum-chevron {
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.curriculum-group[open] .curriculum-chevron {
  transform: rotate(180deg);
}
.curriculum-group-title {
  flex: 1;
  font-weight: 600;
  font-size: 15px;
}
.curriculum-group-meta {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}
.curriculum-lessons {
  list-style: none;
  margin: 0;
  padding: 4px 16px 14px;
  border-top: 1px solid var(--line);
}
.curriculum-lessons li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  font-size: 14px;
}
.curriculum-lessons li + li {
  border-top: 1px dashed var(--line);
}
.curriculum-lessons li > i {
  color: var(--gold-500);
  font-size: 13px;
}
.curriculum-duration {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}
.curriculum-lesson-link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.curriculum-lesson-link:hover {
  color: var(--gold-600);
  text-decoration: underline;
}

/* =============================================================================
    Modernization & PWA polish
   ============================================================================= */

/* Hero ambient glow blobs */
.hero::before {
  content: "";
  position: absolute;
  top: -140px; right: -120px;
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(217, 184, 76, 0.22), transparent 65%);
  filter: blur(10px);
  pointer-events: none;
}
.hero::after { z-index: 1; }
.hero-inner { z-index: 2; }

/* Crisp, themed scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--navy-600) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--navy-600); border-radius: 20px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-600); }
::-webkit-scrollbar-track { background: transparent; }

/* Bottom nav safe-area (iOS PWA standalone) */
.bottom-nav {
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}
@supports (padding-top: env(safe-area-inset-top)) {
  .navbar { padding-top: env(safe-area-inset-top); }
}

/* Back-to-top button */
.to-top {
  position: fixed;
  right: 22px; bottom: 22px;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--navy-600);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 16px;
  opacity: 0; visibility: hidden;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
  z-index: 45;
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { color: var(--gold-600); border-color: var(--gold-500); }

/* PWA install toast */
.install-prompt {
  position: fixed;
  left: 50%; bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
  max-width: min(480px, calc(100vw - 32px));
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, transform .3s ease, visibility .3s;
  z-index: 60;
}
.install-prompt.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.install-prompt-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
  color: var(--gold-500);
  display: grid; place-items: center; font-size: 16px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.install-prompt-body { flex: 1; min-width: 0; }
.install-prompt-body b { display: block; font-size: 14px; }
.install-prompt-body span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.install-prompt .install-close {
  border: 0; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 15px; padding: 6px; border-radius: 6px;
}
.install-prompt .install-close:hover { color: var(--ink); background: var(--navy-50); }
.install-prompt .btn { flex-shrink: 0; }

@media (max-width: 640px) {
  .to-top { right: 16px; bottom: 16px; width: 42px; height: 42px; }
  .install-prompt { bottom: 76px; }
  .install-prompt .btn { padding: 9px 14px; font-size: 13px; }
}

/* Bottom nav shows on mobile only; keep to-top clear of it */
@media (max-width: 900px) {
  body.has-bottom-nav .to-top { bottom: 84px; }
}

/* Card hover lift (subtle, respects motion prefs) */
.card-hover { transition: transform .22s ease, box-shadow .22s ease; }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

/* Slightly richer section sub-links */
.section-head .btn-outline { white-space: nowrap; }

/* =============================================================================
   Lesson player v2 — cinematic stage, sticky toolbar, floating action bar
   ============================================================================= */

.player-layout { background: var(--bg); }

/* Sticky toolbar */
.player-toolbar {
  position: sticky;
  top: 0;
  z-index: 45;
  min-height: 60px;
  background: var(--card);
  background: color-mix(in srgb, var(--card) 82%, transparent);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 22px rgba(16, 40, 74, 0.06);
}
[data-theme="dark"] .player-toolbar { box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4); }

.player-progress-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 700; color: var(--navy-600);
  background: var(--navy-100); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}
[data-theme="dark"] .player-progress-pill { color: #9db9e8; }
.player-progress-pill i { color: var(--gold-600); }

/* Video stage */
.player-stage {
  background:
    radial-gradient(900px 320px at 50% -25%, rgba(44, 102, 184, 0.6), transparent 70%),
    linear-gradient(180deg, #060c18, #0b1f38);
  padding: clamp(10px, 3vw, 28px);
}
[data-theme="dark"] .player-stage {
  background:
    radial-gradient(900px 320px at 50% -25%, rgba(46, 108, 201, 0.35), transparent 70%),
    linear-gradient(180deg, #04070f, #0b1c33);
}
.player-video {
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.player-video-iframe { width: 100%; height: 100%; border: 0; display: block; }
.player-video-placeholder {
  height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px;
}
.player-video-placeholder i { font-size: 42px; color: #6b7992; }
.player-video-placeholder span { color: #93a3bd; font-weight: 600; }

/* Floating action bar: prev / mark-complete / next */
.lesson-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  z-index: 80;
  width: min(900px, calc(100vw - 28px));
  background: var(--card);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-pop);
  padding: 10px 14px;
}
[data-theme="dark"] .lesson-nav { box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55); }
.lesson-nav-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.lesson-nav-side { min-width: 0; display: flex; }
.lesson-nav-side:last-child { justify-content: flex-end; }
.lesson-nav-center { display: flex; align-items: center; justify-content: center; gap: 10px; }
.lesson-nav-btn { max-width: 100%; }
.lesson-nav-btn .lesson-nav-side-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px; }
.lesson-nav-spacer { width: 0; }
.lesson-nav-complete { min-width: 230px; }
.lesson-nav-done { font-size: 13px; padding: 7px 16px; }
.lesson-nav-btn.is-loading { pointer-events: none; }

/* Keep fixed bar clear of content */
.player-content { padding-bottom: 140px; }
.player-rail { padding-bottom: 130px; }

/* ---------- Player rail v2 ---------- */
.rail-module {
  display: flex; align-items: center; gap: 8px;
  padding: 18px 16px 8px;
  font-size: 11.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--gold-600);
}
.rail-module::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.rail-item { position: relative; transition: background 0.15s ease, padding 0.15s ease; }
.rail-item:hover:not(.active) { background: var(--navy-50); padding-left: 19px; }
.rail-item.active {
  background: linear-gradient(90deg, var(--navy-800), transparent);
  border-left: 3px solid var(--gold-500);
}
[data-theme="dark"] .rail-item.active { background: linear-gradient(90deg, #16345f, transparent); }
.rail-item.done .rail-title { color: var(--muted); }
.rail-item.done .rail-num {
  background: var(--green); color: #fff;
  box-shadow: 0 0 0 3px rgba(31, 157, 106, 0.16);
}

/* ---------- Mobile: docked action bar ---------- */
@media (max-width: 640px) {
  .lesson-nav {
    left: 0; right: 0; transform: none;
    bottom: 0; width: 100%;
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
    padding: 10px calc(10px + env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left));
  }
  .lesson-nav-inner { grid-template-columns: 54px 1fr 54px; gap: 8px; }
  .lesson-nav-side { justify-content: center; }
  .lesson-nav-side:last-child { justify-content: center; }
  .lesson-nav-side-label { display: none; }
  .lesson-nav-complete { min-width: 0; width: 100%; padding: 12px 14px; }
  .lesson-nav-side .btn { padding: 12px 14px; }
}

/* Mobile video stays cinematic */
@media (max-width: 980px) {
  .player-stage { padding: 8px; }
  .player-video { aspect-ratio: 16 / 9; border-radius: 10px; }
  .player-video iframe, .player-video video { position: static !important; }
}

/* =============================================================================
   Whole-site polish II — dashboard, catalog, course detail, learn, shell chrome
   ============================================================================= */

/* ---------- Page heads: gold accent bar after the title ---------- */
.page-head h1 { display: inline-flex; align-items: center; gap: 12px; }
.page-head h1::after {
  content: "";
  flex: 0 0 auto;
  width: 46px; height: 5px; border-radius: 99px;
  background: var(--grad-gold);
}
.page-head h1 + p { margin-top: 6px; }

/* ---------- Stat tiles ---------- */
.stat-card { position: relative; overflow: hidden; padding: 20px; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.stat-card::after {
  content: "";
  position: absolute; right: -34px; top: -34px;
  width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 166, 58, 0.14), transparent 70%);
  pointer-events: none;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: rgba(217, 184, 76, 0.45); }
.stat-card > div:last-child { position: relative; z-index: 1; }
.stat-card b { font-size: 26px; line-height: 1.15; display: block; }
.stat-icon {
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 6px 14px rgba(16, 40, 74, 0.12);
}
.stat-tile b { font-size: 26px; }

/* ---------- Continue learning ---------- */
.continue-card { position: relative; overflow: hidden; border-radius: 18px; }
.continue-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(520px 200px at 100% 0%, rgba(217, 184, 76, 0.28), transparent 62%);
  pointer-events: none;
}
.continue-card:hover { box-shadow: var(--shadow-pop); }
.continue-body { position: relative; z-index: 1; }

/* ---------- Academy cards ---------- */
.academy-card { position: relative; overflow: hidden; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.academy-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(217, 184, 76, 0.6); }
.academy-card::after {
  content: "";
  position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--grad-gold);
  opacity: 0; transition: opacity .2s ease;
}
.academy-card:hover::after { opacity: 1; }

/* ---------- Course rows (dashboard / my courses) ---------- */
.course-row { padding: 18px; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.course-row:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: rgba(217, 184, 76, 0.4); }
.course-row .course-thumb { box-shadow: var(--shadow-soft); }
.course-row-stack { transition: transform .2s ease, box-shadow .2s ease; }
.course-row-stack:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* ---------- Hero bands (course + learn) inherit academy glow ---------- */
.course-hero, .learn-hero { border-top: 3px solid var(--gold-500); }
.course-hero::before, .learn-hero::before {
  content: "";
  position: absolute; top: -140px; left: 30%;
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(217, 184, 76, 0.16), transparent 65%);
  pointer-events: none;
}
.course-hero .container, .learn-hero .container { position: relative; z-index: 1; }

/* ---------- Purchase box ---------- */
.purchase-box { position: relative; overflow: hidden; border-radius: var(--radius-lg); box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; }
.purchase-box:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.purchase-box::before {
  content: "";
  position: absolute; top: 0; left: 22px; right: 22px; height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--grad-gold);
}

/* ---------- Catalog group headers ---------- */
.catalog-group-head { position: relative; border-radius: var(--radius-lg); }
.catalog-group-head .group-chevron { color: var(--gold-600); }

/* ---------- Curriculum accordions (public + learn) ---------- */
.curriculum-group { transition: border-color .2s ease, box-shadow .2s ease; }
.curriculum-group[open] { border-color: rgba(217, 184, 76, 0.5); box-shadow: var(--shadow-soft); }
.curriculum-group summary { transition: background .15s ease; }
.curriculum-group summary:hover { background: var(--navy-50); }
[data-theme="dark"] .curriculum-group summary:hover { background: rgba(120, 150, 200, 0.08); }

.accordion { border-radius: var(--radius-lg); }
.accordion-head { padding: 18px 22px; font-weight: 700; }
.accordion-item.open .accordion-head { background: linear-gradient(90deg, rgba(29, 63, 117, 0.07), transparent); }
[data-theme="dark"] .accordion-item.open .accordion-head { background: linear-gradient(90deg, rgba(120, 150, 200, 0.09), transparent); }

.curriculum-row { transition: background .15s ease, padding .15s ease; }
.curriculum-row:hover { background: var(--navy-50); padding-left: 20px; }
.curriculum-row .rail-num { transition: transform .15s ease; }

/* ---------- Sidebar & topbar refinement ---------- */
.side-link { position: relative; }
.side-link.active {
  background: linear-gradient(90deg, var(--navy-700), rgba(22, 52, 95, 0.55));
  box-shadow: inset 3px 0 0 var(--gold-500);
}
.shell-topbar { box-shadow: 0 2px 12px rgba(16, 40, 74, 0.05); }
[data-theme="dark"] .shell-topbar { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35); }
.shell-topbar .top-title { font-size: 18px; }

/* ---------- Bottom-nav active indicator (mobile) ---------- */
.bottom-nav a { position: relative; }
.bottom-nav a.active::before {
  content: "";
  position: absolute; top: -6px; left: 50%;
  transform: translateX(-50%);
  width: 34px; height: 4px;
  border-radius: 0 0 4px 4px;
  background: var(--grad-gold);
}

/* ---------- Empty states ---------- */
.card.empty { border-style: dashed; }

/* ---------- Quiz options: consistent rounded tiles ---------- */
.quiz-option { border-radius: 12px; }
