/* ─── RESET & BASE ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  min-height: 100vh;
}
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
input, textarea { font-family: inherit; outline: none; }
a { text-decoration: none; color: inherit; }
ol, ul { padding-left: 1.5em; }
li { margin-bottom: 4px; }

/* ─── DESIGN TOKENS ────────────────────────────────────────────────────── */
:root {
  --primary: #003057;
  --primary-light: #0072ce;
  --gold: #e8b84b;
  --gold-dark: #c9973d;
  --paper2: #7c3aed;
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --success: #16a34a;
  --error: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-md: 0 4px 24px rgba(0,0,0,.12);
}

/* ─── LOADING ───────────────────────────────────────────────────────────── */
.loading-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; gap: 24px;
}
.loading-logo { display: flex; align-items: center; gap: 12px; }
.logo-icon { font-size: 2.5rem; }
.logo-text { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--border);
  border-top-color: var(--primary-light); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── AUTH PAGES ────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 24px;
}
.auth-card {
  background: white; border-radius: 20px; padding: 40px 36px;
  width: 100%; max-width: 420px; box-shadow: var(--shadow-md);
}
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-logo { font-size: 3rem; margin-bottom: 12px; }
.auth-title { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.auth-subtitle { font-size: 0.9rem; color: var(--muted); margin-top: 6px; }
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.form-input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 1rem; transition: border-color .15s;
}
.form-input:focus { border-color: var(--primary-light); }
.btn-primary {
  width: 100%; padding: 14px; background: var(--primary);
  color: white; font-size: 1rem; font-weight: 700; border-radius: 8px;
  transition: background .15s; cursor: pointer;
}
.btn-primary:hover { background: var(--primary-light); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 0.875rem; color: var(--muted); }
.auth-switch a { color: var(--primary-light); font-weight: 600; cursor: pointer; }
.auth-error {
  background: #fef2f2; border: 1px solid #fecaca; color: var(--error);
  padding: 10px 14px; border-radius: 8px; font-size: 0.875rem; margin-bottom: 16px;
}
.divider { text-align: center; color: var(--muted); font-size: 0.8rem; margin: 16px 0; position: relative; }
.divider::before, .divider::after {
  content: ''; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--border);
}
.divider::before { left: 0; }
.divider::after { right: 0; }

/* ─── LAYOUT ─────────────────────────────────────────────────────────── */
.layout { display: flex; flex-direction: column; min-height: 100vh; }
.main { flex: 1; padding: 32px 24px; max-width: 960px; margin: 0 auto; width: 100%; }

