/* ==========================================================================
   TechEd Design System
   Adopted from the UX handoff (Figma "منصة تعلم" / learing1-web.vercel.app):
     - Teal #0ABAB5 on a warm cream ground #F8F7F3, ink #252A32 for text
     - Soft 20px cards, 13px controls, low-contrast shadows, no gradients
       except the closing call-to-action band
     - Zain for Arabic, Plus Jakarta Sans for Latin
   ========================================================================== */

:root, [data-theme="light"] {
  /* Brand */
  --primary: #0ABAB5;
  --primary-hover: #089994;
  --primary-light: #E4F7F6;
  --primary-tint: #EEF9F8;
  --primary-alpha10: rgba(10, 186, 181, 0.10);
  --primary-alpha20: rgba(10, 186, 181, 0.22);
  --primary-glow: rgba(10, 186, 181, 0.28);

  --teal-deep: #0A9D99;
  --teal-ink: #089994;

  /* Ink scale (the handoff's #252A32 family) */
  --secondary: #252A32;
  --secondary-hover: #3A404A;
  --secondary-light: #5B6169;
  --secondary-dark: #1F242B;
  --secondary-darker: #181C22;
  --secondary-darkest: #111418;

  /* Surfaces */
  --bg-main: #F8F7F3;
  --bg-card: #FFFFFF;
  --bg-subtle: #F0F0EC;
  --border-color: rgba(37, 42, 50, 0.08);
  --border-subtle: rgba(37, 42, 50, 0.06);
  --border-strong: rgba(37, 42, 50, 0.12);
  --border-focus: #0ABAB5;
  --header-bg: rgba(248, 247, 243, 0.85);

  /* Typography */
  --text-main: #252A32;
  --text-heading: #252A32;
  --text-muted: #5B6169;
  --text-light: #9AA0A6;
  --text-inverse: #FFFFFF;

  /* Status */
  --success: #10B981;
  --success-bg: #ECFDF5;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --danger: #E5484D;
  --danger-bg: #FBECEB;
  --info: #0ABAB5;
  --info-bg: #E4F7F6;

  /* Form Elements */
  --input-bg: #FFFFFF;
  --input-border: rgba(37, 42, 50, 0.12);
  --input-text: #252A32;

  /* Layout & Shadows */
  --radius-sm: 9px;
  --radius-md: 13px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-compact: 4px;
  --radius-track: 1px;
  --radius-avatar-control: 999px;

  --shadow-sm: 0 8px 24px rgba(37, 42, 50, 0.05);
  --shadow-md: 0 10px 24px rgba(37, 42, 50, 0.10);
  --shadow-lg: 0 16px 40px rgba(37, 42, 50, 0.10);
  --shadow-xl: 0 20px 50px rgba(37, 42, 50, 0.12);
  --shadow-glow: 0 8px 20px rgba(10, 186, 181, 0.28);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-arabic: 'Zain', 'Plus Jakarta Sans', 'Segoe UI', Tahoma, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, monospace;

  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Arabic pages use the handoff's Zain face. Zain sits small on the em box, so
   the root size steps up to keep the same optical size as the Latin face. */
html[lang^="ar"] {
  --font-sans: var(--font-arabic);
  font-size: 17.5px;
}

/* Dark Mode Theme — the same ink family, inverted */
[data-theme="dark"] {
  --primary: #0ABAB5;
  --primary-hover: #2FD3CE;
  --primary-light: #163A3A;
  --primary-tint: #14302F;
  --primary-alpha10: rgba(10, 186, 181, 0.15);
  --primary-alpha20: rgba(10, 186, 181, 0.28);
  --primary-glow: rgba(10, 186, 181, 0.45);

  --teal-deep: #0E6A65;
  --teal-ink: #0A4A46;

  --secondary: #F0F0EC;
  --secondary-hover: #FFFFFF;
  --secondary-light: #A7ADB5;
  --secondary-dark: #1F242B;
  --secondary-darker: #181C22;
  --secondary-darkest: #111418;

  --bg-main: #14171C;
  --bg-card: #1D2128;
  --bg-subtle: #262B33;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-focus: #0ABAB5;
  --header-bg: rgba(20, 23, 28, 0.85);

  --text-main: #E6E7E4;
  --text-heading: #F5F5F2;
  --text-muted: #A7ADB5;
  --text-light: #6F7680;
  --text-inverse: #14171C;

  --success: #34D399;
  --success-bg: #0F3B2E;
  --warning: #FBBF24;
  --warning-bg: #3D2A08;
  --danger: #F87171;
  --danger-bg: #3F1A1A;
  --info: #2FD3CE;
  --info-bg: #14302F;

  --input-bg: #14171C;
  --input-border: rgba(255, 255, 255, 0.12);
  --input-text: #F5F5F2;

  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.55);
}

/* ==========================================================================
   Component Layer
   Every component reads its own variables instead of the global tokens
   directly. Each one defaults to the token it used to hardcode, so nothing
   changes until a variable is overridden — at which point only that component
   moves. This is what lets the Color Lab recolor the header without touching
   the cards, or the footer without touching the hero.
   ========================================================================== */

:root {
  /* Header */
  --c-header-bg: var(--header-bg);
  --c-header-border: var(--border-color);
  --c-header-link: var(--text-heading);
  --c-header-link-active: var(--primary);

  /* Hero band (flat cream ground; the three stops stay for the Color Lab) */
  --c-hero-from: var(--bg-main);
  --c-hero-mid: var(--bg-main);
  --c-hero-to: var(--bg-main);
  --c-hero-text: var(--text-heading);
  --c-hero-glow: var(--primary-alpha10);

  /* The dark lesson card floating in the hero */
  --c-herocard-bg: #252A32;
  --c-herocard-border: rgba(255, 255, 255, 0.06);
  --c-herocard-text: #FFFFFF;

  /* Page body and alternating sections */
  --c-body-bg: var(--bg-main);
  --c-section-bg: var(--bg-card);
  --c-section-border: var(--border-color);

  /* Stats band */
  --c-stats-bg: var(--bg-card);
  --c-stats-number: var(--secondary);
  --c-stats-accent: var(--primary);
  --c-stats-label: var(--text-muted);
  --c-stats-border: var(--border-color);

  /* Cards and boxes */
  --c-card-bg: var(--bg-card);
  --c-card-border: var(--border-color);
  --c-card-hover-border: var(--border-strong);
  --c-card-title: var(--text-heading);
  --c-card-text: var(--text-muted);

  /* Icon tiles inside cards */
  --c-iconbox-bg: var(--primary-light);
  --c-iconbox-fg: var(--primary);
  --c-iconbox-border: transparent;

  /* Buttons */
  --c-btn-bg: var(--primary);
  --c-btn-fg: #FFFFFF;
  --c-btn-hover-bg: var(--primary-hover);
  --c-btn-glow: var(--primary-glow);
  --c-btn-outline-fg: var(--text-heading);
  --c-btn-outline-border: var(--border-strong);

  /* Badges and tags */
  --c-badge-bg: var(--primary-light);
  --c-badge-fg: var(--teal-ink);
  --c-badge-border: transparent;
  --c-brandbadge-bg: var(--primary-light);
  --c-brandbadge-fg: var(--teal-ink);
  --c-brandbadge-border: transparent;

  /* Call-to-action banner */
  --c-cta-from: #0ABAB5;
  --c-cta-mid: #0AB0AB;
  --c-cta-to: #089994;
  --c-cta-text: #FFFFFF;
  --c-cta-glow: rgba(255, 255, 255, 0.18);

  /* Footer */
  --c-footer-bg: var(--bg-main);
  --c-footer-text: var(--text-muted);
  --c-footer-heading: var(--text-light);
  --c-footer-link: var(--text-heading);
  --c-footer-link-hover: var(--primary);
  --c-footer-accent: var(--border-color);

  /* Inputs */
  --c-input-bg: var(--input-bg);
  --c-input-border: var(--input-border);
  --c-input-text: var(--input-text);
  --c-input-focus: var(--primary);
}

/* Reset & Base Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main, .main-content {
  flex: 1;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* Container */
.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.container-fluid {
  width: 100%;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Typography Utility */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

html[lang^="ar"] h1, html[lang^="ar"] h2, html[lang^="ar"] h3,
html[lang^="ar"] h4, html[lang^="ar"] h5, html[lang^="ar"] h6 {
  letter-spacing: 0;
}

h1 { font-size: 2.75rem; }
h2 { font-size: 2.15rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.05rem; }
h6 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; }

.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-white { color: #FFFFFF !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.fw-semibold { font-weight: 600; }
.fw-bold { font-weight: 700; }
.fw-extrabold { font-weight: 800; }

/* ==========================================================================
   Brand Logo - teal mark tile + wordmark
   ========================================================================== */
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  transition: opacity var(--transition-fast);
  user-select: none;
  color: var(--text-heading);
}

.brand-logo:hover {
  opacity: 0.85;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--primary);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(10, 186, 181, 0.25);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: inherit;
  line-height: 1;
  white-space: nowrap;
}

.brand-name-accent {
  color: var(--primary);
}

.brand-badge {
  background: var(--c-brandbadge-bg);
  color: var(--c-brandbadge-fg);
  border: 1px solid var(--c-brandbadge-border);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-compact);
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  line-height: 1.2;
}

/* Navbar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-base);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--c-header-link);
  padding: 0.45rem 0.8rem;
  border-radius: 10px;
  position: relative;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.nav-link:hover {
  background: var(--bg-subtle);
  color: var(--c-header-link);
}

.nav-link.active {
  background: var(--primary-light);
  color: var(--c-header-link-active);
}

.nav-text-link {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--c-header-link);
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  transition: color var(--transition-fast);
}

.nav-text-link:hover {
  color: var(--primary);
}

/* Mobile menu */
.nav-burger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-heading);
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
}

.nav-mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.5rem 0 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

.nav-mobile-menu.open {
  display: flex;
}

.nav-mobile-link {
  display: block;
  padding: 0.8rem 0.75rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-heading);
}

.nav-mobile-link:hover, .nav-mobile-link.active {
  background: var(--bg-subtle);
}

.nav-mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.6rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-subtle);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--bg-card);
  color: var(--text-heading);
  border: 1px solid var(--border-strong);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* Nav Tools Divider */
.nav-tools-divider {
  width: 1px;
  height: 20px;
  background: var(--border-color);
  margin: 0 0.15rem;
}

/* User Menu & Avatar Dropdown */
.user-dropdown-container {
  position: relative;
  display: inline-flex;
}

.user-avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 2px 8px 2px 2px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-avatar-control);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.user-avatar-btn:hover, .user-avatar-btn.active {
  border-color: var(--primary);
  background: var(--primary-tint);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.82rem;
}

.user-chevron {
  font-size: 0.6rem;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
  margin-right: 2px;
}

.user-chevron.open {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1000;
  min-width: 230px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 0.5rem 0;
  animation: slideDownFade 0.2s ease-out;
}

[dir="rtl"] .user-dropdown-menu {
  right: auto;
  left: 0;
}

.user-dropdown-header {
  padding: 0.75rem 1rem 0.6rem;
}

.user-avatar-lg {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}

.user-dropdown-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 145px;
}

.user-dropdown-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.user-dropdown-badges-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.user-level-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-compact);
  background: var(--primary-tint);
  color: var(--primary-hover);
  border: 1px solid var(--primary-alpha20);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.user-xp-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-compact);
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 0.35rem 0;
}

.user-dropdown-links {
  display: flex;
  flex-direction: column;
}

.user-dropdown-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 1rem;
  color: var(--text-main);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.user-dropdown-link i {
  width: 16px;
  text-align: center;
  font-size: 0.88rem;
}

.user-dropdown-link:hover {
  background: var(--primary-tint);
  color: var(--primary);
}

.user-dropdown-logout {
  color: var(--danger, #EF4444);
}

.user-dropdown-logout:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #DC2626;
}

.streak-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #FFF4E5;
  color: #D9700F;
  border: 1px solid transparent;
  padding: 0 0.7rem;
  height: 38px;
  border-radius: var(--radius-compact);
  font-size: 0.82rem;
  font-weight: 700;
}

.xp-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--c-badge-bg);
  color: var(--c-badge-fg);
  border: 1px solid var(--c-badge-border);
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-compact);
  font-size: 0.78rem;
  font-weight: 700;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  text-decoration: none;
  line-height: 1.2;
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background-color: var(--c-btn-bg);
  color: var(--c-btn-fg);
  border-color: var(--c-btn-bg);
  box-shadow: 0 8px 20px var(--c-btn-glow);
}

.btn-primary:hover {
  background-color: var(--c-btn-hover-bg);
  border-color: var(--c-btn-hover-bg);
  color: var(--c-btn-fg);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(10, 186, 181, 0.3);
}

.btn-secondary {
  background-color: var(--secondary);
  color: #FFFFFF;
  border-color: var(--secondary);
}

.btn-secondary:hover {
  background-color: var(--secondary-hover);
  border-color: var(--secondary-hover);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.btn-outline {
  background-color: var(--bg-card);
  color: var(--c-btn-outline-fg);
  border-color: var(--c-btn-outline-border);
}

.btn-outline:hover {
  background-color: var(--bg-subtle);
  border-color: var(--border-strong);
  color: var(--c-btn-outline-fg);
  transform: translateY(-1px);
}

.btn-outline-primary {
  background-color: transparent;
  color: var(--c-btn-bg);
  border-color: var(--c-btn-bg);
}

.btn-outline-primary:hover {
  background-color: var(--c-btn-bg);
  color: var(--c-btn-fg);
  box-shadow: 0 4px 14px var(--c-btn-glow);
}

.btn-sm {
  padding: 0.5rem 0.95rem;
  font-size: 0.85rem;
  border-radius: 10px;
}

.btn-xs {
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
  gap: 0.35rem;
}

.btn-lg {
  padding: 0.95rem 1.75rem;
  font-size: 1.05rem;
  border-radius: 14px;
}

.btn-compact-corners {
  border-radius: var(--radius-compact);
}

.btn-block {
  width: 100%;
}

/* Cards */
.card {
  background: var(--c-card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base), border-color var(--transition-base);
}

.card-interactive {
  cursor: pointer;
}

.card-interactive:hover {
  transform: translateY(-2px);
  border-color: var(--c-card-hover-border);
  box-shadow: 0 16px 36px rgba(37, 42, 50, 0.10);
}

.card-dark {
  background: var(--c-herocard-bg);
  border-color: var(--c-herocard-border);
  color: var(--c-herocard-text);
}

.card-dark h1, .card-dark h2, .card-dark h3, .card-dark h4 {
  color: var(--c-herocard-text);
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--c-input-border);
  border-radius: var(--radius-md);
  background-color: var(--c-input-bg);
  color: var(--c-input-text);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--c-input-focus);
  box-shadow: 0 0 0 3px var(--primary-alpha20);
}

