/* ========================================================
   ESTILOS MODERNOS EDTECH - PREPÁRATE · INGRESO AL BACHILLERATO
   Estética juvenil, minimalista, dinámica y con Hoja Óptica Realista
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary-accent: #4F46E5;
  --primary-accent-dark: #4338CA;
  --primary-accent-light: #6366F1;
  --secondary-cyan: #06B6D4;
  --emerald-cta: #10B981;
  --emerald-cta-dark: #059669;
  --primary-vino: #9F1239;
  --primary-vino-dark: #881337;
  --blue-brand: #0F172A;
  --blue-brand-light: #1E293B;
  --gold-brand: #F59E0B;
  --gold-brand-light: #FBBF24;
  --bg-light: #F8FAFC;
  --bg-card: #FFFFFF;
  --text-dark: #0F172A;
  --text-muted: #64748B;
  --border-color: #E2E8F0;
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
  --sheet-width: 470px;
  --bubble-w: 32px;
  --bubble-h: 18px;
  --bubble-font: 0.74rem;
  --q-font: 0.85rem;
  --booklet-font-size: 1rem;
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 20px -4px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 35px -6px rgba(15, 23, 42, 0.12);
  --font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* NAVBAR JUVENIL Y COMPACTA */
.navbar {
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(12px);
  color: white;
  padding: 0.55rem 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: white;
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -0.3px;
}

.nav-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #6366F1 0%, #06B6D4 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.35);
}

.nav-brand .badge-tag {
  background: rgba(99, 102, 241, 0.22);
  color: #A5B4FC;
  border: 1px solid rgba(165, 180, 252, 0.3);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 1.4rem;
  align-items: center;
  list-style: none;
}

.nav-links a {
  color: #CBD5E1;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  color: #FFFFFF;
}

