/* ============================================================
   ENJOY CREATOR ACADEMY — design system
   Palette pinned by brief: black/near-black surfaces, white type,
   a single yellow/gold accent used sparingly as a signal of
   progress and action — never as background decoration.
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg-0: #050505;
  --bg-1: #0b0b0b;
  --bg-2: #151515;
  --bg-3: #1d1d1d;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --ink: #ffffff;
  --ink-dim: #bdbdbd;
  --ink-faint: #7a7a7a;
  --gold: #ffd400;
  --gold-soft: #ffe45c;
  --green: #35d07f;
  --red: #ff5c5c;

  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 30px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.08; }
h2 { font-size: 26px; line-height: 1.15; }
h3 { font-size: 19px; line-height: 1.3; }
p { margin: 0; color: var(--ink-dim); }
a { color: inherit; text-decoration: none; }

::selection { background: var(--gold); color: #0b0b0b; }

button, input, select, textarea { font-family: var(--font-ui); font-size: 14px; color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- layout shells ---------- */

.eca-shell { display: flex; min-height: 100vh; }

.eca-sidebar {
  width: 244px;
  flex-shrink: 0;
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.eca-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 22px;
}
.eca-brand .mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; color: #0b0b0b; font-size: 15px;
}
.eca-brand .word { font-family: var(--font-display); font-size: 15px; letter-spacing: 0.01em; }
.eca-brand .word small { display: block; font-family: var(--font-ui); font-size: 10.5px; color: var(--ink-faint); letter-spacing: 0.04em; margin-top: 1px; }

.eca-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.eca-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-s);
  color: var(--ink-dim); font-size: 13.5px; font-weight: 500;
  border: 1px solid transparent;
}
.eca-nav a:hover { color: var(--ink); background: var(--bg-2); }
.eca-nav a.active { color: var(--ink); background: var(--bg-2); border-color: var(--line-strong); }
.eca-nav a.active::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); margin-right: 2px; }
.eca-nav .divider { height: 1px; background: var(--line); margin: 10px 4px; }

.eca-nav-foot { padding-top: 10px; border-top: 1px solid var(--line); }

.eca-main { flex: 1; min-width: 0; }

.eca-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
  position: sticky; top: 0; z-index: 20;
}
.eca-topbar h1 { font-size: 20px; }
.eca-topbar .sub { font-size: 12.5px; color: var(--ink-faint); margin-top: 2px; }

.eca-content { padding: 28px 32px 60px; max-width: 1160px; }

.eca-user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 999px; border: 1px solid var(--line);
  cursor: pointer; background: var(--bg-2);
}
.eca-user-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-3); display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--gold);
  border: 1px solid var(--line-strong);
}
.eca-user-chip .name { font-size: 13px; }
.eca-user-chip .role { font-size: 10.5px; color: var(--ink-faint); }

/* ---------- primitives ---------- */

.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: 13.5px; cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--gold); color: #0b0b0b; }
.btn-primary:hover { background: var(--gold-soft); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: var(--bg-2); }
.btn-danger { background: transparent; border-color: rgba(255, 92, 92, 0.4); color: var(--red); }
.btn-danger:hover { background: rgba(255, 92, 92, 0.08); }
.btn-small { padding: 7px 13px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 12.5px; color: var(--ink-dim); font-weight: 500; }
.field input, .field select, .field textarea {
  background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 9px;
  padding: 11px 13px; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); }
.field textarea { resize: vertical; min-height: 80px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--ink-dim);
}
.badge-published { color: var(--green); border-color: rgba(53, 208, 127, 0.35); background: rgba(53, 208, 127, 0.08); }
.badge-draft { color: var(--ink-faint); }
.badge-gold { color: var(--gold); border-color: rgba(255, 212, 0, 0.35); background: rgba(255, 212, 0, 0.08); }

.progress-track { height: 6px; border-radius: 999px; background: var(--bg-3); overflow: hidden; }
.progress-fill { height: 100%; background: var(--gold); border-radius: 999px; transition: width 0.4s ease; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-faint); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
.table tr:hover td { background: rgba(255, 255, 255, 0.015); }
.table-wrap { overflow-x: auto; }

.empty-state { text-align: center; padding: 60px 24px; color: var(--ink-faint); }
.empty-state h3 { color: var(--ink-dim); margin-bottom: 6px; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--bg-1); border: 1px solid var(--line-strong); border-radius: var(--radius-m);
  width: 100%; max-width: 480px; padding: 26px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.modal h3 { margin-bottom: 6px; }
