@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #0a0f1c;
  --surface: #111827;
  --surface-2: #172033;
  --line: #233049;
  --text: #e8edf6;
  --muted: #8b97ad;
  --fire: #ff6a2b;
  --fire-2: #ffb547;
  --ok: #22c55e;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 20px;
  background: rgba(10, 15, 28, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .2px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--fire), var(--fire-2));
  color: #1a0d05; font-size: 15px; font-weight: 800;
}
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; margin-top: -2px; }
.btn-ghost {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  padding: 7px 12px; border-radius: 10px; font-size: 13px;
}
.btn-ghost:hover { color: var(--text); border-color: #36466a; }

/* ---------- Home ---------- */
.home { max-width: 960px; margin: 0 auto; padding: 48px 20px 80px; }
.home h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; margin: 0 0 8px; }
.home p.lead { color: var(--muted); margin: 0 0 32px; max-width: 560px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.class-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 10px; min-height: 170px;
  transition: border-color .15s, transform .15s;
}
.class-card.live:hover { border-color: var(--fire); transform: translateY(-2px); }
.class-card.live::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--fire), var(--fire-2));
}
.class-card h3 { margin: 0; font-size: 19px; }
.class-card p { margin: 0; color: var(--muted); font-size: 14px; }
.class-card .cta { margin-top: auto; font-weight: 700; color: var(--fire-2); font-size: 14px; }
.class-card.soon { opacity: .55; }
.tag {
  align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted);
}
.tag.on { background: rgba(255, 106, 43, .14); color: var(--fire-2); }

/* ---------- Login ---------- */
.login-wrap { min-height: calc(100vh - 56px); display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 380px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 30px;
}
.login-card h1 { margin: 6px 0 4px; font-size: 24px; }
.login-card p { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.login-card label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.login-card input {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--line); color: var(--text); font: inherit;
}
.login-card input:focus { outline: none; border-color: var(--fire); box-shadow: 0 0 0 3px rgba(255,106,43,.2); }
.btn-fire {
  width: 100%; margin-top: 14px; padding: 12px; border: 0; border-radius: 10px;
  background: linear-gradient(135deg, var(--fire), var(--fire-2)); color: #1a0d05; font-weight: 800;
}
.btn-fire:hover { filter: brightness(1.06); }
.err {
  display: none; margin-bottom: 14px; padding: 10px 12px; border-radius: 10px; font-size: 13px;
  background: rgba(239, 68, 68, .12); color: #fca5a5; border: 1px solid rgba(239, 68, 68, .3);
}
.err.show { display: block; }
.help { margin-top: 18px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ---------- Course player ---------- */
.course { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; max-width: 1320px; margin: 0 auto; padding: 24px 20px 80px; }
.player-col { min-width: 0; }
.video {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  border-radius: var(--radius); overflow: hidden; background: #000; border: 1px solid var(--line);
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-empty {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px;
  background: radial-gradient(ellipse at center, #1a2338 0%, #070b14 75%); color: var(--muted);
}
.video-empty b { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }
.lesson-meta { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px; margin: 20px 0 8px; }
.lesson-meta .crumb { color: var(--fire-2); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.lesson-meta h1 { margin: 4px 0 0; font-size: clamp(20px, 2.4vw, 26px); line-height: 1.25; }
.btn-done {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px;
}
.btn-done .box { width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--muted); display: grid; place-items: center; font-size: 12px; }
.btn-done.is-done { border-color: rgba(34,197,94,.5); background: rgba(34,197,94,.1); }
.btn-done.is-done .box { background: var(--ok); border-color: var(--ok); color: #04210f; }
.desc { color: #c5cede; white-space: pre-line; margin: 6px 0 18px; }
.resources { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.resources a {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600;
  padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line);
}
.resources a:hover { border-color: var(--fire); }
.nav-row { display: flex; justify-content: space-between; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.nav-row button {
  padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; max-width: 48%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-row button:disabled { opacity: .35; cursor: default; }
.nav-row .next { margin-left: auto; background: linear-gradient(135deg, var(--fire), var(--fire-2)); border: 0; color: #1a0d05; }

/* Sidebar */
.sidebar {
  align-self: start; position: sticky; top: 76px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  max-height: calc(100vh - 96px); display: flex; flex-direction: column; overflow: hidden;
}
.side-head { padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.side-head h2 { margin: 0 0 10px; font-size: 16px; }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--fire), var(--fire-2)); transition: width .3s; }
.progress-txt { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.side-body { overflow-y: auto; padding: 8px 0 12px; }
.mod-title { padding: 12px 18px 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--muted); }
.lesson {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left;
  padding: 10px 18px; background: none; border: 0; color: var(--text); border-left: 3px solid transparent;
}
.lesson:hover { background: var(--surface-2); }
.lesson.active { background: rgba(255,106,43,.08); border-left-color: var(--fire); }
.lesson .dot {
  flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%;
  border: 2px solid var(--line); display: grid; place-items: center; font-size: 11px; color: transparent;
}
.lesson.done .dot { background: var(--ok); border-color: var(--ok); color: #04210f; }
.lesson.active .dot { border-color: var(--fire); }
.lesson .l-title { font-size: 14px; font-weight: 500; line-height: 1.35; }
.lesson .l-dur { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

@media (max-width: 960px) {
  .course { grid-template-columns: 1fr; padding: 0 0 60px; gap: 0; }
  .video { border-radius: 0; border-left: 0; border-right: 0; }
  .player-col > :not(.video) { padding-left: 16px; padding-right: 16px; }
  .nav-row { margin: 0 16px; padding-left: 0 !important; padding-right: 0 !important; }
  .sidebar { position: static; max-height: none; margin: 24px 16px 0; }
  .topbar { padding: 10px 16px; }
}