/* BOTONES MODERNOS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.2rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-accent) 0%, #2563EB 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.28);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.38);
}

.btn-gold {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.32);
}
.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: white;
  border-radius: 999px;
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.16);
}

.btn-secondary {
  background: #E2E8F0;
  color: var(--text-dark);
}
.btn-secondary:hover {
  background: #CBD5E1;
}

/* HERO SECTION ATRACTIVO PARA JÓVENES */
.hero {
  background: radial-gradient(circle at 20% 20%, #1E1B4B 0%, #0F172A 60%, #090D16 100%);
  color: white;
  padding: 4.2rem 1.5rem 3.6rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(129, 140, 248, 0.35);
  color: #C7D2FE;
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: -0.8px;
  line-height: 1.18;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.hero h1 span {
  background: linear-gradient(90deg, #38BDF8 0%, #818CF8 50%, #34D399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.1rem;
  color: #CBD5E1;
  max-width: 680px;
  margin: 0 auto 2rem;
  font-weight: 400;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.section-header {
  text-align: center;
  margin-bottom: 2.25rem;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.5px;
  margin-bottom: 0.45rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.02rem;
  max-width: 660px;
  margin: 0 auto;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.4rem;
}

.card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 1.65rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #EEF2FF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.card h3 {
  font-size: 1.18rem;
  font-weight: 800;
  margin-bottom: 0.45rem;
  color: var(--text-dark);
}

.card p {
  color: var(--text-muted);
  font-size: 0.94rem;
}

/* TABLA DE PUNTAJES Y PLANES */
.scores-table-container {
  background: white;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.scores-table {
  width: 100%;
  border-collapse: collapse;
}

.scores-table th {
  background: #F1F5F9;
  color: #334155;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.9rem 1.2rem;
  text-align: left;
}

.scores-table td {
  padding: 0.9rem 1.2rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.94rem;
}

.badge-score {
  background: #EEF2FF;
  color: #4338CA;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.pricing-card {
  background: white;
  border-radius: 18px;
  padding: 2rem 1.75rem;
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pricing-card.featured {
  border: 2px solid var(--primary-accent);
  box-shadow: 0 12px 30px rgba(79, 70, 229, 0.14);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  right: 20px;
  background: linear-gradient(135deg, #4F46E5, #06B6D4);
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

.price {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 1rem 0;
}

.price small {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 600;
}

.pricing-features {
  list-style: none;
  margin: 0 0 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.92rem;
  color: #334155;
}

.pricing-features li::before {
  content: "✓ ";
  color: var(--emerald-cta);
  font-weight: 800;
}

/* CATÁLOGO DE LAS 10 GUÍAS */
.guias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.guia-card {
  background: white;
  border-radius: 14px;
  border: 1.5px solid #E2E8F0;
  padding: 1.15rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.guia-card:hover {
  border-color: var(--primary-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.guia-card.active {
  border-color: var(--emerald-cta);
  background: #F0FDF4;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.guia-badge {
  background: #EEF2FF;
  color: #4338CA;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 0.45rem;
}

.guia-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 0.2rem;
}

.guia-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: block;
}

/* RECOMENDACIÓN PEDAGÓGICA BOX */
.pedagogy-alert {
  background: white;
  border: 1px solid #E2E8F0;
  border-left: 4px solid var(--primary-accent);
  border-radius: 12px;
  padding: 1.15rem 1.4rem;
  margin-bottom: 1.5rem;
  color: #1E293B;
  box-shadow: var(--shadow-sm);
}

.pedagogy-alert h3 {
  color: var(--text-dark);
  font-size: 1.08rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.pedagogy-alert p {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #475569;
}

/* ========================================================
   DASHBOARD Y PESTAÑAS COMPACTAS ESTILO PÍLDORA (JUVENIL)
   ======================================================== */

.dashboard-container {
  display: flex;
  height: calc(100vh - 48px);
  overflow: hidden;
  background: #F1F5F9;
}

.dashboard-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Barra de pestañas compacta, limpia y moderna */
.dashboard-tabs {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0.35rem 1.25rem;
  gap: 0.4rem;
  height: 44px;
}

.tab-btn {
  padding: 0.32rem 0.85rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.81rem;
  color: #475569;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tab-btn:hover {
  background: #F1F5F9;
  color: #0F172A;
}

.tab-btn.active {
  background: linear-gradient(135deg, #4F46E5 0%, #2563EB 100%);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.28);
}

.tab-content {
  flex: 1;
  display: none;
  overflow: auto;
}

.tab-content.active {
  display: flex;
}

/* SIMULATOR VIEWER & OPTICAL SHEET SPLIT */
.sim-workspace {
  display: flex;
  width: 100%;
  height: 100%;
}

.sim-viewer-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #334155;
  position: relative;
  overflow: hidden;
}

.viewer-toolbar {
  background: #1E293B;
  color: white;
  padding: 0.4rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  z-index: 10;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.viewer-toolbar .tool-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tool-btn {
  background: #334155;
  border: none;
  color: white;
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.18s;
}

.tool-btn:hover {
  background: #475569;
}

/* ========================================================
   HOJA DE RESPUESTAS ÓPTICA (LATERAL) ROSA CON ZOOM DINÁMICO
   ======================================================== */

.optical-sheet-pane {
  width: var(--sheet-width);
  background: #FFE4E8;
  border-left: 2px solid #CBD5E1;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 15px rgba(0,0,0,0.08);
  user-select: none;
  z-index: 20;
  transition: width 0.2s ease;
}

.sheet-header {
  background: #881337;
  color: white;
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid #9F1239;
}

.sheet-title {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-align: center;
}

.sheet-subtitle {
  font-size: 0.72rem;
  text-align: center;
  color: #FDE68A;
  margin-top: 1px;
}

.sheet-zoom-toolbar {
  background: #FFD1DC;
  padding: 0.3rem 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #FECDD3;
  font-size: 0.76rem;
  font-weight: 600;
}

.sheet-zoom-group {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.sheet-zoom-btn {
  background: white;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  padding: 0.12rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  color: #334155;
}

.sheet-zoom-btn:hover {
  background: #F1F5F9;
}

.sheet-meta-bar {
  background: #FFE4E8;
  padding: 0.38rem 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #FDA4AF;
  font-size: 0.76rem;
  font-weight: 700;
  color: #881337;
}

.timer-badge {
  background: #0F172A;
  color: #F8FAFC;
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.timer-badge.warning {
  background: #DC2626;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.sheet-scroll-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.35rem 1rem;
  display: flex;
}

.timing-track {
  width: 12px;
  margin: 0 3px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 6px;
  align-items: center;
}

.timing-bar {
  width: 10px;
  height: 14px;
  background-color: #0F172A !important;
  border-radius: 0 !important;
  flex-shrink: 0;
}

.bubbles-columns {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.bubble-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.q-row {
  display: flex;
  align-items: center;
  padding: 2px 4px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #FECDD3;
  transition: background 0.15s;
}

.q-row:hover {
  background: #FFFBEB;
  border-color: #FCD34D;
}

.q-row.active {
  background: #EEF2FF;
  border-color: #6366F1;
}

.q-num-btn {
  width: 34px;
  font-size: var(--q-font);
  font-weight: 800;
  color: #881337;
  background: none;
  border: none;
  cursor: pointer;
  text-align: right;
  padding-right: 5px;
}

.q-num-btn:hover {
  text-decoration: underline;
}

.bubbles-group {
  display: flex;
  gap: 5px;
  flex: 1;
  justify-content: space-around;
}

/* ÓVALO EN ALTA DEFINICIÓN CSS */
.bubble {
  width: 32px;
  height: 18px;
  border-radius: 999px;
  border: 1.8px solid #9F1239;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #881337;
  cursor: pointer;
  background: #FFF5F7;
  transition: all 0.12s ease;
  user-select: none;
}

.bubble:hover {
  border-color: #0F172A;
  transform: scale(1.08);
  background: #FFE4E8;
}

.bubble.filled {
  background: #0F172A !important;
  color: #FFFFFF !important;
  border-color: #0F172A !important;
}

.q-row.correct {
  background: #DCFCE7 !important;
  border-color: #86EFAC !important;
}

.q-row.incorrect {
  background: #FEE2E2 !important;
  border-color: #FCA5A5 !important;
}

.bubble.correct-ans {
  border: 2px solid #15803D !important;
  background: #22C55E !important;
  color: #FFFFFF !important;
  font-weight: 800;
}

.bubble.wrong-ans {
  border: 2px solid #B91C1C !important;
  background: #EF4444 !important;
  color: #FFFFFF !important;
}

.sheet-footer {
  padding: 0.55rem 0.85rem;
  background: #FFD1DC;
  border-top: 1px solid #FECDD3;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  color: #4A3E3D;
}

.progress-bar-container {
  height: 6px;
  background: #CBD5E1;
  border-radius: 999px;
  overflow: hidden;
}

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

/* MODALES */
.modal-overlay, .modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(5px);
}

.modal-backdrop.active {
  display: flex;
}

.modal-content, .modal-card {
  background: white;
  border-radius: 18px;
  width: 92%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 1.85rem;
  animation: modalEnter 0.22s ease-out;
}

@keyframes modalEnter {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.score-display {
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--emerald-cta-dark);
  margin: 0.3rem 0;
}

.school-match-badge {
  display: inline-block;
  padding: 0.45rem 1.15rem;
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
}

.checkout-box {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1.25rem 0;
}

.form-group {
  margin-bottom: 0.9rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: var(--text-dark);
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.94rem;
  font-family: inherit;
  transition: border-color 0.15s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* TEMARIOS ACORDION */
.accordion-item {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 0.85rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.accordion-header {
  padding: 0.95rem 1.35rem;
  background: white;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--text-dark);
}

.accordion-header:hover {
  background: #F8FAFC;
}

.accordion-body {
  padding: 1.35rem;
  border-top: 1px solid var(--border-color);
  background: #FFFFFF;
  display: none;
}

.accordion-body.open {
  display: block;
}

.callout {
  padding: 0.95rem 1.2rem;
  border-radius: 10px;
  margin: 0.9rem 0;
  font-size: 0.92rem;
}

.callout.tip {
  background: #EEF2FF;
  border-left: 4px solid #4F46E5;
  color: #1E1B4B;
}

.callout.warning {
  background: #FEF3C7;
  border-left: 4px solid #F59E0B;
  color: #92400E;
}

.ejemplo-box {
  background: #F8FAFC;
  border: 1px dashed #94A3B8;
  border-radius: 10px;
  padding: 1rem;
  margin: 0.9rem 0;
  font-size: 0.92rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.9rem 0;
}

.data-table th, .data-table td {
  border: 1px solid #CBD5E1;
  padding: 0.55rem 0.75rem;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  background: #F1F5F9;
  font-weight: 700;
}

/* PÍLDORAS DE FILTRO DE MATERIAS EN TEMARIOS */
.temario-pill {
  background: #F1F5F9;
  color: #334155;
  border: 1px solid #E2E8F0;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.temario-pill:hover {
  background: #E2E8F0;
  color: #0F172A;
  transform: translateY(-1px);
}

.temario-pill.active {
  background: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%);
  color: #FFFFFF;
  border-color: #4F46E5;
  box-shadow: 0 3px 8px rgba(79, 70, 229, 0.25);
}

.unit-rich-content h4 {
  color: #1E1B4B;
  font-size: 0.96rem;
  font-weight: 800;
  margin: 0.85rem 0 0.4rem;
}

.unit-rich-content ul, .unit-rich-content ol {
  margin: 0.4rem 0 0.75rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.unit-rich-content p {
  margin-bottom: 0.6rem;
}

/* ========================================================
   LABORATORIO INTERACTIVO ESTILO GOOGLE NOTEBOOKLM
   (Tarjetas de Estudio 3D + Reto de Recuperación Activa)
   ======================================================== */

.notebook-study-hub {
  margin-top: 1.35rem;
  background: linear-gradient(135deg, #F8FAFC 0%, #EEF2FF 100%);
  border: 1.5px solid #C7D2FE;
  border-radius: 14px;
  padding: 1.15rem 1.25rem;
}

.notebook-hub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #C7D2FE;
}

.notebook-hub-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.96rem;
  font-weight: 800;
  color: #1E1B4B;
}

.notebook-method-badge {
  background: #4F46E5;
  color: #FFFFFF;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  letter-spacing: 0.3px;
}

.notebook-hub-tabs {
  display: flex;
  gap: 0.45rem;
}

.nb-tab-btn {
  background: #FFFFFF;
  color: #334155;
  border: 1.5px solid #CBD5E1;
  border-radius: 999px;
  padding: 0.36rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.16s ease;
}

.nb-tab-btn:hover {
  border-color: #6366F1;
  color: #4F46E5;
}

.nb-tab-btn.active {
  background: #1E1B4B;
  color: #FFFFFF;
  border-color: #1E1B4B;
  box-shadow: 0 3px 10px rgba(30, 27, 75, 0.22);
}

/* TARJETAS DE ESTUDIO 3D (FLASHCARDS) */
.flashcard-stage {
  perspective: 1100px;
  max-width: 660px;
  margin: 0.5rem auto 0.85rem;
}

.flashcard-3d {
  width: 100%;
  min-height: 185px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.52s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
}

.flashcard-3d.flipped {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.flashcard-front {
  background: #FFFFFF;
  border: 2px solid #A5B4FC;
  color: #0F172A;
}

.flashcard-back {
  background: linear-gradient(135deg, #1E1B4B 0%, #312E81 100%);
  border: 2px solid #6366F1;
  color: #FFFFFF;
  transform: rotateY(180deg);
}

.fc-tag {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flashcard-front .fc-tag {
  color: #4F46E5;
}

.flashcard-back .fc-tag {
  color: #A5F3FC;
}

.fc-content {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  margin: auto 0;
  padding: 0.45rem 0;
}

.flashcard-back .fc-content {
  font-size: 0.94rem;
  font-weight: 600;
  color: #F8FAFC;
}

.fc-hint {
  font-size: 0.74rem;
  text-align: center;
  opacity: 0.75;
  font-weight: 600;
}

.flashcard-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.fc-btn {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 0.38rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #1E293B;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.14s ease;
}

.fc-btn:hover {
  background: #F1F5F9;
  border-color: #6366F1;
}

.fc-btn.mastered {
  background: #DCFCE7;
  border-color: #16A34A;
  color: #166534;
}

/* MINI-RETO DE EJERCICIOS INTERACTIVOS POR UNIDAD */
.unit-quiz-list {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.unit-quiz-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 1rem 1.15rem;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

.unit-quiz-q {
  font-weight: 700;
  font-size: 0.92rem;
  color: #0F172A;
  margin-bottom: 0.65rem;
  line-height: 1.5;
}

.unit-quiz-opts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.45rem;
}

.unit-quiz-opt {
  background: #F8FAFC;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  padding: 0.48rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1E293B;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.14s ease;
}

.unit-quiz-opt:hover {
  background: #EEF2FF;
  border-color: #6366F1;
}

.unit-quiz-opt.is-correct {
  background: #DCFCE7 !important;
  border-color: #16A34A !important;
  color: #14532D !important;
  font-weight: 800;
}

.unit-quiz-opt.is-wrong {
  background: #FEE2E2 !important;
  border-color: #DC2626 !important;
  color: #7F1D1D !important;
}

.unit-quiz-feedback {
  margin-top: 0.65rem;
  padding: 0.7rem 0.95rem;
  border-radius: 8px;
  font-size: 0.84rem;
  line-height: 1.55;
  display: none;
}

.unit-quiz-feedback.visible {
  display: block;
}

.unit-quiz-feedback.ok {
  background: #F0FDF4;
  border-left: 4px solid #16A34A;
  color: #14532D;
}

.unit-quiz-feedback.err {
  background: #FEF2F2;
  border-left: 4px solid #DC2626;
  color: #7F1D1D;
}

/* MÓDULO DE VIDEOS */
.video-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
  padding: 1.25rem;
  height: 100%;
}

.video-player-container {
  background: #0F172A;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
}

.video-player-frame {
  flex: 1;
  width: 100%;
  min-height: 410px;
  border: none;
}

.video-playlist-pane {
  background: white;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.video-item {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.15s;
}

.video-item:hover {
  background: #F8FAFC;
}

.video-item.active {
  background: #EEF2FF;
  border-left: 4px solid var(--primary-accent);
}

/* ========================================================
   CUADERNILLO DIGITAL CONTINUO DE REACTIVOS (MINIMALISTA)
   ======================================================== */

.booklet-viewport {
  flex: 1;
  overflow-y: auto;
  background: #334155;
  padding: 1.25rem 1rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
}

.booklet-viewport.align-left .booklet-paper {
  margin-left: 1.25rem !important;
  margin-right: auto !important;
}

.booklet-viewport.align-center .booklet-paper {
  margin-left: auto !important;
  margin-right: auto !important;
}

.booklet-viewport.align-right .booklet-paper {
  margin-right: 1.25rem !important;
  margin-left: auto !important;
}

.booklet-paper {
  background: #FFFFFF;
  width: 100%;
  max-width: 860px;
  padding: 2rem 2.3rem;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  user-select: none !important;
}

.booklet-header {
  border-bottom: 1.5px solid #E2E8F0;
  padding-bottom: 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.booklet-exam-title {
  font-size: calc(var(--booklet-font-size) * 1.15);
  font-weight: 800;
  color: #0F172A;
}

.booklet-page-badge {
  background: #F1F5F9;
  color: #334155;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: calc(var(--booklet-font-size) * 0.8);
  font-weight: 700;
}

.subject-banner {
  background: #F8FAFC;
  color: #0F172A;
  border-bottom: 2px solid #0F172A;
  padding: 0.45rem 0.2rem;
  font-weight: 800;
  font-size: calc(var(--booklet-font-size) * 0.92);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-top: 0.3rem;
}

.question-card {
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  padding: 0.9rem 0.2rem 1.1rem;
  transition: all 0.15s ease;
}

.question-card.active-question {
  background: #F8FAFC;
  padding-left: 0.75rem;
  border-left: 3px solid var(--primary-accent);
}

.question-text {
  font-size: calc(var(--booklet-font-size) * 1.03);
  color: #0F172A;
  font-weight: 500;
  line-height: 1.55;
  margin-bottom: 0.75rem;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 0.48rem 0.8rem;
  cursor: pointer;
  transition: all 0.14s ease;
  user-select: none;
}

.option-item:hover {
  border-color: #94A3B8;
  background: #F8FAFC;
}

.option-item.selected {
  border-color: var(--primary-accent);
  background: #EEF2FF;
}

.option-letter-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.6px solid #475569;
  color: #334155;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--booklet-font-size) * 0.82);
  flex-shrink: 0;
  background: white;
}

.option-item.selected .option-letter-badge {
  background: var(--primary-accent);
  border-color: var(--primary-accent);
  color: white;
}

.option-desc {
  font-size: calc(var(--booklet-font-size) * 0.95);
  color: #1E293B;
  font-weight: 500;
  line-height: 1.4;
}

.option-item.selected .option-desc {
  color: #0F172A;
  font-weight: 700;
}

.option-item.correct-revealed {
  border-color: #16A34A !important;
  background: #DCFCE7 !important;
}

.option-item.correct-revealed .option-letter-badge {
  background: #16A34A !important;
  border-color: #16A34A !important;
  color: white !important;
}

.option-item.wrong-selected {
  border-color: #DC2626 !important;
  background: #FEE2E2 !important;
}

.option-item.wrong-selected .option-letter-badge {
  background: #DC2626 !important;
  border-color: #DC2626 !important;
  color: white !important;
}

.tool-btn.tool-btn-active {
  background: var(--primary-accent) !important;
  color: white !important;
  font-weight: 700 !important;
}

/* PROTECCIÓN ANTI-COPIA GLOBAL */
body, .sim-workspace, .question-card, .question-text, .options-list, .optical-sheet-pane {
  user-select: none !important;
  -webkit-user-select: none !important;
}

/* ESTILO SUBRAYADO REACTIVOS */
.question-text u, .option-desc u {
  text-decoration: underline;
  font-weight: 800;
  color: #7F1D1D;
}

/* COLUMNAS DE RELACIÓN Y LISTAS CON PUNTO Y APARTE EN REACTIVOS */
.q-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-top: 0.65rem;
  padding: 0.75rem 1rem;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  font-size: calc(var(--booklet-font-size) * 0.95);
  line-height: 1.55;
}

.q-col {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.q-col:first-child {
  border-right: 1px dashed #CBD5E1;
  padding-right: 0.75rem;
}

.q-list-block {
  margin-top: 0.55rem;
  padding: 0.65rem 1rem;
  background: #F8FAFC;
  border-left: 3px solid #4F46E5;
  border-radius: 6px;
  font-size: calc(var(--booklet-font-size) * 0.95);
  line-height: 1.6;
}

/* ========================================================
   OPTIMIZACIÓN RESPONSIVA PARA MÓVILES Y TABLETS (iOS / Android)
   ======================================================== */

/* Barra de conmutación del simulador oculta en PC de escritorio (>1024px) */
.mobile-sim-switcher {
  display: none;
}

/* Tablas con scroll horizontal táctil suave */
.scores-table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.unit-rich-content {
  overflow-x: hidden;
}

.data-table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 1. TABLETS, TELÉFONOS MÓVILES Y DISPOSITIVOS TÁCTILES (<= 1024px o táctil) */
@media (max-width: 1024px), (hover: none), (pointer: coarse) {
  .hide-on-tablet {
    display: none !important;
  }

  .navbar {
    padding: 0.5rem 1rem;
  }

  .dashboard-container {
    height: calc(100dvh - 50px);
  }

  /* Pestañas principales con desplazamiento horizontal táctil */
  .dashboard-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    scrollbar-width: none;
    padding: 0.35rem 0.75rem;
    height: 46px;
  }

  .dashboard-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex-shrink: 0;
  }

  /* En Móvil y Tablet: Ocultar Hoja de Respuestas Lateral y mostrar el EXAMEN al 100% */
  .sim-workspace {
    flex-direction: column !important;
    position: relative;
    width: 100% !important;
  }

  #optical-sheet-sidebar,
  .optical-sheet-pane {
    display: none !important;
    width: 0 !important;
  }

  .sim-viewer-pane {
    display: flex !important;
    flex: 1 1 100% !important;
    width: 100% !important;
    height: 100% !important;
  }

  .mobile-sim-switcher {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    background: #0F172A;
    padding: 0.42rem 0.75rem;
    border-bottom: 1px solid #334155;
    z-index: 35;
    flex-shrink: 0;
  }

  /* Sección de Videos en Tablet y Móvil */
  .video-grid {
    grid-template-columns: 1fr;
    height: auto;
    overflow-y: auto;
    padding: 0.85rem;
    gap: 1rem;
  }

  .video-player-frame {
    min-height: 280px;
    aspect-ratio: 16 / 9;
  }

  .video-playlist-pane {
    max-height: 360px;
  }
}

/* 2. TELÉFONOS MÓVILES (<= 768px) */
@media (max-width: 768px) {
  .hide-on-mobile {
    display: none !important;
  }

  .navbar {
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.5rem 0.85rem;
  }

  .nav-brand {
    font-size: 0.96rem;
    gap: 0.45rem;
  }

  .nav-brand-icon {
    width: 28px;
    height: 28px;
    font-size: 0.92rem;
  }

  .nav-brand .badge-tag {
    display: none;
  }

  .nav-links {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.45rem 0.85rem;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    justify-content: center;
  }

  .nav-links a {
    font-size: 0.8rem;
  }

  /* Hero y contenedores en móvil */
  .hero {
    padding: 2.5rem 1rem 2.2rem;
  }

  .hero h1 {
    font-size: 1.85rem;
    line-height: 1.24;
  }

  .hero p {
    font-size: 0.95rem;
    margin-bottom: 1.35rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .container {
    padding: 1.5rem 0.9rem !important;
  }

  .section-header h2 {
    font-size: 1.48rem;
  }

  .grid-3 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .pricing-card {
    padding: 1.5rem 1.25rem;
  }

  /* Cuadernillo de preguntas en móvil */
  .booklet-viewport {
    padding: 0.65rem 0.45rem 1.75rem;
    gap: 0.9rem;
  }

  .booklet-paper {
    padding: 1.1rem 0.95rem;
    border-radius: 6px;
  }

  .viewer-toolbar {
    padding: 0.35rem 0.6rem;
    justify-content: space-between;
  }

  /* Temarios Desarrollados y Tarjetas 3D en móvil */
  #tab-temarios {
    overflow-x: hidden;
  }

  .accordion-header {
    padding: 0.8rem 0.9rem;
    font-size: 0.94rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .accordion-body {
    padding: 0.8rem 0.65rem;
  }

  .unit-block {
    padding: 0.95rem 0.85rem !important;
  }

  .notebook-study-hub {
    padding: 0.85rem 0.75rem;
  }

  .notebook-hub-header {
    flex-direction: column;
    align-items: stretch;
  }

  .notebook-hub-tabs {
    width: 100%;
  }

  .nb-tab-btn {
    flex: 1;
    text-align: center;
    padding: 0.42rem 0.5rem;
    font-size: 0.76rem;
  }

  .flashcard-3d {
    min-height: 225px;
  }

  .flashcard-face {
    padding: 0.95rem 1rem;
  }

  .fc-content {
    font-size: 0.9rem;
  }

  .unit-quiz-opts {
    grid-template-columns: 1fr;
  }

  /* Modales en móvil */
  .modal-content, .modal-card {
    width: 96%;
    max-height: 92dvh;
    padding: 1.15rem 1rem !important;
    border-radius: 14px;
  }

  .score-display {
    font-size: 2.35rem;
  }
}

/* 3. PANTALLAS PEQUEÑAS DE SMARTPHONE (<= 540px) */
@media (max-width: 540px) {
  .mob-split-only {
    display: none;
  }

  .q-two-cols {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
  }

  .q-col:first-child {
    border-right: none;
    border-bottom: 1px dashed #CBD5E1;
    padding-right: 0;
    padding-bottom: 0.5rem;
  }

  /* Hoja óptica en smartphones compactos */
  .bubbles-columns {
    gap: 0.25rem;
  }

  .q-num-btn {
    width: 26px;
    font-size: 0.74rem;
    padding-right: 3px;
  }

  .bubble {
    width: 25px;
    height: 17px;
    font-size: 0.66rem;
  }

  .timing-track {
    width: 8px;
    margin: 0 1px;
  }

  .timing-bar {
    width: 6px;
  }

  .video-player-frame {
    min-height: 210px;
  }
}