.modal .modal-body { color: var(--ink-dim); font-size: 13.5px; margin: 12px 0 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

.toast-stack { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast {
  background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 12px 16px; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.5);
  animation: toast-in 0.18s ease;
}
.toast.error { border-color: rgba(255,92,92,.4); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.stat-card { padding: 20px; }
.stat-card .num { font-family: var(--font-display); font-size: 32px; }
.stat-card .label { font-size: 12.5px; color: var(--ink-faint); margin-top: 4px; }

.skeleton { background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 37%, var(--bg-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.eca-mobile-toggle { display: none; }

@media (max-width: 880px) {
  .eca-sidebar { position: fixed; left: -260px; top: 0; z-index: 60; transition: left 0.2s ease; box-shadow: 20px 0 60px rgba(0,0,0,.5); }
  .eca-sidebar.open { left: 0; }
  .eca-mobile-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line-strong);
    background: var(--bg-2); cursor: pointer; margin-right: 10px;
  }
  .eca-topbar { padding: 14px 16px; }
  .eca-content { padding: 18px 16px 90px; }
  .eca-user-chip .name, .eca-user-chip .role { display: none; }
  .field-row { flex-direction: column; gap: 0; }
}

/* ---------- public site ---------- */

.pub-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 60px); border-bottom: 1px solid var(--line);
}
.pub-hero { padding: clamp(50px, 10vw, 110px) clamp(20px, 5vw, 60px) 60px; max-width: 1200px; margin: 0 auto; }
.pub-hero .eyebrow { color: var(--gold); font-size: 13px; font-weight: 600; margin-bottom: 14px; display: block; }
.pub-hero h1 { max-width: 720px; }
.pub-hero .lede { max-width: 560px; margin-top: 18px; font-size: 16.5px; }
.pub-hero .ctas { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.pub-section { padding: 50px clamp(20px, 5vw, 60px); max-width: 1200px; margin: 0 auto; }
.pub-footer { padding: 34px clamp(20px, 5vw, 60px); border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; color: var(--ink-faint); font-size: 12.5px; }

.benefit-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 26px; }
.benefit { padding: 22px; }
.benefit h3 { margin-bottom: 8px; }
.benefit p { font-size: 13.5px; }

.course-preview-card { overflow: hidden; }
.course-preview-card .thumb {
  height: 150px; background: linear-gradient(135deg, #1d1a06, #0b0b0b);
  display: flex; align-items: center; justify-content: center; color: var(--gold); font-family: var(--font-display); font-size: 22px;
  border-bottom: 1px solid var(--line);
}
.course-preview-card .body { padding: 18px; }
.course-preview-card .meta { font-size: 12px; color: var(--ink-faint); margin-top: 10px; }

/* ---------- login ---------- */

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; padding: 34px; }
.login-card .eca-brand { padding: 0 0 26px; }
.login-card h2 { margin-bottom: 6px; }
.login-card .sub { font-size: 13.5px; margin-bottom: 24px; }
.login-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; margin-top: 4px; }
.login-error { background: rgba(255,92,92,.08); border: 1px solid rgba(255,92,92,.3); color: #ff8a8a; padding: 10px 13px; border-radius: 9px; font-size: 13px; margin-bottom: 16px; }
.demo-creds { margin-top: 22px; padding: 14px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-size: 12px; color: var(--ink-faint); }
.demo-creds b { color: var(--ink-dim); }

/* ---------- course curriculum ---------- */

.module-block { border-bottom: 1px solid var(--line); }
.module-block:last-child { border-bottom: none; }
.module-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; cursor: pointer; gap: 12px;
}
.module-head .title { display: flex; flex-direction: column; gap: 2px; }
.module-head .title .m-num { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.03em; }
.module-head .title .m-name { font-size: 14.5px; font-weight: 600; }
.module-head .chev { color: var(--ink-faint); transition: transform 0.15s ease; }
.module-block.open .chev { transform: rotate(90deg); }
.module-progress-mini { font-size: 11.5px; color: var(--ink-faint); }

.lesson-list { display: none; padding: 0 10px 10px; }
.module-block.open .lesson-list { display: block; }
.lesson-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px; border-radius: 9px; font-size: 13.5px; color: var(--ink-dim);
}
.lesson-row:hover { background: var(--bg-2); }
.lesson-row.current { background: var(--bg-2); color: var(--ink); border: 1px solid var(--line-strong); }
.lesson-row .icon { width: 18px; text-align: center; flex-shrink: 0; }
.lesson-row .icon.done { color: var(--green); }
.lesson-row .icon.locked { color: var(--ink-faint); }
.lesson-row .icon.current-dot { color: var(--gold); }
.lesson-row .dur { margin-left: auto; font-size: 11.5px; color: var(--ink-faint); }

/* ---------- video player page ---------- */

.player-shell { display: flex; gap: 22px; align-items: flex-start; }
.player-main { flex: 1; min-width: 0; }
.player-frame { aspect-ratio: 16/9; background: #000; border-radius: var(--radius-m); overflow: hidden; border: 1px solid var(--line); }
.player-frame iframe { width: 100%; height: 100%; border: 0; }
.player-info { padding: 20px 2px; }
.player-info .module-tag { font-size: 12px; color: var(--gold); font-weight: 600; margin-bottom: 8px; }
.player-info h2 { margin-bottom: 10px; }
.player-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; gap: 10px; flex-wrap: wrap; }
.curriculum-side { width: 320px; flex-shrink: 0; max-height: calc(100vh - 100px); overflow-y: auto; position: sticky; top: 90px; }

@media (max-width: 980px) {
  .player-shell { flex-direction: column; }
  .curriculum-side { width: 100%; position: static; max-height: none; }
}

/* ---------- misc ---------- */

.pill-tabs { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.pill-tabs button {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--ink-dim); font-size: 13px; cursor: pointer; font-weight: 500;
}
.pill-tabs button.active { background: var(--gold); color: #0b0b0b; border-color: var(--gold); }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; justify-content: space-between; }
.toolbar .filters { display: flex; gap: 8px; flex-wrap: wrap; }
.search-input { position: relative; }
.search-input input { padding-left: 34px; min-width: 220px; }
.search-input::before { content: "⌕"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); }

.drag-handle { cursor: grab; color: var(--ink-faint); padding: 4px; }
.drag-row.dragging { opacity: 0.4; }
.drag-row { cursor: default; }

.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-head h2 { font-size: 20px; }

.kicker { font-size: 12px; color: var(--ink-faint); margin-bottom: 4px; }
