:root {
  --ink: #101114;
  --ink-soft: #2a2d35;
  --paper: #f6f3ee;
  --white: #ffffff;
  --line: #e4dfd6;
  --gold: #c6a15b;
  --gold-deep: #9a7430;
  --crimson: #9d1c24;
  --muted: #6b6f79;
  --shadow: 0 18px 50px rgba(16, 17, 20, 0.12);
  --radius: 18px;
  --font: "Trebuchet MS", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #0d0e12;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.header-inner, .footer-inner, .wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 14px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold);
  font-size: 13px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.nav-links a, .nav-links button, .nav-links span {
  color: #d7d8de;
  font-size: 14px;
}
.sponsor-bar {
  background: #1a4a7a;
  color: #fff;
  border-top: 1px solid rgba(255,255,255,.12);
}
.sponsor-bar-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.sponsor-label {
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 800;
  color: #d7eefb;
  white-space: nowrap;
}
.sponsor-list {
  display: flex;
  align-items: center;
  gap: 20px;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
}
.sponsor-item {
  display: inline-flex;
  align-items: center;
  height: 32px;
}
.sponsor-item img {
  height: 28px;
  width: auto;
  display: block;
  border-radius: 4px;
}
.sponsor-on-dark img {
  filter: brightness(0) invert(1);
}
.sponsor-sep {
  color: rgba(255,255,255,.35);
  font-weight: 300;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 14px;
}
.btn-gold { background: var(--gold); color: #16140e; }
.btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.2); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-crimson { background: var(--crimson); color: #fff; }
.btn-outline { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn-block { width: 100%; }

.hero {
  background:
    radial-gradient(circle at 80% 20%, rgba(198,161,91,.28), transparent 32%),
    linear-gradient(160deg, #14161c 0%, #0d0e12 48%, #1c1512 100%);
  color: #fff;
  padding: 72px 0 88px;
}
.kicker {
  color: var(--gold);
  letter-spacing: .22em;
  text-transform: uppercase;
  font-size: 12px;
  margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(36px, 6vw, 72px);
  line-height: .95;
  margin: 0 0 18px;
  max-width: 14ch;
}
.hero p { max-width: 54ch; color: #c9ccd4; font-size: 18px; }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

.section { padding: 64px 0; }
.section h2 { font-size: 32px; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 28px; max-width: 60ch; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}
.course-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.cover {
  min-height: 170px;
  padding: 22px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(160deg, rgba(255,255,255,.08), rgba(0,0,0,.25));
}
.badge {
  align-self: flex-start;
  background: var(--gold);
  color: #16140e;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.cover h3 { margin: 24px 0 0; font-size: 24px; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.meta { color: var(--muted); font-size: 13px; }
.price { font-size: 28px; font-weight: 800; }
.progress {
  height: 6px;
  background: #ece8e0;
  border-radius: 999px;
  overflow: hidden;
}
.progress > span { display: block; height: 100%; background: var(--gold); }

.about {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 40px;
  align-items: start;
}
.about ul { padding-left: 18px; color: var(--ink-soft); }
.portrait {
  min-height: 320px;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(16,17,20,.1), rgba(16,17,20,.55)),
    repeating-linear-gradient(135deg, #2a241c 0 12px, #1b1814 12px 24px);
  color: #fff;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: end;
}

.site-footer {
  background: #0d0e12;
  color: #b8bbc3;
  padding: 32px 0;
  margin-top: auto;
  font-size: 13px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-copy {
  display: grid;
  gap: 4px;
}
.footer-social {
  display: flex;
  align-items: center;
  gap: 10px;
}
.social-link {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.1);
  color: #fff;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.social-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.social-link:hover {
  background: #fff;
  color: #0d0e12;
  transform: translateY(-2px);
}

.flash, .alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin: 16px 0;
}
.flash-ok, .alert-ok { background: #e8f6ea; color: #1d5b2a; }
.flash-err, .alert-err { background: #fdecee; color: #8b1c24; }

.auth-card, .panel, .checkout-grid, .admin-table-wrap {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.auth-wrap { width: min(460px, calc(100% - 32px)); margin: 48px auto; }
.auth-wrap-wide { width: min(720px, calc(100% - 32px)); }
.form-grid { display: grid; gap: 14px; }
.terms-box {
  max-height: 240px;
  overflow: auto;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbfe;
  color: var(--ink-soft);
}
.terms-box h1 {
  font-size: 16px;
  margin: 0 0 10px;
  line-height: 1.3;
}
.terms-box p,
.terms-page p {
  font-size: 13px;
  line-height: 1.55;
  margin: 0 0 12px;
  font-weight: 400;
}
.terms-page h1 { font-size: 28px; line-height: 1.2; }
.terms-accept { align-items: flex-start; }
.terms-accept span { font-weight: 600; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--ink-soft); font-weight: 700; }
input, textarea, select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
}
textarea { min-height: 120px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }

.course-hero {
  color: #fff;
  padding: 48px 0 36px;
}
.course-hero .wrap { display: grid; grid-template-columns: 1.4fr .8fr; gap: 32px; }
.buy-box {
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.curriculum { display: grid; gap: 14px; }
.week {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.week h3 {
  margin: 0;
  padding: 14px 18px;
  background: #111318;
  color: #fff;
  font-size: 15px;
}
.lecture {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.lock, .preview-pill {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 800;
}
.preview-pill { color: #1d5b2a; }
.lock { color: var(--muted); }

.lesson-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: calc(100vh - 72px);
  flex: 1;
}
.sidebar {
  background: #14161c;
  color: #d7d8de;
  overflow: auto;
}
.sidebar a, .sidebar h2, .sidebar p { color: inherit; }
.sidebar-head { padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-lesson {
  display: block;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: 13px;
}
.sidebar-lesson.active { background: rgba(198,161,91,.16); color: var(--gold); }
.player-wrap { padding: 24px; }
.player {
  background: #0b0c10;
  border-radius: 16px;
  min-height: 380px;
  display: grid;
  place-items: center;
  color: #fff;
  overflow: hidden;
  position: relative;
}
.player iframe, .player video { width: 100%; height: 100%; min-height: 380px; border: 0; }
.placeholder-play {
  text-align: center;
  padding: 40px;
}
.placeholder-play .orb {
  width: 84px;
  height: 84px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  display: grid;
  place-items: center;
  font-size: 28px;
  color: var(--gold);
}
.locked-panel {
  text-align: center;
  padding: 48px 24px;
}
.admin-nav { display: flex; gap: 10px; margin: 18px 0 24px; flex-wrap: wrap; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.stat { background: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 32px; }

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}
.video-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.video-card a { display: block; color: inherit; }
.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0b2f5b;
  overflow: hidden;
}
.video-thumb video,
.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 42px;
  background: linear-gradient(160deg, #1565c0, #0b3d8c);
}
.video-card h3 { margin: 0; font-size: 20px; }
.video-card p {
  margin: 0;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-detail { max-width: 920px; }
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 28px;
}
.video-collection { margin-bottom: 40px; }
.watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
  gap: 28px;
  align-items: start;
}
.watch-collection {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.watch-collection h2 { margin-top: 0; }
.collection-list { display: grid; gap: 10px; }
.collection-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.collection-item.active {
  border-color: var(--gold);
  background: var(--paper);
}
.collection-item .admin-thumb { width: 96px; height: 54px; }
.admin-thumb {
  width: 120px;
  height: 68px;
  border-radius: 10px;
  overflow: hidden;
  background: #0b2f5b;
  color: #fff;
  font-size: 11px;
  display: grid;
  place-items: center;
}
.admin-thumb img,
.admin-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.checkout-grid { display: grid; grid-template-columns: 1fr .8fr; gap: 24px; padding: 0; background: transparent; box-shadow: none; }
.demo-note { font-size: 12px; color: var(--muted); }

@media (max-width: 900px) {
  .about, .course-hero .wrap, .lesson-layout, .checkout-grid, .stats, .watch-layout { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 56px; }
  .footer-inner { justify-content: center; text-align: center; }
  .sponsor-bar-inner { min-height: 42px; gap: 12px; }
  .sponsor-item img { height: 22px; }
}
