/* ==========================================================
   INNER CIRCLE — premium dark trading-academy design system
   Dark is the default/primary theme. html[data-theme="light"]
   provides the alternate light palette via the theme toggle.
   ========================================================== */

:root {
  /* accent hues */
  --blue: #22d3ee;
  --blue-dark: #0891b2;
  --green: #16d69a;
  --green-dark: #0ea57a;
  --gold: #e3c069;
  --gold-dark: #c9a227;

  /* surfaces + text */
  --ink: #edf3f1;
  --gray: #93a5ac;
  --gray-light: #5c6d75;
  --border: rgba(158, 179, 189, 0.14);
  --border-strong: rgba(178, 199, 209, 0.26);
  --bg: #070d11;
  --bg-elevated: #0c151b;
  --card: #101a22;
  --card-2: #16222b;
  --contrast: #04070a;

  /* geometry */
  --radius: 16px;
  --radius-sm: 11px;

  /* shadows */
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 1px 1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 60px -16px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.03);
  --shadow-glow: 0 0 0 1px rgba(22, 214, 154, 0.16), 0 10px 34px rgba(22, 214, 154, 0.10);

  /* semantic tints (dark-mode default) */
  --success-bg: rgba(22, 214, 154, 0.12);
  --success-fg: #6ee7b7;
  --success-border: rgba(22, 214, 154, 0.32);
  --danger-bg: rgba(248, 113, 113, 0.12);
  --danger-fg: #fca5a5;
  --danger-border: rgba(248, 113, 113, 0.32);
  --accent-soft-bg: rgba(34, 211, 238, 0.12);
  --accent-soft-fg: #67e8f9;

  --tag-read-bg: rgba(34, 211, 238, 0.12);
  --tag-read-fg: #67e8f9;
  --tag-action-bg: rgba(22, 214, 154, 0.12);
  --tag-action-fg: #6ee7b7;
  --tag-exercise-bg: rgba(245, 158, 11, 0.14);
  --tag-exercise-fg: #fcd34d;
  --tag-quiz-bg: rgba(217, 70, 239, 0.14);
  --tag-quiz-fg: #f0abfc;
  --tag-community-bg: rgba(14, 165, 233, 0.14);
  --tag-community-fg: #7dd3fc;
  --tag-milestone-bg: rgba(227, 192, 105, 0.16);
  --tag-milestone-fg: var(--gold);

  --badge-bg: rgba(227, 192, 105, 0.14);
  --badge-fg: var(--gold);

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', 'Georgia', 'Times New Roman', serif;
}

html[data-theme="light"] {
  --blue: #0891b2;
  --blue-dark: #0e7490;
  --green: #0ea56f;
  --green-dark: #0b8a5c;
  --gold: #b8860b;
  --gold-dark: #96690a;

  --ink: #0f1c1a;
  --gray: #5b6b6a;
  --gray-light: #93a3a1;
  --border: #e2e8e6;
  --border-strong: #c7d1cf;
  --bg: #f6f9f8;
  --bg-elevated: #ffffff;
  --card: #ffffff;
  --card-2: #f2f6f5;

  --shadow: 0 1px 3px rgba(15, 28, 26, 0.06), 0 1px 2px rgba(15, 28, 26, 0.04);
  --shadow-lg: 0 10px 30px rgba(15, 28, 26, 0.08);
  --shadow-glow: 0 0 0 1px rgba(14, 165, 111, 0.14), 0 8px 24px rgba(14, 165, 111, 0.08);

  --success-bg: #eafbf3;
  --success-fg: #0b8a5c;
  --success-border: #bdeed6;
  --danger-bg: #fef2f2;
  --danger-fg: #b91c1c;
  --danger-border: #fecaca;
  --accent-soft-bg: #e5f6fb;
  --accent-soft-fg: #0e7490;

  --tag-read-bg: #e5f6fb;
  --tag-read-fg: #0e7490;
  --tag-action-bg: #eafbf3;
  --tag-action-fg: #0b8a5c;
  --tag-exercise-bg: #fef3c7;
  --tag-exercise-fg: #b45309;
  --tag-quiz-bg: #fae8ff;
  --tag-quiz-fg: #a21caf;
  --tag-community-bg: #e0f2fe;
  --tag-community-fg: #0369a1;
  --tag-milestone-bg: #fdf1d9;
  --tag-milestone-fg: #96690a;

  --badge-bg: #fdf1d9;
  --badge-fg: #96690a;
}

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

