/* ============================================================
   Skillarix design system — refined edition
   Premium, calm, professional. Linear/Stripe-grade restraint:
   deep neutrals, one indigo accent, subtle borders, soft shadows.
   Dark is default; light via [data-theme="light"] on <html>.
   ============================================================ */

/* ---------- Self-hosted fonts (CSP fontSrc 'self') ---------- */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/space-grotesk-v22-latin-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/space-grotesk-v22-latin-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/space-grotesk-v22-latin-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-v20-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/inter-v20-latin-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/inter-v20-latin-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/inter-v20-latin-700.woff2') format('woff2');
}

:root {
  --bg: #09090b;
  --bg-soft: #101013;
  --card: #121215;
  --card-2: #1a1a1f;
  --ink: #fafafa;
  --muted: #a1a1aa;
  --faint: #71717a;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-dark: #4f46e5;
  --primary-soft: rgba(99, 102, 241, 0.12);
  --primary-border: rgba(99, 102, 241, 0.35);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.12);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.12);
  --violet: #a78bfa;
  --pink: #f9a8d4;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.45);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --accent2: #8b5cf6;
  --grad-brand: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --grad-text: linear-gradient(120deg, #a5b4fc 0%, #c4b5fd 100%);
  --glow-sm: 0 0 0 1px rgba(99, 102, 241, 0.28), 0 10px 34px rgba(99, 102, 241, 0.20);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.45), 0 14px 34px rgba(0, 0, 0, 0.36);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-top: 0;
  font-weight: 600;
}
a { color: var(--primary-hover); text-decoration: none; }
a:hover { color: var(--primary); }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  font-size: 0.85em;
}
::selection { background: rgba(99, 102, 241, 0.35); }

.container { max-width: 1120px; margin: 0 auto; padding: 1.5rem 1.25rem 3.5rem; }

/* ---------- Top bar ---------- */
.topbar {
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: 0.7rem 1.25rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.brand {
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.15rem;
  font-family: var(--font-display);
  display: flex; align-items: center; gap: 0.55rem; letter-spacing: -0.02em;
  flex-shrink: 0;
}
.brand:hover { color: var(--ink); }
.brand img, .brand-mark { width: 30px; height: 30px; display: inline-block; }
.brand-mark { font-size: 1.3rem; }
.navlinks { display: flex; gap: 0.15rem; flex-wrap: wrap; }
.navlinks a {
  color: var(--muted); text-decoration: none; padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 500; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.navlinks a:hover { background: rgba(255, 255, 255, 0.06); color: var(--ink); }
.navlinks a.active { background: var(--primary-soft); color: var(--primary-hover); }
.userbox { margin-left: auto; display: flex; align-items: center; gap: 0.7rem; flex-shrink: 0; }
.username { font-size: 0.9rem; color: var(--muted); max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline-form { display: inline; margin: 0; }

/* ---------- Cards & layout ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { border-color: var(--border-strong); }
.card h2 { margin-top: 0; font-size: 1.15rem; }
.card h3 { font-size: 1rem; margin-top: 1.4rem; }
.page-head { margin: 0.5rem 0 1.5rem; }
.page-head h1 {
  margin: 0.2rem 0 0.4rem; font-size: 1.9rem; font-weight: 700;
  color: var(--ink); letter-spacing: -0.03em;
}
.page-head p { margin: 0; color: var(--muted); font-size: 1rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center-card { max-width: 480px; margin: 4rem auto; text-align: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- Empty states ---------- */
.empty-state {
  text-align: center; padding: 3rem 1.5rem; border: 1px dashed var(--border-strong);
  border-radius: var(--radius); background: var(--bg-soft);
}
.empty-icon { font-size: 2.4rem; margin-bottom: 0.6rem; color: var(--faint); }
.empty-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.3rem; }
.empty-text { color: var(--muted); font-size: 0.92rem; max-width: 26rem; margin: 0 auto; }

/* ---------- Skeleton shimmer ---------- */
.skeleton {
  position: relative; overflow: hidden; border-radius: 8px;
  background: var(--card-2); min-height: 1rem;
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: skeleton-shimmer 1.4s infinite;
}
@keyframes skeleton-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---------- Search bar ---------- */
.search-bar { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.search-bar input[type="search"] { flex: 1; min-width: 12rem; }

/* ---------- Banner warning ---------- */
.banner-warning {
  background: var(--warn-soft); border: 1px solid rgba(251, 191, 36, 0.3);
  color: var(--warn); border-radius: var(--radius-sm); padding: 0.8rem 1.1rem;
  margin-bottom: 1.25rem; font-size: 0.93rem;
}

/* ---------- Stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { text-align: center; margin-bottom: 0; }
.stat-num { font-size: 2rem; font-weight: 700; color: var(--ink); font-family: var(--font-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 0.88rem; margin-top: 0.2rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; background: var(--bg-soft); }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
.actions { white-space: nowrap; }

/* ---------- Forms ---------- */
.form label { display: block; margin-bottom: 0.9rem; font-weight: 500; font-size: 0.9rem; color: var(--ink); }
.form input[type="text"], .form input[type="email"], .form input[type="password"],
.form input[type="number"], .form input[type="date"], .form input[type="search"],
.form select, .form textarea {
  display: block; width: 100%; margin-top: 0.35rem; padding: 0.62rem 0.8rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 0.95rem; font-family: inherit;
  background: var(--bg-soft); color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}
.form input::placeholder, .form textarea::placeholder { color: var(--faint); }
.form textarea { resize: vertical; }
.form-inline { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: flex-end; }
.form-inline label { margin-bottom: 0; min-width: 12rem; flex: 1; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 1.05rem; height: 1.05rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  padding: 0.62rem 1.25rem; border-radius: var(--radius-sm);
  font-size: 0.92rem; font-weight: 600; font-family: var(--font-display); letter-spacing: 0.01em;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35); }
.btn-secondary { background: var(--primary-soft); color: var(--primary-hover); border-color: var(--primary-border); }
.btn-secondary:hover { background: rgba(99, 102, 241, 0.2); color: var(--primary-hover); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(248, 113, 113, 0.35); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.2); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border-strong); }
.btn-ghost:hover { color: var(--ink); background: rgba(255, 255, 255, 0.04); }
.btn-sm { padding: 0.38rem 0.75rem; font-size: 0.84rem; }
.btn-block { display: flex; width: 100%; text-align: center; }

