/* ============================================
   Move Your Money - Mini Curso Platform
   Premium Design — Navy + Silver
   ============================================ */

:root {
  --bg-base: #0e1225;
  --bg-elevated: #161a31;
  --bg-card: #1c2140;
  --bg-card-hover: #232850;
  --bg-subtle: rgba(255,255,255,0.03);

  --silver: #d0d4e0;
  --silver-bright: #eceef4;
  --silver-glow: rgba(208,212,224,0.12);
  --silver-light: rgba(208,212,224,0.06);
  --silver-border: rgba(208,212,224,0.15);

  /* Text — bright, legible hierarchy via weight+size not opacity */
  --text-white: #ffffff;
  --text-light: #e4e6f0;
  --text-secondary: #c8ccd8;
  --text-muted: #a0a4b8;
  --text-label: #8a8ea6;

  --border: rgba(255,255,255,0.07);
  --red-soft: #f07068;
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Montserrat', sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-light);
  min-height: 100vh;
  line-height: 1.6;
}
a { color: var(--silver-bright); text-decoration: none; transition: color var(--transition); }
a:hover { color: #fff; }

.logo-white { filter: brightness(0) invert(1); opacity: 0.95; }

/* ============================================
   Buttons
   ============================================ */

.btn {
  font-family: var(--font-body); font-weight: 600; border: none; cursor: pointer;
  padding: 12px 28px; font-size: 0.88rem; border-radius: var(--radius);
  transition: all var(--transition); display: inline-flex; align-items: center;
  justify-content: center; gap: 8px; letter-spacing: 0.3px;
}

.btn-primary { background: var(--silver); color: var(--bg-base); font-weight: 700; }
.btn-primary:hover { background: #fff; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

.btn-outline { background: transparent; color: var(--text-secondary); border: 1px solid rgba(255,255,255,0.1); }
.btn-outline:hover { border-color: var(--silver-border); color: var(--silver-bright); }

.btn-full { width: 100%; }
.btn-sm { padding: 9px 18px; font-size: 0.82rem; }

.btn-admin-back {
  background: var(--silver-light); color: var(--silver-bright);
  border: 1px solid var(--silver-border); padding: 7px 14px;
  font-size: 0.76rem; font-weight: 600; border-radius: 6px;
  letter-spacing: 0.5px; text-transform: uppercase;
}
.btn-admin-back:hover { background: var(--silver-glow); color: #fff; }

.btn-progress-toggle {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary); width: 38px; height: 38px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.btn-progress-toggle:hover { background: var(--silver-light); border-color: var(--silver-border); color: #fff; }

/* ============================================
   Auth Pages
   ============================================ */

.auth-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg-base); position: relative;
}

.auth-page::before {
  content: ''; position: absolute; top: -20%; left: 50%; transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.02) 0%, transparent 70%);
  pointer-events: none;
}

.auth-container { width: 100%; max-width: 440px; padding: 20px; position: relative; z-index: 1; }

.auth-card {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 48px 40px;
}

.auth-logo { text-align: center; margin-bottom: 40px; }
.auth-logo-img {
  width: 90px; height: 90px; border-radius: 50%; object-fit: cover;
  margin-bottom: 16px; border: 2px solid rgba(255,255,255,0.08);
}
.brand-subtitle {
  font-family: var(--font-body); font-size: 0.7rem; color: var(--text-muted);
  letter-spacing: 4px; text-transform: uppercase; margin-top: 4px;
}

.auth-heading {
  font-family: var(--font-heading); font-size: 1.4rem; font-weight: 600;
  margin-bottom: 28px; color: var(--text-white);
}

.auth-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.82rem; font-weight: 500; color: var(--text-secondary); }

.form-group input {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius); padding: 14px 16px; font-size: 0.92rem;
  color: var(--text-white); font-family: var(--font-body);
  transition: all var(--transition); outline: none;
}
.form-group input::placeholder { color: var(--text-label); }
.form-group input:focus {
  border-color: rgba(255,255,255,0.2); box-shadow: 0 0 0 3px rgba(255,255,255,0.04);
  background: rgba(255,255,255,0.06);
}