html { transition: background 0.2s ease; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 0%, rgba(22, 214, 154, 0.07), transparent 45%),
    radial-gradient(circle at 88% 8%, rgba(34, 211, 238, 0.06), transparent 40%);
  background-attachment: fixed;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

html[data-theme="light"] body { background-image: none; }

h1, h2, h3 { font-family: var(--font-display); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-size: 16px;
  color: var(--ink);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.theme-toggle:hover { border-color: var(--border-strong); transform: translateY(-1px); }

a { text-decoration: none; color: inherit; }

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

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 13, 17, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

html[data-theme="light"] .nav { background: rgba(246, 249, 248, 0.86); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.logo-mark {
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(22, 214, 154, 0.25));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray);
}

.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--green); }

.mobile-menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: #04141a;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.06); }

.btn-outline {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-strong);
  color: var(--ink);
}
.btn-outline:hover { border-color: var(--green); color: var(--green); }

.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: 12px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 104px 0 84px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 680px;
  background:
    radial-gradient(circle at 18% 30%, rgba(22, 214, 154, 0.14), transparent 55%),
    radial-gradient(circle at 82% 15%, rgba(34, 211, 238, 0.12), transparent 50%),
    linear-gradient(rgba(237, 243, 241, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(237, 243, 241, 0.045) 1px, transparent 1px);
  background-size: auto, auto, 42px 42px, 42px 42px;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 85%);
  mask-image: linear-gradient(to bottom, black, transparent 85%);
  pointer-events: none;
  z-index: 0;
}

html[data-theme="light"] .hero::before {
  background:
    radial-gradient(circle at 18% 30%, rgba(14, 165, 111, 0.10), transparent 55%),
    radial-gradient(circle at 82% 15%, rgba(8, 145, 178, 0.09), transparent 50%),
    linear-gradient(rgba(15, 28, 26, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 28, 26, 0.05) 1px, transparent 1px);
  background-size: auto, auto, 42px 42px, 42px 42px;
}

.hero > .container {
  position: relative;
  z-index: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--badge-bg);
  border: 1px solid rgba(227, 192, 105, 0.25);
  color: var(--gold);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 26px;
}

.hero h1 {
  font-weight: 500;
  font-size: 58px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  max-width: 780px;
  margin: 0 auto 20px;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--green), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: italic;
}

.hero p {
  font-size: 18px;
  color: var(--gray);
  max-width: 560px;
  margin: 0 auto 36px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 56px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.stat { text-align: center; }
.stat-num { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.stat-label { font-size: 12.5px; color: var(--gray); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Sections ---------- */
.section {
  padding: 84px 0;
}

.section-head {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 56px;
}

.eyebrow {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.section-head h2 {
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.section-head p {
  color: var(--gray);
  font-size: 16px;
}

/* ---------- Feature grid ---------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

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

.card {
  position: relative;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0) 55%), var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 18px;
}

.icon-blue { background: var(--accent-soft-bg); color: var(--blue); }
.icon-green { background: var(--success-bg); color: var(--green); }

.card h3 {
  font-size: 17px;
  font-weight: 700;
  font-family: var(--font-body);
  margin-bottom: 8px;
}

.card p {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.6;
}

/* ---------- Curriculum preview ---------- */
.module-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.module-row:hover {
  transform: translateY(-2px) translateX(2px);
  box-shadow: var(--shadow-glow);
  border-color: var(--border-strong);
}

.module-num {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--green);
}

.module-row-info h4 {
  font-size: 15.5px;
  font-weight: 700;
  margin-bottom: 2px;
}

.module-row-info p {
  font-size: 13px;
  color: var(--gray);
}

.module-tasks-count {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--gray-light);
  font-weight: 700;
  white-space: nowrap;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

/* ---------- Pricing ---------- */
.pricing-card {
  position: relative;
  background: linear-gradient(165deg, #0c1c17, var(--contrast));
  color: white;
  border: 1px solid rgba(227, 192, 105, 0.2);
  border-radius: 22px;
  padding: 48px;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}

.pricing-card .price {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 600;
  margin: 16px 0 4px;
}

.pricing-card .price span {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  color: #9fb0b8;
}

.pricing-list {
  list-style: none;
  text-align: left;
  margin: 28px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pricing-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #cbd5e1;
}

.check-dot {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #04141a;
  font-weight: 800;
}

.pricing-card .btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #241a02;
  width: 100%;
}
.pricing-card .btn-primary:hover { filter: brightness(1.08); }

/* ---------- Hero visual (mock dashboard preview) ---------- */
.hero-visual {
  max-width: 860px;
  margin: 0 auto;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0) 40%), var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  text-align: left;
}

.hero-visual-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.hero-visual-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
}

.hero-visual-body {
  display: grid;
  grid-template-columns: 200px 1fr;
}

.hero-visual-side {
  border-right: 1px solid var(--border);
  padding: 18px 14px;
}

.hero-visual-progress {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 14px;
}

.hero-visual-progress-top {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-visual-mini-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray);
  padding: 7px 8px;
  border-radius: 7px;
  margin-bottom: 2px;
}