/* ---------- Alerts & badges ---------- */
.alert { padding: 0.8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.1rem; font-size: 0.93rem; border: 1px solid; }
.alert.success { background: var(--success-soft); color: var(--success); border-color: rgba(52, 211, 153, 0.3); }
.alert.error { background: var(--danger-soft); color: var(--danger); border-color: rgba(248, 113, 113, 0.3); }
.badge { display: inline-flex; align-items: center; padding: 0.18rem 0.65rem; border-radius: 999px; font-size: 0.76rem; font-weight: 600; letter-spacing: 0.02em; border: 1px solid transparent; }
.tick { color: var(--success); font-weight: 700; margin-right: 0.15rem; }
.cross { color: var(--muted); font-weight: 700; margin-right: 0.15rem; }
@media (max-width: 640px) { .plan-highlight { transform: none !important; } }
.badge-pass { background: var(--success-soft); color: var(--success); border-color: rgba(52, 211, 153, 0.3); }
.badge-fail { background: var(--danger-soft); color: var(--danger); border-color: rgba(248, 113, 113, 0.3); }
.badge-muted { background: rgba(255, 255, 255, 0.06); color: var(--muted); border-color: var(--border); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(251, 191, 36, 0.3); }
.badge-info { background: var(--info-soft); color: var(--info); border-color: rgba(96, 165, 250, 0.3); }
.badge-violet { background: rgba(167, 139, 250, 0.12); color: var(--violet); border-color: rgba(167, 139, 250, 0.3); }
.badge-pink { background: rgba(249, 168, 212, 0.12); color: var(--pink); border-color: rgba(249, 168, 212, 0.3); }

/* ---------- Auth (split panel) ---------- */
.auth-wrap {
  display: flex; justify-content: center; align-items: center;
  padding: 3rem 1rem; min-height: 70vh;
}
.auth-card {
  display: flex; width: 100%; max-width: 880px; overflow: hidden;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg); padding: 0; margin-bottom: 0;
  text-align: left;
}
.auth-brand-panel {
  flex: 0 0 42%; position: relative; overflow: hidden;
  background: linear-gradient(160deg, #1e1b4b 0%, #312e81 100%);
  padding: 2.5rem 2rem; display: flex; flex-direction: column; justify-content: center;
  color: #eef2ff;
}
.auth-brand-panel > * { position: relative; z-index: 1; }
.auth-brand-panel .auth-logo { margin-bottom: 1rem; }
.auth-brand-panel .auth-logo img { width: 52px; height: 52px; }
.auth-brand-name { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; font-family: var(--font-display); }
.auth-brand-tag { margin-top: 0.8rem; font-size: 0.95rem; color: #c7d2fe; line-height: 1.6; }
.auth-brand-points { margin: 1.4rem 0 0; padding: 0; list-style: none; font-size: 0.9rem; }
.auth-brand-points li { margin-bottom: 0.55rem; display: flex; gap: 0.55rem; align-items: flex-start; color: #e0e7ff; }
.auth-brand-points li::before { content: "✓"; color: #a5b4fc; font-weight: 700; }
.auth-form-panel { flex: 1; padding: 2.5rem 2.25rem; }
.auth-form-panel h1 { margin-bottom: 0.3rem; font-size: 1.6rem; }
.auth-form-panel .form { margin-top: 1.4rem; }
.auth-form-panel .auth-logo { display: none; }
@media (max-width: 720px) {
  .auth-card { flex-direction: column; max-width: 440px; }
  .auth-brand-panel { flex: none; padding: 1.8rem; }
  .auth-brand-points { display: none; }
}
.auth-card.centered { display: block; max-width: 420px; text-align: center; padding: 1.5rem; }
.auth-card.centered .auth-logo { display: block; font-size: 3rem; text-align: center; }
.auth-card.centered .auth-logo img { width: 60px; height: 60px; }
.auth-card.centered .form { text-align: left; margin-top: 1.2rem; }
.auth-logo { font-size: 3rem; }

/* ---------- Courses / levels (student) ---------- */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.course-card { transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.course-card:hover { border-color: var(--primary-border); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
.course-card h2 { margin-top: 0.4rem; }
/* Muted course accents — subtle top border tints */
.course-card.hue-pink, .course-card.hue-violet, .course-card.hue-cyan,
.course-card.hue-green, .course-card.hue-orange, .course-card.hue-yellow { border-top: 2px solid var(--primary); }
.course-card.hue-pink .progress-bar, .course-card.hue-violet .progress-bar,
.course-card.hue-cyan .progress-bar, .course-card.hue-green .progress-bar,
.course-card.hue-orange .progress-bar, .course-card.hue-yellow .progress-bar {
  background: var(--primary);
}
.progress { background: var(--card-2); border: 1px solid var(--border); border-radius: 999px; height: 8px; overflow: hidden; }
.progress-bar { background: var(--primary); height: 100%; border-radius: 999px; transition: width 0.4s ease; }
.level-list { display: flex; flex-direction: column; gap: 0.7rem; }
.level-row {
  display: flex; align-items: center; gap: 1rem; padding: 0.9rem 1rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft);
}
.level-row.done { border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.05); }
.level-row.locked { opacity: 0.55; }
.level-num {
  width: 2.4rem; height: 2.4rem; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary-hover); font-weight: 700;
}
.level-row.done .level-num { background: var(--success-soft); color: var(--success); }
.level-row.locked .level-num { background: var(--card-2); color: var(--muted); }
.level-info { flex: 1; }
.level-action { display: flex; gap: 0.5rem; align-items: center; }

/* ---------- Curriculum roadmap (vertical timeline) ---------- */
.roadmap { position: relative; margin: 0.4rem 0 0; padding-left: 2.6rem; }
.roadmap::before {
  content: ""; position: absolute; left: 1.15rem; top: 1.4rem; bottom: 1.4rem; width: 2px;
  background: linear-gradient(to bottom, var(--success), var(--primary), var(--border));
  border-radius: 2px; opacity: 0.55;
}
.roadmap-step { position: relative; padding: 0 0 1.1rem; }
.roadmap-step:last-child { padding-bottom: 0.2rem; }
.roadmap-node {
  position: absolute; left: -2.6rem; top: 0.85rem; width: 2.35rem; height: 2.35rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;
  background: var(--card-2); color: var(--muted); border: 2px solid var(--border); z-index: 1;
}
.roadmap-step.done .roadmap-node { background: var(--success-soft); color: var(--success); border-color: var(--success); }
.roadmap-step.current .roadmap-node { background: var(--primary-soft); color: var(--primary-hover); border-color: var(--primary); }
.roadmap-step.locked .roadmap-node { opacity: 0.7; }
.roadmap-spin {
  width: 1rem; height: 1rem; border-radius: 50%;
  border: 2.5px solid var(--primary); border-top-color: transparent;
  animation: roadmap-spin 1.1s linear infinite;
}
@keyframes roadmap-spin { to { transform: rotate(360deg); } }
.roadmap-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft);
  padding: 0.9rem 1rem;
}
.roadmap-step.done .roadmap-card { border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.05); }
.roadmap-step.current .roadmap-card { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.roadmap-step.locked .roadmap-card { opacity: 0.6; }
.roadmap-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.6rem; flex-wrap: wrap; }
.roadmap-meta { margin-top: 0.45rem; }
.roadmap-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.7rem; }

