/* ============================================================
   El Secreto Femenino — App CSS
   ============================================================ */

:root {
  --red:        #c8001e;
  --red-bright: #ff1a35;
  --red-dark:   #8a0015;
  --red-glow:   rgba(200, 0, 30, 0.35);
  --gold:       #d4a847;
  --gold-light: #f0cc72;
  --dark:       #0a0005;
  --dark-mid:   #130008;
  --dark-card:  #1a000d;
  --text:       #f0e8e0;
  --text-muted: #9a8880;
  --white:      #ffffff;
  --success:    #22c55e;
  --warning:    #f59e0b;
  --danger:     #ef4444;
  --border:     rgba(200, 0, 30, 0.18);
  --radius:     10px;
  --shadow:     0 8px 32px rgba(0, 0, 0, 0.5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--dark);
  color: var(--text);
  font-family: 'Barlow', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  opacity: .5;
}

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

/* ── ALERTS ──────────────────────────────────────────────────── */
.alert {
  padding: 12px 18px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; margin-bottom: 16px;
}
.alert-danger  { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.35); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.3); color: #86efac; }
.alert-warning { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.3); color: #fcd34d; }

/* ════════════════════════════════════════════════════════════
   AUTH — LOGIN PAGE
════════════════════════════════════════════════════════════ */
.auth-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(150,0,20,.55) 0%, transparent 65%),
    var(--dark);
  padding: 24px 16px;
}

.auth-wrap { width: 100%; max-width: 420px; position: relative; z-index: 1; }

.auth-card {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px 40px;
  box-shadow: var(--shadow);
}

.auth-logo { text-align: center; margin-bottom: 36px; }
.auth-logo-icon { font-size: 48px; margin-bottom: 12px; }
.auth-title {
  font-family: 'Playfair Display', serif;
  font-size: 26px; color: var(--white); margin-bottom: 6px;
}
.auth-subtitle { font-size: 14px; color: var(--text-muted); }

.auth-form { margin-top: 28px; }

.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; letter-spacing: .5px; }
.form-input {
  width: 100%; padding: 13px 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  color: var(--text); font-size: 15px; font-family: inherit;
  outline: none; transition: border-color .2s;
}
.form-input:focus { border-color: var(--red); background: rgba(200,0,30,.05); }
.form-input::placeholder { color: var(--text-muted); opacity: .6; }

.btn-auth {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(135deg, var(--red-bright), var(--red-dark));
  color: #fff; font-size: 17px; font-weight: 700; font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: 1px; text-transform: uppercase;
  padding: 16px 24px; border: none; border-radius: 10px;
  cursor: pointer; transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 20px rgba(200,0,30,.4);
  animation: pulse-btn 2s infinite;
}
.btn-auth:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(200,0,30,.6); }

@keyframes pulse-btn {
  0%,100% { box-shadow: 0 4px 20px rgba(200,0,30,.4); }
  50%      { box-shadow: 0 4px 35px rgba(200,0,30,.7); }
}

.auth-note { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 20px; line-height: 1.6; }
.auth-badge { text-align: center; margin-top: 16px; font-size: 12px; color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════
   NAVBAR
════════════════════════════════════════════════════════════ */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,0,5,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1100px; margin: 0 auto;
  padding: 14px 20px;
}

