:root {
  --bg: #0b0b0d;
  --bg-elev: #16161a;
  --gold: #d4af6a;
  --gold-dark: #b8860b;
  --cream: #faf6ee;
  --text-dim: #9a958c;
  --card-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: Arial, Helvetica, sans-serif;
  min-height: 100vh;
}

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

/* ---------- Login ---------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 20%, rgba(184, 134, 11, 0.15), transparent 60%), var(--bg);
  padding: 24px;
}

.login-card {
  background: var(--bg-elev);
  border: 1px solid rgba(212, 175, 106, 0.25);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--card-shadow);
  text-align: center;
}

.login-card img.logo { height: 40px; margin-bottom: 24px; }

.login-card h1 { font-size: 1.2rem; font-weight: 400; color: var(--text-dim); margin-bottom: 24px; }

.login-card input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 106, 0.3);
  background: #0e0e11;
  color: var(--cream);
  font-size: 0.95rem;
}

.login-card button {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: none;
  background: var(--gold-dark);
  color: #1a1305;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 8px;
}

.login-card button:hover { background: var(--gold); }

.login-error {
  background: rgba(180, 60, 60, 0.15);
  border: 1px solid rgba(180, 60, 60, 0.4);
  color: #ffb3b3;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.login-hint { font-size: 0.78rem; color: var(--text-dim); margin-top: 18px; }

/* ---------- Top nav ---------- */

.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  position: sticky;
  top: 0;
  background: linear-gradient(to bottom, rgba(11, 11, 13, 0.95), rgba(11, 11, 13, 0));
  z-index: 10;
}

.topnav img.logo { height: 28px; }

.topnav form { display: inline; }

.topnav button {
  background: transparent;
  border: 1px solid rgba(250, 246, 238, 0.3);
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  height: 46vh;
  min-height: 280px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  margin-top: -70px;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg) 5%, rgba(11, 11, 13, 0.2) 60%, rgba(11,11,13,0.1));
}

.hero-content { position: relative; padding: 0 40px 40px; max-width: 640px; }
.hero-content h1 { font-size: 2.2rem; margin: 0 0 10px; font-weight: 700; }
.hero-content p { color: var(--text-dim); font-size: 1rem; margin: 0 0 18px; }

.btn-continue {
  display: inline-block;
  background: var(--gold-dark);
  color: #1a1305;
  padding: 10px 22px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9rem;
}

/* ---------- Rows ---------- */

.rows { padding: 10px 0 60px; }

.row { margin-bottom: 34px; }
.row h2 {
  padding: 0 40px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 12px;
}

.row-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 0 40px 8px;
  scrollbar-width: thin;
}

.card {
  flex: 0 0 auto;
  width: 150px;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease;
}

.card:hover { transform: scale(1.05); }

.card img {
  width: 100%;
  aspect-ratio: 374 / 1000;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--card-shadow);
}

.card.locked img { filter: grayscale(0.8) brightness(0.4); }

.card-label {
  font-size: 0.78rem;
  margin-top: 6px;
  color: var(--cream);
}

.card-sub { font-size: 0.7rem; color: var(--text-dim); }

.lock-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.progress-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--gold-dark);
  color: #1a1305;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

/* ---------- Module detail ---------- */

.module-header {
  display: flex;
  gap: 24px;
  padding: 100px 40px 30px;
  align-items: flex-end;
}

.module-header img { width: 160px; border-radius: 10px; box-shadow: var(--card-shadow); }
.module-header h1 { font-size: 1.6rem; margin: 0 0 6px; }
.module-header p { color: var(--text-dim); margin: 0; }

.lesson-list { padding: 0 40px 60px; max-width: 700px; }

.lesson-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-elev);
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid rgba(212, 175, 106, 0.12);
}

.lesson-item.done { border-color: rgba(212, 175, 106, 0.4); }
.lesson-title { font-size: 0.95rem; }
.lesson-check { color: var(--gold); font-size: 0.85rem; }

.btn-play {
  background: var(--gold-dark);
  color: #1a1305;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.82rem;
}

/* ---------- Player ---------- */

.player-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}

.player-wrap img.cover {
  width: 220px;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  margin-bottom: 28px;
}

.player-wrap h1 { font-size: 1.3rem; margin: 0 0 4px; }
.player-wrap .module-name { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 26px; }

.player-wrap audio { width: 100%; max-width: 420px; margin-bottom: 20px; }

.back-link { color: var(--text-dim); font-size: 0.85rem; margin-top: 10px; }

@media (max-width: 640px) {
  .topnav, .hero-content, .module-header, .lesson-list, .row h2, .row-scroll { padding-left: 18px; padding-right: 18px; }
  .hero-content h1 { font-size: 1.5rem; }
  .module-header { flex-direction: column; align-items: flex-start; }
}
