:root {
  color-scheme: dark;
  --bg: #101318;
  --panel: #181d24;
  --panel-2: #202630;
  --text: #f4f7fb;
  --muted: #9aa7b8;
  --line: #303948;
  --accent: #39c6a3;
  --accent-2: #4f8cff;
  --danger: #ff6678;
  --warning: #f0ba55;
  --shadow: 0 18px 50px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(57, 198, 163, .08), transparent 35%),
    linear-gradient(220deg, rgba(79, 140, 255, .12), transparent 35%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; text-decoration: none; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(16, 19, 24, .82);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-size: 18px;
  font-weight: 800;
}

nav {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

nav a, .nav-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  padding: 8px 10px;
}

.shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 70px;
}

.hero {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 480px);
  align-items: center;
  gap: 48px;
}

.hero-copy h1, .page-head h1, .auth-card h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 68px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 640px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 800;
}

.actions, .card-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-2);
  font-weight: 700;
  cursor: pointer;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #07110f;
}

.button.ghost { background: transparent; }
.button.danger { background: var(--danger); border-color: var(--danger); color: #1b0609; }
.button.full { width: 100%; margin-top: 18px; }

.video-panel, .panel, .lesson-card {
  background: rgba(24, 29, 36, .88);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.mock-player {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.mock-player span {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--accent);
  clip-path: polygon(35% 25%, 35% 75%, 78% 50%);
}

.mock-player strong {
  position: absolute;
  left: 24px;
  bottom: 22px;
}

.auth-layout {
  min-height: calc(100vh - 72px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(420px, 100%);
  padding: 28px;
}

.auth-card h1 { font-size: 34px; margin-bottom: 24px; }

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-weight: 700;
}

input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1015;
  color: var(--text);
  min-height: 42px;
  padding: 10px 12px;
}

.form-note, .message, .muted { color: var(--muted); }
.message.error { color: var(--danger); }
.message.success { color: var(--accent); }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 28px;
}

.page-head h1 { font-size: clamp(32px, 4vw, 52px); }

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.lesson-card {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
}

.lesson-card h2 {
  margin: 14px 0 10px;
  font-size: 22px;
}

.lesson-card p, .lesson-description {
  color: var(--muted);
  line-height: 1.6;
}

.status, .access-status {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: var(--muted);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}

.status.free, .status.purchase, .status.admin { color: var(--accent); }
.status.locked, .status.revoked { color: var(--warning); }
.status.expired { color: var(--danger); }

.player-wrap {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  background: #050609;
}

.video-js {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.watermark {
  position: absolute;
  z-index: 5;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .34);
  color: rgba(255, 255, 255, .64);
  font-size: 13px;
  pointer-events: none;
}

.watermark.top-left { top: 16px; left: 16px; }
.watermark.top-right { top: 16px; right: 16px; }
.watermark.bottom-left { bottom: 16px; left: 16px; }
.watermark.bottom-right { bottom: 16px; right: 16px; }

.blocked { padding: 28px; }

.admin-shell .panel { padding: 20px; }
.admin-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.user-list, .access-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.user-row {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
}

.access-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.1fr) minmax(220px, 1.1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
}

.access-row form {
  display: grid;
  gap: 8px;
}

.price {
  display: block;
  font-size: 42px;
  margin: 12px 0;
}

@media (max-width: 860px) {
  .hero, .admin-grid, .access-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }

  nav { flex-wrap: wrap; }
}