.error-message {
  background: rgba(240,112,104,0.08); border: 1px solid rgba(240,112,104,0.2);
  color: var(--red-soft); padding: 12px 16px; border-radius: var(--radius); font-size: 0.85rem;
}

.auth-switch { text-align: center; margin-top: 28px; font-size: 0.85rem; color: var(--text-muted); }

/* ============================================
   Header
   ============================================ */

.header {
  background: rgba(14,18,37,0.92); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.header-brand { display: flex; align-items: center; gap: 0; }
.header-logo { height: 40px; width: auto; }

.brand-divider {
  width: 1px; height: 28px; background: rgba(255,255,255,0.15); margin: 0 12px;
}
.brand-name { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name-top {
  font-family: var(--font-heading); font-size: 0.95rem; font-weight: 800;
  color: var(--text-white); letter-spacing: 3px; text-transform: uppercase;
}
.brand-name-bottom {
  font-family: var(--font-body); font-size: 0.72rem; font-weight: 400;
  color: var(--text-secondary); letter-spacing: 0.5px;
}
.header-right { display: flex; align-items: center; gap: 12px; }
.header-user { font-size: 0.82rem; color: var(--text-secondary); }

/* ============================================
   Course Page
   ============================================ */

.course-page { background: var(--bg-base); min-height: 100vh; display: flex; flex-direction: column; }
.main { max-width: 1100px; margin: 0 auto; padding: 44px 24px 60px; flex: 1; width: 100%; }

/* ---- Welcome ---- */
.welcome-section {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 36px; gap: 20px;
}
.welcome-title {
  font-family: var(--font-heading); font-size: 2rem; font-weight: 700;
  color: var(--text-white); margin-bottom: 6px; letter-spacing: -0.5px;
}
.welcome-subtitle { font-size: 0.92rem; color: var(--text-secondary); line-height: 1.6; }

/* ---- Live Timer ---- */
.welcome-timer {
  display: flex; flex-direction: column; align-items: center;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 22px; min-width: 180px;
  flex-shrink: 0;
}
.timer-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 6px; }
.timer-value {
  font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700;
  color: var(--text-white); letter-spacing: 2px; font-variant-numeric: tabular-nums;
}
.timer-value.expired { color: var(--red-soft); }
.timer-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }

/* ---- Progress Bar ---- */
.progress-section {
  margin-bottom: 40px; background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 24px;
}
.progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.progress-label { font-family: var(--font-heading); font-size: 0.88rem; font-weight: 600; color: var(--text-white); }
.progress-text { font-size: 0.85rem; color: var(--text-secondary); font-weight: 500; }

.progress-bar { height: 6px; background: rgba(255,255,255,0.05); border-radius: 3px; overflow: hidden; }
.progress-fill {
  height: 100%; background: linear-gradient(90deg, #6a72a0, var(--silver-bright));
  border-radius: 3px; transition: width 0.8s ease;
}

/* ---- Clases Grid ---- */
.clases-section { margin-bottom: 40px; }
.clases-heading {
  font-family: var(--font-heading); font-size: 0.78rem; font-weight: 600;
  color: var(--text-muted); margin-bottom: 20px; text-transform: uppercase; letter-spacing: 2px;
}

.clases-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px;
}