.form-input::placeholder {
  color: var(--text-light);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230ABAB5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.2rem;
  padding-right: 2.5rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.form-check-input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 0.35rem;
}

/* Progress Bar */
.progress-bar-container {
  width: 100%;
  height: 6px;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-track);
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-track);
  transition: width 0.5s ease;
}

.progress-bar-lg {
  height: 10px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-compact);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.badge-primary {
  background: var(--c-badge-bg);
  color: var(--c-badge-fg);
  border: 1px solid var(--c-badge-border);
}

.badge-secondary {
  background: var(--secondary-dark);
  color: #FFFFFF;
}

.badge-beginner {
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
}

.badge-intermediate {
  background: #EFF6FF;
  color: #2563EB;
  border: 1px solid #BFDBFE;
}

.badge-advanced {
  background: #FDF4FF;
  color: #C026D3;
  border: 1px solid #F5D0FE;
}

/* Hero Section — flat cream ground, ink headline, floating product cards */
.hero-section {
  background: linear-gradient(135deg, var(--c-hero-from) 0%, var(--c-hero-mid) 60%, var(--c-hero-to) 100%);
  color: var(--c-hero-text);
  padding: 4.5rem 0 5rem;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 6vw, 3.75rem);
  align-items: center;
  position: relative;
  z-index: 2;
}

.hero-content h1 {
  color: var(--c-hero-text);
  font-size: clamp(2.3rem, 5.2vw, 3.5rem);
  font-weight: 800;
  line-height: 1.18;
  margin-bottom: 1.25rem;
  max-width: 560px;
}

.hero-highlight {
  color: var(--primary);
  position: relative;
  display: inline-block;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 520px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Feature Cards & Grids */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

/* Course Card */
.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.course-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(37, 42, 50, 0.10);
}

.course-card-thumb {
  position: relative;
  height: 160px;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 38%),
    radial-gradient(circle at 85% 90%, rgba(37, 42, 50, 0.55) 0%, rgba(37, 42, 50, 0) 45%),
    linear-gradient(135deg, #9FE3E0 0%, #0ABAB5 60%, #089994 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.course-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.course-card:hover .course-card-thumb img {
  transform: scale(1.05);
}

.course-card-tag {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-heading);
  border: none;
}

.course-card-body {
  padding: 1.25rem 1.35rem 1.35rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.course-card-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 0.4rem;
  line-height: 1.35;
  transition: color var(--transition-fast);
}

.course-card:hover .course-card-title {
  color: var(--primary);
}

.course-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
  flex: 1;
}

.course-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Classroom / Lesson View Player Layout */
.player-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: calc(100vh - 72px);
  background: var(--bg-main);
}

.player-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 72px);
  position: sticky;
  top: 72px;
  overflow-y: auto;
}

.player-sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-subtle);
}

.player-curriculum {
  flex: 1;
  overflow-y: auto;
}

.curriculum-module-title {
  padding: 0.85rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
}

.curriculum-lesson-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.curriculum-lesson-item:hover {
  background: var(--primary-tint);
  color: var(--primary-hover);
}

.curriculum-lesson-item.active {
  background: var(--primary-alpha10);
  color: var(--primary);
  font-weight: 700;
  border-left: 4px solid var(--primary);
}

.lesson-check-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: transparent;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.lesson-check-icon.completed {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
}

.player-content-area {
  padding: 2.5rem 3.5rem;
  overflow-y: auto;
  max-width: 960px;
}

.lesson-article-body {
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--text-main);
  margin-top: 1.5rem;
}

.lesson-article-body h2, .lesson-article-body h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text-heading);
}

.lesson-article-body p {
  margin-bottom: 1.25rem;
}

.lesson-article-body ul, .lesson-article-body ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.lesson-article-body li {
  margin-bottom: 0.5rem;
}