/* ─── HEADER ──────────────────────────────────────────────────────────── */
.header {
  background: var(--primary); color: white;
  padding: 0 24px; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.header-left { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.header-logo { font-size: 1.5rem; }
.header-title { font-size: 1rem; font-weight: 700; letter-spacing: .3px; }
.header-subtitle { font-size: 0.75rem; opacity: .75; }
.header-right { display: flex; align-items: center; gap: 12px; }
.header-user { font-size: 0.8rem; opacity: .85; }
.btn-signout, .btn-home {
  background: rgba(255,255,255,.15); color: white; border: 1px solid rgba(255,255,255,.3);
  padding: 6px 14px; border-radius: 6px; font-size: 0.8rem; font-weight: 600;
  transition: background .15s;
}
.btn-signout:hover, .btn-home:hover { background: rgba(255,255,255,.25); }

/* ─── DASHBOARD ────────────────────────────────────────────────────────── */
.dash-welcome { margin-bottom: 32px; }
.dash-welcome h1 { font-size: 1.6rem; font-weight: 800; color: var(--primary); }
.dash-welcome p { color: var(--muted); margin-top: 6px; }

.chapter-card {
  background: var(--card); border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow); margin-bottom: 24px;
}
.chapter-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.chapter-icon { font-size: 2.5rem; flex-shrink: 0; }
.chapter-info h2 { font-size: 1.25rem; font-weight: 800; color: var(--primary); }
.chapter-info p { font-size: 0.875rem; color: var(--muted); margin-top: 4px; }

.topics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.topic-card {
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 16px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.topic-card:hover { border-color: var(--primary-light); box-shadow: 0 4px 12px rgba(0,114,206,.12); transform: translateY(-1px); }
.topic-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.topic-title { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.badge {
  font-size: 0.65rem; font-weight: 700; padding: 2px 8px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: .5px; white-space: nowrap;
}
.badge-paper2 { background: #ede9fe; color: var(--paper2); }
.badge-paper1 { background: #dbeafe; color: #1d4ed8; }
.topic-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 12px; }
.topic-actions { display: flex; gap: 6px; }
.btn-notes {
  flex: 1; padding: 8px; background: var(--primary); color: white;
  border-radius: 6px; font-size: 0.8rem; font-weight: 700; text-align: center;
  transition: background .15s; cursor: pointer;
}
.btn-notes:hover { background: var(--primary-light); }
.btn-quiz {
  flex: 1; padding: 8px; background: var(--gold); color: #1a1000;
  border-radius: 6px; font-size: 0.8rem; font-weight: 700; text-align: center;
  transition: background .15s; cursor: pointer;
}
.btn-quiz:hover { background: var(--gold-dark); }

/* ─── BACK BUTTON ─────────────────────────────────────────────────────── */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 0.875rem; font-weight: 600;
  margin-bottom: 20px; cursor: pointer; background: none;
  transition: color .15s;
}
.back-btn:hover { color: var(--primary); }

/* ─── PAGE HEADER ──────────────────────────────────────────────────────── */
.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.page-header-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; }

/* ─── TAB NAVIGATION ──────────────────────────────────────────────────── */
.tab-nav {
  display: flex; gap: 4px; border-bottom: 2px solid var(--border);
  margin-bottom: 24px; overflow-x: auto;
}
.tab-btn {
  padding: 10px 18px; font-size: 0.875rem; font-weight: 600;
  color: var(--muted); background: none; border: none;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  cursor: pointer; white-space: nowrap; transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary-light); }

/* ─── NOTES CONTENT ───────────────────────────────────────────────────── */
.notes-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.notes-inner { padding: 28px; }
.notes-content { max-width: 100%; }
.notes-section { margin-bottom: 28px; }
.notes-section:last-child { margin-bottom: 0; }
.notes-section h3 {
  font-size: 1rem; font-weight: 800; color: var(--primary);
  margin-bottom: 12px; padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}
.notes-section p { font-size: 0.9rem; line-height: 1.7; color: var(--text); margin-bottom: 8px; }
.notes-section ul, .notes-section ol { font-size: 0.9rem; line-height: 1.7; color: var(--text); }

.key-term {
  font-weight: 700; color: var(--primary-light);
}

.formula-box {
  background: #f0f7ff; border: 1.5px solid #bfdbfe;
  border-radius: 8px; padding: 12px 16px;
  font-size: 0.9rem; font-weight: 600; color: #1e3a5f;
  font-family: 'Courier New', monospace;
}

.tip-box {
  background: #fefce8; border: 1.5px solid #fde68a;
  border-radius: 8px; padding: 12px 16px;
  font-size: 0.875rem; color: #78350f; line-height: 1.6;
  margin-top: 16px;
}
.tip-box.tip-blue {
  background: #eff6ff; border-color: #bfdbfe; color: #1e3a5f;
}

.def-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.def-item {
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 8px; padding: 12px 14px;
  font-size: 0.875rem; line-height: 1.6; color: var(--text);
}

.notes-table {
  width: 100%; border-collapse: collapse; font-size: 0.875rem;
  margin-top: 8px;
}
.notes-table th {
  background: var(--primary); color: white;
  padding: 10px 12px; text-align: left; font-size: 0.8rem; font-weight: 700;
}
.notes-table td {
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  vertical-align: top; line-height: 1.5;
}
.notes-table tr:last-child td { border-bottom: none; }
.notes-table tr:nth-child(even) td { background: #f8fafc; }

.paper2-banner {
  background: linear-gradient(135deg, #5b21b6, var(--paper2));
  color: white; font-size: 0.8rem; font-weight: 700;
  padding: 6px 16px; border-radius: 6px; display: inline-block;
  margin-bottom: 20px; letter-spacing: .05em;
}
.paper2-tag { border-left: 4px solid var(--paper2); padding-left: 14px; }
.paper2-label {
  font-size: 0.7rem; font-weight: 700; color: var(--paper2);
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 6px;
}

/* ─── COMING SOON ─────────────────────────────────────────────────────── */
.coming-soon {
  text-align: center; padding: 60px 20px;
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.coming-soon-icon { font-size: 3rem; margin-bottom: 16px; }
.coming-soon h3 { font-size: 1.2rem; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.coming-soon p { color: var(--muted); font-size: 0.9rem; }

/* ─── QUIZ ────────────────────────────────────────────────────────────── */
.quiz-container { max-width: 680px; }
.quiz-progress-bar { background: var(--border); border-radius: 4px; height: 6px; margin-bottom: 8px; }
.quiz-progress-fill {
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  height: 100%; border-radius: 4px; transition: width .3s;
}
.quiz-progress-text { font-size: 0.8rem; color: var(--muted); margin-bottom: 16px; font-weight: 600; }
.quiz-card {
  background: var(--card); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.quiz-question { font-size: 1.05rem; font-weight: 700; color: var(--text); line-height: 1.5; margin-bottom: 20px; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  padding: 14px 16px; border: 2px solid var(--border); border-radius: 10px;
  font-size: 0.9rem; cursor: pointer; text-align: left; background: white;
  transition: border-color .15s, background .15s; line-height: 1.4;
}
.quiz-option:hover:not(:disabled) { border-color: var(--primary-light); background: #f0f7ff; }
.quiz-option.correct { border-color: var(--success); background: #f0fdf4; color: #14532d; }
.quiz-option.wrong { border-color: var(--error); background: #fef2f2; color: #7f1d1d; }
.quiz-option:disabled { cursor: default; }
.quiz-explanation {
  background: #f0f9ff; border: 1.5px solid #bae6fd; border-radius: 8px;
  padding: 12px 16px; font-size: 0.875rem; color: #0c4a6e;
  margin-top: 12px; line-height: 1.55;
}
.quiz-explanation strong { display: block; margin-bottom: 4px; }
.quiz-next-btn {
  width: 100%; padding: 14px; background: var(--primary); color: white;
  border-radius: 8px; font-size: 1rem; font-weight: 700; margin-top: 16px;
  transition: background .15s;
}
.quiz-next-btn:hover { background: var(--primary-light); }

/* ─── RESULTS ─────────────────────────────────────────────────────────── */
.results-card {
  background: var(--card); border-radius: var(--radius);
  padding: 40px 36px; box-shadow: var(--shadow); text-align: center;
  max-width: 520px;
}
.results-emoji { font-size: 4rem; margin-bottom: 16px; }
.results-score { font-size: 2.5rem; font-weight: 900; color: var(--primary); }
.results-label { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-top: 4px; }
.results-desc { color: var(--muted); margin-top: 8px; font-size: 0.9rem; }
.results-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }
.btn-retry {
  padding: 14px; background: var(--primary); color: white;
  border-radius: 8px; font-size: 1rem; font-weight: 700;
  transition: background .15s; cursor: pointer;
}
.btn-retry:hover { background: var(--primary-light); }
.btn-dashboard {
  padding: 14px; background: white; color: var(--primary);
  border: 2px solid var(--primary); border-radius: 8px;
  font-size: 1rem; font-weight: 700; transition: background .15s; cursor: pointer;
}
.btn-dashboard:hover { background: #f0f4ff; }

/* ─── HOMEPAGE ────────────────────────────────────────────────────────── */
.home-page { background: white; }

/* Nav */
.home-nav {
  background: var(--primary); padding: 0 clamp(1rem, 4vw, 2.5rem);
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 200;
}
.home-nav-brand { display: flex; align-items: center; gap: 10px; }
.home-nav-logo { font-size: 1.6rem; }
.home-nav-name { font-weight: 800; color: white; font-size: 1rem; }
.home-nav-sub { font-size: 0.72rem; opacity: .7; color: white; }
.home-nav-right { display: flex; gap: 10px; align-items: center; }
.nav-btn-ghost {
  color: white; font-weight: 600; font-size: 0.875rem;
  padding: 7px 16px; border-radius: 7px;
  border: 1.5px solid rgba(255,255,255,.3);
  background: transparent; cursor: pointer; transition: background .15s;
}
.nav-btn-ghost:hover { background: rgba(255,255,255,.12); }
.nav-btn-solid {
  color: var(--primary); font-weight: 700; font-size: 0.875rem;
  padding: 7px 16px; border-radius: 7px;
  background: var(--gold); border: none; cursor: pointer; transition: background .15s;
}
.nav-btn-solid:hover { background: var(--gold-dark); }

/* Hero */
.home-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #1a5296 60%, #1a4a8a 100%);
  color: white; text-align: center;
  padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 4vw, 2rem);
}
.home-hero-logo {
  margin-bottom: 16px;
}
.home-hero-logo img {
  height: 60px; object-fit: contain;
  background: white; border-radius: 12px; padding: 0.4rem 0.9rem;
}
.home-hero-cvql { font-size: clamp(2rem, 5vw, 3rem); font-weight: 900; letter-spacing: .08em; color: var(--gold); margin-bottom: 4px; }
.home-hero-cvql-sub { font-size: clamp(0.85rem, 2vw, 1rem); font-weight: 600; letter-spacing: .04em; opacity: .8; margin-bottom: 24px; }
.home-hero h1 { font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 900; line-height: 1.15; margin-bottom: 20px; max-width: 720px; margin-left: auto; margin-right: auto; }
.home-hero-sub { font-size: clamp(0.95rem, 2.5vw, 1.1rem); opacity: .9; max-width: 660px; margin: 0 auto 8px; line-height: 1.8; }
.home-hero-free { margin-top: 20px; opacity: .6; font-size: 0.85rem; }
.home-hero-cta { margin-top: 32px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta-btn-main {
  padding: 14px 32px; background: var(--gold); color: #1a1000;
  font-weight: 800; font-size: 1rem; border-radius: 10px; border: none; cursor: pointer;
  transition: background .15s;
}
.cta-btn-main:hover { background: var(--gold-dark); }
.cta-btn-secondary {
  padding: 14px 28px; background: rgba(255,255,255,.12); color: white;
  font-weight: 700; font-size: 1rem; border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,.3); cursor: pointer;
  transition: background .15s;
}
.cta-btn-secondary:hover { background: rgba(255,255,255,.2); }

/* How-to steps */
.home-section { padding: clamp(3rem, 6vw, 5rem) clamp(1rem, 4vw, 2.5rem); }
.home-section-inner { max-width: 680px; margin: 0 auto; }
.home-section-inner-wide { max-width: 900px; margin: 0 auto; }
.section-label {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: var(--primary-light); margin-bottom: 8px;
}
.section-title { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; color: var(--primary); margin-bottom: 8px; }
.section-sub { color: var(--muted); font-size: 0.95rem; margin-bottom: 2.5rem; }

.steps-list { display: flex; flex-direction: column; gap: 28px; }
.step-item { display: flex; gap: 20px; align-items: flex-start; }
.step-num {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.1rem;
}
.step-icon { font-size: 1.4rem; margin-bottom: 4px; }
.step-content h4 { font-size: 1rem; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.step-content p { font-size: 0.875rem; color: var(--muted); line-height: 1.65; }

/* Features grid */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.feature-card {
  background: var(--bg); border: 1.5px solid var(--border); border-radius: 12px; padding: 20px;
  transition: border-color .15s;
}
.feature-card:hover { border-color: var(--primary-light); }
.feature-icon { font-size: 1.6rem; margin-bottom: 8px; }
.feature-card h4 { font-size: 0.9rem; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.feature-card p { font-size: 0.8rem; color: var(--muted); line-height: 1.55; }

/* Book section */
.book-section {
  background: var(--bg); padding: clamp(3rem, 6vw, 5rem) clamp(1rem, 4vw, 2.5rem);
}
.book-card {
  max-width: 720px; margin: 0 auto;
  background: white; border-radius: 20px; padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: var(--shadow-md); display: flex; gap: 2rem; align-items: flex-start; flex-wrap: wrap;
}
.book-badge {
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: #92400e; margin-bottom: 6px;
}
.book-card h2 { font-size: clamp(1.2rem, 3vw, 1.6rem); font-weight: 800; color: var(--primary); margin-bottom: 10px; }
.book-card p { color: #4b5563; font-size: 0.9rem; line-height: 1.7; margin-bottom: 16px; }
.book-btn {
  display: inline-block; background: #f59e0b; color: #1a1a1a;
  padding: 10px 20px; border-radius: 10px; font-weight: 800; font-size: 0.95rem;
  text-decoration: none; transition: background .15s; border: none; cursor: pointer;
}
.book-btn:hover { background: #d97706; }

/* Pricing */
.pricing-section { background: white; padding: clamp(3rem, 6vw, 5rem) clamp(1rem, 4vw, 2.5rem); }
.pricing-grid { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.pricing-card {
  background: var(--bg); border: 2px solid var(--border); border-radius: 16px;
  padding: 28px; flex: 1; min-width: 240px; max-width: 300px;
  display: flex; flex-direction: column;
}
.pricing-card.highlight { background: var(--primary); border-color: var(--primary); color: white; }
.pricing-plan { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; color: var(--muted); }
.pricing-card.highlight .pricing-plan { color: rgba(255,255,255,.7); }
.pricing-price { font-size: 2.2rem; font-weight: 900; color: var(--primary); margin-bottom: 4px; }
.pricing-card.highlight .pricing-price { color: var(--gold); }
.pricing-period { font-size: 0.8rem; color: var(--muted); margin-bottom: 16px; }
.pricing-card.highlight .pricing-period { color: rgba(255,255,255,.6); }
.pricing-badge {
  display: inline-block; background: var(--gold); color: #1a1000;
  font-size: 0.65rem; font-weight: 800; padding: 2px 8px; border-radius: 20px;
  margin-bottom: 12px; letter-spacing: .05em;
}
.pricing-features { flex: 1; list-style: none; padding: 0; margin-bottom: 20px; }
.pricing-features li { font-size: 0.875rem; padding: 6px 0; border-bottom: 1px solid var(--border); color: var(--text); }
.pricing-card.highlight .pricing-features li { border-color: rgba(255,255,255,.1); color: rgba(255,255,255,.9); }
.pricing-features li:last-child { border-bottom: none; }
.pricing-cta {
  width: 100%; padding: 12px; border-radius: 8px; font-weight: 700; font-size: 0.95rem;
  cursor: pointer; border: none; transition: background .15s;
  background: var(--primary); color: white;
}
.pricing-card.highlight .pricing-cta { background: var(--gold); color: #1a1000; }
.pricing-cta:hover { opacity: .9; }

/* Schools */
.schools-section {
  background: var(--primary); padding: clamp(3rem, 6vw, 5rem) clamp(1rem, 4vw, 2.5rem); color: white;
}
.schools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 2.5rem; }
.school-feature {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px; padding: 20px;
}
.school-feature-icon { font-size: 1.5rem; margin-bottom: 8px; }
.school-feature p { font-size: 0.875rem; color: rgba(255,255,255,.85); line-height: 1.6; }
.school-plans { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-bottom: 2rem; }
.school-plan {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px; padding: 24px; flex: 1; min-width: 180px; text-align: center;
}
.school-plan.highlight { background: var(--gold); border: none; }
.school-plan-name { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: rgba(255,255,255,.6); margin-bottom: 6px; }
.school-plan.highlight .school-plan-name { color: var(--primary); }
.school-plan-price { font-size: 2rem; font-weight: 900; color: white; }
.school-plan.highlight .school-plan-price { color: var(--primary); }
.school-plan-year { font-size: 0.75rem; color: rgba(255,255,255,.5); margin-bottom: 6px; }
.school-plan.highlight .school-plan-year { color: var(--primary); opacity: .7; }
.school-plan-desc { font-size: 0.875rem; font-weight: 700; color: rgba(255,255,255,.85); }
.school-plan.highlight .school-plan-desc { color: var(--primary); }

/* Teacher section */
.teacher-section {
  background: var(--bg); padding: clamp(3rem, 6vw, 5rem) clamp(1rem, 4vw, 2.5rem);
}
.teacher-card {
  max-width: 720px; margin: 0 auto; background: white; border-radius: 20px;
  padding: clamp(1.5rem, 4vw, 2.5rem); box-shadow: var(--shadow-md);
  display: flex; gap: 2rem; align-items: flex-start; flex-wrap: wrap;
}
.teacher-photo {
  width: 120px; height: 120px; border-radius: 50%; overflow: hidden;
  border: 4px solid var(--gold); flex-shrink: 0;
}
.teacher-photo img { width: 100%; height: 100%; object-fit: cover; }
.teacher-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--primary-light); margin-bottom: 4px; }
.teacher-name { font-size: 1.3rem; font-weight: 800; color: var(--primary); margin-bottom: 10px; }
.teacher-bio { font-size: 0.875rem; color: #4b5563; line-height: 1.8; }

/* Footer */
.home-footer {
  background: var(--primary); color: rgba(255,255,255,.5);
  text-align: center; padding: 24px; font-size: 0.8rem;
}
.home-footer a { color: rgba(255,255,255,.7); margin: 0 8px; }

/* ─── MISC ─────────────────────────────────────────────────────────────── */
.paper2-notice {
  background: #f5f3ff; border: 1.5px solid #c4b5fd; border-radius: 10px;
  padding: 14px 18px; margin-bottom: 20px; display: flex; align-items: flex-start; gap: 10px;
}
.paper2-notice-icon { font-size: 1.2rem; flex-shrink: 0; }
.paper2-notice p { font-size: 0.875rem; color: #4c1d95; line-height: 1.5; }
.paper2-notice strong { color: var(--paper2); }

/* ─── CHAPTER PAGE ────────────────────────────────────────────────────── */

/* Chapter banner */
.chap-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #1a5296 100%);
  color: white; border-radius: var(--radius); padding: 28px 32px;
  margin-bottom: 20px; box-shadow: var(--shadow-md);
}
.chap-banner-label {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; opacity: .7; margin-bottom: 6px;
}
.chap-banner-title { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 900; margin-bottom: 8px; }
.chap-banner-sub { font-size: 0.9rem; opacity: .8; line-height: 1.6; }

/* Section cards */
.section-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden;
}
.section-card-header {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
}
.section-card-header.accordion-toggle {
  cursor: pointer; user-select: none;
}
.section-card-header.accordion-toggle:hover { background: #f8fafc; }
.section-card-icon { font-size: 1.4rem; }
.section-card-title { font-size: 1rem; font-weight: 800; color: var(--primary); flex: 1; }
.section-card-count { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.accordion-arrow { font-size: 0.8rem; color: var(--muted); margin-left: auto; transition: transform .2s; }
.accordion-body { padding: 0; }

/* Lesson pills (video section) */
.lesson-pills {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}
.lesson-pill {
  padding: 7px 14px; border-radius: 20px;
  font-size: 0.8rem; font-weight: 600; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--bg); color: var(--muted);
  transition: all .15s; white-space: nowrap;
}
.lesson-pill:hover { border-color: var(--primary-light); color: var(--primary-light); background: #f0f7ff; }
.lesson-pill.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Video placeholder */
.video-placeholder {
  background: #0d1b2a; min-height: 220px; display: flex;
  align-items: center; justify-content: center;
}
.video-coming-soon { text-align: center; padding: 40px 20px; }

/* Checklist */
.checklist-topic { border-bottom: 1px solid var(--border); padding: 16px 24px; }
.checklist-topic:last-child { border-bottom: none; }
.checklist-topic-title {
  font-size: 0.875rem; font-weight: 800; color: var(--primary);
  margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.checklist-topic-title.checklist-p2 { color: var(--paper2); }
.checklist-items { display: flex; flex-direction: column; gap: 6px; }
.checklist-item {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.85rem; color: var(--text); line-height: 1.5; cursor: pointer;
}
.checklist-item input { margin-top: 3px; flex-shrink: 0; accent-color: var(--primary); }
.checklist-item:has(input:checked) span { text-decoration: line-through; color: var(--muted); }

/* Notes section inside chapter */
.notes-topic-pills {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 20px;
  border-bottom: 1px solid var(--border); background: #f8fafc;
}
.notes-pill {
  padding: 6px 12px; border-radius: 16px; font-size: 0.78rem; font-weight: 600;
  border: 1.5px solid var(--border); background: white; color: var(--muted);
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.notes-pill:hover { border-color: var(--primary-light); color: var(--primary); }
.notes-pill.active { background: var(--primary); color: white; border-color: var(--primary); }
.notes-pill-p2 { border-color: #c4b5fd; color: var(--paper2); }
.notes-pill-p2.active { background: var(--paper2); border-color: var(--paper2); color: white; }
#notes-content-area { padding: 20px 24px; }

/* Quiz cards grid */
.quiz-cards-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px; padding: 20px 24px;
}
.qcard {
  background: var(--bg); border: 2px solid var(--border);
  border-radius: 12px; padding: 22px;
  display: flex; flex-direction: column; gap: 8px;
}
.qcard:hover { border-color: var(--primary-light); box-shadow: 0 4px 12px rgba(0,114,206,.1); }
.qcard-amber { border-color: #fde68a; }
.qcard-amber:hover { border-color: #f59e0b; box-shadow: 0 4px 12px rgba(245,158,11,.1); }
.qcard-teal { border-color: #99f6e4; }
.qcard-teal:hover { border-color: #14b8a6; }
.qcard-purple { border-color: #e9d5ff; }
.qcard-purple:hover { border-color: var(--paper2); }
.qcard-icon { font-size: 1.8rem; }
.qcard-title { font-size: 0.95rem; font-weight: 800; color: var(--primary); }
.qcard-desc { font-size: 0.82rem; color: var(--muted); line-height: 1.6; flex: 1; }
.qcard-count { font-size: 0.8rem; font-weight: 700; color: var(--primary); }
.coming-count { color: var(--muted); }
.qcard-btn {
  width: 100%; padding: 10px; border-radius: 8px; font-size: 0.875rem; font-weight: 700;
  border: none; cursor: pointer; margin-top: 4px; transition: background .15s;
}
.qcard-btn-primary { background: var(--primary); color: white; }
.qcard-btn-primary:hover { background: var(--primary-light); }
.qcard-btn-amber { background: #fde68a; color: #78350f; }
.qcard-btn-amber:disabled, .qcard-btn-teal:disabled, .qcard-btn-purple:disabled {
  background: var(--bg); color: var(--muted); border: 1.5px solid var(--border); cursor: not-allowed;
}

/* Quiz inline mode */
.quiz-inline-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  background: #f8fafc;
}
.back-to-quizzes {
  font-size: 0.8rem; font-weight: 600; color: var(--muted);
  background: none; border: none; cursor: pointer; padding: 0;
}
.back-to-quizzes:hover { color: var(--primary); }
.quiz-topic-label { font-size: 0.8rem; font-weight: 600; color: var(--primary); }
.quiz-container { padding: 20px 24px; max-width: 100%; }

/* Chapter card stats & pills */
.chapter-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.stat-pill {
  background: #f0f7ff; color: var(--primary); font-size: 0.78rem; font-weight: 700;
  padding: 4px 10px; border-radius: 12px;
}
.stat-pill-p2 { background: #ede9fe; color: var(--paper2); }
.chapter-topic-pills {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px;
}
.topic-pill {
  background: #f1f5f9; color: var(--muted); font-size: 0.75rem; font-weight: 600;
  padding: 3px 10px; border-radius: 12px; border: 1px solid var(--border);
}
.topic-pill-p2 { background: #f5f3ff; color: var(--paper2); border-color: #e9d5ff; }
.chapter-start-btn {
  background: var(--primary); color: white; padding: 12px 20px;
  border-radius: 8px; font-weight: 700; font-size: 0.9rem;
  border: none; cursor: pointer; transition: background .15s;
}
.chapter-start-btn:hover { background: var(--primary-light); }

@media (max-width: 640px) {
  .main { padding: 20px 16px; }
  .auth-card { padding: 28px 20px; }
  .topics-grid { grid-template-columns: 1fr; }
  .results-card { padding: 28px 20px; }
  .home-nav-sub { display: none; }
  .tab-btn { padding: 8px 12px; font-size: 0.8rem; }
  .notes-inner { padding: 18px; }
  .def-grid { grid-template-columns: 1fr; }
  .notes-table { font-size: 0.8rem; }
  .notes-table th, .notes-table td { padding: 7px 8px; }
  .teacher-photo { width: 80px; height: 80px; }
  .pricing-card { min-width: 100%; }
  .school-plan { min-width: 100%; }
  .quiz-cards-grid { grid-template-columns: 1fr; }
  .section-card-header { padding: 14px 16px; }
  .checklist-topic { padding: 14px 16px; }
  .lesson-pills { padding: 12px 16px; }
  .notes-topic-pills { padding: 10px 14px; }
  #notes-content-area { padding: 14px 16px; }
  .quiz-container { padding: 14px 16px; }
  .chap-banner { padding: 20px 18px; }
}