.clase-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; cursor: pointer;
  transition: all var(--transition); position: relative;
}
.clase-card:hover {
  border-color: var(--silver-border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  transform: translateY(-3px); background: var(--bg-card-hover);
}
.clase-card.completed { border-color: rgba(255,255,255,0.08); }

/* Locked card */
.clase-card.locked { opacity: 0.5; cursor: not-allowed; }
.clase-card.locked:hover { transform: none; box-shadow: none; border-color: var(--border); background: var(--bg-card); }

.clase-card-lock {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  background: rgba(0,0,0,0.4); border-radius: 50%; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
}
.clase-card-lock svg { width: 14px; height: 14px; stroke: var(--text-secondary); }

.clase-card-thumb {
  width: 100%; aspect-ratio: 16 / 9;
  background-color: var(--bg-base);
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.clase-card-thumb::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(14,18,37,0.3);
  transition: background var(--transition);
}
.clase-card:hover:not(.locked) .clase-card-thumb::before {
  background: rgba(14,18,37,0.15);
}
.clase-card-thumb .play-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255,255,255,0.05); border: 1.5px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); z-index: 1;
}
.clase-card:hover:not(.locked) .play-icon {
  background: rgba(255,255,255,0.1); border-color: var(--silver);
  box-shadow: 0 0 30px rgba(255,255,255,0.06); transform: scale(1.06);
}
.play-icon svg { width: 22px; height: 22px; fill: var(--silver-bright); margin-left: 2px; }

.clase-card-body { padding: 16px 20px; }
.clase-card-info { flex: 1; }
.clase-card-number {
  font-family: var(--font-heading); font-size: 0.68rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 4px;
}
.clase-card-title {
  font-family: var(--font-heading); font-size: 1.02rem; font-weight: 600;
  color: var(--text-white); margin-bottom: 4px;
}
.clase-card-desc { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }

.clase-card-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 20px 16px; margin-top: -4px;
}

.clase-card-check {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.clase-card-check.done { background: var(--silver-glow); }
.clase-card-check.done svg { stroke: var(--silver-bright); }
.clase-card-check.pending { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); }
.clase-card-check svg { width: 13px; height: 13px; stroke: var(--text-label); }

.clase-card-status {
  position: absolute; top: 14px; right: 14px;
  background: var(--silver-bright); color: var(--bg-base);
  font-size: 0.6rem; font-weight: 700; padding: 4px 10px;
  border-radius: 4px; letter-spacing: 1.2px; text-transform: uppercase; z-index: 2;
}

/* ============================================
   Progress Slide-in Panel
   ============================================ */

.progress-panel {
  position: fixed; top: 0; right: 0; width: 360px; height: 100vh;
  background: var(--bg-elevated); z-index: 200;
  transform: translateX(100%); transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column; border-left: 1px solid var(--border);
}
.progress-panel.open { transform: translateX(0); }

.progress-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px; border-bottom: 1px solid var(--border);
}
.progress-panel-header h3 { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 600; color: var(--text-white); }

.progress-panel-close { background: none; border: none; color: var(--text-muted); font-size: 1.4rem; cursor: pointer; }
.progress-panel-close:hover { color: #fff; }

.progress-panel-user { padding: 16px 24px 4px; font-size: 0.9rem; color: var(--text-secondary); }

.progress-circle-wrapper { display: flex; align-items: center; gap: 20px; padding: 12px 24px 24px; }
.progress-circle { width: 76px; height: 76px; position: relative; flex-shrink: 0; }
.progress-circle svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-circle-bg { fill: none; stroke: rgba(255,255,255,0.05); stroke-width: 5; }
.progress-circle-fill {
  fill: none; stroke: var(--silver-bright); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 263.9; stroke-dashoffset: 263.9; transition: stroke-dashoffset 0.8s ease;
}
.progress-circle-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-size: 1rem; font-weight: 700; color: var(--text-white);
}

.progress-circle-info { display: flex; flex-direction: column; gap: 4px; }
.progress-circle-info span { font-size: 0.88rem; color: var(--text-light); }
.progress-days { font-size: 0.82rem !important; color: var(--text-secondary) !important; font-weight: 500; }

.progress-panel-list { flex: 1; padding: 0 24px; overflow-y: auto; }
.progress-lesson-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--border);
}
.progress-lesson-item:last-child { border-bottom: none; }