.hero-visual-mini-link.active { background: var(--accent-soft-bg); color: var(--accent-soft-fg); }

.hero-visual-mini-dot {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: white;
}

.hero-visual-mini-link.done .hero-visual-mini-dot { background: var(--green); color: #04141a; }
.hero-visual-mini-link.active .hero-visual-mini-dot { background: var(--blue); color: #04141a; }

.hero-visual-main {
  padding: 22px 24px;
}

.hero-visual-main h4 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
}

.hero-visual-main > p {
  font-size: 12.5px;
  color: var(--gray);
  margin-bottom: 16px;
}

.hero-visual-task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}

.hero-visual-task.done {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-fg);
}

.hero-visual-task .box {
  width: 16px;
  height: 16px;
  min-width: 16px;
  border-radius: 5px;
  border: 2px solid var(--border-strong);
}

.hero-visual-task.done .box {
  background: var(--green);
  border-color: var(--green);
}

/* ---------- Testimonials ---------- */
.testimonial-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.testimonial-stars {
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.testimonial-card p.quote {
  font-size: 14.5px;
  color: var(--ink);
  margin-bottom: 20px;
  line-height: 1.6;
}

.testimonial-person {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: #04141a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}

.testimonial-person-name { font-size: 13.5px; font-weight: 700; }
.testimonial-person-role { font-size: 12px; color: var(--gray); }

/* ---------- FAQ ---------- */
.faq-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 20px;
  transition: border-color 0.15s ease;
}

.faq-item[open] { border-color: var(--border-strong); }

.faq-item summary {
  padding: 16px 0;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  font-size: 20px;
  font-weight: 400;
  color: var(--green);
}

.faq-item[open] summary::after { content: "−"; }

.faq-item p {
  font-size: 14px;
  color: var(--gray);
  padding-bottom: 18px;
  line-height: 1.6;
}

/* ---------- Partner strip ---------- */
.partner-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--card);
  padding: 28px 0;
}

.partner-strip-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  text-align: center;
}

.partner-strip-inner span.label {
  font-size: 13px;
  color: var(--gray);
  font-weight: 600;
}

.partner-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.partner-mark .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--blue));
}

.sidebar-partner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray);
  margin-bottom: 14px;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  color: var(--gray-light);
  font-size: 13px;
}