.code-box {
  background: var(--secondary-darker);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.5rem 0;
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: #E2E8F0;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Quiz Card Component */
.quiz-container {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-top: 2rem;
  box-shadow: var(--shadow-sm);
}

.quiz-question-block {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.quiz-choice-label {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.2rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-main);
  margin-top: 0.6rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.95rem;
}

.quiz-choice-label:hover {
  border-color: var(--primary);
  background: var(--primary-tint);
}

.quiz-choice-label.selected {
  border-color: var(--primary);
  background: var(--primary-alpha10);
  font-weight: 600;
}

/* Footer — light, three quiet columns */
.site-footer {
  background: var(--c-footer-bg);
  color: var(--c-footer-text);
  padding: 2.5rem 0 2rem;
  margin-top: auto;
  border-top: 1px solid var(--c-footer-accent);
  font-size: 0.85rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 2.5rem;
}

.footer-logo {
  color: var(--text-heading);
  margin-bottom: 1rem;
}

.footer-links-title {
  color: var(--c-footer-heading);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.footer-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-link {
  color: var(--c-footer-link);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--c-footer-link-hover);
}

.footer-copyright {
  font-size: 0.78rem;
  color: var(--text-light);
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: center;
  }
  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-cta {
    justify-content: center;
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .player-layout {
    grid-template-columns: 1fr;
  }
  .player-sidebar {
    position: static;
    height: auto;
    max-height: 350px;
  }
  .auth-card-grid {
    grid-template-columns: 1fr !important;
  }
  .auth-hero-pane {
    display: none !important;
  }
  .auth-card-grid {
    min-height: 0;
    border-radius: var(--radius-lg);
  }
  .auth-page-wrapper {
    min-height: 0;
    align-items: flex-start;
    padding: 1.5rem 1rem;
  }
  .grid-2-1, .grid-2-1-wide, .dash-grid, .course-layout-grid, .achieve-hero-grid, .grid-main-sidebar {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 900px) {
  .nav-links, .nav-desktop-only {
    display: none;
  }
  .nav-burger {
    display: inline-flex;
  }
}

@media (max-width: 768px) {
  .grid-3, .grid-2, .grid-2-col, .grid-2-col-wide, .stats-grid, .auth-form-grid-2 {
    grid-template-columns: 1fr !important;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .player-content-area {
    padding: 1.5rem 1rem;
  }
  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.75rem; }
}

/* ==========================================================================
   Component & Layout Classes (Strict Zero-Inline-CSS Standard)
   ========================================================================== */

/* Layout & Containers */
.page-section { padding: 3rem 0; background: var(--c-body-bg); }
.page-section-lg { padding: 4rem 0; background: var(--c-body-bg); }
.page-section-xl { padding: 5rem 0; background: var(--c-body-bg); }
.page-section-card { padding: 5rem 0; background: var(--c-section-bg); border-top: 1px solid var(--c-section-border); }
.container-narrow { max-width: 720px; margin-left: auto; margin-right: auto; }
.container-medium { max-width: 900px; margin-left: auto; margin-right: auto; }
.container-md { max-width: 980px; margin-left: auto; margin-right: auto; }
.container-lg { max-width: 1140px; margin-left: auto; margin-right: auto; }

/* Display & Flex Utilities */
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-block { display: block; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }
.align-stretch { align-items: stretch; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-start { justify-content: flex-start; }

/* Gap Utilities */
.gap-xs { gap: 0.35rem; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 0.75rem; }
.gap-base { gap: 1rem; }
.gap-lg { gap: 1.25rem; }
.gap-xl { gap: 1.5rem; }
.gap-2xl { gap: 2rem; }

/* Grid Utilities */
.grid-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-2-col-wide { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; }
.grid-2-1-wide { display: grid; grid-template-columns: 2fr 1fr; gap: 3rem; }
.grid-auto-fill-200 { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.grid-auto-fill-280 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }

/* Spacing Utilities */
.mb-0 { margin-bottom: 0 !important; }
.mb-xs { margin-bottom: 0.25rem !important; }
.mb-sm { margin-bottom: 0.5rem !important; }
.mb-md { margin-bottom: 0.75rem !important; }
.mb-base { margin-bottom: 1rem !important; }
.mb-lg { margin-bottom: 1.25rem !important; }
.mb-xl { margin-bottom: 1.5rem !important; }
.mb-2xl { margin-bottom: 2rem !important; }
.mb-3xl { margin-bottom: 2.5rem !important; }
.mb-4xl { margin-bottom: 3rem !important; }
.mb-5xl { margin-bottom: 3.5rem !important; }
.mt-0 { margin-top: 0 !important; }
.mt-xs { margin-top: 0.25rem !important; }
.mt-sm { margin-top: 0.5rem !important; }
.mt-md { margin-top: 0.75rem !important; }
.mt-base { margin-top: 1rem !important; }
.mt-lg { margin-top: 1.25rem !important; }
.mt-xl { margin-top: 1.5rem !important; }
.mt-2xl { margin-top: 2rem !important; }
.mt-3xl { margin-top: 2.5rem !important; }
.mt-4xl { margin-top: 3.5rem !important; }
.p-0 { padding: 0 !important; }
.p-sm { padding: 0.75rem !important; }
.p-base { padding: 1rem !important; }
.p-lg { padding: 1.25rem !important; }
.p-xl { padding: 1.5rem !important; }
.p-2xl { padding: 2rem !important; }
.p-3xl { padding: 2.5rem !important; }
.p-4xl { padding: 3.5rem !important; }
.pt-base { padding-top: 1rem !important; }
.pt-xl { padding-top: 1.5rem !important; }
.pt-2xl { padding-top: 2rem !important; }
.pb-base { padding-bottom: 1rem !important; }
.pb-xl { padding-bottom: 1.25rem !important; }
.pt-sm { padding-top: 0.5rem !important; }
.pt-lg { padding-top: 1.25rem !important; }
.pb-md { padding-bottom: 0.75rem !important; }
.m-0 { margin: 0 !important; }
.ml-0 { margin-left: 0 !important; }
.ml-xs { margin-left: 0.25rem !important; }
.mr-xs { margin-right: 0.25rem !important; }

/* Background Utilities */
.bg-main { background: var(--bg-main) !important; }
.bg-card { background: var(--bg-card) !important; }
.bg-subtle { background: var(--bg-subtle) !important; }

/* Borders & Positioning */
.border-top { border-top: 1px solid var(--border-color) !important; }
.border-top-thick { border-top: 1.5px solid var(--border-color) !important; }
.border-bottom { border-bottom: 1px solid var(--border-color) !important; }
.overflow-hidden { overflow: hidden !important; }
.relative { position: relative !important; }
.z-2 { z-index: 2 !important; }

/* Typography Helpers */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-white { color: #FFFFFF !important; }
.text-warning { color: #F59E0B !important; }
.text-success { color: #10B981 !important; }
.text-danger { color: #EF4444 !important; }
.text-cyan { color: #22D3EE !important; }
.text-slate { color: #CBD5E1 !important; }
.text-slate-dark { color: #334155 !important; }
.text-light { color: var(--text-light) !important; }
.italic { font-style: italic !important; }
.font-mono { font-family: var(--font-mono) !important; }
.text-uppercase { text-transform: uppercase !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }
.letter-spacing-wide { letter-spacing: 0.05em !important; }
.truncate { white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
.pre-wrap { white-space: pre-wrap !important; }
.pre-line { white-space: pre-line !important; }
.lh-1 { line-height: 1 !important; }
.lh-12 { line-height: 1.2 !important; }
.lh-13 { line-height: 1.3 !important; }
.lh-14 { line-height: 1.4 !important; }
.lh-15 { line-height: 1.5 !important; }
.lh-16 { line-height: 1.6 !important; }
.lh-17 { line-height: 1.7 !important; }
.lh-18 { line-height: 1.8 !important; }

/* Font size helpers */
.font-xs { font-size: 0.75rem !important; }
.font-sm { font-size: 0.82rem !important; }
.font-base { font-size: 0.92rem !important; }
.font-md { font-size: 1rem !important; }
.font-lg { font-size: 1.15rem !important; }
.font-xl { font-size: 1.35rem !important; }
.font-2xl { font-size: 1.75rem !important; }
.font-3xl { font-size: 2.2rem !important; }
.font-4xl { font-size: 2.75rem !important; }

/* Navbar Component */
.user-dropdown-container { position: relative; }

/* Footer Component */
.footer-tagline { color: var(--c-footer-text); font-size: 0.85rem; line-height: 1.6; margin-bottom: 0.75rem; max-width: 320px; }
.footer-social-links { display: flex; gap: 1rem; }
.footer-social-btn { color: #CBD5E1; border-color: rgba(255,255,255,0.15); border-radius: 50%; width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.footer-status-wrapper { display: flex; align-items: center; gap: 1.5rem; }
.footer-status { display: flex; align-items: center; gap: 0.4rem; color: #64748B; }
.footer-status-dot { color: #10B981; font-size: 0.6rem; }

/* Auth Pages (Login & Register) */
/* Auth pages — Figma frame 2 of the handoff: a dark ink hero with a teal glow
   and floating stat cards (3/5) beside a cream form column (2/5). */
.auth-page-wrapper { min-height: calc(100vh - 70px); display: flex; align-items: stretch; justify-content: center; padding: 1.25rem; background: var(--bg-main); }
.auth-card-grid { width: 100%; max-width: 1500px; min-height: 675px; display: grid; grid-template-columns: 3fr 2fr; background: var(--bg-main); border-radius: 22px; overflow: hidden; border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); }
.auth-card-register { grid-template-columns: 1fr 1.15fr; }
.auth-hero-pane { background: linear-gradient(180deg, #252A32 0%, #1B1F25 100%); color: #FFFFFF; padding: 45px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-hero-glow { position: absolute; top: 50%; left: 50%; width: 70%; height: 46%; transform: translate(-50%, -50%); background: radial-gradient(ellipse at center, rgba(10, 186, 181, 0.42) 0%, rgba(10, 186, 181, 0.14) 38%, transparent 72%); filter: blur(28px); pointer-events: none; }
.auth-hero-glow-alt { position: absolute; bottom: -60px; left: -60px; width: 280px; height: 280px; background: radial-gradient(circle, rgba(10, 186, 181, 0.35) 0%, transparent 70%); filter: blur(20px); border-radius: 50%; pointer-events: none; }
.auth-hero-logo { color: #FFFFFF; align-self: flex-start; margin-bottom: 2rem; position: relative; z-index: 1; }
.auth-hero-cards { position: absolute; top: 38%; inset-inline-start: 58%; display: flex; flex-direction: column; align-items: flex-start; gap: 3.25rem; z-index: 1; }
.auth-hero-card { border-radius: var(--radius-md); padding: 0.8rem 1rem; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35); }
.auth-hero-card-dark { width: 190px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.72); backdrop-filter: blur(6px); }
.auth-hero-card-light { width: 150px; background: #FFFFFF; color: var(--secondary); text-align: center; margin-inline-start: 0.5rem; }
.auth-hero-card-label { display: block; font-size: 0.74rem; font-weight: 600; line-height: 1.3; }
.auth-hero-card-light .auth-hero-card-label { color: #5B6169; }
.auth-hero-card-value { display: block; font-size: 1.35rem; font-weight: 800; color: var(--primary); line-height: 1.1; margin-bottom: 0.2rem; }
.auth-hero-progress { height: 4px; margin-top: 0.55rem; border-radius: var(--radius-track); background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.auth-hero-progress-fill { width: 72%; height: 100%; border-radius: var(--radius-track); background: var(--primary); }
.auth-hero-title { color: #FFFFFF; font-size: 2rem; font-weight: 800; margin-bottom: 1rem; line-height: 1.2; position: relative; z-index: 1; }
.auth-hero-desc { color: rgba(255, 255, 255, 0.7); font-size: 0.98rem; line-height: 1.7; position: relative; z-index: 1; }
.auth-feature-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 2rem; position: relative; z-index: 1; }
.auth-feature-item { display: flex; align-items: center; gap: 0.75rem; color: #FFFFFF; font-size: 0.92rem; font-weight: 600; }
.auth-feature-item-top { align-items: flex-start; gap: 1rem; }
.auth-feature-icon { width: 30px; height: 30px; border-radius: 9px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.08); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.auth-feature-icon-lg { width: 38px; height: 38px; border-radius: 11px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.08); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.auth-feature-body h4 { color: #FFFFFF; font-size: 1rem; margin-bottom: 0.2rem; font-weight: 700; }
.auth-feature-body p { color: rgba(255, 255, 255, 0.65); font-size: 0.88rem; font-weight: 400; }
.auth-perk-box { margin-top: 2rem; padding: 1rem 1.15rem; background: rgba(255, 255, 255, 0.06); border-radius: var(--radius-md); border: 1px solid rgba(255, 255, 255, 0.08); font-size: 0.88rem; color: rgba(255, 255, 255, 0.75); position: relative; z-index: 1; }
.auth-form-pane { background: var(--bg-main); padding: 3.5rem 2.5rem; display: flex; flex-direction: column; justify-content: center; }
.auth-form-inner { width: 100%; max-width: 340px; margin: 0 auto; }
.auth-form-header { margin-bottom: 1.5rem; }
.auth-form-title { font-size: 1.75rem; font-weight: 800; color: var(--text-heading); margin-bottom: 0.4rem; }
.auth-form-subtitle { color: var(--text-muted); font-size: 0.92rem; }
.auth-form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.25rem; }
.auth-remember-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.auth-remember-label { font-size: 0.85rem; color: var(--text-muted); cursor: pointer; }
.auth-submit { padding: 0.85rem 1.4rem; margin-bottom: 0.75rem; }
.auth-alt-btn { padding: 0.85rem 1.4rem; background: var(--bg-subtle); color: var(--text-heading); border-color: var(--bg-subtle); }
.auth-alt-btn:hover { background: var(--border-strong); border-color: transparent; color: var(--text-heading); }
.auth-footer-text { text-align: center; font-size: 0.9rem; color: var(--text-muted); }
.auth-link { color: var(--primary); font-weight: 700; margin-left: 0.25rem; }
.auth-forgot-link { font-size: 0.8rem; color: var(--primary); font-weight: 600; }

/* Social login (Google / Apple) on the auth pages */
.social-login { margin-top: 1.5rem; }
.social-login-divider { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; color: var(--text-light); font-size: 0.8rem; font-weight: 600; }
.social-login-divider::before, .social-login-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-strong); }
.social-login-buttons { display: flex; flex-direction: column; gap: 0.6rem; }
.social-login-btn { padding: 0.8rem 1.4rem; gap: 0.65rem; background: var(--bg-card); color: var(--text-heading); border-color: var(--input-border); font-weight: 700; }
.social-login-btn:hover { background: var(--bg-card); border-color: var(--text-light); color: var(--text-heading); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.social-login-btn-google { background: var(--primary); color: var(--text-inverse); border-color: var(--primary); }
.social-login-btn-google:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--text-inverse); box-shadow: var(--shadow-glow); }
.social-login-btn-apple { background: var(--secondary); color: var(--bg-card); border-color: var(--secondary); }
.social-login-btn-apple:hover { background: var(--secondary-hover); border-color: var(--secondary-hover); color: var(--bg-card); }
.social-login-btn.is-disabled { opacity: 0.45; cursor: not-allowed; pointer-events: auto; transform: none; box-shadow: none; }

/* Home Section Components */
.hero-badge-light { background: rgba(10, 186, 181, 0.2); border-color: rgba(10, 186, 181, 0.4); color: #22D3EE; }
.hero-search-form { display: flex; gap: 0.5rem; max-width: 500px; margin-bottom: 2rem; background: var(--c-input-bg); padding: 0.4rem; border-radius: var(--radius-compact); border: 1px solid var(--border-strong); box-shadow: var(--shadow-sm); }
.hero-search-input { flex: 1; border: none; outline: none; padding: 0.6rem 1.25rem; font-size: 0.95rem; border-radius: var(--radius-compact); background: transparent; color: var(--c-input-text); }
.hero-search-btn { padding: 0.6rem 1.5rem; }
.hero-btn-outline { color: #FFFFFF; border-color: rgba(255,255,255,0.3); }
.hero-visual-wrapper { position: relative; }
.hero-floating-card { padding: 2rem; border-radius: var(--radius-xl); box-shadow: 0 20px 40px rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.15); }
.hero-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.hero-avatar-python { width: 44px; height: 44px; border-radius: 12px; background: var(--primary); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.hero-code-box { margin: 0 0 1.5rem 0; font-size: 0.85rem; border: 1px solid rgba(255,255,255,0.1); }
.hero-code-pre { margin: 0; }
.hero-status-row { display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.05); padding: 1rem; border-radius: var(--radius-md); border: 1px solid rgba(255,255,255,0.08); }
.hero-xp-tag { font-size: 0.85rem; padding: 0.4rem 0.8rem; }
.hero-floating-badge { position: absolute; bottom: -20px; left: -20px; background: #FFFFFF; color: var(--secondary); padding: 0.85rem 1.25rem; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 0.75rem; border: 1px solid var(--border-color); animation: floatSlow 4s ease-in-out infinite; }
.hero-floating-badge-icon { width: 36px; height: 36px; border-radius: 50%; background: #ECFDF5; color: #10B981; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }

.stats-section { padding: 2.5rem 0; background: var(--c-stats-bg); border-bottom: 1px solid var(--c-stats-border); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; text-align: center; }
.stat-value-secondary { font-size: 2.5rem; font-weight: 800; color: var(--c-stats-number); margin-bottom: 0.2rem; }
.stat-value-primary { font-size: 2.5rem; font-weight: 800; color: var(--c-stats-accent); margin-bottom: 0.2rem; }
.stat-label { font-size: 0.9rem; color: var(--c-stats-label); font-weight: 600; }
/* Home renders .stat-number / .stat-number-primary; keep them in step with the above. */
.stat-number { font-size: 2.5rem; font-weight: 800; color: var(--c-stats-number); margin-bottom: 0.2rem; }
.stat-number-primary { color: var(--c-stats-accent); }

.section-header-centered { text-align: center; max-width: 680px; margin: 0 auto 3.5rem; }
.section-title-lg { font-size: 2.35rem; font-weight: 800; margin-bottom: 1rem; }
.section-subtitle-lg { color: var(--text-muted); font-size: 1.05rem; }

.feature-card-pad { padding: 2.25rem; }
.feature-icon-box { width: 46px; height: 46px; border-radius: 13px; background: var(--c-iconbox-bg); color: var(--c-iconbox-fg); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; margin-bottom: 1.25rem; border: 1px solid var(--c-iconbox-border); }
.feature-card-title { font-size: 1.1rem; font-weight: 800; color: var(--c-card-title); margin-bottom: 0.4rem; }
.feature-card-desc { color: var(--c-card-text); font-size: 0.95rem; line-height: 1.6; }
.feature-title { font-size: 1.1rem; font-weight: 800; color: var(--c-card-title); margin-bottom: 0.4rem; }
.feature-desc { color: var(--c-card-text); font-size: 0.95rem; line-height: 1.6; }

.course-thumb-icon { width: 58px; height: 58px; border-radius: 16px; background: rgba(255, 255, 255, 0.92); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; box-shadow: 0 10px 24px rgba(37, 42, 50, 0.18); }
.course-card-cat { font-size: 0.82rem; font-weight: 700; color: var(--primary); }
.course-card-rating { font-size: 0.82rem; font-weight: 700; color: #F59E0B; }
.course-btn-wrapper { margin-top: 1rem; }

.roadmap-card-flex { display: flex; flex-direction: column; justify-content: space-between; }
.roadmap-icon-box { width: 46px; height: 46px; border-radius: 13px; background: var(--c-iconbox-bg); color: var(--c-iconbox-fg); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; margin-bottom: 1.25rem; border: 1px solid var(--c-iconbox-border); }
.roadmap-icon-box-lg { width: 56px; height: 56px; border-radius: 14px; font-size: 1.6rem; }
.roadmap-badge { margin-bottom: 0.6rem; }
.roadmap-title { font-size: 1.15rem; font-weight: 800; color: var(--c-card-title); margin-bottom: 0.5rem; }
.roadmap-desc { font-size: 0.88rem; color: var(--c-card-text); line-height: 1.5; margin-bottom: 1.25rem; }
.roadmap-footer { padding-top: 1rem; border-top: 1px solid var(--c-card-border); display: flex; align-items: center; justify-content: space-between; }
.roadmap-meta-text { font-size: 0.8rem; color: var(--c-card-text); font-weight: 600; }
.roadmap-link { font-size: 0.85rem; color: var(--primary); font-weight: 700; }

.cta-banner-section { padding: 5rem 0; background: linear-gradient(120deg, var(--c-cta-from) 0%, var(--c-cta-mid) 55%, var(--c-cta-to) 100%); color: var(--c-cta-text); text-align: center; position: relative; overflow: hidden; }
.cta-banner-glow { position: absolute; top: -40px; left: 50%; transform: translateX(-50%); width: 700px; height: 320px; background: radial-gradient(circle, var(--c-cta-glow) 0%, transparent 70%); pointer-events: none; }
.cta-banner-container { position: relative; z-index: 2; max-width: 760px; margin-left: auto; margin-right: auto; }
.cta-banner-badge { background: rgba(255,255,255,0.18); border-color: transparent; color: #FFFFFF; margin-bottom: 1.25rem; }
.cta-banner-title { color: #FFFFFF; font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; margin-bottom: 1rem; line-height: 1.2; }
.cta-banner-desc { color: rgba(255,255,255,0.85); font-size: 1.1rem; margin-bottom: 2rem; line-height: 1.7; }
.cta-banner-actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.cta-btn-outline { color: #FFFFFF; border-color: rgba(255,255,255,0.4); background: transparent; }
.btn-on-teal { background: #FFFFFF; color: var(--primary); border-color: #FFFFFF; box-shadow: 0 10px 24px rgba(37, 42, 50, 0.12); }
.btn-on-teal:hover { background: #FFFFFF; color: var(--primary-hover); border-color: #FFFFFF; transform: translateY(-1px); box-shadow: 0 14px 30px rgba(37, 42, 50, 0.16); }

/* Course List & Catalog */
.catalog-search-form { display: flex; gap: 0.5rem; background: var(--input-bg); padding: 0.4rem; border-radius: var(--radius-compact); border: 1px solid var(--border-strong); box-shadow: var(--shadow-sm); }
.catalog-search-input { flex: 1; border: none; outline: none; padding: 0.6rem 1.25rem; font-size: 0.95rem; border-radius: var(--radius-compact); color: var(--input-text); background: transparent; }
.catalog-filter-card { margin-bottom: 2.5rem; padding: 1.25rem 1.5rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.select-control-sm { padding: 0.4rem 2rem 0.4rem 0.8rem; font-size: 0.85rem; width: auto; }
.empty-state-card { padding: 4rem 2rem; text-align: center; }
.empty-state-icon { width: 64px; height: 64px; border-radius: 18px; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin: 0 auto 1rem; }

/* Course Detail */
.course-hero-header { background: var(--bg-card); color: var(--text-heading); padding: 3.5rem 0; position: relative; overflow: hidden; border-bottom: 1px solid var(--border-subtle); }
.course-hero-glow { position: absolute; top: -80px; inset-inline-end: -80px; width: 360px; height: 360px; background: radial-gradient(circle, var(--primary-alpha10) 0%, transparent 70%); border-radius: 50%; pointer-events: none; }
.course-hero-meta-row, .course-meta-row { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2rem; font-size: 0.95rem; color: var(--text-muted); }
.course-hero-title { color: var(--text-heading); }
.course-hero-tagline { color: var(--text-muted); }
.badge-tag-orange { background: #FFF7ED; color: #EA580C; border: 1px solid #FFEDD5; }
.module-accordion-box { border: 1px solid var(--border-color); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 1.25rem; }
.module-header-box { background: var(--bg-subtle); padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; }
.module-lesson-row { padding: 0.9rem 1.25rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(226, 232, 240, 0.6); transition: background var(--transition-fast); }
.lesson-type-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-tint); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; flex-shrink: 0; }
.review-form-box { background: var(--bg-subtle); padding: 1.5rem; border-radius: var(--radius-md); margin-bottom: 2rem; border: 1px solid var(--border-color); }
.review-card-item { padding: 1.25rem; border-radius: var(--radius-md); background: var(--bg-subtle); border: 1px solid var(--border-color); margin-bottom: 1.25rem; }
.review-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; }
.instructor-avatar { width: 52px; height: 52px; border-radius: 16px; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }

/* Video Player Embed */
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: var(--radius-lg); margin-bottom: 2rem; background: #000; box-shadow: var(--shadow-md); }
.video-iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }

/* Lesson Player Specifics */
.player-top-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; border-bottom: 1px solid var(--border-color); padding-bottom: 1.25rem; }
.quiz-choice-label { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1.25rem; border: 1.5px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-card); cursor: pointer; transition: all var(--transition-fast); font-size: 0.95rem; }
.quiz-choice-label:hover { border-color: var(--primary); background: var(--primary-tint); }
.lesson-note-textarea { font-family: inherit; font-size: 0.95rem; line-height: 1.6; }
.lesson-nav-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 3.5rem; padding-top: 2rem; border-top: 1.5px solid var(--border-color); flex-wrap: wrap; gap: 1rem; }

/* Timeline for Roadmaps */
.roadmap-timeline-box { position: relative; padding-left: 2.5rem; border-left: 3px solid var(--primary-alpha20); margin-left: 1rem; }
.roadmap-timeline-step { position: relative; margin-bottom: 3rem; }
.roadmap-timeline-node { position: absolute; left: -2.5rem; top: 0; transform: translateX(-50%); width: 34px; height: 34px; border-radius: 11px; background: var(--secondary); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.9rem; border: 3px solid var(--bg-card); box-shadow: var(--shadow-md); }

/* Badges & Achievements */
.hidden-badge { display: none !important; }
.badge-unlocked-tag { background: #ECFDF5; color: #059669; border: 1px solid #A7F3D0; }
.badge-locked-tag { background: var(--bg-subtle); color: var(--text-light); border: 1px solid var(--border-color); }
.badge-icon-box { width: 58px; height: 58px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 1.65rem; border-width: 1.5px; border-style: solid; }
.badge-icon-locked { background: var(--bg-subtle); color: var(--text-light); border-color: var(--border-color); }

/* Dashboard & Profile */
.profile-cover-bar { position: absolute; top: 0; left: 0; right: 0; height: 100px; background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-main) 100%); }
.profile-avatar-large { width: 100px; height: 100px; border-radius: 28px; background: var(--primary); color: #FFFFFF; font-size: 2.5rem; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 4px solid var(--bg-card); box-shadow: var(--shadow-md); }
.dash-avatar-lg { width: 72px; height: 72px; border-radius: 20px; background: var(--primary); color: #FFFFFF; font-size: 1.8rem; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 24px rgba(10, 186, 181, 0.3); }
.dash-stat-chip-box { background: var(--bg-subtle); border: 1px solid var(--border-subtle); padding: 0.85rem 1.25rem; border-radius: var(--radius-md); text-align: center; min-width: 110px; }
.dash-hero-banner { position: relative; overflow: hidden; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); padding: 2rem 2.25rem; box-shadow: var(--shadow-sm); }
.dash-hero-glow { position: absolute; top: -80px; inset-inline-end: -80px; width: 320px; height: 320px; background: radial-gradient(circle, var(--primary-alpha10) 0%, transparent 70%); border-radius: 50%; pointer-events: none; }
.dash-welcome-title { color: var(--text-heading); font-size: 1.9rem; font-weight: 800; line-height: 1.2; }
.dash-welcome-subtitle { color: var(--text-muted); font-size: 0.95rem; }
.dash-stat-chip-title { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); margin-bottom: 0.3rem; display: flex; align-items: center; justify-content: center; gap: 0.35rem; }
.dash-stat-chip-val { font-size: 1.15rem; font-weight: 800; line-height: 1.2; color: var(--text-heading); }
.dash-progress-row { position: relative; z-index: 2; margin-top: 1.5rem; }
.text-heading { color: var(--text-heading) !important; }
.grid-main-sidebar { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.card-border-primary { border-left: 5px solid var(--primary); }
.note-box { white-space: pre-wrap; font-size: 0.95rem; color: var(--text-main); line-height: 1.6; background: var(--bg-subtle); padding: 1rem; border-radius: var(--radius-md); border-left: 3px solid var(--primary); }
.profile-badge-card { padding: 1rem; border-radius: var(--radius-md); background: var(--primary-tint); border: 1px solid var(--primary-alpha20); display: flex; align-items: center; gap: 0.75rem; }
.profile-badge-icon-box { width: 42px; height: 42px; border-radius: 12px; background: var(--primary); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.dash-list-unstyled { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.dash-list-item { padding: 0.75rem; border-radius: var(--radius-sm); background: var(--bg-subtle); display: flex; justify-content: space-between; align-items: center; }
.border-dashed-primary { border: 1.5px dashed var(--primary) !important; }
.progress-fill-locked { background: var(--text-light) !important; }
.badge-locked { opacity: 0.82; }
.badge-unlocked { opacity: 1; }
.badge-icon-item { width: 58px; height: 58px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 1.65rem; border: 1.5px solid var(--border-color); background: var(--bg-subtle); color: var(--text-light); }
.badge-icon-item.active { background: var(--primary-tint); color: var(--primary); border-color: var(--primary-alpha20); }
.bg-hero-dark { background: var(--bg-card) !important; border: 1px solid var(--border-subtle); }
.grid-hero-achieve { display: grid; grid-template-columns: 1.2fr 0.8fr; }
.max-w-580 { max-width: 580px; }
.max-w-480 { max-width: 480px; }
.progress-bar-hero { background: var(--bg-subtle) !important; height: 10px !important; }
.progress-bar-sm { height: 6px !important; }
.stat-card-glass { background: var(--bg-subtle); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1.25rem; text-align: center; }
.filter-tabs-scroll { overflow-x: auto; padding-bottom: 0.5rem; }
.roadmap-rec-course-card { background: var(--bg-subtle); padding: 1.25rem; border-radius: var(--radius-md); border: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.roadmap-rec-icon-box { width: 40px; height: 40px; border-radius: 10px; background: var(--primary); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.hero-badge-glow { background: var(--primary-light) !important; border-color: transparent !important; color: var(--teal-ink) !important; }
.hero-py-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--primary); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.dash-badge-level { font-size: 0.8rem; padding: 0.3rem 0.75rem; }
.dash-hub-link { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; border-radius: var(--radius-md); background: var(--bg-subtle); color: var(--secondary); font-weight: 600; font-size: 0.9rem; transition: background var(--transition-fast); }
.dash-quiz-item { display: flex; align-items: center; justify-content: space-between; padding: 0.65rem 0.85rem; border-radius: var(--radius-sm); border: 1px solid var(--border-color); font-size: 0.85rem; }
.dash-badge-item { padding: 0.85rem; border-radius: var(--radius-md); border: 1px solid var(--border-color); background: var(--bg-subtle); display: flex; align-items: center; gap: 0.75rem; opacity: 0.5; }
.dash-badge-item.active { border-color: var(--primary-alpha20); background: var(--primary-tint); opacity: 1; }
.dash-badge-item-icon { width: 38px; height: 38px; border-radius: 11px; background: var(--text-light); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.dash-badge-item-icon.active { background: var(--primary); }
.course-badge-orange { background: #FFF7ED !important; color: #EA580C !important; border: 1px solid #FFEDD5 !important; }
.btn-study-sm { padding: 0.3rem 0.75rem !important; }
.course-desc-content { color: var(--text-main); font-size: 1.02rem; line-height: 1.8; white-space: pre-line; }
.player-back-link { font-size: 0.82rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.5rem; }
.player-course-title { font-size: 1.1rem; font-weight: 800; color: var(--secondary); margin-bottom: 0.75rem; line-height: 1.3; }
.player-progress-header { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.curriculum-lesson-content { display: flex; align-items: center; gap: 0.75rem; overflow: hidden; }
.curriculum-lesson-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.curriculum-lesson-name { display: block; font-size: 0.88rem; line-height: 1.2; }
.curriculum-lesson-meta { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; }
.player-top-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; border-bottom: 1px solid var(--border-color); padding-bottom: 1.25rem; }
.player-module-subtitle { font-size: 0.82rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.05em; }
.player-lesson-title { font-size: 2rem; font-weight: 800; color: var(--secondary); margin-top: 0.2rem; }
.video-responsive-wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: var(--radius-lg); margin-bottom: 2rem; background: #000; box-shadow: var(--shadow-md); }
.video-iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.practice-code-wrapper { margin: 2.5rem 0; }
.copy-code-btn { background: transparent; border: none; color: var(--text-light); cursor: pointer; font-size: 0.8rem; }
.key-takeaways-card { background: var(--primary-tint); border: 1.5px solid var(--primary-alpha20); border-radius: var(--radius-lg); padding: 1.5rem; margin: 2rem 0; }
.key-takeaways-title { color: var(--secondary); font-size: 1.1rem; font-weight: 800; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.key-takeaways-body { color: var(--text-main); font-size: 0.95rem; line-height: 1.6; }
.quiz-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; border-bottom: 1.5px solid var(--border-color); padding-bottom: 1rem; }
.quiz-header-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.quiz-result-feedback { padding: 1.25rem; border-radius: var(--radius-md); margin-bottom: 2rem; }
.quiz-result-feedback.passed { background: #ECFDF5; border: 1px solid #A7F3D0; color: #065F46; }
.quiz-result-feedback.failed { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }
.quiz-detail-item { background: rgba(255, 255, 255, 0.7); padding: 0.75rem 1rem; border-radius: var(--radius-sm); font-size: 0.88rem; }
.note-taker-card { margin: 2.5rem 0; background: var(--bg-card); }
.note-textarea { font-family: inherit; font-size: 0.95rem; line-height: 1.6; }
.player-nav-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 3.5rem; padding-top: 2rem; border-top: 1.5px solid var(--border-color); flex-wrap: wrap; gap: 1rem; }

/* ==========================================================================
   Achievement Notification Card (Bottom Right Corner - 5s Auto Dismiss)
   ========================================================================== */
.achievement-bottom-right-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  max-width: 400px;
  width: calc(100vw - 48px);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* Up to 3 cards stack above one another; each animates independently */
.achievement-popup-card.slide-in {
  animation: slideInBottomRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.achievement-popup-card.slide-out {
  animation: slideOutBottomRight 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.achievement-popup-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
}

.achievement-card-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem 0.45rem 1rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.achievement-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
}

.achievement-trophy-icon {
  color: #F59E0B;
  font-size: 0.85rem;
  animation: trophyWiggle 2s infinite ease-in-out;
}

.achievement-top-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.achievement-xp-tag {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-compact);
  border: 1px solid var(--primary-alpha20);
}

.achievement-close-btn {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0 0.2rem;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.achievement-close-btn:hover {
  color: var(--danger);
  transform: scale(1.15);
}

.achievement-card-body {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1rem 1rem 1rem;
}

/* Pixelated Graphic: Username / Passw0rd */
.achievement-pixel-wrapper {
  flex-shrink: 0;
}

.pixel-auth-card {
  width: 76px;
  height: 72px;
  background: #0B1120;
  border: 2px solid #1E293B;
  border-radius: 8px;
  box-shadow: inset 0 0 10px rgba(10, 186, 181, 0.35), 0 3px 10px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
  image-rendering: pixelated;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.pixel-scanline {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.25),
    rgba(0, 0, 0, 0.25) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 2;
}

.pixel-auth-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 2px 4px;
  z-index: 1;
}

.pixel-auth-row {
  display: flex;
  align-items: center;
  gap: 3px;
  line-height: 1.15;
}

.pixel-user-row {
  color: #22D3EE;
  font-size: 0.64rem;
  font-weight: 700;
  text-shadow: 0 0 5px rgba(34, 211, 238, 0.7);
  letter-spacing: -0.02em;
}

.pixel-pass-row {
  color: #F59E0B;
  font-size: 0.64rem;
  font-weight: 700;
  text-shadow: 0 0 5px rgba(245, 158, 11, 0.7);
  letter-spacing: -0.02em;
}

.pixel-icon-user, .pixel-icon-key {
  font-size: 0.65rem;
}

.pixel-divider {
  font-size: 0.65rem;
  color: #64748B;
  font-weight: 900;
  line-height: 0.9;
  margin: 1px 0;
}

.pixel-corner-dots .dot {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #0ABAB5;
  opacity: 0.8;
}
.pixel-corner-dots .dot-1 { top: 2px; left: 2px; }
.pixel-corner-dots .dot-2 { top: 2px; right: 2px; }
.pixel-corner-dots .dot-3 { bottom: 2px; left: 2px; }
.pixel-corner-dots .dot-4 { bottom: 2px; right: 2px; }

.achievement-default-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--primary-tint);
  border: 1.5px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

/* Pixel image slot in the Achievements hub badge grid */
.pixel-auth-grid-item {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Generic pixel-art sprite frame (same retro CRT look as pixel-auth-card) */
.pixel-art-card {
  width: 72px;
  height: 72px;
  background: #0B1120;
  border: 2px solid #1E293B;
  border-radius: 8px;
  box-shadow: inset 0 0 10px rgba(10, 186, 181, 0.35), 0 3px 10px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  image-rendering: pixelated;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.pixel-art-svg {
  width: 56px;
  height: 56px;
  display: block;
  z-index: 1;
}

/* Locked badges show a dimmed, desaturated sprite */
.badge-locked .pixel-art-card,
.badge-locked .pixel-auth-card {
  filter: grayscale(1) opacity(0.45);
}

.achievement-text-content {
  flex: 1;
  min-width: 0;
}

.achievement-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-heading);
  margin: 0 0 0.25rem 0;
  line-height: 1.25;
}

.achievement-description {
  font-size: 0.86rem;
  color: var(--text-main);
  margin: 0;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}

/* 5-Second Timer Progress Bar */
.achievement-timer-track {
  height: 3.5px;
  background: var(--border-subtle);
  width: 100%;
  overflow: hidden;
}

.achievement-timer-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #22D3EE 50%, #F59E0B 100%);
  width: 100%;
  animation: timerCountdown 5s linear forwards;
}

@keyframes slideInBottomRight {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideOutBottomRight {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(30px) scale(0.92);
  }
}

@keyframes timerCountdown {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}

@keyframes trophyWiggle {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-10deg); }
  40% { transform: rotate(10deg); }
  60% { transform: rotate(-5deg); }
  80% { transform: rotate(5deg); }
}

@media (max-width: 640px) {
  .achievement-bottom-right-container {
    bottom: 16px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
  }
}

/* ==========================================================================
   Language Switcher & Internationalization
   ========================================================================== */
.language-toggle-btn,
.language-switcher-btn {
  background: var(--bg-card);
  color: var(--text-heading);
  border: 1px solid var(--border-strong);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
  line-height: 1;
  user-select: none;
}

.language-toggle-btn:hover,
.language-switcher-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.language-toggle-btn:disabled,
.language-switcher-btn:disabled {
  opacity: 0.65;
  cursor: default;
}

.language-toggle-btn.is-loading {
  border-color: var(--primary);
  background: var(--primary-light);
  cursor: wait;
  opacity: 1;
}

.lang-spinner {
  font-size: 0.95rem;
  color: var(--primary);
  animation: langSpin 0.75s linear infinite;
  display: inline-block;
  line-height: 1;
}

@keyframes langSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.lang-toggle-ar {
  font-family: var(--font-arabic);
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1;
  letter-spacing: 0;
}

.lang-toggle-en {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1;
  letter-spacing: 0.04em;
}

/* RTL Support */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}
[dir="rtl"] .achievement-bottom-right-container {
  right: auto;
  left: 24px;
}
[dir="rtl"] .card-border-primary {
  border-left: none;
  border-right: 5px solid var(--primary);
}
[dir="rtl"] .note-box {
  border-left: none;
  border-right: 3px solid var(--primary);
}

/* Code Blocks & Inline Code: Strictly LTR */
code,
pre,
kbd,
samp,
.code-box,
.code-box pre,
.code-box code,
.code-header,
.lesson-article-body pre,
.lesson-article-body code,
.slide-body pre,
.slide-body code,
.practice-code-wrapper,
.practice-code-wrapper pre,
.practice-code-wrapper code,
.hero-code-box,
.hero-code-pre,
.playground-textarea,
.console-output,
.hljs,
[class*="language-"],
[class*="lang-"] {
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: isolate !important;
}

[dir="rtl"] code,
[dir="rtl"] pre,
[dir="rtl"] kbd,
[dir="rtl"] samp,
[dir="rtl"] .code-box,
[dir="rtl"] .code-box pre,
[dir="rtl"] .code-box code,
[dir="rtl"] .code-header,
[dir="rtl"] .lesson-article-body pre,
[dir="rtl"] .lesson-article-body code,
[dir="rtl"] .slide-body pre,
[dir="rtl"] .slide-body code,
[dir="rtl"] .practice-code-wrapper,
[dir="rtl"] .practice-code-wrapper pre,
[dir="rtl"] .practice-code-wrapper code,
[dir="rtl"] .hero-code-box,
[dir="rtl"] .hero-code-pre,
[dir="rtl"] .playground-textarea,
[dir="rtl"] .console-output,
[dir="rtl"] .hljs,
[dir="rtl"] [class*="language-"],
[dir="rtl"] [class*="lang-"] {
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: isolate !important;
}












/* ==========================================================================
   Slide Deck Viewer
   ========================================================================== */
.slide-viewer { margin-bottom: 2rem; border: 1px solid var(--border-color); border-radius: var(--radius-lg); background: var(--bg-card); overflow: hidden; }
.slide-viewer-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--border-color); flex-wrap: wrap; }
.slide-pdf-frame { display: block; width: 100%; height: 560px; border: none; background: var(--secondary-darker); }
.slide-canvas { width: 100%; height: auto; display: block; direction: ltr !important; unicode-bidi: isolate; }
.slide-loading, .slide-error { min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.slide-stage { position: relative; width: 100%; min-height: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; background: #111; color: var(--text-inverse); text-align: center; overflow: hidden; }
.slide-stage:fullscreen { padding: 0; }
.slide-image { width: 100%; height: auto; display: block; }
.slide-image + .slide-text { margin-top: 1.25rem; }
.slide-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 1rem; color: #fff; }
.slide-body { font-size: 1.05rem; line-height: 1.7; color: #E2E8F0; text-align: left; max-width: 720px; }
.slide-body ul, .slide-body ol { padding-left: 1.4rem; margin: 0.5rem 0; }
.slide-body code { background: rgba(255, 255, 255, 0.12); padding: 0.1rem 0.4rem; border-radius: 4px; font-family: var(--font-mono); font-size: 0.92em; }
.slide-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(4px); color: #fff; cursor: pointer; font-size: 0.65rem; display: flex; align-items: center; justify-content: center; padding: 0; z-index: 5; opacity: 0.75; transition: all var(--transition-fast); }
.slide-nav-btn:hover:not(:disabled) { opacity: 1; background: var(--primary); border-color: var(--primary); }
.slide-nav-btn:disabled { opacity: 0.15; cursor: default; }
.slide-nav-btn.prev { left: 0.5rem; }
.slide-nav-btn.next { right: 0.5rem; }
[dir="rtl"] .slide-nav-btn.prev { left: 0.5rem; right: auto; }
[dir="rtl"] .slide-nav-btn.next { right: 0.5rem; left: auto; }
.slide-counter { position: absolute; bottom: 0.5rem; right: 0.6rem; font-size: 0.7rem; font-weight: 700; color: rgba(255, 255, 255, 0.85); background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px); padding: 0.15rem 0.45rem; border-radius: var(--radius-compact); z-index: 5; }
[dir="rtl"] .slide-counter { right: auto; left: 0.6rem; }
.slide-notes { padding: 0.85rem 1.25rem; font-size: 0.88rem; color: var(--text-muted); background: var(--bg-subtle); border-top: 1px solid var(--border-color); }
.slide-dots { display: flex; justify-content: center; gap: 0.45rem; padding: 0.8rem; }
.slide-dot { width: 9px; height: 9px; border-radius: 50%; border: none; background: var(--border-color); cursor: pointer; transition: all var(--transition-fast); padding: 0; }
.slide-dot.active { background: var(--primary); transform: scale(1.3); }

/* ==========================================================================
   Exams
   ========================================================================== */
.exam-page { padding-top: 2rem; padding-bottom: 3rem; }
.exam-intro-card { margin-top: 1rem; }
.exam-intro-header { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1.25rem; }
.exam-icon-circle { width: 64px; height: 64px; border-radius: var(--radius-lg); background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; flex-shrink: 0; }
.exam-rules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.exam-rule { display: flex; align-items: center; gap: 0.8rem; padding: 0.9rem 1rem; background: var(--bg-subtle); border-radius: var(--radius-md); font-size: 0.92rem; }
.exam-rule i { font-size: 1.15rem; }
.exam-best-score { padding: 0.8rem 1.1rem; border-radius: var(--radius-md); background: var(--warning-bg); color: var(--warning); font-size: 0.92rem; }
.exam-best-score.passed { background: var(--success-bg); color: var(--success); }
.exam-attempt-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 1rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); flex-wrap: wrap; }
.exam-take-topbar { position: sticky; top: 72px; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 1.25rem; margin-bottom: 1.5rem; background: var(--header-bg); backdrop-filter: blur(8px); border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); flex-wrap: wrap; }
.exam-timer { font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem; color: var(--primary); background: var(--primary-light); padding: 0.4rem 0.9rem; border-radius: var(--radius-md); }
.exam-timer.urgent { color: var(--danger); background: var(--danger-bg); animation: exam-timer-pulse 1s infinite; }
@keyframes exam-timer-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.exam-question-card { margin-bottom: 1.25rem; }
.exam-submit-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); flex-wrap: wrap; }
.exam-result-hero { text-align: center; padding: 2.5rem 1.5rem; margin-top: 1rem; }
.exam-result-hero.passed { border-top: 4px solid var(--success); }
.exam-result-hero.failed { border-top: 4px solid var(--danger); }
.exam-result-score { font-size: 3.2rem; font-weight: 800; font-family: var(--font-mono); margin-bottom: 0.25rem; }
.exam-result-hero.passed .exam-result-score { color: var(--success); }
.exam-result-hero.failed .exam-result-score { color: var(--danger); }
.exam-list-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 1rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); flex-wrap: wrap; }

/* ==========================================================================
   Assignments / Work Submission
   ========================================================================== */
.assignment-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 2rem; }
.assignment-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.assignment-header-icon { width: 52px; height: 52px; border-radius: var(--radius-md); background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.assignment-instructions { font-size: 0.95rem; line-height: 1.65; color: var(--text-main); margin-bottom: 1.25rem; }
.assignment-status-box { padding: 1rem 1.15rem; border-radius: var(--radius-md); margin-bottom: 1.25rem; font-size: 0.92rem; border: 1px solid var(--border-color); }
.assignment-status-box.status-submitted { background: var(--info-bg); border-color: var(--primary-alpha20); }
.assignment-status-box.status-graded { background: var(--success-bg); border-color: rgba(16, 185, 129, 0.25); }
.assignment-status-box.status-returned { background: var(--warning-bg); border-color: rgba(245, 158, 11, 0.25); }
.assignment-grade { margin-top: 0.5rem; font-size: 1rem; }
.assignment-feedback { margin-top: 0.5rem; font-size: 0.9rem; line-height: 1.55; }
.assignment-errors { padding: 0.8rem 1rem; border-radius: var(--radius-md); background: var(--danger-bg); color: var(--danger); font-size: 0.9rem; margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.file-drop-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; padding: 1.6rem 1rem; border: 2px dashed var(--border-color); border-radius: var(--radius-md); background: var(--bg-subtle); cursor: pointer; text-align: center; font-size: 0.92rem; color: var(--text-muted); transition: all var(--transition-fast); }
.file-drop-zone:hover { border-color: var(--primary); background: var(--primary-tint); }
.file-drop-zone input[type="file"] { display: none; }
.file-drop-zone i { font-size: 1.5rem; color: var(--primary); }

/* Small utilities used by the exam & assignment views */
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.ml-sm { margin-left: 0.5rem; }
.d-inline { display: inline; }

/* ==========================================================================
   Lesson Page-Builder Blocks
   ========================================================================== */
.lesson-blocks { display: flex; flex-direction: column; gap: 1.75rem; margin-bottom: 2rem; }
.lesson-blocks .lesson-article-body, .lesson-blocks .video-responsive-wrapper, .lesson-blocks .key-takeaways-card, .lesson-blocks .slide-viewer { margin-bottom: 0; }
.block-section { display: flex; flex-direction: column; gap: 0.6rem; }
.block-heading { font-size: 1.05rem; font-weight: 700; color: var(--text-heading); }
.block-image { margin: 0; text-align: center; }
.block-image img { max-width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.block-image figcaption { margin-top: 0.55rem; font-size: 0.82rem; color: var(--text-muted); }
.block-callout { display: flex; gap: 0.9rem; padding: 1.1rem 1.25rem; border-radius: var(--radius-md); font-size: 0.95rem; line-height: 1.6; border: 1px solid; }
.block-callout > i { font-size: 1.15rem; margin-top: 0.15rem; }
.callout-info { background: var(--info-bg); border-color: var(--primary-alpha20); color: var(--text-main); }
.callout-info > i { color: var(--info); }
.callout-success { background: var(--success-bg); border-color: rgba(16, 185, 129, 0.3); color: var(--text-main); }
.callout-success > i { color: var(--success); }
.callout-warning { background: var(--warning-bg); border-color: rgba(245, 158, 11, 0.3); color: var(--text-main); }
.callout-warning > i { color: var(--warning); }
.callout-danger { background: var(--danger-bg); border-color: rgba(239, 68, 68, 0.3); color: var(--text-main); }
.callout-danger > i { color: var(--danger); }
.block-quote { margin: 0; padding: 1.1rem 1.5rem; border-left: 4px solid var(--primary); background: var(--bg-subtle); border-radius: 0 var(--radius-md) var(--radius-md) 0; font-size: 1.05rem; font-style: italic; line-height: 1.65; color: var(--text-main); }
.block-quote cite { display: block; margin-top: 0.6rem; font-size: 0.85rem; font-style: normal; font-weight: 700; color: var(--text-muted); }
.block-download { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border: 1.5px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-card); text-decoration: none; transition: all var(--transition-fast); }
.block-download:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.block-download-icon { width: 44px; height: 44px; border-radius: var(--radius-md); background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; }
.block-download-text { flex: 1; }
.block-embed-frame { width: 100%; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-subtle); }
.block-divider { border: none; border-top: 2px solid var(--border-color); margin: 0.5rem 0; }


/* ==========================================================================
   Color Lab (/color-lab/)
   A design-token editor drawn over the real Home page. Its chrome is painted
   in literal brand values rather than design tokens: the panel has to stay
   readable no matter how far the palette underneath it is pushed, so it can't
   consume the same variables it edits.
   Brand refs — teal #0ABAB5, charcoal #3C4048, white #FFFFFF, ink #202021.
   ========================================================================== */

.clab-panel {
  --clab-ink: #202021;
  --clab-surface: #2A2C31;
  --clab-raised: #34373D;
  --clab-line: #43464D;
  --clab-teal: #0ABAB5;
  --clab-text: #F1F1F2;
  --clab-dim: #A7A9AD;
  --clab-faint: #73757B;

  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 9000;
  width: 380px;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  background: var(--clab-ink);
  color: var(--clab-text);
  border-left: 1px solid var(--clab-line);
  box-shadow: -18px 0 48px rgba(32, 32, 33, 0.45);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.clab-panel.is-open { transform: none; }
[dir="rtl"] .clab-panel { right: auto; left: 0; border-left: none; border-right: 1px solid var(--clab-line); transform: translateX(-100%); }
[dir="rtl"] .clab-panel.is-open { transform: none; }

.clab-fab {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1.3rem;
  border: none;
  border-radius: var(--radius-compact);
  background: #202021;
  color: #F1F1F2;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(32, 32, 33, 0.4);
}
.clab-fab:hover { background: #2A2C31; }
.clab-fab i { color: #0ABAB5; }

.clab-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.15rem 0.9rem;
  border-bottom: 1px solid var(--clab-line);
}
.clab-title { margin: 0; font-size: 0.98rem; font-weight: 800; letter-spacing: -0.01em; }
.clab-title i { color: var(--clab-teal); margin-right: 0.35rem; }
.clab-sub { margin: 0.2rem 0 0; font-size: 0.74rem; color: var(--clab-dim); }

.clab-icon-btn {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--clab-line);
  border-radius: 8px;
  background: var(--clab-surface);
  color: var(--clab-dim);
  cursor: pointer;
  transition: background 0.15s ease;
}
.clab-icon-btn:hover { background: var(--clab-raised); color: #fff; }

.clab-tabs { display: flex; gap: 0.35rem; padding: 0.8rem 1.15rem; border-bottom: 1px solid var(--clab-line); }
.clab-tab {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--clab-line);
  border-radius: 8px;
  background: transparent;
  color: var(--clab-dim);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: capitalize;
  cursor: pointer;
}
.clab-tab.is-active { background: var(--clab-teal); border-color: var(--clab-teal); color: #062E2D; }

.clab-body { flex: 1; overflow-y: auto; padding: 0.5rem 1.15rem 1rem; }
.clab-body::-webkit-scrollbar { width: 8px; }
.clab-body::-webkit-scrollbar-thumb { background: var(--clab-line); border-radius: 4px; }

.clab-section { padding: 0.95rem 0; border-bottom: 1px solid #2E3036; }
.clab-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.6rem;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--clab-dim);
}
.clab-source {
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  background: rgba(10, 186, 181, 0.16);
  color: var(--clab-teal);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0;
  text-transform: none;
}
.clab-source-added { background: rgba(167, 169, 173, 0.16); color: var(--clab-dim); }
.clab-hint { margin: 0 0 0.7rem; font-size: 0.72rem; line-height: 1.5; color: var(--clab-faint); }
.clab-hint-tight { margin: 0.5rem 0 0; }

/* --- Brand reference swatches --- */
.clab-brand-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
.clab-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--clab-line);
  border-radius: 9px;
  background: var(--clab-surface);
  color: var(--clab-text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.clab-brand:hover { border-color: var(--clab-faint); }
.clab-brand.is-active { border-color: var(--clab-teal); }
.clab-brand-chip { width: 22px; height: 22px; flex-shrink: 0; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.14); }
.clab-brand-name { flex: 1; font-size: 0.74rem; font-weight: 700; }
.clab-brand-hex { display: block; font-family: var(--font-mono); font-size: 0.6rem; color: var(--clab-faint); }

/* --- Accent + ramps --- */
.clab-primary-row { display: flex; align-items: center; gap: 0.5rem; }
.clab-primary-swatch {
  width: 52px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--clab-line);
  border-radius: 10px;
  background: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.clab-primary-swatch::-webkit-color-swatch-wrapper { padding: 2px; }
.clab-primary-swatch::-webkit-color-swatch { border: none; border-radius: 7px; }

.clab-ramp { margin-top: 0.8rem; }
.clab-ramp-label { display: block; margin-bottom: 0.25rem; font-size: 0.68rem; font-weight: 700; color: var(--clab-dim); }
.clab-ramp-strip { display: flex; border-radius: 7px; overflow: hidden; border: 1px solid var(--clab-line); }
.clab-ramp-step {
  flex: 1;
  height: 26px;
  border: none;
  padding: 0;
  cursor: pointer;
  position: relative;
}
.clab-ramp-step:hover { outline: 2px solid var(--clab-text); outline-offset: -2px; z-index: 1; }
.clab-ramp-step.is-active { outline: 2px solid var(--clab-teal); outline-offset: -2px; z-index: 2; }

/* --- Status --- */
.clab-status-row { display: flex; gap: 0.4rem; }
.clab-status {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.4rem;
  border: 1px solid var(--clab-line);
  border-radius: 8px;
  background: var(--clab-surface);
  color: var(--clab-text);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}
.clab-status:hover { border-color: var(--clab-faint); }
.clab-status.is-active { border-color: var(--clab-teal); }
.clab-status-chip { width: 12px; height: 12px; border-radius: 50%; }

.clab-check { display: flex; gap: 0.55rem; margin-top: 0.85rem; cursor: pointer; }
.clab-check input { margin-top: 0.15rem; accent-color: var(--clab-teal); }
.clab-check span { font-size: 0.78rem; font-weight: 600; }
.clab-check em { display: block; margin-top: 0.15rem; font-size: 0.71rem; font-style: normal; font-weight: 400; line-height: 1.45; color: var(--clab-faint); }

.clab-hex {
  width: 92px;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--clab-line);
  border-radius: 8px;
  background: #191A1C;
  color: var(--clab-text);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
}
.clab-hex:focus { outline: none; border-color: var(--clab-teal); }
.clab-hex-lg { flex: 1; height: 42px; font-size: 0.85rem; letter-spacing: 0.04em; }

/* --- Global knobs --- */
.clab-knob { display: block; margin-bottom: 0.7rem; }
.clab-knob-label { display: flex; align-items: center; justify-content: space-between; font-size: 0.75rem; font-weight: 600; margin-bottom: 0.25rem; }
.clab-knob-value {
  border: 1px solid var(--clab-line);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  background: #191A1C;
  color: var(--clab-dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  cursor: pointer;
}
.clab-knob-value:hover { color: var(--clab-teal); border-color: var(--clab-teal); }
.clab-knob input[type="range"] { width: 100%; accent-color: var(--clab-teal); }

/* --- Contrast --- */
.clab-contrast { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.clab-contrast li { display: flex; align-items: center; gap: 0.55rem; }
.clab-contrast-chip {
  width: 30px;
  height: 26px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--clab-line);
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
}
.clab-contrast-label { flex: 1; font-size: 0.74rem; color: var(--clab-text); }
.clab-grade { font-family: var(--font-mono); font-size: 0.68rem; font-weight: 700; padding: 0.15rem 0.4rem; border-radius: 5px; }
.clab-grade-AAA { background: rgba(41, 243, 149, 0.16); color: #29F395; }
.clab-grade-AA { background: rgba(10, 186, 181, 0.18); color: #12D9D3; }
.clab-grade-AAlg { background: rgba(245, 184, 78, 0.16); color: #F5B84E; }
.clab-grade-fail { background: rgba(230, 109, 101, 0.16); color: #E66D65; }

/* --- Token groups --- */
.clab-group { border-bottom: 1px solid #2E3036; }
.clab-group > summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 0;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.clab-group > summary::-webkit-details-marker { display: none; }
.clab-group > summary::before {
  content: "\f105";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: var(--clab-faint);
  transition: transform 0.2s ease;
}
.clab-group[open] > summary::before { transform: rotate(90deg); }
.clab-group-name { flex-shrink: 0; }
.clab-swatch-strip { display: flex; flex: 1; gap: 2px; justify-content: flex-end; }
.clab-swatch-strip i { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.12); }
.clab-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--clab-teal); flex-shrink: 0; }

/* --- Token rows --- */
.clab-row { padding: 0.3rem 0; }
.clab-row.is-picking { background: #26282C; border-radius: 10px; padding: 0.4rem; margin: 0.1rem -0.4rem; }
.clab-row-head { display: flex; align-items: center; gap: 0.5rem; }
.clab-swatch-btn {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid var(--clab-line);
  border-radius: 8px;
  cursor: pointer;
}
.clab-swatch-btn:hover { border-color: var(--clab-text); }
.clab-row-main { flex: 1; min-width: 0; }
.clab-row-label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--clab-text); }
.clab-row-token { display: block; font-family: var(--font-mono); font-size: 0.65rem; color: var(--clab-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clab-row.is-changed .clab-row-label { color: var(--clab-teal); }
.clab-derived { margin-left: 0.3rem; font-size: 0.6rem; color: var(--clab-faint); }
.clab-offpalette { margin-left: 0.3rem; font-size: 0.62rem; color: #F5B84E; }
.clab-row .clab-hex { width: 84px; }

.clab-alpha-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0 0 38px; }
.clab-alpha-row span { flex-shrink: 0; font-size: 0.66rem; color: var(--clab-faint); }
.clab-alpha-row input { flex: 1; accent-color: var(--clab-teal); }

.clab-revert {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--clab-faint);
  font-size: 0.68rem;
  cursor: pointer;
}
.clab-revert:hover:not(:disabled) { background: var(--clab-raised); color: #E66D65; }
.clab-revert:disabled { opacity: 0.25; cursor: default; }

/* --- Brand palette picker --- */
.clab-picker { margin-top: 0.6rem; padding-top: 0.5rem; border-top: 1px solid var(--clab-line); }
.clab-picker-group { margin-bottom: 0.5rem; }
.clab-picker-label { display: block; margin-bottom: 0.25rem; font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--clab-faint); }
.clab-picker-grid { display: flex; flex-wrap: wrap; gap: 3px; }
.clab-picker-cell {
  width: 26px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  padding: 0;
  cursor: pointer;
}
.clab-picker-cell:hover { outline: 2px solid var(--clab-text); outline-offset: 1px; }
.clab-picker-cell.is-active { outline: 2px solid var(--clab-teal); outline-offset: 1px; }
.clab-picker-custom { display: flex; align-items: center; gap: 0.5rem; font-size: 0.68rem; color: var(--clab-faint); cursor: pointer; }
.clab-picker-custom input {
  width: 34px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--clab-line);
  border-radius: 6px;
  background: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.clab-picker-custom input::-webkit-color-swatch-wrapper { padding: 2px; }
.clab-picker-custom input::-webkit-color-swatch { border: none; border-radius: 4px; }

/* --- Footer --- */
.clab-foot { padding: 0.85rem 1.15rem; border-top: 1px solid var(--clab-line); background: #1A1B1D; }
.clab-foot-row { display: flex; gap: 0.4rem; margin-bottom: 0.4rem; }
.clab-foot-row:last-of-type { margin-bottom: 0; }
.clab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--clab-line);
  border-radius: 8px;
  background: var(--clab-surface);
  color: var(--clab-text);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}
.clab-btn:hover { background: var(--clab-raised); color: #fff; }
.clab-btn-primary { flex: 1; background: var(--clab-teal); border-color: var(--clab-teal); color: #062E2D; }
.clab-btn-primary:hover { background: #12D9D3; color: #062E2D; }
.clab-btn-ghost { flex: 1; background: transparent; color: var(--clab-dim); font-weight: 600; }
.clab-btn-wide { width: 100%; margin-top: 0.75rem; }

.clab-css {
  width: 100%;
  height: 170px;
  margin-top: 0.6rem;
  padding: 0.6rem;
  border: 1px solid var(--clab-line);
  border-radius: 8px;
  background: #131415;
  color: #7FE3DF;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.5;
  resize: vertical;
}

@media (max-width: 640px) {
  .clab-panel { width: 100%; }
  .clab-row .clab-hex { width: 76px; }
}

/* Palette / Components view switch */
.clab-views { display: flex; gap: 0.35rem; padding: 0.7rem 1.15rem; border-bottom: 1px solid var(--clab-line); }
.clab-view {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.42rem;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--clab-faint);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}
.clab-view:hover { color: var(--clab-text); }
.clab-view.is-active { background: #34373D; color: #fff; }
.clab-count {
  min-width: 17px;
  padding: 0 0.28rem;
  border-radius: var(--radius-compact);
  background: var(--clab-teal);
  color: #062E2D;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1.35;
}
.clab-group-icon { width: 15px; flex-shrink: 0; font-size: 0.72rem; color: var(--clab-faint); text-align: center; }
.clab-hint-lead { margin: 0.9rem 0 0.2rem; }

/* ================================================
   Course Builder (staff authoring UI)
   ================================================ */
.builder-header { gap: 1.5rem; flex-wrap: wrap; }

.builder-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.builder-sidebar {
  padding: 1rem;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.builder-sidebar-title {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.5rem 0.6rem;
}

.builder-course-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.6rem 0.65rem;
  margin-bottom: 0.35rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  font-family: inherit;
  text-align: start;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.builder-course-row:hover { background: var(--bg-subtle); }
.builder-course-row.active {
  background: var(--primary-light);
  border-color: var(--primary);
}
.builder-course-row-body { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.builder-course-row-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.builder-status-dot {
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-light);
}
.builder-status-dot.is-live { background: var(--success); }

.builder-placeholder { padding: 4rem 2rem; text-align: center; }

.builder-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

.builder-publish-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
  cursor: pointer;
}

.builder-module {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--bg-subtle);
}
.builder-module-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.builder-module-header .form-input { flex: 1; font-weight: 600; }
.builder-module-index {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: var(--text-inverse);
  font-size: 0.8rem;
  font-weight: 700;
}

.builder-lesson-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 70px auto auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0;
}
.builder-lesson-row .form-input { padding-top: 0.5rem; padding-bottom: 0.5rem; font-size: 0.85rem; }
.builder-lesson-index {
  min-width: 34px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}
.builder-duration-input { text-align: center; }

.builder-preview-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-light);
  cursor: pointer;
}
.builder-preview-toggle input { display: none; }
.builder-preview-toggle:has(input:checked) {
  color: var(--success);
  background: var(--success-bg);
}

.builder-row-actions { display: flex; align-items: center; gap: 0.2rem; }

.builder-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.builder-icon-btn:hover { background: var(--bg-card); color: var(--text-main); }
.builder-icon-btn:disabled { opacity: 0.35; cursor: default; }
.builder-icon-btn:disabled:hover { background: transparent; color: var(--text-muted); }
.builder-icon-btn-danger:hover { background: var(--danger-bg); color: var(--danger); }

.builder-add-lesson { margin-top: 0.5rem; }
.builder-add-module { width: 100%; border-style: dashed; }

.builder-savebar {
  position: sticky;
  bottom: 1rem;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.25rem;
  box-shadow: var(--shadow-lg);
}

.builder-flash-ok { color: var(--success); }

.builder-btn-danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}
.builder-btn-danger:hover { background: var(--danger-bg); }

@media (max-width: 900px) {
  .builder-layout { grid-template-columns: 1fr; }
  .builder-sidebar { position: static; max-height: none; }
  .builder-meta-grid { grid-template-columns: 1fr; }
  .builder-lesson-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-auto-flow: dense;
  }
  .builder-duration-input { grid-column: 2; }
}

/* ---- Builder: lesson content / quiz / exam editors ---- */
.builder-lesson-flags {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--primary);
  min-width: 20px;
  justify-content: center;
}

.builder-content-btn { white-space: nowrap; }

.builder-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.builder-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-compact);
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.builder-tab:hover { color: var(--text-main); }
.builder-tab.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}
.builder-tab-count {
  min-width: 18px;
  padding: 0 0.3rem;
  border-radius: var(--radius-compact);
  background: var(--primary);
  color: var(--text-inverse);
  font-size: 0.68rem;
  line-height: 1.5;
  text-align: center;
}

.builder-block-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.85rem;
  background: var(--bg-subtle);
}
.builder-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.builder-block-type {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-compact);
}
.builder-block-card .form-input { background: var(--input-bg); }

.builder-mono { font-family: var(--font-mono); font-size: 0.82rem; }

.builder-add-block-row { margin-top: 0.5rem; }
.builder-add-block-select { max-width: 280px; }

.builder-choice-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.builder-choice-row .form-input {
  flex: 1;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
  font-size: 0.85rem;
}
.builder-choice-row input[type='radio'] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--success);
  cursor: pointer;
}

.builder-file-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.builder-file-btn { cursor: pointer; margin-bottom: 0; }
.builder-file-name {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-main);
}
.builder-file-name a { color: var(--primary); }