.progress-lesson-icon {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.progress-lesson-icon.done { background: var(--silver-glow); }
.progress-lesson-icon.done svg { stroke: var(--silver-bright); }
.progress-lesson-icon.pending { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); }
.progress-lesson-icon svg { width: 13px; height: 13px; stroke: var(--text-label); }

.progress-lesson-info { flex: 1; }
.progress-lesson-name { font-size: 0.88rem; font-weight: 500; color: var(--text-white); }
.progress-lesson-status { font-size: 0.72rem; color: var(--text-muted); }
.progress-lesson-status.done-text { color: var(--text-secondary); }

.progress-panel-motivational { padding: 20px 24px; border-top: 1px solid var(--border); }
.motivational-card {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius); padding: 16px;
}
.motivational-card p { font-size: 0.85rem; color: var(--text-light); line-height: 1.6; }

.progress-panel-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 199; display: none; }
.progress-panel-backdrop.visible { display: block; }

/* ============================================
   Video Modal
   ============================================ */

.video-overlay {
  position: fixed; inset: 0; z-index: 1000; background: rgba(10,14,30,0.94);
  backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.video-modal {
  width: 100%; max-width: 940px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
}
.video-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
}
.video-modal-number {
  font-size: 0.68rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 2px; margin-bottom: 2px;
}
.video-modal-title { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 600; color: var(--text-white); }

.video-close-btn {
  background: none; border: none; color: var(--text-muted); font-size: 1.6rem;
  cursor: pointer; line-height: 1; transition: color var(--transition);
}
.video-close-btn:hover { color: #fff; }

.video-wrapper { width: 100%; background: #000; }
.video-wrapper video { width: 100%; display: block; max-height: 70vh; background: #000; }

.video-cta {
  padding: 16px 24px;
  background: rgba(255,255,255,0.03);
  border-top: 1px solid var(--border);
  text-align: center;
}
.video-cta a {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--silver-bright); color: var(--bg-base);
  padding: 12px 28px; border-radius: var(--radius);
  font-weight: 700; font-size: 0.9rem;
  transition: all var(--transition); text-decoration: none;
}
.video-cta a:hover { background: #fff; transform: translateY(-1px); }
.video-cta a svg { width: 16px; height: 16px; }

.video-actions {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; border-top: 1px solid var(--border); gap: 12px;
}
.video-nav-btn {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary); padding: 9px 18px; font-size: 0.82rem;
  font-family: var(--font-body); font-weight: 600; border-radius: var(--radius);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: all var(--transition);
}
.video-nav-btn:hover { border-color: rgba(255,255,255,0.2); color: #fff; }
.video-nav-btn:disabled { opacity: 0.25; cursor: not-allowed; }
.video-nav-btn svg { width: 14px; height: 14px; }
.video-actions-right { display: flex; gap: 10px; align-items: center; }

/* ============================================
   Footer
   ============================================ */

.footer {
  text-align: center; padding: 24px; color: var(--text-muted);
  font-size: 0.78rem; border-top: 1px solid var(--border);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .auth-card { padding: 36px 24px; }
  .auth-logo-img { width: 80px; height: 80px; }
  .welcome-title { font-size: 1.5rem; }
  .welcome-section { flex-direction: column; }
  .welcome-timer { align-self: flex-start; flex-direction: row; gap: 14px; min-width: auto; padding: 10px 18px; }
  .clases-grid { grid-template-columns: 1fr; }
  .header-inner { padding: 10px 16px; }
  .header-logo { height: 34px; }
  .header-user { display: none; }
  .brand-divider, .brand-name { display: none; }
  .main { padding: 24px 16px 40px; }
  .video-modal-header { padding: 14px 16px; }
  .video-actions { padding: 14px 16px; flex-wrap: wrap; }
  .progress-panel { width: 100%; }
}

@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; }
  .welcome-title { font-size: 1.3rem; }
  .header-logo { height: 30px; }
}

.btn-loader {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid transparent; border-top-color: currentColor;
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