.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-logo   { font-size: 20px; }
.nav-name   { font-family: 'Barlow Condensed', sans-serif; font-size: 18px; font-weight: 700; color: var(--white); letter-spacing: 1px; }
.nav-back   {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  color: var(--text-muted); transition: background .2s, color .2s;
}
.nav-back:hover { background: rgba(255,255,255,.07); color: var(--white); }
.nav-breadcrumb { display: flex; flex-direction: column; margin-left: 4px; }
.nav-module      { font-size: 11px; color: var(--text-muted); letter-spacing: .5px; }
.nav-lesson-title { font-size: 14px; color: var(--white); font-weight: 600; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-user  { display: flex; align-items: center; gap: 12px; }
.nav-email { font-size: 12px; color: var(--text-muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-logout {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px;
  color: var(--text-muted); transition: background .2s, color .2s;
}
.nav-logout:hover { background: rgba(200,0,30,.15); color: var(--red-bright); }

/* ════════════════════════════════════════════════════════════
   DASHBOARD
════════════════════════════════════════════════════════════ */
.dash-hero {
  background: linear-gradient(180deg, rgba(150,0,20,.3) 0%, transparent 100%);
  padding: 36px 20px 24px;
  position: relative; z-index: 1;
}
.dash-hero-inner { max-width: 1100px; margin: 0 auto; }
.dash-greeting   { font-family: 'Playfair Display', serif; font-size: 28px; color: var(--white); margin-bottom: 6px; }
.dash-greeting strong { color: var(--red-bright); }
.dash-greeting-sub    { font-size: 14px; color: var(--text-muted); }

.dash-content { max-width: 1100px; margin: 0 auto; padding: 16px 20px 48px; position: relative; z-index: 1; }

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title-sm { font-family: 'Playfair Display', serif; font-size: 20px; color: var(--white); }
.section-count    { font-size: 13px; color: var(--text-muted); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-icon  { font-size: 48px; margin-bottom: 12px; }

/* ── Course Grid ─── */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.course-card {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.course-card:hover { transform: translateY(-4px); border-color: rgba(200,0,30,.4); box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.course-card--locked { opacity: .8; }

.course-thumb {
  width: 100%; height: 180px; background: var(--dark-mid);
  position: relative; overflow: hidden;
}
.course-thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 48px; }

.course-lock-overlay {
  position: absolute; inset: 0; background: rgba(10,0,5,.65);
  display: flex; align-items: center; justify-content: center;
}
.lock-icon { font-size: 36px; filter: drop-shadow(0 2px 8px rgba(0,0,0,.8)); }
.course-complete-badge {
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(34,197,94,.9); color: #fff;
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px;
}

.course-info { padding: 20px; }
.course-name { font-family: 'Playfair Display', serif; font-size: 18px; color: var(--white); margin-bottom: 8px; line-height: 1.3; }
.course-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }
.course-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }

.progress-wrap  { margin-bottom: 16px; }
.progress-bar   { height: 5px; background: rgba(255,255,255,.08); border-radius: 10px; overflow: hidden; margin-bottom: 6px; }
.progress-fill  { height: 100%; background: linear-gradient(90deg, var(--red), var(--gold)); border-radius: 10px; transition: width .4s ease; }
.progress-label { font-size: 11px; color: var(--text-muted); }

.btn-course {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--red-bright), var(--red-dark));
  color: #fff; font-size: 14px; font-weight: 700;
  font-family: 'Barlow Condensed', sans-serif; letter-spacing: .5px; text-transform: uppercase;
  padding: 12px 20px; border-radius: 8px; width: 100%;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 4px 16px rgba(200,0,30,.3);
}
.btn-course:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(200,0,30,.5); }

.locked-info { margin-top: 4px; }
.locked-text { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.btn-unlock  {
  display: block; text-align: center; padding: 11px 20px;
  border: 1px solid var(--gold); color: var(--gold); border-radius: 8px;
  font-size: 14px; font-weight: 600; transition: background .2s;
}
.btn-unlock:hover { background: rgba(212,168,71,.12); }

/* ════════════════════════════════════════════════════════════
   COURSE PAGE
════════════════════════════════════════════════════════════ */
.course-hero {
  background: linear-gradient(180deg, rgba(150,0,20,.35) 0%, transparent 100%);
  padding: 36px 20px 28px; position: relative; z-index: 1;
}
.course-hero-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: flex-start; gap: 32px; flex-wrap: wrap;
}
.course-hero-info { flex: 1; min-width: 240px; }
.breadcrumb { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb a { color: var(--text-muted); }
.course-hero-title { font-family: 'Playfair Display', serif; font-size: clamp(24px,4vw,38px); color: var(--white); margin-bottom: 10px; }
.course-hero-desc  { font-size: 15px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.6; }
.course-stats-row  { display: flex; gap: 20px; flex-wrap: wrap; }
.course-stat       { font-size: 13px; color: var(--text-muted); }
.course-stat strong { color: var(--text); }

.course-progress-circle { position: relative; flex-shrink: 0; }
.circle-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.circle-pct   { font-family: 'Barlow Condensed', sans-serif; font-size: 26px; font-weight: 800; color: var(--white); line-height: 1; }
.circle-sub   { font-size: 11px; color: var(--text-muted); }

.course-hero-cta { max-width: 1100px; margin: 20px auto 0; }
.btn-continue {
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--red-bright), var(--red-dark));
  color: #fff; font-family: 'Barlow Condensed', sans-serif; font-size: 18px; font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase;
  padding: 14px 32px; border-radius: 10px;
  box-shadow: 0 4px 20px rgba(200,0,30,.4);
  transition: transform .2s, box-shadow .2s;
}
.btn-continue:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(200,0,30,.6); }

/* ── Modules ─── */
.modules-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; position: relative; z-index: 1; }

.module-item {
  background: var(--dark-card);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color .25s;
}
.module-item:hover { border-color: rgba(200,0,30,.25); }

.module-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; cursor: pointer;
  user-select: none;
}
.module-header-left  { display: flex; align-items: center; gap: 16px; }
.module-num   { font-family: 'Barlow Condensed', sans-serif; font-size: 28px; font-weight: 800; color: rgba(200,0,30,.5); line-height: 1; width: 36px; }
.module-title    { font-size: 16px; font-weight: 600; color: var(--white); margin-bottom: 2px; }
.module-subtitle { font-size: 12px; color: var(--text-muted); }

.module-header-right { display: flex; align-items: center; gap: 12px; }
.mod-progress-bar { width: 80px; height: 4px; background: rgba(255,255,255,.08); border-radius: 10px; overflow: hidden; }
.mod-progress-fill { height: 100%; background: linear-gradient(90deg,var(--red),var(--gold)); border-radius: 10px; transition: width .4s; }
.module-chevron { color: var(--text-muted); transition: transform .3s; }
.module-open .module-chevron { transform: rotate(180deg); }