.builder-enable-box { text-align: center; padding: 1.5rem 1rem; }

.builder-exam-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
.builder-exam-published { flex-shrink: 0; margin: 0 0.25rem; white-space: nowrap; }
.builder-exam-q-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

@media (max-width: 900px) {
  .builder-exam-meta { grid-template-columns: 1fr 1fr; }
}

/* ---- Builder: reusable module library ---- */
.builder-shared-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-compact);
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.builder-library-panel {
  margin-top: 0.85rem;
  padding: 1rem;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
}
.builder-library-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
}
.builder-library-row:hover { background: var(--bg-card); }
.builder-library-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.builder-add-row { flex-wrap: wrap; }
.builder-add-row .builder-add-module { flex: 1; width: auto; }

/* Nested cards (slides/questions) inside a unified lesson editor card */
.builder-nested-card {
  background: var(--bg-card);
  margin-top: 0.6rem;
}

/* Shared (locked) library items in the builder */
.builder-input-locked {
  background: var(--bg-subtle) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed;
}
.builder-content-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}


/* ==========================================================================
   Landing page (UX handoff)
   Hero art stack, feature / category / step cards, section headers.
   ========================================================================== */
.section-head { text-align: center; max-width: 640px; margin: 0 auto 2.25rem; }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.2rem); font-weight: 800; margin-bottom: 0.5rem; }
.section-head p { color: var(--text-muted); font-size: 1.05rem; line-height: 1.6; }
.section-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.section-head-row h2 { font-size: clamp(1.7rem, 3.4vw, 2.2rem); font-weight: 800; margin-bottom: 0.35rem; }
.section-head-row p { color: var(--text-muted); font-size: 1.05rem; }
.section-link { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; color: var(--primary); font-size: 0.95rem; white-space: nowrap; }
.section-link:hover { color: var(--primary-hover); }