/* ==================== DASHBOARD ==================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 284px;
  min-width: 284px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
}

.sidebar .logo { padding: 0 8px; margin-bottom: 0; }

.sidebar-mobile-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

#sidebar-mobile-toggle { display: none; }

.player-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, #0d211c 0%, #0a171e 55%, #0a141c 100%);
  border: 1px solid rgba(227, 192, 105, 0.18);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  color: white;
  box-shadow: var(--shadow-glow);
}

.player-card::after {
  content: "";
  position: absolute;
  top: -60%;
  right: -30%;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(227, 192, 105, 0.18), transparent 70%);
  pointer-events: none;
}

.player-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  position: relative;
}

.player-level {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--gold);
}

.player-xp {
  font-size: 12px;
  color: #b7c7cd;
  font-weight: 600;
}

.player-card .progress-bar-track {
  background: rgba(255, 255, 255, 0.1);
  position: relative;
}

.player-card .progress-bar-fill {
  background: linear-gradient(90deg, var(--green), var(--blue));
  box-shadow: 0 0 10px rgba(22, 214, 154, 0.5);
}

.player-card-bottom {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  font-size: 11px;
  color: #b7c7cd;
  position: relative;
}

.streak-badge {
  font-weight: 700;
  color: var(--gold);
}

.quiz-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 24px;
}

.quiz-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.quiz-card-head h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
}

.quiz-score-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success-fg);
  border: 1px solid var(--success-border);
}

.quiz-intro {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 16px;
}

.quiz-question {
  margin-bottom: 20px;
}

.quiz-question:last-child { margin-bottom: 0; }

.quiz-question-text {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}

.quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.quiz-option:hover:not(:disabled) { border-color: var(--border-strong); transform: translateX(2px); }

.quiz-option.correct {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-fg);
}

.quiz-option.incorrect {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-fg);
}

.quiz-option:disabled { cursor: default; opacity: 0.9; }

.quiz-explain {
  font-size: 12.5px;
  color: var(--gray);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 4px;
}

.quiz-result {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quiz-result-score {
  font-size: 14px;
  font-weight: 800;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.leaderboard-row.you {
  border-color: rgba(22, 214, 154, 0.4);
  background: var(--success-bg);
  box-shadow: var(--shadow-glow);
}

.leaderboard-rank {
  width: 30px;
  min-width: 30px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--gray-light);
  text-align: center;
}

.leaderboard-name {
  flex: 1;
  font-weight: 700;
  font-size: 13.5px;
}

.leaderboard-level {
  font-size: 11.5px;
  color: var(--gray);
}

.leaderboard-xp {
  font-weight: 800;
  font-size: 13.5px;
  white-space: nowrap;
  color: var(--green);
}

.progress-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.progress-block-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.progress-block-top span:first-child {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.progress-percent {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  color: var(--green);
}

.progress-bar-track {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--blue));
  border-radius: 999px;
  transition: width 0.4s ease;
  width: 0%;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--gray);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.sidebar-link:hover { background: var(--card-2); color: var(--ink); transform: translateX(3px); }

.sidebar-link.active {
  background: var(--accent-soft-bg);
  color: var(--accent-soft-fg);
}

.sidebar-link-num {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 7px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-light);
}

.sidebar-link.active .sidebar-link-num {
  background: var(--blue);
  border-color: var(--blue);
  color: #04141a;
}

.sidebar-link.done .sidebar-link-num {
  background: var(--green);
  border-color: var(--green);
  color: #04141a;
}

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--gray-light);
}

.sidebar-foot a:hover { color: var(--green); }

.main {
  flex: 1;
  padding: 40px 48px;
  max-width: 920px;
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.dashboard-topbar-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- Dashboard hero / greeting / continue learning ---------- */
.dashboard-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.greeting-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(155deg, #0d211c, #0a141c 70%);
  border: 1px solid rgba(227, 192, 105, 0.16);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow-lg);
}

.greeting-card::after {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(22, 214, 154, 0.16), transparent 70%);
  pointer-events: none;
}

.greeting-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

.greeting-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  color: #f4f1e8;
  margin-bottom: 6px;
}

.greeting-sub {
  font-size: 13.5px;
  color: #9fb0b8;
  max-width: 380px;
}

.continue-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.continue-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 8px;
}

.continue-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.continue-sub {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 14px;
}

.continue-cta {
  align-self: flex-start;
}

/* ---------- Chart card ---------- */
.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 28px;
}

.chart-card-head {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gray);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #241a02;
}

.badge-chip.locked {
  background: var(--bg);
  color: var(--gray-light);
  border: 1px dashed var(--border);
}

#module-content.module-fade {
  animation: module-fade-in 0.32s ease;
}

@keyframes module-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.module-header {
  margin-bottom: 32px;
}

.module-header .eyebrow { margin-bottom: 8px; }

