:root {
  --bg-dark: #070a12;
  --bg-card: #0e1524;
  --bg-card-hover: #151f34;
  --border-color: #1e2c47;
  --primary: #20c7b8;
  --primary-hover: #1aa396;
  --primary-glow: rgba(32, 199, 184, 0.2);
  --accent: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --danger: #ef4444;
  --success: #10b981;
  --radius: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

/* NAVBAR */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 10, 18, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 20px;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-badge {
  width: 40px;
  height: 40px;
  background: var(--primary-glow);
  border: 1px solid var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  display: block;
  letter-spacing: -0.3px;
}

.brand-sub {
  font-size: 11px;
  color: var(--primary);
  display: block;
  font-family: 'JetBrains Mono', monospace;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
  background: var(--bg-card);
}

.nav-link.active {
  color: var(--primary);
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* BOTONES */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #05080e;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border-color: var(--border-color);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-accent {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #05080e;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

/* HERO BANNER */
.hero-banner {
  background: radial-gradient(circle at 50% 0%, rgba(32, 199, 184, 0.12) 0%, transparent 70%);
  padding: 56px 20px 32px;
  text-align: center;
  border-bottom: 1px solid rgba(30, 44, 71, 0.5);
}

.hero-content {
  max-width: 820px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 18px;
}

.hero-title {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 16px;
}

.gradient-text {
  background: linear-gradient(135deg, #20c7b8, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

.search-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 680px;
  margin: 0 auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 15px;
  width: 100%;
}

/* CATEGORÍAS */
.categories-bar {
  max-width: 1280px;
  margin: 24px auto 16px;
  padding: 0 20px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.categories-bar::-webkit-scrollbar { display: none; }

.cat-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 30px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.cat-pill:hover, .cat-pill.active {
  background: var(--primary);
  color: #05080e;
  border-color: var(--primary);
}

/* SECCIONES Y GRILLA */
.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 20px 60px;
}

.view-section {
  display: none;
}
.view-section.active {
  display: block;
}

.catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0 16px;
}

.catalog-counter {
  font-size: 13px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

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

/* TARJETA DE CURSO */
.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
}

.course-card:hover {
  transform: translateY(-4px);
  border-color: rgba(32, 199, 184, 0.4);
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}

.course-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #05080e;
}

.course-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.course-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.course-cat-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-glow);
  padding: 3px 8px;
  border-radius: 6px;
}

.course-duration {
  font-size: 12px;
  color: var(--text-muted);
}

.course-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
  color: var(--text-main);
}

.course-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.course-price-box {
  display: flex;
  flex-direction: column;
}

.price-sub {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.price-amount {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  font-family: 'JetBrains Mono', monospace;
}

/* MODALES */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 12, 0.85);
  backdrop-filter: blur(10px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 100%;
  max-width: 460px;
  position: relative;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
}
.modal-close:hover { color: var(--text-main); }

.modal-header {
  text-align: center;
  margin-bottom: 20px;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* PAGO MERCADO PAGO */
.payment-amount-box {
  background: #05080e;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.amount-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  font-family: 'JetBrains Mono', monospace;
}

.qr-box {
  text-align: center;
  background: #090e18;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}

.qr-canvas-container {
  width: 220px;
  height: 220px;
  margin: 0 auto 14px;
  background: #ffffff;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-instructions {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.payment-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* AULA VIRTUAL */
.classroom-overlay .classroom-card {
  max-width: 1200px;
  width: 95vw;
  height: 90vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.classroom-header {
  background: #070a12;
  border-bottom: 1px solid var(--border-color);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.classroom-title-area {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.btn-back {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.btn-back:hover { color: var(--text-main); }

.progress-bar-container {
  width: 200px;
  height: 6px;
  background: #1e2c47;
  border-radius: 3px;
  margin-top: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
}

.classroom-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.classroom-sidebar {
  width: 320px;
  background: #080d16;
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  padding: 16px;
}

.sidebar-module-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 14px 0 8px;
}

.sidebar-lesson-item {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  transition: all 0.2s ease;
}

.sidebar-lesson-item:hover, .sidebar-lesson-item.active {
  background: var(--bg-card);
  color: var(--text-main);
}

.sidebar-lesson-item.completed {
  color: var(--primary);
}

.sidebar-exam-btn {
  width: 100%;
  margin: 10px 0;
  padding: 10px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 8px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.classroom-main {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}

.player-container {
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 480px;
  background: #000000;
  border-radius: 14px;
  margin: 16px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
}

.mock-player {
  text-align: center;
}

.play-btn-circle {
  width: 64px;
  height: 64px;
  background: var(--primary);
  color: #05080e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 12px;
  cursor: pointer;
  box-shadow: 0 0 25px var(--primary-glow);
}

/* EXÁMENES */
.question-card {
  background: #080d16;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
}

.question-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
}

.option-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--bg-card);
  margin-bottom: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.option-label:hover {
  border-color: var(--primary);
}

/* CERTIFICADO */
.cert-modal-card {
  max-width: 840px;
  padding: 20px;
}

.certificate-paper {
  background: #ffffff;
  color: #0f172a;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  font-family: 'Plus Jakarta Sans', serif;
}

.cert-border {
  border: 4px double #d97706;
  padding: 36px 30px;
  text-align: center;
}

.cert-logo {
  font-size: 22px;
  font-weight: 800;
  color: #b45309;
  letter-spacing: 2px;
}

.cert-sub {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 3px;
  margin-top: 4px;
}

.cert-student {
  font-size: 32px;
  font-weight: 800;
  color: #0f172a;
  margin: 18px 0 10px;
  text-decoration: underline;
  text-decoration-color: #f59e0b;
}

.cert-course {
  font-size: 24px;
  font-weight: 800;
  color: #0284c7;
  margin: 8px 0 20px;
}

.cert-details {
  display: flex;
  justify-content: space-around;
  margin: 24px 0 10px;
  padding: 14px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 13px;
}

.cert-seal {
  display: inline-block;
  color: #b45309;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 1px;
}

/* SPINNER & RESPONSIVE */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(32, 199, 184, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  .hero-title { font-size: 28px; }
  .courses-grid { grid-template-columns: 1fr; }
  .classroom-body { flex-direction: column; }
  .classroom-sidebar { width: 100%; height: 200px; }
  .cert-details { flex-direction: column; gap: 8px; }
}