.landing-section { padding: 4.5rem 0; background: var(--c-body-bg); }
.landing-section-tight { padding: 3.5rem 0; }

/* Hero art: three staggered product cards + a floating icon tile */
.hero-art { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 1.1rem; padding-inline-end: 2rem; }
.hero-art-card { background: var(--bg-card); border-radius: 20px; box-shadow: var(--shadow-xl); border: 1px solid var(--border-subtle); }
.hero-art-course { position: relative; width: min(100%, 320px); padding: 1.25rem 1.4rem 1.3rem; }
.hero-art-course .brand-badge { margin-bottom: 0.7rem; }
.hero-art-course-title { font-size: 1.1rem; font-weight: 800; color: var(--text-heading); margin-bottom: 0.8rem; line-height: 1.3; }
.hero-art-course-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; font-size: 0.82rem; color: var(--text-muted); margin-top: 0.55rem; }
.hero-art-float { position: absolute; top: 18px; inset-inline-end: -26px; width: 56px; height: 56px; border-radius: 16px; background: var(--bg-card); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; box-shadow: var(--shadow-lg); border: 1px solid var(--border-subtle); }
.hero-art-lesson { width: min(100%, 300px); margin-inline-start: 2rem; background: var(--c-herocard-bg); color: var(--c-herocard-text); border-radius: 20px; padding: 1.1rem 1.25rem 1.15rem; box-shadow: 0 20px 50px rgba(37, 42, 50, 0.25); }
.hero-art-lesson-row { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 0.9rem; }
.hero-art-play { width: 40px; height: 40px; border-radius: 12px; background: var(--primary); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; flex-shrink: 0; }
.hero-art-lesson-title { font-size: 1rem; font-weight: 800; line-height: 1.25; }
.hero-art-lesson-sub { font-size: 0.8rem; color: rgba(255, 255, 255, 0.65); margin-top: 0.15rem; }
.hero-art-lesson .progress-bar-container { background: rgba(255, 255, 255, 0.15); height: 5px; }
.hero-art-stat { width: min(100%, 160px); margin-inline-start: 4rem; padding: 1.1rem 1.25rem; text-align: center; }
.hero-art-stat-value { font-size: 1.9rem; font-weight: 800; color: var(--primary); line-height: 1.1; }
.hero-art-stat-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.3rem; font-weight: 600; }
.hero-cta .btn i { font-size: 0.85em; }