.module-desc { padding: 0 20px 12px 72px; font-size: 13px; color: var(--text-muted); display: none; }
.module-open .module-desc { display: block; }

.lessons-list { display: none; border-top: 1px solid rgba(255,255,255,.05); }
.module-open .lessons-list { display: block; }

.lesson-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 20px; border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .15s; color: var(--text);
}
.lesson-row:last-child { border-bottom: none; }
.lesson-row:hover      { background: rgba(255,255,255,.03); }
.lesson-done .lesson-title { color: var(--text-muted); text-decoration: line-through; text-decoration-color: rgba(255,255,255,.2); }

.lesson-row-left  { display: flex; align-items: center; gap: 12px; }
.lesson-row-right { display: flex; align-items: center; gap: 10px; color: var(--text-muted); }

.lesson-check {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  font-size: 11px; color: var(--text-muted);
}
.lesson-check--done { background: rgba(34,197,94,.15); border-color: rgba(34,197,94,.4); color: var(--success); }
.lesson-title    { font-size: 14px; }
.lesson-duration { font-size: 12px; color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════
   PLAYER PAGE
════════════════════════════════════════════════════════════ */
.player-body { background: #000; }
.navbar--player { background: rgba(0,0,0,.95); }

.player-layout { display: flex; max-width: 1300px; margin: 0 auto; min-height: calc(100vh - 58px); }

.player-main    { flex: 1; min-width: 0; }
.player-sidebar { width: 320px; background: var(--dark-mid); border-left: 1px solid rgba(255,255,255,.06); overflow-y: auto; flex-shrink: 0; }

.player-video-wrap { background: #000; width: 100%; }
.player-no-video   { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 80px 20px; font-size: 48px; color: var(--text-muted); gap: 12px; }

.player-info { padding: 24px; background: var(--dark); }
.player-info-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.player-module-label { font-size: 11px; color: var(--red); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 6px; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; }
.player-lesson-title { font-family: 'Playfair Display', serif; font-size: 24px; color: var(--white); margin-bottom: 10px; }
.player-lesson-desc  { font-size: 14px; color: var(--text-muted); line-height: 1.7; }

.btn-complete {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  color: var(--text); font-size: 13px; font-weight: 600; padding: 10px 18px; border-radius: 8px;
  cursor: pointer; transition: all .2s; flex-shrink: 0;
}
.btn-complete:hover     { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.3); color: var(--success); }
.btn-complete--done     { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.3); color: var(--success); }

.player-nav { display: flex; justify-content: space-between; align-items: center; }
.player-nav-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 8px; font-size: 14px; font-weight: 600;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  color: var(--text); transition: background .2s, border-color .2s;
}
.player-nav-btn:hover            { background: rgba(255,255,255,.1); }
.player-nav-btn--next            { background: linear-gradient(135deg,var(--red-bright),var(--red-dark)); border-color: transparent; color: #fff; }
.player-nav-btn--next:hover      { opacity: .9; }

/* Sidebar */
.sidebar-header { padding: 16px 18px; border-bottom: 1px solid rgba(255,255,255,.06); display: flex; justify-content: space-between; align-items: center; }
.sidebar-header h3 { font-size: 14px; font-weight: 700; color: var(--white); }
.sidebar-header span { font-size: 12px; color: var(--text-muted); }

.sidebar-lessons { overflow-y: auto; }

.sidebar-lesson {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .15s; color: var(--text-muted); font-size: 13px;
}
.sidebar-lesson:hover               { background: rgba(255,255,255,.04); color: var(--text); }
.sidebar-lesson--active             { background: rgba(200,0,30,.1); color: var(--white); border-left: 3px solid var(--red); }
.sidebar-lesson--done .sidebar-lesson-title { text-decoration: line-through; opacity: .6; }

.sidebar-check {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  font-size: 10px; color: var(--text-muted);
}
.sidebar-check--done   { background: rgba(34,197,94,.15); border-color: rgba(34,197,94,.4); color: var(--success); }
.sidebar-check--active { background: rgba(200,0,30,.2); border-color: var(--red); color: var(--red); }

.sidebar-lesson-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-duration      { font-size: 11px; white-space: nowrap; flex-shrink: 0; }

/* ════════════════════════════════════════════════════════════
   FOOTER
════════════════════════════════════════════════════════════ */
.app-footer { text-align: center; padding: 28px 20px; font-size: 12px; color: var(--text-muted); border-top: 1px solid rgba(255,255,255,.04); position: relative; z-index: 1; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE
════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .player-layout  { flex-direction: column; }
  .player-sidebar { width: 100%; border-left: none; border-top: 1px solid rgba(255,255,255,.06); max-height: 340px; }
}

@media (max-width: 600px) {
  .auth-card         { padding: 36px 24px 32px; }
  .dash-greeting     { font-size: 22px; }
  .courses-grid      { grid-template-columns: 1fr; }
  .course-hero-inner { flex-direction: column; }
  .player-info-top   { flex-direction: column; }
  .player-info       { padding: 18px; }
  .module-num        { font-size: 20px; }
  .nav-email         { display: none; }
}