/* ---------- Course detail: stats, skills, trainer ---------- */
.course-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.7rem; margin-bottom: 1rem; }
.course-stat {
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft);
  padding: 0.8rem 0.9rem; text-align: center;
}
.course-stat .stat-num { font-size: 1.35rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.course-stat .stat-label { font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; }
.skill-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
.skill-pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: var(--primary-soft); color: var(--primary-hover);
  border: 1px solid var(--primary); border-radius: 999px;
  padding: 0.32rem 0.8rem; font-size: 0.85rem; font-weight: 600;
}
.trainer-card { display: flex; gap: 0.9rem; align-items: center; flex-wrap: wrap; }
.trainer-avatar {
  width: 3.2rem; height: 3.2rem; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff; font-weight: 800; font-size: 1.3rem;
}
@media (max-width: 560px) {
  .roadmap { padding-left: 2.2rem; }
  .roadmap::before { left: 0.95rem; }
  .roadmap-node { left: -2.2rem; width: 2rem; height: 2rem; top: 0.9rem; font-size: 0.9rem; }
}

/* ---------- Test runner ---------- */
.test-topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.timer {
  font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--card-2); border: 1px solid var(--border); color: var(--ink);
  padding: 0.35rem 0.9rem; border-radius: var(--radius-sm);
  font-family: var(--font-display);
}
.timer.low { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.instructions ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.q-dots { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.q-dot {
  width: 2.1rem; height: 2.1rem; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--bg-soft); cursor: pointer; font-weight: 600; color: var(--muted);
  font-family: inherit; transition: all 0.12s ease;
}
.q-dot.current { border-color: var(--primary); color: var(--primary-hover); box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25); }
.q-dot.answered { background: var(--success); border-color: var(--success); color: #fff; }
.q-dot.skipped { background: var(--warn); border-color: var(--warn); color: #1c1917; }
.q-text { font-size: 1.08rem; font-weight: 600; }
.q-opts { display: flex; flex-direction: column; gap: 0.6rem; margin: 1rem 0 1.4rem; }
.q-opt {
  display: flex; align-items: center; gap: 0.8rem; padding: 0.75rem 0.9rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; font-weight: 500;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.q-opt:hover { border-color: var(--primary); background: var(--primary-soft); }
.q-opt input { width: 1.1rem; height: 1.1rem; accent-color: var(--primary); }
.opt-letter {
  width: 1.9rem; height: 1.9rem; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card-2); font-weight: 700; font-size: 0.85rem; color: var(--muted);
}
.q-nav { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; flex-wrap: wrap; }

/* ---------- Results / review ---------- */
.result-summary { display: flex; gap: 1.4rem; align-items: center; }
.score-ring {
  width: 5.5rem; height: 5.5rem; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 700; color: #fff;
  font-family: var(--font-display);
}
.score-ring.pass { background: #059669; }
.score-ring.fail { background: #dc2626; }
.result-title { font-size: 1.25rem; font-weight: 700; }
.result-title.pass { color: var(--success); }
.result-title.fail { color: var(--danger); }
.review-q { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; margin-bottom: 1rem; background: var(--bg-soft); }
.review-q.correct { border-left: 4px solid var(--success); }
.review-q.wrong { border-left: 4px solid var(--danger); }
.review-q-head { font-size: 1rem; margin-bottom: 0.7rem; font-weight: 600; }
.review-opts { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.6rem; }
.review-opt { padding: 0.55rem 0.75rem; border-radius: var(--radius-sm); border: 1px solid var(--border); display: flex; align-items: center; gap: 0.6rem; }
.review-opt.opt-correct { background: var(--success-soft); border-color: rgba(52, 211, 153, 0.4); }
.review-opt.opt-wrong { background: var(--danger-soft); border-color: rgba(248, 113, 113, 0.4); }
.explanation { background: var(--warn-soft); border: 1px solid rgba(251, 191, 36, 0.3); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; margin-top: 0.6rem; font-size: 0.9rem; color: var(--warn); }

/* ---------- Admin: level blocks ---------- */
.level-block { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 0.8rem; background: var(--bg-soft); }
.level-block summary { padding: 0.9rem 1rem; cursor: pointer; font-size: 1rem; font-weight: 600; }
.level-body { padding: 0 1rem 1.2rem; border-top: 1px solid var(--border); }
.level-actions { display: flex; gap: 0.5rem; margin: 0.8rem 0; flex-wrap: wrap; }

/* ---------- Certificates (decorative, kept) ---------- */
.cert-icon { font-size: 2.2rem; }
.cert-page { background: var(--bg); }
.cert-toolbar { max-width: 940px; margin: 1.25rem auto; display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; padding: 0 1rem; flex-wrap: wrap; }
.cert-sheet {
  max-width: 940px; margin: 0 auto 3rem; background: #101014;
  border: 1px solid var(--border-strong); border-radius: 16px; padding: 10px;
  box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}
.cert-inner {
  position: relative; border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 3.2rem 2.5rem; text-align: center; background: #141419;
}
.cert-brand { display: flex; align-items: center; justify-content: center; gap: 0.6rem; margin-bottom: 1.6rem; }
.cert-brand img { width: 40px; height: 40px; }
.cert-brand-name { font-size: 1.2rem; font-weight: 700; letter-spacing: 0.28em; text-transform: uppercase; color: var(--primary-hover); font-family: var(--font-display); }
.cert-institute { font-size: 1.05rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--muted); }
.cert-title {
  font-size: 2.6rem; font-weight: 700; margin: 0.7rem 0; color: var(--ink);
  font-family: var(--font-display); letter-spacing: -0.02em;
}
.cert-sub { color: var(--muted); margin: 0.9rem 0 0.3rem; }
.cert-name {
  font-family: Georgia, "Times New Roman", serif; font-size: 2.1rem; font-weight: 700;
  color: #fff; border-bottom: 2px solid var(--primary);
  display: inline-block; padding: 0 2rem 0.35rem; margin: 0.4rem 0;
}
.cert-course { font-size: 1.45rem; font-weight: 600; color: var(--primary-hover); margin: 0.5rem 0 1.2rem; }
.cert-meta { display: flex; justify-content: space-around; gap: 1rem; margin-top: 1.8rem; flex-wrap: wrap; }
.cert-meta .muted { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.cert-meta strong { color: var(--ink); }
.cert-verify { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 2rem; }
.cert-qr { width: 112px; height: 112px; border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 5px; }
.cert-verify-text { text-align: left; font-size: 0.9rem; }
.cert-verify-text code { font-size: 0.7rem; word-break: break-all; }
.cert-seal { margin-top: 1.4rem; display: flex; justify-content: center; }
.cert-seal img { width: 56px; height: 56px; opacity: 0.95; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 1.4rem 0 2rem; color: var(--muted); font-size: 0.85rem; }
.footer .container { padding-bottom: 0; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* ---------- Print ---------- */
@media print {
  .no-print, .topbar, .footer, .alert { display: none !important; }
  body.cert-page { background: #fff; }
  .cert-sheet { box-shadow: none; margin: 0; max-width: none; border-radius: 0; }
  .cert-inner { border-radius: 0; }
  .container { padding: 0; }
}

/* Two-column form rows */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* ============================================================
   Landing page
   ============================================================ */
.landing { background: var(--bg); color: var(--ink); overflow-x: clip; }
.landing-nav {
  position: sticky; top: 0; z-index: 60;
  background: rgba(9, 9, 11, 0.85); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.landing-nav-inner {
  max-width: 1140px; margin: 0 auto; padding: 0.85rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
}
.landing-nav .navlinks { margin-left: 1rem; }
.landing-nav .userbox .btn { margin-left: 0.25rem; }

.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.hero-inner {
  position: relative; max-width: 1140px; margin: 0 auto; padding: 5rem 1.25rem 4.5rem;
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 3rem; align-items: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--primary-soft); border: 1px solid var(--primary-border);
  color: var(--primary-hover); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 0.4rem 0.9rem; border-radius: 999px; margin-bottom: 1.2rem;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.hero-title { font-size: clamp(2.3rem, 5vw, 3.6rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; margin: 0 0 1.1rem; color: var(--ink); }
.hero-title .grad { color: var(--primary-hover); }
.hero-sub { font-size: 1.1rem; color: var(--muted); max-width: 34rem; margin: 0 0 1.8rem; line-height: 1.65; }
.hero-cta { display: flex; gap: 0.9rem; flex-wrap: wrap; align-items: center; }
.hero-cta .btn { padding: 0.8rem 1.6rem; font-size: 1rem; }
.hero-note { margin-top: 1rem; font-size: 0.85rem; color: var(--muted); }
.hero-visual { position: relative; display: flex; justify-content: center; }
.hero-card {
  width: 100%; max-width: 400px; background: var(--card);
  border: 1px solid var(--border-strong); border-radius: 16px; padding: 1.6rem;
  box-shadow: var(--shadow-lg);
}
.hero-card-top { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1.2rem; }
.hero-card-top img { width: 44px; height: 44px; }
.hero-card-title { font-weight: 700; font-size: 1.05rem; font-family: var(--font-display); }
.hero-card-sub { font-size: 0.82rem; color: var(--muted); }
.hero-stat-row { display: flex; gap: 0.8rem; margin-top: 1.2rem; }
.hero-stat { flex: 1; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.7rem; text-align: center; }
.hero-stat b { display: block; font-size: 1.25rem; color: var(--ink); font-family: var(--font-display); }
.hero-stat span { font-size: 0.75rem; color: var(--muted); }
.hero-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.65rem; font-size: 0.92rem; }
.hero-checklist li { display: flex; gap: 0.6rem; align-items: flex-start; color: var(--muted); }
.hero-checklist li::before { content: "✓"; color: var(--primary-hover); font-weight: 700; flex-shrink: 0; }

.section { max-width: 1140px; margin: 0 auto; padding: 4.5rem 1.25rem; }
.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; letter-spacing: -0.025em; text-align: center; margin-bottom: 0.7rem; }
.section-sub { text-align: center; color: var(--muted); max-width: 40rem; margin: 0 auto 2.6rem; font-size: 1rem; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.25rem; }
.feature-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem; transition: border-color 0.2s ease;
}
.feature-card:hover { border-color: var(--primary-border); }
.feature-icon {
  width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; background: var(--primary-soft); border: 1px solid var(--primary-border);
  color: var(--primary-hover); margin-bottom: 1rem;
}
.feature-card h3 { margin: 0 0 0.5rem; font-size: 1.02rem; }
.feature-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.catalog-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; transition: border-color 0.2s ease;
}
.catalog-card:hover { border-color: var(--primary-border); }
.catalog-tag {
  display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--primary-hover); background: var(--primary-soft);
  border: 1px solid var(--primary-border); border-radius: 999px; padding: 0.15rem 0.6rem; margin-bottom: 0.7rem;
}
.catalog-card h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.catalog-card p { margin: 0; color: var(--muted); font-size: 0.87rem; }

.stats-band { max-width: 1140px; margin: 0 auto 4rem; padding: 0 1.25rem; }
.stats-band-inner {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.9rem;
  background: var(--card); border: 1px solid var(--border-strong);
  border-radius: 16px; padding: 1.8rem 1.5rem;
}
.stat-item { text-align: center; }
.stat-item b { display: block; font-size: clamp(1.2rem, 2vw, 1.6rem); color: var(--ink); font-weight: 700; font-family: var(--font-display); }
.stat-item span { font-size: 0.75rem; color: var(--muted); }
@media (max-width: 900px) { .stats-band-inner { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 901px) and (max-width: 1100px) { .stats-band-inner { grid-template-columns: repeat(4, 1fr); } }

.how-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
@media (max-width: 1000px) { .how-steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .how-steps { grid-template-columns: 1fr; } }
.step-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.8rem 1.4rem 1.4rem; text-align: center;
}
.step-num {
  width: 2.6rem; height: 2.6rem; margin: 0 auto 1rem; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.15rem;
  font-family: var(--font-display);
}
.step-card h3 { margin: 0 0 0.5rem; }
.step-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.testimonial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.testimonial {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem;
}
.testimonial .stars { color: var(--warn); letter-spacing: 0.15em; margin-bottom: 0.7rem; }
.testimonial p { margin: 0 0 1rem; font-size: 0.95rem; color: var(--muted); }
.testimonial-who { display: flex; align-items: center; gap: 0.8rem; }
.testimonial-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.testimonial-who b { display: block; font-size: 0.92rem; }
.testimonial-who span { font-size: 0.8rem; color: var(--muted); }

.faq-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 0.8rem; }
.faq-item {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
}
.faq-item summary {
  cursor: pointer; padding: 1.1rem 1.3rem; font-weight: 600; font-size: 1rem; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.4rem; color: var(--primary-hover); flex-shrink: 0; transition: transform 0.2s ease; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-a { padding: 0 1.3rem 1.2rem; color: var(--muted); font-size: 0.95rem; }

.cta-band { max-width: 1140px; margin: 0 auto 4.5rem; padding: 0 1.25rem; }
.cta-band-inner {
  text-align: center; background: #1e1b4b;
  border: 1px solid rgba(99, 102, 241, 0.4); border-radius: 20px; padding: 3.5rem 2rem;
}
.cta-band h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin: 0 0 0.7rem; color: #fff; }
.cta-band p { color: #c7d2fe; margin: 0 0 1.8rem; }

.landing-footer { border-top: 1px solid var(--border); background: var(--bg-soft); }
.footer-grid {
  max-width: 1140px; margin: 0 auto; padding: 3rem 1.25rem 2rem;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem;
}
.footer-brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.1rem; margin-bottom: 0.7rem; font-family: var(--font-display); }
.footer-brand img { width: 30px; height: 30px; }
.footer-grid p { color: var(--muted); font-size: 0.9rem; margin: 0; max-width: 22rem; }
.footer-col h4 { margin: 0 0 0.8rem; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.footer-col a { display: block; color: var(--muted); text-decoration: none; font-size: 0.92rem; margin-bottom: 0.5rem; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  max-width: 1140px; margin: 0 auto; padding: 1.2rem 1.25rem 1.8rem;
  border-top: 1px solid var(--border); color: var(--muted); font-size: 0.82rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}

/* ---------- Landing responsive ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; padding: 3.5rem 1.25rem 3rem; gap: 2.5rem; }
  .hero-visual { order: -1; }
  .hero-card { max-width: 460px; }
  .how-steps { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .landing-nav .navlinks { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .landing-nav-inner { gap: 0.5rem; padding: 0.6rem 0.75rem; }
  .landing-nav .userbox .btn { padding: 0.45rem 0.7rem; font-size: 0.82rem; margin-left: 0.15rem; }
  .landing-nav .userbox .icon-btn { width: 2rem; height: 2rem; }
  .landing-nav .brand { font-size: 1.05rem; }
  .landing-nav .brand img { width: 28px; height: 28px; }
}
.landing-nav .short-text { display: none; }
@media (max-width: 480px) {
  .landing-nav .full-text { display: none; }
  .landing-nav .short-text { display: inline; }
  .landing-nav .userbox .btn { padding: 0.4rem 0.6rem; font-size: 0.8rem; }
}

/* ---------- Topbar responsive ---------- */
@media (max-width: 860px) {
  .topbar-inner { flex-wrap: wrap; gap: 0.6rem 1rem; }
  .navlinks {
    order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto;
    padding-bottom: 0.3rem; scrollbar-width: thin;
  }
  .navlinks a { flex-shrink: 0; }
  .username { max-width: 7rem; }
}

/* ---- PWA install banner ---- */
.pwa-banner {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 1rem; z-index: 1000;
  display: flex; align-items: center; gap: 0.75rem;
  width: min(26rem, calc(100% - 2rem));
  background: var(--card-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 0.7rem 0.85rem;
  box-shadow: var(--shadow-lg);
}
.pwa-banner[hidden] { display: none; }
.pwa-banner-icon { border-radius: 10px; flex-shrink: 0; }
.pwa-banner-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pwa-banner-text strong { font-size: 0.92rem; }
.pwa-banner-text small { color: var(--muted); font-size: 0.78rem; }
.pwa-banner-dismiss {
  background: transparent; border: none; color: var(--muted);
  font-size: 1rem; cursor: pointer; padding: 0.25rem 0.4rem; flex-shrink: 0;
}
.pwa-banner-dismiss:hover { color: var(--ink); }

/* ---------- Legal docs ---------- */
.legal-doc h2 { font-size: 1.1rem; margin: 1.4rem 0 0.5rem; }
.legal-doc h2:first-child { margin-top: 0; }
.legal-doc p, .legal-doc li { line-height: 1.65; }
.legal-doc ul { padding-left: 1.3rem; }
.checkbox-label input[type="checkbox"] { width: 1.1rem; height: 1.1rem; flex-shrink: 0; }

/* ---------- Practice sessions & coding ---------- */
.topic-card { display: flex; gap: 1rem; align-items: flex-start; }
.topic-num {
  flex-shrink: 0; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; background: var(--primary);
}
.pq-opt { cursor: pointer; }
.pq-opt.disabled { cursor: default; opacity: .85; }
.pq-opt.pq-correct { border-color: #059669; background: #ecfdf5; color: #064e3b; }
.pq-opt.pq-correct .opt-letter { background: #059669; color: #fff; }
.pq-opt.pq-wrong { border-color: #dc2626; background: #fef2f2; color: #7f1d1d; }
.pq-opt.pq-wrong .opt-letter { background: #dc2626; color: #fff; }
.pq-explain {
  margin-top: .8rem; padding: .8rem 1rem; border-radius: var(--radius-sm);
  background: #fffbeb; border: 1px solid #fde68a; line-height: 1.6; color: #92400e;
}
.code-sample {
  background: #131316; color: #e4e4e7; padding: .9rem 1rem;
  border-radius: var(--radius-sm); overflow-x: auto; font-size: .85rem; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word; border: 1px solid var(--border);
}
#code-editor {
  background: #131316; color: #e4e4e7; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: .8rem; tab-size: 4;
  resize: vertical; max-width: 100%;
}
#code-editor:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25); }
details summary { font-weight: 600; cursor: pointer; }

/* ============================================================
   Light theme — toggled via [data-theme="light"] on <html>.
   Dark remains the default (:root values above).
   ============================================================ */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --card: #ffffff;
  --card-2: #f1f5f9;
  --ink: #09090b;
  --muted: #52525b;
  --faint: #a1a1aa;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-dark: #4338ca;
  --primary-soft: rgba(79, 70, 229, 0.08);
  --primary-border: rgba(79, 70, 229, 0.28);
  --success: #059669;
  --success-soft: rgba(5, 150, 105, 0.1);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.08);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, 0.1);
  --info: #0284c7;
  --info-soft: rgba(2, 132, 199, 0.1);
  --violet: #7c3aed;
  --pink: #db2777;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12);
  --accent2: #7c3aed;
  --grad-brand: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --grad-text: linear-gradient(120deg, #4f46e5 0%, #7c3aed 100%);
  --glow-sm: 0 0 0 1px rgba(79, 70, 229, 0.16), 0 10px 30px rgba(79, 70, 229, 0.14);
  --shadow-md: 0 1px 2px rgba(16, 24, 40, 0.08), 0 12px 28px rgba(16, 24, 40, 0.10);
}
[data-theme="light"] .topbar { background: rgba(255, 255, 255, 0.88); }
[data-theme="light"] .landing-nav { background: rgba(255, 255, 255, 0.88); }
[data-theme="light"] .navlinks a:hover { background: rgba(9, 9, 11, 0.05); }
[data-theme="light"] .table tbody tr:hover td { background: rgba(9, 9, 11, 0.02); }
[data-theme="light"] .table th { background: #f8fafc; }
[data-theme="light"] .btn-ghost:hover { background: rgba(9, 9, 11, 0.04); }
[data-theme="light"] .btn-primary { box-shadow: 0 1px 2px rgba(79, 70, 229, 0.3); }
[data-theme="light"] .btn-primary:hover { box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3); }
[data-theme="light"] .form input::placeholder,
[data-theme="light"] .form textarea::placeholder { color: var(--faint); }
[data-theme="light"] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(9, 9, 11, 0.06), transparent);
}
[data-theme="light"] .auth-brand-panel {
  background: linear-gradient(160deg, #312e81 0%, #4f46e5 100%);
}
[data-theme="light"] .cta-band-inner { background: #312e81; }
[data-theme="light"] .cert-sheet { background: #fafafa; }
[data-theme="light"] .cert-inner { background: #ffffff; }
[data-theme="light"] .cert-title { color: #09090b; }
[data-theme="light"] .cert-name { color: #09090b; }
[data-theme="light"] .hero-title .grad { color: var(--primary); }

/* Theme toggle + notification bell buttons */
.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-size: 1.05rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.icon-btn:hover { border-color: var(--primary); color: var(--ink); }
.badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
/* Chat bubbles (AI tutor) */
.chat-wrap { display: flex; flex-direction: column; gap: 0.7rem; margin: 1rem 0; }
.chat-msg { max-width: 85%; padding: 0.7rem 0.95rem; border-radius: 14px; line-height: 1.55; white-space: pre-wrap; font-size: 0.95rem; }
.chat-msg.user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.assistant { align-self: flex-start; background: var(--card-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; color: var(--ink); }
/* Flashcard flip */
.flash-card { perspective: 800px; cursor: pointer; }
.flash-inner { transition: transform 0.5s; transform-style: preserve-3d; position: relative; min-height: 14rem; }
.flash-card.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face { backface-visibility: hidden; -webkit-backface-visibility: hidden; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 1.5rem; border-radius: var(--radius); }
.flash-front { background: var(--card-2); border: 1px solid var(--border); }
.flash-back { background: var(--primary-soft); border: 1px solid var(--primary-border); transform: rotateY(180deg); }
/* Timer bar (challenges) */
.timer-bar { height: 0.5rem; background: var(--card-2); border-radius: 999px; overflow: hidden; }
.timer-fill { height: 100%; background: var(--primary); transition: width 1s linear; }
.timer-fill.low { background: var(--danger); }
/* Streak flame */
.streak { font-weight: 700; color: var(--warn); }

/* ============================================================
   Public catalog — ratings & reviews
   ============================================================ */
.rating-stars { color: var(--warn); letter-spacing: 0.12em; font-size: 0.95rem; }
.rating-line { display: flex; align-items: center; gap: 0.45rem; margin: 0.5rem 0; }
.catalog-stats { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0.6rem 0; }
.catalog-stat { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.85rem; color: var(--muted); }
.catalog-search-wrap { max-width: 26rem; margin-top: 1rem; }
.catalog-search-wrap input { width: 100%; }

/* ============================================================
   Course discovery — filters, chips, skill picker
   ============================================================ */
.discovery-controls { display: flex; gap: 0.8rem; flex-wrap: wrap; align-items: flex-end; }
.discovery-controls .catalog-search-wrap { margin-top: 0; flex: 2; min-width: 12rem; }
.discovery-label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.discovery-label select { min-width: 9rem; }
.chip-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.skill-picker { display: flex; gap: 0.5rem; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.4rem; scrollbar-width: thin; }
.chip {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.42rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.chip:hover { border-color: var(--primary); transform: translateY(-1px); }
.chip-active {
  background: var(--grad-brand, var(--primary));
  border-color: transparent;
  color: #fff;
  box-shadow: var(--glow-sm, 0 2px 10px rgba(99, 102, 241, 0.35));
}
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.related-card { display: flex; flex-direction: column; gap: 0.5rem; }
.related-card h3 { margin: 0; font-size: 1.02rem; }
.related-card h3 a { color: var(--ink); text-decoration: none; }
.related-card h3 a:hover { color: var(--primary); }
.review-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.1rem; }
.review-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.review-card .stars { color: var(--warn); letter-spacing: 0.12em; margin-bottom: 0.5rem; }
.review-card .review-title { font-weight: 700; margin: 0 0 0.4rem; }
.review-card .review-body { margin: 0 0 0.9rem; font-size: 0.93rem; color: var(--muted); }
.review-meta { display: flex; align-items: center; gap: 0.65rem; }
.review-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.review-meta b { display: block; font-size: 0.9rem; }
.review-meta .sub { font-size: 0.78rem; color: var(--muted); }
.rating-summary { display: flex; align-items: center; gap: 0.9rem; margin: 0.8rem 0 1.2rem; }
.rating-summary .big { font-size: 2.4rem; font-weight: 700; line-height: 1; font-family: var(--font-display); }

/* ============================================================
   Practice sessions & coding workspace — viewport stability
   ============================================================ */
@media (max-width: 700px) {
  .grid-2[style] { grid-template-columns: 1fr !important; }
}
.practice-progress > div:first-child { flex-wrap: wrap; gap: .5rem .8rem; }
.q-screen .q-head { flex-wrap: wrap; gap: .4rem .8rem; }
.q-opt > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.q-text { overflow-wrap: break-word; }
.pq-explain { overflow-wrap: break-word; }
@media (max-width: 480px) {
  #code-editor { font-size: 16px !important; }
  .btn-sm { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .page-head h1 { font-size: 1.65rem; }
}

/* Payment tracking timeline + financials */
.pay-timeline { display: flex; align-items: flex-start; margin: 1rem 0 .5rem; }
.pay-step { flex: 1; text-align: center; position: relative; }
.pay-step::before { content: ''; position: absolute; top: 1.1rem; left: -50%; width: 100%; height: 2px; background: var(--border-strong); z-index: 0; }
.pay-step:first-child::before { display: none; }
.pay-step.done::before { background: var(--success); }
.pay-step.active::before { background: linear-gradient(90deg, var(--success), var(--border-strong)); }
.pay-dot { width: 2.2rem; height: 2.2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; background: var(--bg-soft); border: 2px solid var(--border-strong); position: relative; z-index: 1; color: var(--muted); }
.pay-step.done .pay-dot { background: var(--success); border-color: var(--success); color: #fff; }
.pay-step.active .pay-dot { border-color: var(--warn); color: var(--warn); }
.pay-step.failed .pay-dot { background: var(--danger); border-color: var(--danger); color: #fff; }
.pay-label { margin-top: .4rem; font-weight: 600; font-size: .85rem; }
.fin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.fin-card { text-align: center; padding: 1.2rem .8rem; }
.fin-card .fin-num { font-size: 1.7rem; font-weight: 700; margin: .3rem 0; font-family: var(--font-display); }
.fin-bar-row { display: flex; align-items: center; gap: .6rem; margin: .35rem 0; }
.fin-bar-label { width: 4.5rem; flex-shrink: 0; font-size: .8rem; }
.fin-bar-track { flex: 1; height: 1rem; background: var(--card-2); border-radius: 999px; overflow: hidden; }
.fin-bar-fill { height: 100%; border-radius: 999px; background: var(--primary); }
.fin-bar-val { width: 5.5rem; text-align: right; font-size: .8rem; font-weight: 700; flex-shrink: 0; }

/* ---------- Custom scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: padding-box; border: 2px solid transparent; }

/* ---------- Polished keyboard focus ---------- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Reduced motion: respect user preference ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   Rich premium theme — depth without gaudiness.
   Layered ambient glows, glassmorphism, gradient accents
   (indigo <-> violet only). All washes kept at 5-12% opacity:
   premium depth, never neon, never rainbow.
   ============================================================ */

/* ---------- Ambient layered page background ---------- */
body {
  background:
    radial-gradient(1100px 540px at 8% -10%, rgba(99, 102, 241, 0.09), transparent 62%),
    radial-gradient(900px 600px at 100% 112%, rgba(139, 92, 246, 0.08), transparent 62%),
    var(--bg);
  background-attachment: fixed;
}
[data-theme="light"] body {
  background:
    radial-gradient(1100px 540px at 8% -10%, rgba(79, 70, 229, 0.07), transparent 62%),
    radial-gradient(900px 600px at 100% 112%, rgba(124, 58, 237, 0.06), transparent 62%),
    var(--bg);
  background-attachment: fixed;
}

/* ---------- Gradient text ---------- */
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.hero-title .grad {
  background: linear-gradient(115deg, #818cf8 0%, #a78bfa 60%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
[data-theme="light"] .hero-title .grad {
  background: linear-gradient(115deg, #4f46e5 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* ---------- Hero: mesh gradient + dot texture ---------- */
.hero {
  background:
    radial-gradient(rgba(148, 163, 184, 0.10) 1px, transparent 1.5px),
    radial-gradient(760px 420px at 15% 0%, rgba(99, 102, 241, 0.16), transparent 65%),
    radial-gradient(680px 420px at 88% 105%, rgba(139, 92, 246, 0.12), transparent 65%);
  background-size: 24px 24px, auto, auto;
}
[data-theme="light"] .hero {
  background:
    radial-gradient(rgba(9, 9, 11, 0.055) 1px, transparent 1.5px),
    radial-gradient(760px 420px at 15% 0%, rgba(79, 70, 229, 0.10), transparent 65%),
    radial-gradient(680px 420px at 88% 105%, rgba(124, 58, 237, 0.08), transparent 65%);
  background-size: 24px 24px, auto, auto;
}
.hero-card {
  background: rgba(18, 18, 21, 0.60);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 0 44px rgba(99, 102, 241, 0.12);
}
[data-theme="light"] .hero-card {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(9, 9, 11, 0.08);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 0 44px rgba(79, 70, 229, 0.10);
}

/* ---------- Glassmorphism utility ---------- */
.glass {
  background: rgba(18, 18, 21, 0.55);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
[data-theme="light"] .glass {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(9, 9, 11, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* ---------- Richer cards ---------- */
.card {
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s ease, box-shadow 0.22s ease, transform 0.2s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-border);
  box-shadow: var(--shadow-md), var(--glow-sm);
}
.card-accent { position: relative; overflow: hidden; }
.card-accent::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad-brand);
}
.feature-card, .catalog-card, .step-card, .testimonial, .review-card, .course-card {
  transition: border-color 0.2s ease, box-shadow 0.22s ease, transform 0.2s ease;
}
.feature-card:hover, .catalog-card:hover, .step-card:hover,
.testimonial:hover, .review-card:hover, .course-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-border);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42), 0 0 26px rgba(99, 102, 241, 0.13);
}
[data-theme="light"] .feature-card:hover, [data-theme="light"] .catalog-card:hover,
[data-theme="light"] .step-card:hover, [data-theme="light"] .testimonial:hover,
[data-theme="light"] .review-card:hover, [data-theme="light"] .course-card:hover {
  box-shadow: 0 14px 30px rgba(16, 24, 40, 0.12), 0 0 26px rgba(79, 70, 229, 0.12);
}
.feature-icon {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(139, 92, 246, 0.16));
  border: 1px solid rgba(139, 92, 246, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 16px rgba(99, 102, 241, 0.20);
}

/* ---------- Gradient primary buttons ---------- */
.btn {
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    box-shadow 0.18s ease, transform 0.16s ease, filter 0.16s ease;
}
.btn-primary {
  background: var(--grad-brand);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-primary:hover {
  background: var(--grad-brand);
  border-color: rgba(255, 255, 255, 0.08);
  color: #fff;
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.50), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
[data-theme="light"] .btn-primary {
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
[data-theme="light"] .btn-primary:hover {
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* ---------- Gradient progress bars ---------- */
.progress-bar { background: var(--grad-brand); }
.timer-fill { background: var(--grad-brand); }
.fin-bar-fill { background: var(--grad-brand); }

/* ---------- Topbar accent hairline ---------- */
.topbar { box-shadow: 0 1px 0 rgba(99, 102, 241, 0.14); }

/* ---------- Refined gradient dividers ---------- */
.divider {
  height: 1px;
  border: 0;
  margin: 1.6rem 0;
  background: linear-gradient(90deg, transparent, var(--border-strong) 20%, var(--border-strong) 80%, transparent);
}

/* ---------- Stats band: frosted glass ---------- */
.stats-band-inner {
  background: rgba(18, 18, 21, 0.60);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
[data-theme="light"] .stats-band-inner {
  background: rgba(255, 255, 255, 0.75);
  border-color: var(--border-strong);
}

/* ---------- CTA band: glow + texture ---------- */
.cta-band-inner {
  background:
    radial-gradient(640px 320px at 50% -30%, rgba(139, 92, 246, 0.40), transparent 65%),
    radial-gradient(rgba(199, 210, 254, 0.13) 1px, transparent 1.5px),
    linear-gradient(160deg, #1e1b4b 0%, #2e2a7a 100%);
  background-size: auto, 24px 24px, auto;
  box-shadow: 0 20px 60px rgba(49, 46, 129, 0.50), inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
[data-theme="light"] .cta-band-inner {
  background:
    radial-gradient(640px 320px at 50% -30%, rgba(196, 181, 253, 0.45), transparent 65%),
    radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1.5px),
    linear-gradient(160deg, #312e81 0%, #4f46e5 100%);
  background-size: auto, 24px 24px, auto;
  box-shadow: 0 20px 50px rgba(49, 46, 129, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