/* Feature cards */
.feature-card { padding: 1.5rem 1.5rem 1.6rem; }

/* Category cards */
.cat-card { display: flex; flex-direction: column; gap: 0.15rem; padding: 1.4rem 1.5rem; color: inherit; }
.cat-card-icon { width: 46px; height: 46px; border-radius: 13px; background: var(--bg-subtle); color: var(--text-heading); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; margin-bottom: 1.1rem; transition: background var(--transition-fast), color var(--transition-fast); }
.cat-card:hover .cat-card-icon { background: var(--primary-light); color: var(--primary); }
.cat-card-name { font-size: 1.1rem; font-weight: 800; color: var(--text-heading); }
.cat-card-count { font-size: 0.88rem; color: var(--text-muted); }

/* Roadmap cards on the landing page */
.roadmap-card-flex { display: flex; flex-direction: column; justify-content: space-between; }
.roadmap-view-link { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--primary); font-weight: 700; }

/* "How it works" steps */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; text-align: center; max-width: 960px; margin: 0 auto; }
.step-num { width: 60px; height: 60px; border-radius: 18px; background: var(--secondary); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; font-weight: 800; margin: 0 auto 1.1rem; font-variant-numeric: tabular-nums; }
[data-theme="dark"] .step-num { background: var(--primary); }
.step-title { font-size: 1.1rem; font-weight: 800; color: var(--text-heading); margin-bottom: 0.35rem; }
.step-desc { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; }