.module-header h1 {
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.module-header p {
  color: var(--gray);
  font-size: 15px;
  max-width: 620px;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.task-item:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }

.task-item.completed {
  background: var(--success-bg);
  border-color: var(--success-border);
}

.task-checkbox {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 7px;
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: all 0.15s ease;
}

.task-item.completed .task-checkbox {
  background: var(--green);
  border-color: var(--green);
  color: #04141a;
  font-size: 13px;
  font-weight: 800;
}

.task-item-body { flex: 1; }

.task-item-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.task-item h4 {
  font-size: 15px;
  font-weight: 700;
}

.task-item.completed h4 { color: var(--success-fg); text-decoration: line-through; text-decoration-color: var(--success-border); }

.task-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--bg-elevated);
  color: var(--gray);
}

.tag-read { background: var(--tag-read-bg); color: var(--tag-read-fg); }
.tag-action { background: var(--tag-action-bg); color: var(--tag-action-fg); }
.tag-exercise { background: var(--tag-exercise-bg); color: var(--tag-exercise-fg); }
.tag-quiz { background: var(--tag-quiz-bg); color: var(--tag-quiz-fg); }
.tag-community { background: var(--tag-community-bg); color: var(--tag-community-fg); }
.tag-milestone { background: var(--tag-milestone-bg); color: var(--tag-milestone-fg); }

.sidebar-link-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-light);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.stat-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.stat-card .num {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--green);
}

.stat-card .label {
  font-size: 12px;
  color: var(--gray);
  font-weight: 600;
  margin-top: 2px;
}

.task-item p {
  font-size: 13.5px;
  color: var(--gray);
}

.lesson-toggle {
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: #04141a;
  background: linear-gradient(135deg, var(--green), var(--blue));
  border: none;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lesson-toggle:hover { filter: brightness(1.08); }

.video-link {
  margin-top: 10px;
  margin-left: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-soft-fg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.video-link:hover { border-color: var(--border-strong); text-decoration: underline; }

.lesson-box {
  margin-top: 12px;
  padding: 16px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.65;
}

.lesson-box p { margin-bottom: 10px; }
.lesson-box p:last-child { margin-bottom: 0; }
.lesson-box ul { margin: 0 0 10px 18px; }
.lesson-box li { margin-bottom: 4px; }
.lesson-box strong { color: var(--green); }

.task-note-toggle {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-soft-fg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.task-note-toggle:hover { text-decoration: underline; }

.task-note-box {
  margin-top: 10px;
}

.task-note-box textarea {
  width: 100%;
  min-height: 70px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  background: var(--bg-elevated);
  color: var(--ink);
}

.task-note-box textarea:focus {
  outline: none;
  border-color: var(--green);
}

.task-note-saved {
  font-size: 11px;
  color: var(--green);
  font-weight: 700;
  margin-top: 4px;
  height: 14px;
}

.module-nav-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ---------- Login screen ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 20% 20%, rgba(22, 214, 154, 0.10), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(34, 211, 238, 0.08), transparent 45%);
  padding: 24px;
}

html[data-theme="light"] .login-wrap { background-image: none; }

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-card .logo { justify-content: center; margin-bottom: 8px; }

.login-card h2 {
  font-size: 23px;
  font-weight: 600;
  margin: 16px 0 6px;
}

.login-card > p {
  color: var(--gray);
  font-size: 14px;
  margin-bottom: 28px;
}

.field {
  text-align: left;
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--gray);
}

.field input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
}

.field input:focus {
  outline: none;
  border-color: var(--green);
}

.login-card .btn-primary {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
}

.login-hint {
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--gray-light);
}

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .hero h1 { font-size: 38px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .dashboard-hero { grid-template-columns: 1fr; }

  .nav-links {
    display: none;
  }
  .mobile-menu-toggle { display: inline-flex; }

  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px 20px;
  }
  .nav-links.mobile-open a { padding: 10px 0; width: 100%; }

  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 68px;
    overflow: hidden;
    transition: max-height 0.25s ease;
    padding: 16px 16px 24px;
  }
  .sidebar.mobile-open { max-height: 2000px; }
  .sidebar-mobile-toggle { margin-bottom: 20px; }
  #sidebar-mobile-toggle { display: inline-flex; }
  .main { padding: 28px 20px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}
