:root {
  --bg: #0f1115;
  --card: #171a21;
  --card-2: #1f242d;
  --text: #e8eaee;
  --muted: #8a92a3;
  --accent: #c9a86a;        /* мягкое золото */
  --accent-2: #e6c896;
  --danger: #ff6b6b;
  --ok: #5ac88e;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(0,0,0,.25);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent); }
code { background: #20242d; padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .87rem; }
.container { max-width: 1140px; margin: 0 auto; padding: 24px 20px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row.gap { gap: 14px; }

/* TOPBAR */
.topbar { background: linear-gradient(180deg, #131720, #0f1115); border-bottom: 1px solid #20242d; position: sticky; top: 0; z-index: 10; }
.topbar .container { padding: 14px 20px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand-title { font-weight: 700; }
.brand-sub { margin-top: 2px; }
.auth-logo {
  width: 44px; height: 44px; border-radius: 12px; display:flex; align-items:center; justify-content:center;
  background: radial-gradient(circle at 30% 20%, var(--accent-2), var(--accent) 60%, #8a7340);
  color: #1a1407; font-weight: 800; font-size: 22px; box-shadow: var(--shadow);
}
.auth-logo.small { width: 34px; height: 34px; font-size: 16px; border-radius: 10px; }

/* AUTH */
.auth-body { min-height: 100vh; display: grid; place-items: center; background:
  radial-gradient(1200px 600px at 20% -10%, #1b1f2a 0, transparent 60%),
  radial-gradient(800px 500px at 110% 110%, #221a0e 0, transparent 50%), var(--bg);
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 420px; background: var(--card); border: 1px solid #232733; border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.auth-brand { text-align: center; margin-bottom: 18px; }
.auth-brand h1 { margin: 10px 0 4px; font-size: 1.4rem; }
.auth-card label { display: block; margin: 12px 0 4px; color: var(--muted); font-size: .9rem; }
.auth-card input { width: 100%; padding: 12px 14px; background: var(--card-2); border: 1px solid #2a303c;
  border-radius: 10px; color: var(--text); font-size: 1rem; outline: none; }
.auth-card input:focus { border-color: var(--accent); }
.auth-card button, .btn-primary {
  margin-top: 18px; width: 100%; padding: 12px 16px; background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #1a1407; font-weight: 700; border: 0; border-radius: 10px; cursor: pointer; font-size: 1rem;
}
.auth-card button:hover, .btn-primary:hover { filter: brightness(1.05); }
.alert { background: #3a1d1f; color: #ffd2d2; border: 1px solid #5a2a2c; padding: 10px 12px; border-radius: 10px; margin-bottom: 8px; }

/* COURSE */
.module { margin: 32px 0; }
.module-head h2 { margin: 0 0 6px; font-size: 1.4rem; }
.lesson-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 14px; }
.lesson-card {
  background: var(--card); border: 1px solid #232733; border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; transition: transform .15s ease, border-color .15s ease;
  color: var(--text);
}
.lesson-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.lesson-card.done { border-color: #2e6a48; }
.lesson-poster {
  aspect-ratio: 16/9; background-color: #20242d; background-size: cover; background-position: center; background-repeat: no-repeat; position: relative; display: grid; place-items: center;
}
.lesson-poster .play {
  width: 56px; height: 56px; border-radius: 999px; display: grid; place-items: center;
  background: rgba(15,17,21,.6); color: var(--accent-2); font-size: 22px; backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.08);
}
.lesson-poster .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.65); color: #fff; font-size: .8rem; padding: 2px 6px; border-radius: 6px; }
.lesson-meta { padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lesson-title { font-weight: 600; line-height: 1.3; }
.badge { background: #1e3a2a; color: #a7e6c0; font-size: .75rem; padding: 3px 7px; border-radius: 999px; }

/* LESSON PAGE */
.lesson-page h1 { margin: 8px 0 16px; font-size: 1.6rem; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent-2); }
.player-wrap { background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.player-wrap video { width: 100%; display: block; aspect-ratio: 16/9; background: #000; }
.lesson-body { background: var(--card); border: 1px solid #232733; border-radius: var(--radius); padding: 18px 22px; margin-top: 20px; line-height: 1.6; }
.lesson-body img { max-width: 100%; height: auto; border-radius: 8px; }
.lesson-body h2, .lesson-body h3 { margin-top: 1.2em; }
.attachments { margin-top: 20px; }
.attachments ul { list-style: none; padding: 0; margin: 8px 0 0; }
.attachments li { padding: 8px 0; border-bottom: 1px solid #232733; }
.lesson-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 22px 0 8px; }
.lesson-nav > a, .lesson-nav > span { justify-self: stretch; }
.lesson-nav > a:first-child { justify-self: start; }
.lesson-nav > a:last-child  { justify-self: end; }

/* BUTTONS */
.btn-ghost { display: inline-block; padding: 9px 14px; border: 1px solid #2a303c; border-radius: 10px; color: var(--text); background: transparent; cursor: pointer; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-2); }
.btn-primary { width: auto; padding: 10px 18px; }

/* EMPTY */
.empty { text-align: center; padding: 60px 20px; }
.footer { text-align: center; padding: 30px 20px 50px; }

/* AVAILABLE COURSES */
.page-head { margin: 16px 0 24px; }
.page-head h1 { margin: 0 0 6px; font-size: 1.7rem; }
.btn-ghost.active { border-color: var(--accent); color: var(--accent-2); background: rgba(201,168,106,.08); }
.course-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.course-card {
  background: var(--card); border: 1px solid #232733; border-radius: var(--radius); overflow: hidden;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.course-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 28px rgba(0,0,0,.35); }
.course-cover {
  aspect-ratio: 16/10; background: linear-gradient(135deg, #1d2230, #262c3a) center/cover no-repeat;
  display: grid; place-items: center; position: relative;
}
.cover-placeholder {
  font-size: 64px; font-weight: 800; color: var(--accent);
  text-shadow: 0 2px 12px rgba(0,0,0,.4); opacity: .6;
}
.course-meta { padding: 14px 16px 16px; }
.course-title { margin: 0 0 6px; font-size: 1.05rem; font-weight: 600; line-height: 1.3; }
.empty pre { background: var(--card-2); padding: 12px 16px; border-radius: 10px; display: inline-block; text-align: left; }