/* Reveal-on-scroll (mirrors the handoff's om-reveal) */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

@media (max-width: 1024px) {
  .hero-art { align-items: center; padding-inline-end: 0; }
  .hero-art-lesson, .hero-art-stat { margin-inline-start: 0; }
  .hero-content h1, .hero-desc { margin-left: auto; margin-right: auto; }
}

@media (max-width: 768px) {
  .steps-grid { grid-template-columns: 1fr; gap: 2rem; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .landing-section { padding: 3.25rem 0; }
  .hero-section { padding: 3rem 0 3.5rem; }
  .hero-art-float { inset-inline-end: 0; }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
}

/* Directional icons mirror in RTL */
[dir="rtl"] .rtl-flip { transform: scaleX(-1); }
.text-slate-dark { color: var(--text-main) !important; }

/* ==========================================================================
   Privacy Policy — collapsible clauses (after tuwaiq.edu.sa/privacy)
   ========================================================================== */
.privacy-doc-wrapper {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 60vh;
  padding: 3rem 0 4.5rem;
}

.privacy-doc-meta-line {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 1.25rem;
}

.privacy-acc-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.privacy-acc-item:hover,
.privacy-acc-item.open {
  border-color: var(--border-strong);
}

.privacy-acc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.35rem 0;
  border: none;
  background: transparent;
  color: var(--text-heading);
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: start;
  cursor: pointer;
}

.privacy-acc-chevron {
  flex-shrink: 0;
  font-size: 1rem;
  color: var(--text-muted);
  transition: transform var(--transition-base);
}

.privacy-acc-item.open .privacy-acc-chevron {
  transform: rotate(180deg);
}

.privacy-acc-body {
  margin-top: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--text-main);
}

.privacy-arabic-content .privacy-acc-body {
  font-family: var(--font-arabic);
  font-size: 1.06rem;
  line-height: 2;
}

.privacy-acc-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 1.25rem 0 0.5rem;
}

.privacy-acc-body h3:first-child {
  margin-top: 0;
}

.privacy-acc-body p {
  margin-bottom: 1rem;
}

.privacy-acc-body p:last-child {
  margin-bottom: 0;
}

.privacy-acc-body ul,
.privacy-acc-body ol {
  margin: 0.75rem 0 1.25rem;
  padding-inline-start: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.privacy-acc-body li {
  line-height: 1.8;
}

.privacy-acc-body a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.privacy-acc-body a:hover {
  color: var(--primary-hover);
}

@media (max-width: 768px) {
  .privacy-doc-wrapper {
    padding: 2rem 0 3rem;
  }
  .privacy-acc-head {
    font-size: 1.05rem;
  }
}

/* ==========================================================================
   Cookie Permissions Request (Bottom Banner & Preferences Modal)
   ========================================================================== */
.cookie-consent-wrapper {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9995;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 1.25rem 1.5rem;
  pointer-events: none;
}

.cookie-consent-card {
  pointer-events: auto;
  width: 100%;
  max-width: 1060px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 1.25rem 1.75rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-sizing: border-box;
}

.cookie-consent-card.cookie-slide-up {
  animation: cookieSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.cookie-consent-card.cookie-slide-down {
  animation: cookieSlideDown 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cookieSlideUp {
  0% {
    opacity: 0;
    transform: translateY(120%);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cookieSlideDown {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(120%);
  }
}

/* Main Consent Banner */
.cookie-main-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  justify-content: space-between;
}

.cookie-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.cookie-info {
  flex: 1;
  min-width: 0;
}

.cookie-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.3rem;
}

.cookie-description {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.cookie-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}

.cookie-link:hover {
  color: var(--primary-hover);
}

.cookie-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.cookie-action-btn {
  white-space: nowrap;
}

/* Preferences Dialog */
.cookie-pref-modal {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cookie-pref-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.cookie-pref-header-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.cookie-pref-icon {
  color: var(--primary);
  font-size: 1.25rem;
}

.cookie-close-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.cookie-close-btn:hover {
  color: var(--text-heading);
  background-color: var(--bg-subtle);
}

.cookie-pref-intro {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.cookie-categories-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: 48vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.cookie-cat-item {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cookie-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-cat-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.cookie-cat-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-heading);
}

.cookie-pointer {
  cursor: pointer;
  user-select: none;
}

.cookie-badge-locked {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-compact);
  font-size: 0.72rem;
  font-weight: 700;
  background-color: var(--primary-light);
  color: var(--teal-ink);
}

.cookie-cat-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

/* Custom CSS Switch */
.cookie-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.cookie-switch-input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cookie-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--input-border);
  transition: var(--transition-base);
  border-radius: var(--radius-compact);
}

.cookie-switch-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #FFFFFF;
  transition: var(--transition-base);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cookie-switch-input:checked + .cookie-switch-slider {
  background-color: var(--primary);
}

.cookie-switch-input:checked + .cookie-switch-slider::before {
  transform: translateX(20px);
}

.cookie-toggle-locked {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  opacity: 0.75;
}

.cookie-switch-slider.disabled {
  background-color: var(--primary);
  cursor: not-allowed;
}

.cookie-switch-slider.disabled::before {
  transform: translateX(20px);
}

.cookie-pref-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.cookie-pref-footer-end {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}

/* Footer link button */
.footer-link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-align: inherit;
  color: var(--c-footer-link);
  transition: color var(--transition-fast);
}

.footer-link-btn:hover {
  color: var(--c-footer-link-hover);
}

/* RTL Support */
[dir="rtl"] .cookie-consent-card {
  text-align: right;
}

[dir="rtl"] .cookie-switch-slider::before {
  left: auto;
  right: 3px;
}

[dir="rtl"] .cookie-switch-input:checked + .cookie-switch-slider::before {
  transform: translateX(-20px);
}

