:root {
  --maroon: #7a1c2b;
  --maroon-dark: #5c141f;
  --gold: #d4a017;
  --gold-light: #f3e5ab;
  --cream: #fdf8f0;
  --ink: #2b1a14;
  --muted: #7a6a60;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
}

a {
  color: var(--maroon);
  text-decoration: none;
}

a:hover {
  color: var(--gold);
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */

.site-header {
  background: linear-gradient(120deg, var(--maroon), var(--maroon-dark));
  color: #fff;
  padding: 18px 0;
  border-bottom: 4px solid var(--gold);
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: #fff;
}

.brand:hover {
  color: var(--gold-light);
}

.brand-name {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-tagline {
  font-size: 0.85rem;
  color: var(--gold-light);
}

.main-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.main-nav a {
  color: #fff;
  font-weight: 500;
}

.main-nav a:hover {
  color: var(--gold-light);
}

.nav-user {
  color: var(--gold-light);
  font-size: 0.9rem;
}

.logout-form {
  margin: 0;
  display: inline;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: #fff;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.link-button:hover {
  color: var(--gold-light);
}

/* Hero */

.hero {
  background: radial-gradient(circle at top right, var(--gold-light), var(--cream) 60%);
  padding: 56px 0;
  border-bottom: 1px solid #ecdfc9;
}

.hero h1 {
  font-size: 2.4rem;
  margin: 0 0 12px;
  color: var(--maroon-dark);
}

.hero p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 640px;
}

.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--maroon);
  color: #fff;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--maroon-dark);
  color: var(--gold-light);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--maroon);
  color: var(--maroon);
}

.btn-outline:hover {
  background: var(--maroon);
  color: #fff;
}

/* Sections */

.section {
  padding: 40px 0;
}

.section-title {
  font-size: 1.5rem;
  color: var(--maroon-dark);
  margin-bottom: 20px;
  border-left: 5px solid var(--gold);
  padding-left: 12px;
}

/* Category chips */

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.category-chip {
  padding: 6px 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--gold);
  color: var(--maroon-dark);
  font-size: 0.9rem;
}

.category-chip.active,
.category-chip:hover {
  background: var(--gold);
  color: var(--maroon-dark);
}

/* Course grid */

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.course-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(90, 40, 30, 0.08);
  border: 1px solid #eee0c8;
  display: flex;
  flex-direction: column;
}

.course-card-thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--maroon), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
}

.course-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.course-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--gold-light);
  color: var(--maroon-dark);
  text-transform: capitalize;
  width: fit-content;
}

.course-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Filters */

.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 24px;
}

.filter-bar input,
.filter-bar select {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 0.9rem;
}

/* Course detail */

.course-header {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 24px;
}

.lesson-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid #eee0c8;
  border-radius: var(--radius);
  overflow: hidden;
}

.lesson-list li + li {
  border-top: 1px solid #eee0c8;
}

.lesson-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: #fff;
}

.lesson-row:hover {
  background: var(--gold-light);
}

.lesson-row.active {
  background: var(--gold-light);
  font-weight: 600;
}

.lesson-index {
  color: var(--muted);
  margin-right: 10px;
}

/* Lesson player */

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: #000;
  margin-bottom: 20px;
}

.video-wrapper iframe,
.video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.lesson-nav {
  display: flex;
  justify-content: space-between;
  margin: 20px 0;
  gap: 10px;
  flex-wrap: wrap;
}

/* Footer */

.site-footer {
  background: var(--maroon-dark);
  color: var(--gold-light);
  padding: 28px 0;
  margin-top: 60px;
  font-size: 0.9rem;
  text-align: center;
}

.site-footer a {
  color: #fff;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

/* Auth forms */

.auth-container {
  max-width: 420px;
}

.auth-container form p {
  margin-bottom: 16px;
}

.auth-container form label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  color: var(--maroon-dark);
}

.auth-container form input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 0.95rem;
}

.auth-container .helptext {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

.auth-container ul.errorlist {
  list-style: none;
  padding: 0;
  margin: 4px 0;
  color: #b00020;
  font-size: 0.85rem;
}

.form-error {
  color: #b00020;
  margin-bottom: 16px;
}

/* Flash messages */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin: 20px 0 0;
  font-size: 0.95rem;
}

.alert-success {
  background: #e6f4ea;
  color: #1e6b34;
  border: 1px solid #b6dfc1;
}

.alert-error,
.alert-danger {
  background: #fbe7e7;
  color: #a3231f;
  border: 1px solid #f1bcbc;
}

@media (max-width: 640px) {
  .hero h1 {
    font-size: 1.8rem;
  }
}
