:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #fbfbfe;
  --ink: #0d1526;
  --ink-soft: #263149;
  --muted: #5d6679;
  --muted-2: #8b93a7;
  --line: #e7e9f1;
  --line-strong: #d6dae6;
  --primary: #4f46e5;
  --primary-dark: #3f37c9;
  --primary-soft: #eef0ff;
  --violet: #7c3aed;
  --success: #0f9f6e;
  --success-soft: #e7f8f1;
  --danger: #d92d4b;
  --danger-soft: #fdecef;
  --warning: #b45309;
  --warning-soft: #fff6e8;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 12px rgba(15, 23, 42, .04);
  --shadow: 0 2px 6px rgba(15, 23, 42, .04), 0 16px 40px rgba(15, 23, 42, .08);
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  --header-h: 72px;
  --sidebar-w: 256px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.2; letter-spacing: -.02em; font-weight: 800; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
::selection { background: #ddd9ff; }

/* ---------------- Boot ---------------- */
.boot {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  color: var(--muted);
}
.boot-logo {
  width: 58px; height: 58px; border-radius: 17px; display: grid; place-items: center;
  background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; font-weight: 800; font-size: 28px;
  box-shadow: 0 12px 30px rgba(99, 102, 241, .35);
  animation: pop .5s ease;
}
.boot-bar { width: 180px; height: 5px; background: #e6e8f2; border-radius: 99px; overflow: hidden; }
.boot-bar span { display: block; width: 40%; height: 100%; border-radius: 99px; background: var(--primary); animation: slide 1s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------------- Layout ---------------- */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container-wide { width: 100%; max-width: 1360px; margin: 0 auto; padding: 0 24px; }
.main { min-height: calc(100vh - var(--header-h)); }
.section { padding: 64px 0; }
.section-tight { padding: 40px 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; } .mb-4 { margin-bottom: 32px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.strong { font-weight: 700; }
.center { text-align: center; }
.hide { display: none !important; }
.mono { font-family: var(--mono); }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(226, 229, 240, .9);
}
.site-header .container-wide { height: 100%; display: flex; align-items: center; gap: 30px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 19px; letter-spacing: -.03em; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; font-size: 20px;
  box-shadow: 0 6px 16px rgba(99, 102, 241, .32);
}
.brand small { display: block; font-size: 10px; font-weight: 600; letter-spacing: .14em; color: var(--muted-2); text-transform: uppercase; margin-top: -3px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav-link {
  padding: 9px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted);
  transition: .18s;
}
.nav-link:hover { background: #f2f3f9; color: var(--ink); }
.nav-link.active { color: var(--primary); background: var(--primary-soft); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-btn {
  display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 5px; border: 1px solid var(--line);
  border-radius: 999px; background: #fff; transition: .18s;
}
.user-btn:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.user-btn .ic { width: 14px; height: 14px; color: var(--muted-2); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #eef0ff, #e5e0ff); color: var(--primary-dark);
  font-weight: 800; font-size: 13px; text-transform: uppercase; flex: none;
}
.avatar.lg { width: 54px; height: 54px; font-size: 19px; }
.user-menu { position: relative; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 8px; z-index: 60;
  animation: drop .16s ease;
}
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-item {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0;
  background: none; border-radius: 9px; text-align: left; font-size: 14px; font-weight: 600; color: var(--ink-soft);
}
.menu-item:hover { background: #f5f6fb; }
.menu-item.danger { color: var(--danger); }
.menu-item svg { width: 17px; height: 17px; }
.mobile-nav { display: none; }

.ic { width: 18px; height: 18px; flex: none; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 700; font-size: 14px; letter-spacing: -.01em; transition: .18s; white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(79, 70, 229, .26); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(79, 70, 229, .32); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #1c2740; }
.btn-light { background: #fff; border-color: var(--line-strong); color: var(--ink); }
.btn-light:hover { border-color: #b9bfd2; background: #fcfcff; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #f1f2f8; color: var(--ink); }
.btn-soft { background: var(--primary-soft); color: var(--primary-dark); }
.btn-soft:hover { background: #e3e6ff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #bd233f; }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn-danger-soft:hover { background: #fbdde3; }
.btn-sm { height: 36px; padding: 0 14px; border-radius: 10px; font-size: 13px; }
.btn-xs { height: 30px; padding: 0 10px; border-radius: 8px; font-size: 12px; }
.btn-lg { height: 52px; padding: 0 26px; border-radius: 14px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 10px; }
.btn-icon svg { width: 18px; height: 18px; }

/* ---------------- Cards & surfaces ---------------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 24px; }
.card-hover { transition: .22s; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #d9dce9; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.panel-flush { padding: 0; overflow: hidden; }
.panel-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-body { padding: 22px 24px; }
.panel-title { font-size: 16px; font-weight: 800; }
.divider { height: 1px; background: var(--line); border: 0; margin: 20px 0; }

/* ---------------- Badges ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 25px; padding: 0 10px;
  border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .01em;
  background: #f2f3f8; color: var(--muted); white-space: nowrap;
}
.badge svg { width: 13px; height: 13px; }
.badge-primary { background: var(--primary-soft); color: var(--primary-dark); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-dark { background: #eef0f6; color: var(--ink-soft); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------------- Forms ---------------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.field .hint { font-size: 12px; color: var(--muted-2); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 11px; background: #fff;
  padding: 11px 14px; color: var(--ink); outline: none; transition: .16s; font-size: 14px;
  min-height: 46px;
}
.input::placeholder, .textarea::placeholder { color: #9aa2b5; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .13);
}
.textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235d6679' stroke-width='2'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 38px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.checkbox { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; cursor: pointer; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--primary); }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted-2); }
.search-box .input { padding-left: 39px; }
.form-error {
  background: var(--danger-soft); color: #a51d38; border: 1px solid #f6ccd5;
  padding: 11px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; margin-bottom: 14px;
}
.form-success { background: var(--success-soft); color: #07734f; border: 1px solid #bfeeda; padding: 11px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }

/* ---------------- Auth ---------------- */
.auth-wrap { min-height: calc(100vh - var(--header-h)); display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
  position: relative; overflow: hidden; padding: 60px; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(circle at 15% 15%, #312e81 0%, transparent 45%),
              radial-gradient(circle at 85% 80%, #6d28d9 0%, transparent 50%), #0b1220;
}
.auth-side::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 26px 26px; opacity: .5; pointer-events: none;
}
.auth-side > * { position: relative; z-index: 1; }
.auth-quote { font-size: 30px; font-weight: 800; line-height: 1.25; letter-spacing: -.03em; max-width: 460px; }
.auth-features { display: flex; flex-direction: column; gap: 14px; margin-top: 28px; }
.auth-feature { display: flex; gap: 12px; align-items: flex-start; color: #c7cbe0; font-size: 14px; }
.auth-feature .ic { width: 28px; height: 28px; border-radius: 9px; background: rgba(255,255,255,.1); display: grid; place-items: center; flex: none; }
.auth-feature svg { width: 15px; height: 15px; color: #a5b4fc; }
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-box { width: 100%; max-width: 410px; }
.auth-box h1 { font-size: 30px; margin-bottom: 8px; }
.auth-switch { text-align: center; font-size: 14px; color: var(--muted); margin-top: 22px; }
.auth-switch a { color: var(--primary); font-weight: 700; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative; overflow: hidden; padding: 72px 0 64px;
  background:
    radial-gradient(800px 400px at 85% 10%, rgba(168, 85, 247, .10), transparent 60%),
    radial-gradient(700px 380px at 10% 20%, rgba(79, 70, 229, .10), transparent 60%),
    linear-gradient(180deg, #fbfbff 0%, var(--bg) 100%);
  border-bottom: 1px solid #edeef5;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(36px, 4.6vw, 58px); line-height: 1.05; letter-spacing: -.04em; }
.hero h1 .grad {
  background: linear-gradient(100deg, #4f46e5 10%, #9333ea 55%, #db2777 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: 17px; color: var(--muted); margin-top: 20px; max-width: 540px; line-height: 1.7; }
.hero-actions { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 34px; margin-top: 38px; flex-wrap: wrap; }
.hero-stat b { display: block; font-size: 24px; letter-spacing: -.03em; }
.hero-stat span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.hero-visual { position: relative; min-height: 440px; }
.float-card {
  position: absolute; background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 16px;
}
.fc-main { top: 6px; left: 0; width: 312px; transform: rotate(-2deg); animation: float1 7s ease-in-out infinite; }
.fc-exam { bottom: 0; right: 0; width: 300px; transform: rotate(2deg); animation: float2 8s ease-in-out infinite; }
.fc-badge { top: 0; right: 6px; padding: 10px 14px; display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; animation: float2 6s ease-in-out infinite; }
@keyframes float1 { 0%,100% { transform: rotate(-2deg) translateY(0); } 50% { transform: rotate(-2deg) translateY(-10px); } }
@keyframes float2 { 0%,100% { transform: rotate(2deg) translateY(0); } 50% { transform: rotate(2deg) translateY(-8px); } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px; background: #fff; border: 1px solid #e3e5f1; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); box-shadow: var(--shadow-sm); }
.eyebrow .dot { background: var(--success); box-shadow: 0 0 0 4px rgba(15,159,110,.13); }

/* ---------------- Course cards ---------------- */
.course-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.course-card { display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); transition: .22s; box-shadow: var(--shadow-sm); }
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #d8dbe8; }
.course-cover {
  height: 138px; display: flex; align-items: center; justify-content: space-between; padding: 22px;
  position: relative; overflow: hidden;
}
.course-cover::after {
  content: ''; position: absolute; width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,.14); right: -50px; top: -60px;
}
.course-cover .emoji { font-size: 44px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.12)); z-index: 1; }
.course-cover .lvl { z-index: 1; background: rgba(255,255,255,.9); color: #1f2937; font-size: 11px; font-weight: 800; padding: 5px 10px; border-radius: 999px; }
.accent-indigo { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.accent-violet { background: linear-gradient(135deg, #7c3aed, #c026d3); }
.accent-emerald { background: linear-gradient(135deg, #059669, #14b8a6); }
.accent-amber { background: linear-gradient(135deg, #d97706, #f59e0b); }
.accent-rose { background: linear-gradient(135deg, #e11d48, #f97316); }
.accent-sky { background: linear-gradient(135deg, #0284c7, #6366f1); }
.accent-slate { background: linear-gradient(135deg, #334155, #64748b); }
.course-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.course-cat { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--primary); }
.course-card h3 { font-size: 17px; line-height: 1.35; letter-spacing: -.02em; }
.course-summary { font-size: 13px; color: var(--muted); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-meta { display: flex; align-items: center; gap: 14px; color: var(--muted-2); font-size: 12px; font-weight: 600; padding-top: 12px; border-top: 1px solid var(--line); margin-top: auto; }
.course-meta span { display: inline-flex; align-items: center; gap: 5px; }
.course-meta svg { width: 14px; height: 14px; }

/* ---------------- Progress ---------------- */
.progress { height: 7px; background: #eef0f6; border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #6366f1, #a855f7); transition: width .4s; }
.progress.sm { height: 5px; }
.progress.success span { background: linear-gradient(90deg, #10b981, #34d399); }

/* ---------------- Section headings ---------------- */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { font-size: 28px; letter-spacing: -.035em; }
.section-head p { color: var(--muted); margin-top: 6px; font-size: 14.5px; }
.kicker { font-size: 11.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--primary); margin-bottom: 8px; }

/* ---------------- Course detail ---------------- */
.course-hero { background: #0d1526; color: #fff; padding: 48px 0; position: relative; overflow: hidden; }
.course-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(600px 300px at 80% 20%, rgba(124,58,237,.35), transparent 65%);
}
.course-hero .container { position: relative; z-index: 1; }
.course-hero-grid { display: grid; grid-template-columns: 1.5fr .8fr; gap: 40px; align-items: start; }
.course-hero h1 { font-size: clamp(28px, 3.6vw, 44px); margin: 14px 0 16px; letter-spacing: -.035em; }
.course-hero p { color: #b9c0d4; font-size: 15.5px; max-width: 680px; }
.course-hero .badge { background: rgba(255,255,255,.12); color: #e7e9f5; backdrop-filter: blur(4px); }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #9aa3bb; font-weight: 600; }
.breadcrumb a:hover { color: #fff; }
.breadcrumb svg { width: 13px; height: 13px; }
.buy-card { background: #fff; color: var(--ink); border-radius: var(--radius); padding: 24px; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.buy-card .badge { background: #f2f3f8; color: var(--muted); }
.buy-card .badge-success { background: var(--success-soft); color: var(--success); }
.buy-card .badge-warning { background: var(--warning-soft); color: var(--warning); }
.buy-card .icon-xl { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; font-size: 32px; margin-bottom: 16px; }
.course-hero .row span svg { width: 15px; height: 15px; }
.meta-list { display: flex; flex-direction: column; gap: 11px; margin: 18px 0; }
.meta-list div { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; }
.meta-list span { color: var(--muted); display: flex; align-items: center; gap: 7px; }
.meta-list b { font-weight: 700; }
.meta-list svg { width: 15px; height: 15px; color: var(--muted-2); }

/* ---------------- Lessons ---------------- */
.lesson-row {
  display: flex; align-items: center; gap: 14px; padding: 15px 18px; border-radius: 12px;
  border: 1px solid transparent; transition: .15s; cursor: pointer;
}
.lesson-row:hover { background: #f8f9fd; border-color: var(--line); }
.lesson-num {
  width: 30px; height: 30px; border-radius: 9px; background: #f1f2f8; color: var(--muted);
  display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none;
}
.lesson-row.done .lesson-num { background: var(--success-soft); color: var(--success); }
.lesson-row.current { background: var(--primary-soft); border-color: #d8dbff; }
.lesson-row.current .lesson-num { background: var(--primary); color: #fff; }
.lesson-title { font-weight: 700; font-size: 14px; line-height: 1.35; }
.lesson-time { font-size: 11.5px; color: var(--muted-2); font-weight: 600; margin-top: 2px; }
.lesson-play { margin-left: auto; color: var(--muted-2); display: flex; }
.lesson-play svg { width: 17px; height: 17px; }
.lesson-layout { display: grid; grid-template-columns: 320px 1fr; gap: 30px; align-items: start; }
.lesson-side { position: sticky; top: calc(var(--header-h) + 22px); }
.lesson-side-head { padding: 20px; border-bottom: 1px solid var(--line); }
.lesson-side-list { max-height: calc(100vh - 260px); overflow: auto; padding: 10px; }
.lesson-content { padding: 40px 48px; }
.lesson-content .lesson-kicker { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); }
.lesson-content h1 { font-size: 30px; margin: 8px 0 20px; }

/* ---------------- Prose / markdown ---------------- */
.prose { color: #2a3349; font-size: 15.3px; line-height: 1.75; max-width: 760px; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin: 30px 0 12px; letter-spacing: -.025em; color: var(--ink); }
.prose h1 { font-size: 28px; } .prose h2 { font-size: 22px; } .prose h3 { font-size: 18px; } .prose h4 { font-size: 16px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 24px; }
.prose li { margin-bottom: 7px; }
.prose li::marker { color: var(--primary); }
.prose strong { color: var(--ink); font-weight: 700; }
.prose a { color: var(--primary); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.prose code {
  font-family: var(--mono); font-size: .87em; background: #f1f2f8; color: #4338ca;
  padding: 2px 6px; border-radius: 5px; border: 1px solid #e6e8f2;
}
.prose pre { background: #0f172a; color: #e2e8f0; padding: 18px 20px; border-radius: 13px; overflow: auto; margin: 0 0 20px; font-size: 13px; line-height: 1.65; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.prose blockquote {
  margin: 0 0 20px; padding: 14px 20px; border-left: 3px solid var(--primary);
  background: #f7f7ff; border-radius: 0 10px 10px 0; color: #3c4660;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 28px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 14px; }
.prose th { text-align: left; background: #f7f8fc; font-weight: 700; color: var(--ink); }
.prose th, .prose td { padding: 10px 13px; border: 1px solid var(--line); }
.prose img { border-radius: 12px; }

/* ---------------- Exam ---------------- */
.exam-shell { max-width: 980px; margin: 0 auto; padding: 32px 24px 80px; }
.exam-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px;
  position: sticky; top: calc(var(--header-h) + 14px); z-index: 20; box-shadow: var(--shadow-sm);
}
.timer { display: flex; align-items: center; gap: 9px; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 17px; background: #f4f5fb; padding: 8px 14px; border-radius: 10px; }
.timer.warn { background: var(--danger-soft); color: var(--danger); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }
.timer svg { width: 17px; height: 17px; }
.exam-layout { display: grid; grid-template-columns: 1fr 240px; gap: 24px; margin-top: 24px; align-items: start; }
.question-card { padding: 30px 32px; min-height: 380px; display: flex; flex-direction: column; }
.q-index { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); }
.q-text { font-size: 19px; font-weight: 800; line-height: 1.4; letter-spacing: -.02em; margin: 12px 0 24px; }
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex; align-items: flex-start; gap: 13px; padding: 14px 16px; border: 1.5px solid var(--line);
  border-radius: 12px; cursor: pointer; transition: .15s; background: #fff; text-align: left; width: 100%;
}
.option:hover { border-color: #b9befb; background: #fbfbff; }
.option.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.option-letter {
  width: 28px; height: 28px; border-radius: 8px; background: #f1f2f8; color: var(--muted);
  display: grid; place-items: center; font-size: 12.5px; font-weight: 800; flex: none; transition: .15s;
}
.option.selected .option-letter { background: var(--primary); color: #fff; }
.option-text { font-size: 14.5px; font-weight: 600; color: var(--ink-soft); padding-top: 2px; line-height: 1.5; }
.exam-nav-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.q-dot {
  aspect-ratio: 1; border-radius: 9px; border: 1.5px solid var(--line); background: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--muted);
}
.q-dot.answered { background: var(--primary-soft); border-color: #c7caff; color: var(--primary-dark); }
.q-dot.current { background: var(--primary); border-color: var(--primary); color: #fff; }
.exam-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.exam-legend { display: flex; flex-direction: column; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 16px; }
.exam-legend div { display: flex; align-items: center; gap: 8px; }
.legend-box { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--line); background: #fff; }
.legend-box.a { background: var(--primary-soft); border-color: #c7caff; }
.legend-box.c { background: var(--primary); border-color: var(--primary); }

/* ---------------- Result ---------------- */
.result-hero { text-align: center; padding: 40px 24px; }
.score-ring { position: relative; width: 170px; height: 170px; margin: 0 auto 22px; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .score-val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-ring .score-val b { font-size: 42px; letter-spacing: -.04em; line-height: 1; }
.score-ring .score-val span { font-size: 12px; color: var(--muted); font-weight: 700; margin-top: 4px; }
.review-item { border: 1px solid var(--line); border-radius: 13px; margin-bottom: 10px; overflow: hidden; background: #fff; }
.review-head { display: flex; align-items: flex-start; gap: 12px; padding: 15px 18px; cursor: pointer; }
.review-status { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.review-status.ok { background: var(--success-soft); color: var(--success); }
.review-status.bad { background: var(--danger-soft); color: var(--danger); }
.review-status svg { width: 15px; height: 15px; }
.review-q { font-weight: 700; font-size: 14px; line-height: 1.45; }
.review-body { padding: 0 18px 18px 56px; display: none; }
.review-item.open .review-body { display: block; }
.review-answer { font-size: 13px; padding: 8px 12px; border-radius: 8px; margin-bottom: 7px; font-weight: 600; }
.review-answer.correct { background: var(--success-soft); color: #07734f; }
.review-answer.wrong { background: var(--danger-soft); color: #a51d38; }
.review-explain { font-size: 13px; color: var(--muted); background: #f8f9fd; padding: 11px 14px; border-radius: 9px; margin-top: 8px; border-left: 3px solid #c7caff; }

/* ---------------- Dashboard ---------------- */
.page-head { padding: 34px 0 8px; }
.page-head h1 { font-size: 30px; letter-spacing: -.035em; }
.page-head p { color: var(--muted); margin-top: 4px; font-size: 14.5px; }
.stat-card { padding: 20px; display: flex; align-items: center; gap: 16px; }
.stat-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.stat-icon svg { width: 21px; height: 21px; }
.stat-icon.indigo { background: var(--primary-soft); color: var(--primary); }
.stat-icon.green { background: var(--success-soft); color: var(--success); }
.stat-icon.amber { background: var(--warning-soft); color: var(--warning); }
.stat-icon.rose { background: var(--danger-soft); color: var(--danger); }
.stat-card b { font-size: 24px; letter-spacing: -.03em; display: block; line-height: 1.2; }
.stat-card span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.continue-card { display: flex; gap: 16px; padding: 16px; align-items: center; }
.continue-cover { width: 66px; height: 66px; border-radius: 14px; display: grid; place-items: center; font-size: 30px; flex: none; }
.empty-state { text-align: center; padding: 56px 24px; }
.empty-icon { width: 62px; height: 62px; border-radius: 18px; background: #f3f4fa; display: grid; place-items: center; margin: 0 auto 16px; color: var(--muted-2); }
.empty-icon svg { width: 26px; height: 26px; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted-2);
  font-weight: 800; padding: 12px 16px; background: #fafbfe; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 14px 16px; border-bottom: 1px solid #eff1f7; vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fbfbfe; }
.table-user { display: flex; align-items: center; gap: 10px; }
.table-user .avatar { width: 32px; height: 32px; font-size: 11px; }
.table-title { font-weight: 700; color: var(--ink); }
.table-sub { font-size: 12px; color: var(--muted-2); }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; }
.cell-course { display: flex; align-items: center; gap: 11px; }
.cell-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex: none; }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tab {
  padding: 11px 16px; border: 0; background: none; font-weight: 700; font-size: 13.5px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .count { font-size: 11px; background: #f1f2f8; padding: 1px 6px; border-radius: 99px; margin-left: 5px; }

/* ---------------- Admin ---------------- */
.admin-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: calc(100vh - var(--header-h)); }
.admin-side { background: #0d1526; color: #fff; padding: 26px 16px; position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow: auto; }
.admin-side-brand { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: #7c879f; font-weight: 800; padding: 0 12px 14px; }
.admin-link {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 10px;
  color: #aab3c8; font-size: 13.5px; font-weight: 600; margin-bottom: 3px; transition: .15s;
}
.admin-link svg { width: 17px; height: 17px; flex: none; }
.admin-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-link.active { background: linear-gradient(120deg, rgba(99,102,241,.9), rgba(124,58,237,.85)); color: #fff; box-shadow: 0 6px 18px rgba(79,70,229,.3); }
.admin-content { padding: 30px 34px 60px; min-width: 0; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.admin-head h1 { font-size: 25px; letter-spacing: -.03em; }
.admin-head p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.admin-mobile-nav { display: none; }

/* ---------------- Modal ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10, 16, 30, .55); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 200;
  overflow-y: auto; animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 560px; box-shadow: 0 30px 80px rgba(0,0,0,.3);
  animation: modalIn .2s ease; margin: auto;
}
.modal.wide { max-width: 820px; }
.modal.narrow { max-width: 430px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal-head h3 { font-size: 18px; letter-spacing: -.02em; }
.modal-head p { font-size: 13px; color: var(--muted); margin-top: 3px; }
.modal-body { padding: 22px 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: #fcfcfe; border-radius: 0 0 18px 18px; flex-wrap: wrap; }
.modal-x { width: 34px; height: 34px; border-radius: 9px; border: 0; background: #f2f3f8; display: grid; place-items: center; color: var(--muted); flex: none; }
.modal-x:hover { background: #e8eaf2; color: var(--ink); }
.modal-x svg { width: 17px; height: 17px; }

/* ---------------- Toasts ---------------- */
.toast-root { position: fixed; bottom: 22px; right: 22px; z-index: 300; display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.toast {
  background: #0f172a; color: #fff; padding: 13px 17px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 16px 40px rgba(0,0,0,.25); display: flex; align-items: center; gap: 10px;
  animation: toastIn .22s ease;
}
.toast.success { background: #087a57; }
.toast.error { background: #b81f3b; }
.toast svg { width: 17px; height: 17px; flex: none; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.toast.out { animation: toastOut .2s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

/* ---------------- Footer ---------------- */
.site-footer { background: #0d1526; color: #9aa3bb; padding: 46px 0 30px; margin-top: 60px; }
.footer-grid { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.site-footer .brand { color: #fff; }
.footer-links { display: flex; gap: 24px; font-size: 13px; flex-wrap: wrap; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.09); margin-top: 30px; padding-top: 20px; display: flex; justify-content: space-between; font-size: 12px; gap: 14px; flex-wrap: wrap; }

/* ---------------- Certificate ---------------- */
.certificate {
  background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 54px; max-width: 860px; margin: 0 auto;
  position: relative; overflow: hidden;
}
.certificate::before { content: ''; position: absolute; inset: 14px; border: 2px solid #ecebff; border-radius: 14px; pointer-events: none; }
.cert-brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 18px; }
.cert-title { font-size: 13px; letter-spacing: .3em; text-transform: uppercase; color: var(--primary); font-weight: 800; margin: 38px 0 14px; }
.cert-name { font-size: 40px; letter-spacing: -.035em; line-height: 1.15; }
.cert-course { font-size: 22px; font-weight: 700; color: var(--ink-soft); margin-top: 14px; }
.cert-meta { display: flex; gap: 40px; margin-top: 38px; flex-wrap: wrap; }
.cert-meta b { display: block; font-size: 15px; margin-top: 3px; }
.cert-meta span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); font-weight: 700; }
.cert-folio { position: absolute; right: 54px; bottom: 46px; font-size: 11px; color: var(--muted-2); font-family: var(--mono); }
.cert-seal { position: absolute; right: 50px; top: 46px; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #eef0ff, #f6edff); color: var(--primary); border: 1px solid #e0ddff; }
.cert-seal .ic { width: 34px; height: 34px; }

/* ---------------- Misc ---------------- */
.skeleton { background: linear-gradient(90deg, #eef0f6 25%, #f7f8fc 37%, #eef0f6 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 10px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.fade-in { animation: fadeUp .3s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.spinner { width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.spinner.dark { border-color: #d8dbe8; border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }
.alert { border-radius: 12px; padding: 14px 16px; font-size: 13.5px; display: flex; gap: 11px; align-items: flex-start; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert-info { background: #eef4ff; color: #1d4ed8; border: 1px solid #d6e3ff; }
.alert-warning { background: var(--warning-soft); color: #92400e; border: 1px solid #f8e0bd; }
.alert-success { background: var(--success-soft); color: #06724e; border: 1px solid #c3ecd9; }
.alert-danger { background: var(--danger-soft); color: #9f1c34; border: 1px solid #f7ccd5; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff;
  font-size: 12.5px; font-weight: 700; color: var(--muted); transition: .15s;
}
.chip:hover { border-color: #b9befb; color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.copy-box { position: relative; }
.copy-box pre { background: #0f172a; color: #cbd5e1; border-radius: 10px; padding: 16px; overflow: auto; font-size: 12px; font-family: var(--mono); }
.copy-btn { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.1); color: #fff; border: 0; border-radius: 7px; padding: 5px 9px; font-size: 11px; font-weight: 700; }
.dropzone {
  border: 2px dashed var(--line-strong); border-radius: 14px; padding: 30px; text-align: center;
  transition: .18s; cursor: pointer; background: #fbfbfe;
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone svg { width: 30px; height: 30px; color: var(--muted-2); margin-bottom: 8px; }
.q-option-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.q-option-row .opt-letter { width: 26px; height: 26px; border-radius: 7px; background: #f1f2f8; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--muted); flex: none; }
.q-option-row input[type="radio"] { accent-color: var(--primary); width: 17px; height: 17px; flex: none; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1080px) {
  .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero-visual { display: none; }
  .course-hero-grid { grid-template-columns: 1fr; }
  .lesson-layout { grid-template-columns: 260px 1fr; }
  .exam-layout { grid-template-columns: 1fr; }
  .exam-side { order: -1; }
  .exam-nav-grid { grid-template-columns: repeat(10, 1fr); }
  .admin-content { padding: 24px; }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .mobile-nav { display: flex; gap: 4px; overflow-x: auto; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: var(--header-h); z-index: 40; }
  .mobile-nav a { padding: 7px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
  .mobile-nav a.active { background: var(--primary-soft); color: var(--primary); }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-side { position: static; }
  .lesson-side-list { max-height: none; }
  .lesson-content { padding: 26px 22px; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { display: none; }
  .admin-mobile-nav { display: flex; gap: 4px; overflow-x: auto; padding: 10px 16px; background: #0d1526; position: sticky; top: var(--header-h); z-index: 40; }
  .admin-mobile-nav a { padding: 8px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: #aab3c8; white-space: nowrap; }
  .admin-mobile-nav a.active { background: var(--primary); color: #fff; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .certificate { padding: 30px; }
  .cert-name { font-size: 30px; }
  .cert-seal { display: none; }
}
@media (max-width: 640px) {
  .container, .container-wide { padding: 0 16px; }
  .course-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .hero { padding: 44px 0 36px; }
  .hero h1 { font-size: 34px; }
  .hero-stats { gap: 22px; }
  .section { padding: 42px 0; }
  .exam-nav-grid { grid-template-columns: repeat(5, 1fr); }
  .question-card { padding: 22px 20px; }
  .q-text { font-size: 17px; }
  .exam-top { flex-wrap: wrap; }
  .site-header .brand small { display: none; }
  .header-right .btn span { display: none; }
  .header-right .btn svg { margin: 0; }
  .stat-card { padding: 16px; }
  .stat-card b { font-size: 21px; }
  .modal-backdrop { padding: 16px 10px; }
  .modal-body { padding: 18px; }
  .certificate { padding: 24px; }
  .cert-folio { position: static; margin-top: 24px; }
  .admin-content { padding: 18px 16px 50px; }
  .tabs { margin-bottom: 16px; }
  .lesson-content h1 { font-size: 24px; }
}
@media print {
  body { background: #fff; }
  .site-header, .site-footer, .mobile-nav, .no-print, .toast-root { display: none !important; }
  .main { min-height: 0; }
  .certificate { border: 0; box-shadow: none; max-width: none; padding: 40px; }
  .certificate::before { border-color: #ddd; }
}