[dir="rtl"] .cookie-switch-slider.disabled::before {
  transform: translateX(-20px);
}

[dir="rtl"] .cookie-pref-footer-end {
  margin-left: 0;
  margin-right: auto;
}

/* Responsive Media Queries */
@media (max-width: 860px) {
  .cookie-consent-wrapper {
    padding: 0.75rem;
  }

  .cookie-main-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .cookie-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .cookie-action-btn {
    flex: 1;
    min-width: 110px;
  }

  .cookie-pref-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-pref-footer-end {
    width: 100%;
    margin: 0;
    justify-content: stretch;
  }

  .cookie-pref-footer-end .cookie-action-btn {
    flex: 1;
  }
}

/* --- Standalone Error Pages (404 / 500) --- */
.error-page-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.error-page-card {
  max-width: 540px;
  margin: 0 auto;
}

.error-page-icon {
  font-size: 4rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.error-page-icon-danger {
  font-size: 4rem;
  color: var(--danger, #EF4444);
  margin-bottom: 1rem;
}

.error-badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger, #EF4444);
}

.error-page-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Generated avatars (Multiavatar). The sizing classes above keep their box;
   these rules just swap the teal initial for the SVG. */
.avatar { display: inline-flex; align-items: center; justify-content: center; overflow: hidden; background: var(--bg-subtle); color: transparent; padding: 0; flex-shrink: 0; }
.avatar svg { width: 100%; height: 100%; display: block; }
.avatar-picker { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1.75rem; }
.avatar-picker-compact { margin-bottom: 0; }
.avatar-picker-preview { position: relative; display: inline-flex; flex-shrink: 0; }
.avatar-picker-btn { position: absolute; bottom: -6px; inset-inline-end: -6px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--bg-card); background: var(--primary); color: #FFFFFF; font-size: 0.72rem; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform var(--transition-fast), background var(--transition-fast); }
.avatar-picker-btn:hover { background: var(--primary-hover); transform: rotate(45deg); }
.avatar-picker-btn:disabled { cursor: wait; opacity: 0.7; transform: none; }
.avatar-picker-btn.is-busy i { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Profile page — Figma frame 6: identity card, dark overall-progress card,
   stat tiles, list cards, floating dock. */
.profile-head { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 22px; padding: 1.75rem 2rem 1.5rem; box-shadow: var(--shadow-sm); margin-bottom: 1.5rem; }
.profile-head-main { display: flex; align-items: flex-start; gap: 1.25rem; }
.profile-head-avatar { width: 84px; height: 84px; border-radius: 50%; box-shadow: 0 10px 24px rgba(10, 186, 181, 0.25); }
.profile-head-text { flex: 1; min-width: 0; padding-top: 0.15rem; }
.profile-head-name { font-size: 1.6rem; font-weight: 800; color: var(--text-heading); margin: 0 0 0.2rem; line-height: 1.2; }
.profile-head-bio { color: var(--text-main); font-size: 0.9rem; line-height: 1.6; margin: 0; max-width: 60ch; white-space: pre-line; }
.profile-head-goal { color: var(--text-muted); font-size: 0.82rem; font-weight: 600; }
.profile-head-goal i { color: var(--primary); margin-inline-end: 0.3rem; }
.profile-head-bio-row { margin-bottom: 0.35rem; }
.profile-head-goal-row { margin-top: 0.35rem; }

/* Click-to-edit fields */
.inline-edit { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.inline-edit > :first-child { min-width: 0; }
.inline-edit-btn { width: 24px; height: 24px; border-radius: 7px; border: 0; background: transparent; color: var(--text-light); font-size: 0.7rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; opacity: 0; transition: opacity var(--transition-fast), color var(--transition-fast), background var(--transition-fast); }
.inline-edit:hover .inline-edit-btn, .inline-edit-btn:focus-visible { opacity: 1; }
.inline-edit-btn:hover { background: var(--primary-light); color: var(--teal-ink); }
.inline-edit-empty { background: none; border: 0; padding: 0; font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text-light); cursor: pointer; }
.inline-edit-empty:hover { color: var(--primary); }
.inline-edit.is-editing { display: block; margin: 0.15rem 0 0.4rem; }
.inline-edit-fields { display: flex; gap: 0.5rem; flex-wrap: wrap; max-width: 520px; }
.inline-edit-input { flex: 1; min-width: 160px; padding: 0.4rem 0.65rem; border: 1px solid var(--primary); border-radius: 9px; background: var(--c-input-bg); color: var(--c-input-text); font: inherit; font-size: 0.9rem; outline: none; box-shadow: 0 0 0 3px var(--primary-alpha20); }
.inline-edit-textarea { width: 100%; flex-basis: 100%; resize: vertical; line-height: 1.5; }
.inline-edit-select { min-width: 220px; }
@media (hover: none) { .inline-edit-btn { opacity: 1; } }
.profile-head-meta { color: var(--text-muted); font-size: 0.85rem; overflow-wrap: anywhere; }
.profile-links { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.7rem; }
.profile-link-row { display: flex; align-items: center; gap: 0.5rem; min-height: 28px; font-size: 0.85rem; }
.profile-link-icon { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-subtle); color: var(--text-heading); font-size: 0.8rem; flex-shrink: 0; }
.profile-link-text { color: var(--text-heading); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.profile-link-text:hover { color: var(--primary); }
.profile-link-empty { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--text-light); cursor: pointer; }
.profile-link-empty:hover { color: var(--primary); }
.profile-link-edit { width: 24px; height: 24px; border-radius: 7px; border: 0; background: transparent; color: var(--text-light); font-size: 0.7rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; opacity: 0; transition: opacity var(--transition-fast), color var(--transition-fast), background var(--transition-fast); }
.profile-link-row:hover .profile-link-edit, .profile-link-edit:focus-visible { opacity: 1; }
.profile-link-edit:hover { background: var(--primary-light); color: var(--teal-ink); }
.profile-link-input { flex: 1; max-width: 360px; padding: 0.3rem 0.6rem; border: 1px solid var(--primary); border-radius: 8px; background: var(--c-input-bg); color: var(--c-input-text); font-size: 0.85rem; outline: none; box-shadow: 0 0 0 3px var(--primary-alpha20); }
.profile-link-error { margin-top: 0; }
@media (hover: none) { .profile-link-edit { opacity: 1; } }
.profile-head-tools { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
.profile-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.85rem; border-radius: var(--radius-pill); background: var(--bg-subtle); color: var(--text-heading); font-size: 0.8rem; font-weight: 700; }
.profile-chip i { color: var(--primary); }
.profile-chip-link:hover { background: var(--primary-light); }
.profile-level { display: flex; align-items: center; gap: 1.25rem; margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--border-subtle); flex-wrap: wrap; }
.profile-level-label { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.profile-level-badge { padding: 0.3rem 0.7rem; border-radius: var(--radius-pill); background: var(--primary); color: #FFFFFF; font-size: 0.76rem; font-weight: 800; }
.profile-level-name { color: var(--text-heading); font-size: 0.88rem; font-weight: 700; }
.profile-level-bar { flex: 1; min-width: 180px; display: flex; align-items: center; gap: 0.75rem; }
.profile-level-bar .profile-bar { flex: 1; height: 6px; }
.profile-level-xp { color: var(--text-muted); font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.profile-level-streak { flex-shrink: 0; }

.profile-grid { display: grid; grid-template-columns: 2fr 3fr; gap: 1.5rem; align-items: start; }
.profile-col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.profile-section-title { font-size: 1.05rem; font-weight: 800; color: var(--text-heading); margin: 0.75rem 0 0; }

.profile-overall { display: flex; align-items: center; gap: 1.25rem; padding: 1.5rem 1.75rem; border-radius: 22px; background: linear-gradient(180deg, #252A32 0%, #1B1F25 100%); color: #FFFFFF; box-shadow: 0 16px 40px rgba(37, 42, 50, 0.18); }
.profile-overall-title { font-weight: 800; font-size: 1rem; margin-bottom: 0.2rem; }
.profile-overall-sub { color: rgba(255, 255, 255, 0.6); font-size: 0.8rem; }
.profile-ring { --ring: 0%; width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; background: conic-gradient(var(--primary) var(--ring), rgba(255, 255, 255, 0.12) 0); display: grid; place-items: center; }
.profile-ring::before { content: ''; grid-area: 1 / 1; width: 50px; height: 50px; border-radius: 50%; background: #252A32; }
.profile-ring-value { grid-area: 1 / 1; font-size: 0.82rem; font-weight: 800; color: #FFFFFF; }

.profile-course-list { display: flex; flex-direction: column; gap: 0.85rem; }
.profile-course-list-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.profile-course { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1rem 1.15rem; box-shadow: var(--shadow-sm); }
.profile-course-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.6rem; }
.profile-course-title { font-weight: 700; color: var(--text-heading); font-size: 0.95rem; text-decoration: none; }
.profile-course-title:hover { color: var(--primary); }
.profile-course-pct { color: var(--primary); font-weight: 800; font-size: 0.8rem; white-space: nowrap; }
.profile-bar { height: 4px; border-radius: var(--radius-track); background: var(--bg-subtle); overflow: hidden; }
.profile-bar-fill { height: 100%; border-radius: var(--radius-track); background: var(--primary); transition: width var(--transition-smooth); }
.profile-course-foot { display: flex; justify-content: flex-end; margin-top: 0.75rem; }
.profile-course-action { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.85rem; border-radius: var(--radius-compact); background: var(--primary-light); color: var(--teal-ink); font-size: 0.76rem; font-weight: 700; text-decoration: none; transition: background var(--transition-fast); }
.profile-course-action:hover { background: var(--primary-alpha20); color: var(--teal-ink); }
.profile-course-action-done { background: var(--success-bg); color: var(--success); }

.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; }
.profile-stat { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1.1rem 0.75rem; text-align: center; box-shadow: var(--shadow-sm); }
.profile-stat-value { color: var(--primary); font-size: 1.35rem; font-weight: 800; line-height: 1.1; margin-bottom: 0.3rem; }
.profile-stat-label { color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }

.profile-list-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 0.35rem 1.25rem; box-shadow: var(--shadow-sm); }
.profile-list-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem 0; border-bottom: 1px solid var(--border-subtle); }
.profile-list-row:last-child { border-bottom: 0; }
.profile-list-title { font-weight: 700; color: var(--text-heading); font-size: 0.92rem; }
.profile-list-sub { color: var(--text-light); font-size: 0.75rem; }
.profile-list-score { color: var(--primary); font-weight: 800; font-size: 0.85rem; white-space: nowrap; }
.profile-list-score.is-low { color: var(--warning); }
.profile-list-empty { padding: 1rem 0; color: var(--text-muted); font-size: 0.88rem; text-align: center; }
.profile-badges-head { padding-bottom: 0.6rem; }
.profile-badge-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding: 0.6rem 0 0.8rem; }
.profile-badge { width: 36px; height: 36px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-subtle); color: var(--text-light); font-size: 0.95rem; }
.profile-badge.is-earned { background: var(--primary); color: #FFFFFF; box-shadow: 0 6px 14px rgba(10, 186, 181, 0.28); }
.profile-badge-more { margin-inline-start: auto; font-size: 0.78rem; font-weight: 700; color: var(--primary); }

.profile-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.25rem; }
.profile-actions .btn { padding: 0.65rem 1.15rem; font-size: 0.88rem; }
.profile-recommended { margin-top: 2rem; }
.profile-recommended .profile-section-title { margin-bottom: 0.85rem; }

.profile-dock { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 0.25rem; padding: 0.4rem; border-radius: var(--radius-compact); background: rgba(37, 42, 50, 0.96); box-shadow: 0 16px 40px rgba(37, 42, 50, 0.35); backdrop-filter: blur(8px); max-width: calc(100% - 2rem); }
.profile-dock-item { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 0.95rem; border-radius: var(--radius-compact); color: rgba(255, 255, 255, 0.72); font-size: 0.8rem; font-weight: 700; text-decoration: none; white-space: nowrap; transition: background var(--transition-fast), color var(--transition-fast); }
.profile-dock-item:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.08); }
.profile-dock-item.is-active { background: var(--primary); color: #FFFFFF; }
.profile-dock-item i { font-size: 0.8rem; }

@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-head { padding: 1.25rem; }
  .profile-head-main { flex-wrap: wrap; }
  .profile-head-tools { width: 100%; justify-content: flex-start; }
  .profile-dock-item span { display: none; }
  .profile-dock-item { padding: 0.65rem 0.85rem; }
  .profile-dock-item i { font-size: 0.95rem; }
}

/* Custom tooltip (replaces the native title bubble) */
.tt { position: relative; display: inline-flex; }
.tt-bubble { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translate(-50%, 4px); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 0.1rem; width: max-content; max-width: 240px; padding: 0.6rem 0.85rem; border-radius: var(--radius-md); background: #252A32; color: #FFFFFF; font-size: 0.78rem; line-height: 1.35; text-align: center; box-shadow: 0 12px 28px rgba(37, 42, 50, 0.28); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast); }
.tt-bubble::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: #252A32; }
.tt:hover .tt-bubble, .tt:focus-within .tt-bubble { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.tt-label { font-weight: 800; }
.tt-desc { color: rgba(255, 255, 255, 0.8); font-size: 0.74rem; font-weight: 500; white-space: normal; }
.tt-meta { color: var(--primary); font-size: 0.7rem; font-weight: 700; margin-top: 0.15rem; }
.profile-badge { cursor: default; outline: none; }
.profile-badge:focus-visible { box-shadow: 0 0 0 3px var(--primary-alpha20); }

/* Inline profile editor (identity card) */
.profile-edit-toggle { border: 0; cursor: pointer; font-family: inherit; }
.profile-edit { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border-subtle); }
.profile-edit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }
.profile-edit-grid .form-group { margin-bottom: 1rem; }
.profile-edit-wide { grid-column: 1 / -1; }
.profile-edit-actions { display: flex; gap: 0.6rem; }
@media (max-width: 900px) {
  .profile-edit-grid { grid-template-columns: 1fr; }
}
