/* =====================================================================
   MINIO LEARN — Design System
   ===================================================================== */

:root {
  /* Brand */
  --primary: #4F46E5;
  --primary-dark: #3730A3;
  --primary-light: #EEF2FF;
  --primary-soft: #E0E7FF;

  --xp: #F59E0B;
  --xp-light: #FEF3C7;
  --streak: #F97316;
  --streak-light: #FFEDD5;
  --success: #10B981;
  --success-light: #D1FAE5;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --info: #0EA5E9;
  --info-light: #E0F2FE;

  /* Neutrals */
  --ink: #14151F;
  --ink-soft: #4B4E5B;
  --muted: #6B7280;
  --line: #E7E8F0;
  --bg: #F7F7FB;
  --surface: #FFFFFF;
  --surface-2: #FAFAFD;

  /* Scale */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(20, 21, 31, 0.06);
  --shadow-md: 0 6px 20px rgba(20, 21, 31, 0.08);
  --shadow-lg: 0 16px 40px rgba(20, 21, 31, 0.12);

  --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  margin: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .display-font {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

a { color: inherit; text-decoration: none; }
a.link { color: var(--primary); text-decoration: none; }
a.link:hover { text-decoration: underline; }

.container-app {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

.muted { color: var(--muted); }
.text-primary-brand { color: var(--primary); }

/* =====================================================================
   NAVBAR
   ===================================================================== */
.ml-navbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.ml-navbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.ml-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  color: var(--ink);
}
.ml-brand-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #8B5CF6);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 16px;
  box-shadow: var(--shadow-sm);
}
.ml-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ml-nav-link {
  padding: 9px 16px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink-soft);
  transition: all .15s ease;
}
.ml-nav-link:hover { background: var(--primary-light); color: var(--primary); }
.ml-nav-link.active { background: var(--primary); color: #fff; }

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

.ml-xp-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--xp-light); color: #92620A;
  font-weight: 700; font-size: 13px;
  padding: 7px 12px; border-radius: var(--radius-full);
}
.ml-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #8B5CF6);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; cursor: pointer;
  border: 2px solid #fff; box-shadow: var(--shadow-sm);
}

.ml-hamburger {
  display: none;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  align-items: center; justify-content: center;
  cursor: pointer;
}
.ml-hamburger span, .ml-hamburger span::before, .ml-hamburger span::after {
  content: ''; display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; position: relative; transition: .2s;
}
.ml-hamburger span::before { position: absolute; top: -6px; }
.ml-hamburger span::after { position: absolute; top: 6px; }

