:root {
  --brand: #6c2bd9;
  --brand-strong: #58239f;
  --brand-tint: #f1eafc;
  --ink: #1c1d1f;
  --ink-soft: #49484c;
  --ink-faint: #6a6a6e;
  --paper: #f7f7f8;
  --paper-raised: #ffffff;
  --paper-sunken: #ececee;
  --dark: #1c1d1f;
  --dark-raised: #26272b;
  --dark-line: rgba(255, 255, 255, 0.1);
  --good: #1e7a4c;
  --good-tint: #e5f5ec;
  --bad: #c0202f;
  --bad-tint: #fbe9ea;
  --line: rgba(20, 20, 20, 0.1);
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 20px;
  --shadow-card: 0 1px 2px rgba(20, 20, 20, 0.04), 0 8px 24px rgba(20, 20, 20, 0.06);
  --font-body: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }
svg { display: block; }

/* ---------------------------------------------------------------- Header */

.site-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: var(--dark);
  color: #fff;
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: #fff; text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), #a06bf0);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
}
.header-user { font-size: 13.5px; display: flex; gap: 14px; align-items: center; color: rgba(255,255,255,0.85); }
.header-user a { color: rgba(255,255,255,0.85); text-decoration: none; }
.header-user a:hover { color: #fff; text-decoration: underline; }
.header-links { display: flex; gap: 14px; align-items: center; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand-tint); color: var(--brand-strong);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12.5px;
}
.inline-form { display: inline; }
.link-button { background: none; border: none; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }

.page { max-width: 1120px; margin: 0 auto; padding: 28px 20px 72px; }
.page-narrow { max-width: 640px; }
h1 { font-size: 23px; margin: 0 0 16px; letter-spacing: -0.2px; }
h2 { font-size: 19px; margin: 0 0 8px; letter-spacing: -0.2px; }
.muted { color: var(--ink-faint); font-size: 13.5px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.06em; font-size: 11.5px; font-weight: 700; color: var(--brand); margin: 0 0 6px; }

/* ----------------------------------------------------------------- Cards */

.card { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 22px; box-shadow: var(--shadow-card); }
.card-narrow { max-width: 400px; margin: 0 auto; }

.auth-shell {
  min-height: calc(100vh - 56px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 16px;
  background:
    radial-gradient(circle at 20% 10%, rgba(108, 43, 217, 0.12), transparent 55%),
    radial-gradient(circle at 85% 90%, rgba(108, 43, 217, 0.08), transparent 50%);
}
.auth-box { width: 100%; max-width: 400px; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 20px; }
.auth-box .card { padding: 30px 28px; }
.auth-box h1 { text-align: center; margin-bottom: 4px; }
.auth-sub { text-align: center; margin: 0 0 22px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.field input, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-s);
  font: inherit; background: var(--paper-raised); transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: #fff; border: none; border-radius: 999px;
  padding: 12px 20px; font-size: 14.5px; font-weight: 700; cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--brand-strong); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }

.errors { color: var(--bad); font-size: 13px; }
.alert { padding: 12px 14px; border-radius: var(--radius-s); margin-bottom: 16px; font-size: 13.5px; }
.alert-ok { background: var(--good-tint); color: var(--good); }
.alert-error { background: var(--bad-tint); color: var(--bad); }

.empty-state { color: var(--ink-faint); padding: 48px 20px; text-align: center; font-size: 15px; }
.empty-state-emoji { font-size: 32px; display: block; margin-bottom: 10px; }

/* ----------------------------------------------------- Reproductor curso */

.course-hero { margin-bottom: 18px; }
.course-hero h1 { margin-bottom: 2px; }

.course-layout { display: grid; grid-template-columns: 1fr 360px; gap: 22px; align-items: start; }

.lesson-main { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 22px; box-shadow: var(--shadow-card); }
.video-embed { position: relative; width: 100%; padding-top: 56.25%; margin-bottom: 18px; border-radius: var(--radius-s); overflow: hidden; background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.lesson-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 10px; }
.lesson-head h2 { margin-bottom: 0; }
.lesson-number-tag { font-size: 12.5px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 4px; }
.lesson-material { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 13.5px; font-weight: 600; text-decoration: none; }
.lesson-actions { margin-top: 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 700; flex-shrink: 0; }
.badge-ok { background: var(--good-tint); color: var(--good); }

/* Sidebar de currícula, estilo lista de clases de Udemy */
.curriculum { background: var(--dark); color: #fff; border-radius: var(--radius-m); overflow: hidden; position: sticky; top: 76px; }
.curriculum-head { padding: 18px 18px 16px; border-bottom: 1px solid var(--dark-line); }
.curriculum-title { font-weight: 700; font-size: 15px; margin: 0 0 10px; }
.progress-track { height: 6px; background: rgba(255,255,255,0.15); border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--brand), #a06bf0); border-radius: 999px; transition: width .3s; }
.progress-label { font-size: 12.5px; color: rgba(255,255,255,0.7); }

.lesson-list { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.lesson-item { border-bottom: 1px solid var(--dark-line); }
.lesson-item:last-child { border-bottom: none; }
.lesson-item a, .lesson-item .lesson-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 18px; font-size: 13.5px;
  text-decoration: none; color: #fff;
}
.lesson-item a:hover { background: var(--dark-raised); }
.lesson-icon {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700;
  background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.85);
}
.lesson-item.lesson-completed .lesson-icon { background: var(--good); color: #fff; }
.lesson-item.lesson-unlocked .lesson-icon { background: var(--brand); color: #fff; }
.lesson-item.lesson-locked .lesson-row { color: rgba(255,255,255,0.4); cursor: default; }
.lesson-item.lesson-locked .lesson-icon { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.35); }
.lesson-item.is-current { background: var(--dark-raised); }
.lesson-item.is-current a, .lesson-item.is-current .lesson-row { font-weight: 700; }
.lesson-title { flex: 1; }
.lesson-duration-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); flex-shrink: 0; }

@media (max-width: 860px) {
  .course-layout { grid-template-columns: 1fr; }
  .curriculum { position: static; }
  .lesson-list { max-height: none; }
}