.ml-mobile-menu {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 10px 24px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.ml-mobile-menu.open { display: flex; }
.ml-mobile-menu .ml-nav-link { padding: 12px 14px; border-radius: var(--radius-sm); }

/* =====================================================================
   BUTTONS
   ===================================================================== */
.btn-ml {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
  white-space: nowrap;
}
.btn-ml:active { transform: translateY(1px) scale(0.99); }
.btn-primary-ml {
  background: var(--primary); color: #fff;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.28);
}
.btn-primary-ml:hover { background: var(--primary-dark); color: #fff; }
.btn-outline-ml {
  background: var(--surface); color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn-outline-ml:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost-ml { background: transparent; color: var(--ink-soft); }
.btn-ghost-ml:hover { background: var(--surface-2); }
.btn-success-ml { background: var(--success); color: #fff; box-shadow: 0 8px 20px rgba(16,185,129,.25); }
.btn-success-ml:hover { background: #0d9668; color: #fff; }
.btn-sm-ml { padding: 8px 16px; font-size: 13.5px; }
.btn-block-ml { width: 100%; }
.btn-ml:disabled { opacity: .5; cursor: not-allowed; }

/* =====================================================================
   CARDS
   ===================================================================== */
.card-ml {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-ml-pad { padding: 24px; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 800; }
.stat-label { font-size: 13.5px; color: var(--muted); font-weight: 600; }

/* Course card */
.course-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
  height: 100%;
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.course-thumb {
  height: 130px;
  display: flex; align-items: center; justify-content: center;
  font-size: 44px;
  position: relative;
}
.course-thumb .cat-badge {
  position: absolute; top: 12px; left: 12px;
  background: rgba(255,255,255,.92); color: var(--ink);
  font-size: 11.5px; font-weight: 700; padding: 5px 11px; border-radius: var(--radius-full);
}
.course-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.course-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; line-height: 1.3; }
.course-meta { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.course-stats-row { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--ink-soft); flex-wrap: wrap; }
.course-actions { margin-top: auto; display: flex; gap: 8px; padding-top: 6px; }

/* thumbnail gradients by category */
.thumb-database { background: linear-gradient(135deg,#4F46E5,#7C3AED); }
.thumb-programming { background: linear-gradient(135deg,#0EA5E9,#22C55E); }
.thumb-networking { background: linear-gradient(135deg,#F97316,#F59E0B); }
.thumb-systems { background: linear-gradient(135deg,#EF4444,#EC4899); }

.difficulty-badge {
  font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-full);
}
.difficulty-Beginner { background: var(--success-light); color: #067A55; }
.difficulty-Intermediate { background: var(--xp-light); color: #92620A; }
.difficulty-Advanced { background: var(--danger-light); color: #B91C1C; }

.rating-stars { color: #F59E0B; font-weight: 700; font-size: 13px; }

/* =====================================================================
   PROGRESS BARS
   ===================================================================== */
.progress-track {
  width: 100%; height: 10px; background: var(--line);
  border-radius: var(--radius-full); overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary), #8B5CF6);
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.progress-fill.success { background: linear-gradient(90deg, var(--success), #34D399); }
.progress-fill.xp { background: linear-gradient(90deg, var(--xp), #FBBF24); }

/* =====================================================================
   HERO / LANDING
   ===================================================================== */
.hero-section {
  position: relative;
  padding: 84px 24px 100px;
  background:
    radial-gradient(700px 380px at 15% -10%, var(--primary-soft), transparent 60%),
    radial-gradient(600px 340px at 100% 0%, #DDD6FE, transparent 55%),
    var(--bg);
  overflow: hidden;
}
.hero-inner { max-width: 1240px; margin: 0 auto; text-align: center; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 8px 16px; border-radius: var(--radius-full);
  font-size: 13.5px; font-weight: 700; color: var(--primary);
  box-shadow: var(--shadow-sm); margin-bottom: 24px;
}
.hero-title {
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  line-height: 1.12;
  margin: 0 0 20px;
}
.hero-title .accent { color: var(--primary); }
.hero-subtitle {
  font-size: 18px; color: var(--ink-soft); max-width: 640px; margin: 0 auto 36px;
  line-height: 1.6;
}
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 56px; }
.hero-stats {
  display: flex; justify-content: center; gap: 48px; flex-wrap: wrap;
  padding-top: 40px; border-top: 1px solid var(--line);
  max-width: 900px; margin: 0 auto;
}
.hero-stat-num { font-family: var(--font-display); font-size: 30px; font-weight: 800; color: var(--primary); }
.hero-stat-label { font-size: 13.5px; color: var(--muted); font-weight: 600; }

.section { padding: 76px 24px; }
.section-tight { padding: 56px 24px; }
.section-header { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-eyebrow { color: var(--primary); font-weight: 700; font-size: 13.5px; letter-spacing: .06em; text-transform: uppercase; }
.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 10px 0 12px; }
.section-subtitle { color: var(--muted); font-size: 16px; line-height: 1.6; }

.how-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; max-width: 1180px; margin: 0 auto; }
.how-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; text-align: left; }
.how-num { font-family: var(--font-display); font-size: 13px; font-weight: 800; color: var(--primary); background: var(--primary-light); width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }

.subject-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; max-width: 1180px; margin: 0 auto; }
.subject-chip {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px 14px; text-align: center; font-weight: 700; font-size: 14px;
  transition: all .15s ease;
}
.subject-chip:hover { border-color: var(--primary); background: var(--primary-light); transform: translateY(-2px); }
.subject-chip .ic { font-size: 26px; display: block; margin-bottom: 8px; }

.preview-split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; max-width: 1180px; margin: 0 auto; }
.preview-split.reverse { direction: rtl; }
.preview-split.reverse > * { direction: ltr; }

.mock-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); padding: 26px;
}

.testimonial-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 1180px; margin: 0 auto; }
.testimonial-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; }
.testimonial-quote { font-size: 15px; line-height: 1.65; color: var(--ink-soft); margin-bottom: 18px; }
.testimonial-author { display: flex; align-items: center; gap: 10px; }
.testimonial-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 800; }

.final-cta {
  background: linear-gradient(135deg, var(--primary), #7C3AED);
  border-radius: var(--radius-xl);
  padding: 64px 40px; text-align: center; color: #fff;
  max-width: 1180px; margin: 0 auto;
}
.final-cta h2 { color: #fff; }
.final-cta p { color: rgba(255,255,255,.85); }
.final-cta .btn-outline-ml { background: transparent; border-color: rgba(255,255,255,.5); color: #fff; }
.final-cta .btn-outline-ml:hover { background: rgba(255,255,255,.12); }
.final-cta .btn-primary-ml { background: #fff; color: var(--primary); box-shadow: none; }
.final-cta .btn-primary-ml:hover { background: #f3f3ff; }

.site-footer { padding: 48px 24px 28px; border-top: 1px solid var(--line); }
.footer-grid { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer-col h6 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 14px; }
.footer-col a { display: block; color: var(--ink-soft); font-size: 14px; margin-bottom: 10px; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { max-width: 1240px; margin: 32px auto 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* =====================================================================
   AUTH PAGES
   ===================================================================== */
.auth-wrap {
  min-height: calc(100vh - 68px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
  background: radial-gradient(600px 300px at 50% 0%, var(--primary-light), transparent 60%), var(--bg);
}
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 40px; }
.auth-logo { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 6px; }
.auth-title { text-align: center; font-size: 22px; margin: 14px 0 4px; }
.auth-subtitle { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 26px; }
.form-label-ml { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; display: block; }
.form-control-ml {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-md);
  border: 1.5px solid var(--line); font-size: 15px; font-family: var(--font-body);
  transition: border-color .15s ease, box-shadow .15s ease;
  background: var(--surface-2);
}
.form-control-ml:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); background: #fff; }
.form-group-ml { margin-bottom: 18px; }
.demo-box { background: var(--primary-light); border: 1px dashed var(--primary-soft); border-radius: var(--radius-md); padding: 14px 16px; font-size: 12.5px; color: var(--primary-dark); margin-top: 20px; line-height: 1.6; }
.alert-ml { padding: 12px 16px; border-radius: var(--radius-md); font-size: 14px; margin-bottom: 18px; font-weight: 600; }
.alert-danger-ml { background: var(--danger-light); color: #B91C1C; }
.alert-success-ml { background: var(--success-light); color: #067A55; }

/* =====================================================================
   DASHBOARD
   ===================================================================== */
.dash-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.dash-greeting { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 4px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }

.continue-card {
  background: linear-gradient(120deg, var(--ink) 0%, #2A2D45 100%);
  border-radius: var(--radius-xl);
  padding: 32px;
  color: #fff;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.continue-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(400px 200px at 100% 0%, rgba(139,92,246,.35), transparent 60%);
}
.continue-icon { font-size: 52px; z-index: 1; }
.continue-info { z-index: 1; }
.continue-info .eyebrow { color: #A5B4FC; font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.continue-info h3 { color: #fff; font-size: 22px; margin: 0 0 6px; }
.continue-info .lesson-name { color: rgba(255,255,255,.75); font-size: 14.5px; margin-bottom: 16px; }
.continue-info .progress-track { background: rgba(255,255,255,.18); max-width: 320px; }
.continue-progress-pct { color: #fff; font-weight: 700; font-size: 13px; margin-top: 8px; }
.continue-action { z-index: 1; }

.section-block { margin-bottom: 36px; }
.section-block-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.section-block-head h3 { font-size: 19px; margin: 0; }

.my-courses-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

.insight-card {
  background: linear-gradient(120deg, var(--primary-light), #F5F3FF);
  border: 1px solid var(--primary-soft);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  display: flex; gap: 16px; align-items: flex-start;
}
.insight-icon { font-size: 26px; flex-shrink: 0; }
.insight-card h4 { font-size: 15px; margin: 0 0 6px; color: var(--primary-dark); }
.insight-card p { margin: 0; color: var(--ink-soft); font-size: 14.5px; line-height: 1.6; }

.badges-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.badge-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 18px 12px; text-align: center;
}
.badge-card.locked { opacity: .5; filter: grayscale(1); }
.badge-icon { font-size: 30px; margin-bottom: 8px; }
.badge-name { font-weight: 700; font-size: 12.5px; margin-bottom: 2px; }
.badge-desc { font-size: 11px; color: var(--muted); }

/* =====================================================================
   COURSE MARKETPLACE / DETAILS
   ===================================================================== */
.filter-bar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 14px 18px; margin-bottom: 28px;
}
.search-input-wrap { flex: 1; min-width: 220px; position: relative; }
.search-input-wrap input {
  width: 100%; padding: 11px 16px 11px 40px; border-radius: var(--radius-full);
  border: 1.5px solid var(--line); font-size: 14.5px; background: var(--surface-2);
}
.search-input-wrap input:focus { outline: none; border-color: var(--primary); background: #fff; }
.search-input-wrap .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.filter-select { padding: 10px 14px; border-radius: var(--radius-full); border: 1.5px solid var(--line); font-size: 14px; font-weight: 600; background: var(--surface-2); }

.courses-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .ic { font-size: 44px; margin-bottom: 14px; }

.course-hero { background: linear-gradient(120deg, var(--ink), #2A2D45); color: #fff; padding: 48px 0 60px; }
.course-hero-inner { max-width: 1240px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: 2fr 1fr; gap: 40px; align-items: start; }
.course-hero .cat-tag { display: inline-block; background: rgba(255,255,255,.14); padding: 6px 14px; border-radius: var(--radius-full); font-size: 12.5px; font-weight: 700; margin-bottom: 16px; }
.course-hero h1 { color: #fff; font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin-bottom: 14px; }
.course-hero p { color: rgba(255,255,255,.78); font-size: 15.5px; line-height: 1.65; max-width: 640px; }
.course-hero-meta { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 22px; }
.course-hero-meta .item { font-size: 14px; color: rgba(255,255,255,.9); }
.course-hero-meta .item b { display: block; font-size: 17px; color: #fff; font-family: var(--font-display); }
.enroll-card { background: #fff; color: var(--ink); border-radius: var(--radius-xl); padding: 26px; box-shadow: var(--shadow-lg); }

.checklist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--ink-soft); }
.checklist li .tick { color: var(--success); flex-shrink: 0; font-weight: 800; }

.module-block { margin-bottom: 18px; }
.module-title { font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 10px; }
.lesson-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-radius: var(--radius-md); border: 1px solid var(--line);
  margin-bottom: 8px; background: var(--surface); font-size: 14.5px; font-weight: 600;
}
.lesson-row.completed { border-color: var(--success-light); background: #F5FDFA; }
.lesson-row.current { border-color: var(--primary); background: var(--primary-light); }
.lesson-row.locked { color: var(--muted); }
.lesson-status-icon { width: 22px; text-align: center; flex-shrink: 0; }
.lesson-row .xp-tag { margin-left: auto; font-size: 12px; color: var(--xp); font-weight: 700; }

/* =====================================================================
   LESSON PAGE
   ===================================================================== */
.lesson-layout { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: start; }
.curriculum-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow-y: auto; }
.curriculum-panel h6 { font-size: 12.5px; text-transform: uppercase; color: var(--muted); font-weight: 800; letter-spacing: .05em; margin-bottom: 12px; }
.curriculum-lesson { display: flex; align-items: center; gap: 10px; padding: 10px 10px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600; margin-bottom: 2px; }
.curriculum-lesson.active { background: var(--primary-light); color: var(--primary); }
.curriculum-lesson.locked { color: var(--muted); }
.curriculum-lesson a { flex: 1; }

.video-stage {
  background: linear-gradient(135deg, #1A1B2E, #2A2D45);
  border-radius: var(--radius-lg);
  aspect-ratio: 16/8;
  display: flex; align-items: center; justify-content: center;
  color: #fff; position: relative; overflow: hidden; margin-bottom: 24px;
}
.video-stage .play-btn {
  width: 76px; height: 76px; border-radius: 50%; background: rgba(255,255,255,.15);
  border: 2px solid rgba(255,255,255,.5); display: flex; align-items: center; justify-content: center;
  font-size: 28px; cursor: pointer; transition: transform .15s ease, background .15s ease;
}
.video-stage .play-btn:hover { transform: scale(1.08); background: rgba(255,255,255,.25); }
.video-stage .video-label { position: absolute; bottom: 18px; left: 22px; font-size: 13px; color: rgba(255,255,255,.7); }

.lesson-nav-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; gap: 12px; flex-wrap: wrap; }

.resource-chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); font-size: 13.5px; font-weight: 600; margin-right: 10px; margin-top: 10px; background: var(--surface-2); }

/* =====================================================================
   UNDERSTAND MODE
   ===================================================================== */
.understand-hero {
  background: linear-gradient(120deg, #1E1B4B, #4338CA);
  color: #fff; border-radius: var(--radius-xl); padding: 30px 34px; margin-bottom: 26px;
}
.understand-hero .tag { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.14); padding: 7px 16px; border-radius: var(--radius-full); font-size: 12.5px; font-weight: 700; margin-bottom: 14px; }
.understand-hero h2 { color: #fff; font-size: 24px; margin: 0 0 6px; }
.understand-hero p { color: rgba(255,255,255,.8); margin: 0; font-size: 14.5px; }

.step-tracker { display: flex; gap: 8px; margin-bottom: 28px; }
.step-dot { flex: 1; height: 6px; border-radius: var(--radius-full); background: var(--line); }
.step-dot.done { background: var(--success); }
.step-dot.active { background: var(--primary); }

.understand-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 32px; box-shadow: var(--shadow-md); }
.step-label { color: var(--primary); font-weight: 800; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.step-heading { font-size: 20px; margin-bottom: 16px; }
.step-scenario { font-size: 15.5px; line-height: 1.7; color: var(--ink-soft); margin-bottom: 22px; }

.mini-table { width: 100%; border-collapse: collapse; margin-bottom: 22px; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--line); }
.mini-table th { background: var(--surface-2); font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 10px 14px; text-align: left; }
.mini-table td { padding: 11px 14px; border-top: 1px solid var(--line); font-size: 14px; }
.mini-table td.repeat-flag { color: var(--danger); font-weight: 700; }

.option-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.option-btn {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 15px 18px; border: 1.5px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface); cursor: pointer; font-size: 15px; font-weight: 600; color: var(--ink);
  transition: all .15s ease; width: 100%;
}
.option-btn:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-light); }
.option-btn .opt-label { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 800; flex-shrink: 0; }
.option-btn.correct { border-color: var(--success); background: var(--success-light); }
.option-btn.correct .opt-label { background: var(--success); color: #fff; border-color: var(--success); }
.option-btn.wrong { border-color: var(--danger); background: var(--danger-light); }
.option-btn.wrong .opt-label { background: var(--danger); color: #fff; border-color: var(--danger); }
.option-btn:disabled { cursor: default; }

.feedback-box { padding: 16px 18px; border-radius: var(--radius-md); font-size: 14.5px; line-height: 1.6; margin-bottom: 18px; font-weight: 600; display: none; }
.feedback-box.show { display: block; }
.feedback-box.correct { background: var(--success-light); color: #067A55; }
.feedback-box.wrong { background: var(--danger-light); color: #B91C1C; }

.design-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; }
.design-card { border: 1.5px solid var(--line); border-radius: var(--radius-md); padding: 20px; cursor: pointer; transition: all .15s ease; background: var(--surface); }
.design-card:hover:not(.disabled) { border-color: var(--primary); }
.design-card h5 { font-size: 15px; margin: 0 0 8px; }
.design-card p { font-size: 13.5px; color: var(--muted); margin: 0; line-height: 1.55; }
.design-card.correct { border-color: var(--success); background: var(--success-light); }
.design-card.wrong { border-color: var(--danger); background: var(--danger-light); }

.result-hero { text-align: center; padding: 20px 0 8px; }
.result-icon { font-size: 56px; margin-bottom: 10px; }
.result-rewards { display: flex; justify-content: center; gap: 16px; margin: 24px 0; flex-wrap: wrap; }
.reward-chip { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 24px; text-align: center; min-width: 140px; }
.reward-chip .val { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--primary); }
.reward-chip .lbl { font-size: 12.5px; color: var(--muted); font-weight: 700; }

/* =====================================================================
   QUIZ
   ===================================================================== */
.quiz-progress-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.quiz-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 34px; box-shadow: var(--shadow-md); }
.quiz-question { font-size: 19px; margin-bottom: 22px; }
.quiz-option {
  display: flex; align-items: center; gap: 12px; padding: 15px 18px;
  border: 1.5px solid var(--line); border-radius: var(--radius-md); margin-bottom: 10px;
  cursor: pointer; font-size: 15px; font-weight: 600; transition: all .15s ease;
}
.quiz-option:hover { border-color: var(--primary); background: var(--primary-light); }
.quiz-option input { accent-color: var(--primary); width: 18px; height: 18px; }
.quiz-option.selected { border-color: var(--primary); background: var(--primary-light); }
.quiz-nav { display: flex; justify-content: space-between; margin-top: 26px; }
.quiz-dots { display: flex; gap: 6px; justify-content: center; margin: 20px 0; }
.quiz-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.quiz-dot.answered { background: var(--primary); }
.quiz-dot.current { background: var(--primary-dark); transform: scale(1.3); }

.result-answer-row { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--radius-md); border: 1px solid var(--line); margin-bottom: 10px; }
.result-answer-row.correct { background: var(--success-light); border-color: #a7e8cf; }
.result-answer-row.wrong { background: var(--danger-light); border-color: #f4b6b6; }

/* =====================================================================
   LEADERBOARD
   ===================================================================== */
.leaderboard-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); margin-bottom: 10px; }
.leaderboard-row.you { border-color: var(--primary); background: var(--primary-light); }
.rank-badge { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; background: var(--surface-2); flex-shrink: 0; }
.rank-badge.gold { background: #FDE68A; color: #92620A; }
.rank-badge.silver { background: #E5E7EB; color: #4B5563; }
.rank-badge.bronze { background: #FED7AA; color: #9A3412; }
.leaderboard-name { font-weight: 700; flex: 1; }
.you-tag { background: var(--primary); color: #fff; font-size: 10.5px; font-weight: 800; padding: 3px 9px; border-radius: var(--radius-full); margin-left: 8px; }

/* =====================================================================
   ADMIN
   ===================================================================== */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; font-size: 12px; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); }
.admin-table td { padding: 14px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.admin-table tr:last-child td { border-bottom: none; }

/* =====================================================================
   TOASTS
   ===================================================================== */
.toast-stack { position: fixed; top: 84px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.toast-ml {
  background: var(--ink); color: #fff; padding: 14px 20px; border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 10px;
  min-width: 260px; transform: translateX(120%); transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.toast-ml.show { transform: translateX(0); }
.toast-ml.success { background: #0d9668; }
.toast-ml.danger { background: #C0392B; }
.toast-ml.xp { background: linear-gradient(120deg, #92620A, #B8860B); }

/* Badge unlock animation */
@keyframes badgePop {
  0% { transform: scale(0.4) rotate(-8deg); opacity: 0; }
  60% { transform: scale(1.12) rotate(3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.badge-unlock-anim { animation: badgePop .5s cubic-bezier(.34,1.56,.64,1); }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .my-courses-grid { grid-template-columns: repeat(2, 1fr); }
  .courses-grid { grid-template-columns: repeat(2, 1fr); }
  .how-grid { grid-template-columns: repeat(2, 1fr); }
  .subject-grid { grid-template-columns: repeat(3, 1fr); }
  .preview-split { grid-template-columns: 1fr; }
  .testimonial-grid { grid-template-columns: repeat(1, 1fr); }
  .badges-grid { grid-template-columns: repeat(3, 1fr); }
  .lesson-layout { grid-template-columns: 1fr; }
  .curriculum-panel { position: static; max-height: none; }
  .course-hero-inner { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .ml-nav-links { display: none; }
  .ml-hamburger { display: flex; }
  .nav-desktop-only { display: none; }
  .ml-nav-right { gap: 8px; }
  .ml-xp-pill { padding: 7px 10px; font-size: 12px; }
  .continue-card { grid-template-columns: 1fr; text-align: center; }
  .continue-card .progress-track { margin: 0 auto; }
  .design-compare { grid-template-columns: 1fr; }
  .checklist { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .my-courses-grid { grid-template-columns: 1fr; }
  .courses-grid { grid-template-columns: 1fr; }
  .how-grid { grid-template-columns: 1fr; }
  .subject-grid { grid-template-columns: repeat(2, 1fr); }
  .badges-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { gap: 26px; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .quiz-card, .understand-card { padding: 22px; }
  .toast-stack { right: 10px; left: 10px; top: 76px; }
  .toast-ml { min-width: 0; width: 100%; }
}
