/* ===================================================
   LECTURA EDOMEX - Estilos Principales
   Secretaría de Educación, Ciencia, Tecnología e Innovación
   Estado de México
=================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=Source+Sans+3:wght@300;400;600;700&display=swap');

:root {
  --burgundy: #7B1D2B;
  --burgundy-dark: #5a1520;
  --burgundy-light: #9c2535;
  --gold: #C9A227;
  --gold-light: #e6b82a;
  --gold-pale: #f5e8c0;
  --cream: #FBF8F3;
  --white: #ffffff;
  --gray-50: #f9f9f9;
  --gray-100: #f0f0f0;
  --gray-200: #e0e0e0;
  --gray-400: #9ca3af;
  --gray-600: #555555;
  --gray-700: #333333;
  --gray-800: #1a1a1a;

  --phase2: #4CAF50;
  --phase3: #2196F3;
  --phase4: #FF9800;
  --phase5: #9C27B0;
  --phase6: #F44336;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);

  --radius: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--gray-700);
  line-height: 1.6;
  font-size: 16px;
}

img { max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font-body); }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== HEADER ===== */
#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.header-top {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 14px 0;
}

.header-top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-title {
  flex: 1;
  text-align: center;
}

.header-title h1 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--burgundy);
  line-height: 1.2;
}

.header-logo-edomex {
  height: 52px;
  width: auto;
}

.header-subtitle {
  background: var(--white);
  border-bottom: 3px solid var(--gold);
  padding: 6px 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--gray-600);
}

/* Nav */
nav.main-nav {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-logo {
  display: flex;
  align-items: center;
}

.nav-logo img {
  height: 40px;
  width: auto;
}

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

.nav-links a {
  display: block;
  padding: 6px 12px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--burgundy);
  border-bottom-color: var(--gold);
}

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

.btn-acceso {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 2px solid var(--burgundy);
  border-radius: var(--radius);
  color: var(--burgundy);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-acceso:hover {
  background: var(--burgundy);
  color: var(--white);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gray-700);
  transition: all 0.3s;
}

/* Mobile nav */
.mobile-nav {
  display: none;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 16px 20px;
}

.mobile-nav.open { display: block; }

.mobile-nav a {
  display: block;
  padding: 12px 16px;
  border-radius: var(--radius);
  color: var(--gray-700);
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
  margin-bottom: 4px;
}

.mobile-nav a:hover,
.mobile-nav a.active {
  background: rgba(123,29,43,0.08);
  color: var(--burgundy);
}

/* ===== MAIN CONTENT ===== */
main { min-height: 70vh; }

/* ===== HERO BANNER ===== */
.hero-banner {
  position: relative;
  overflow: hidden;
  height: 220px;
  border-radius: 0;
}

.hero-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(91,18,28,0.75) 0%, rgba(91,18,28,0.4) 60%, transparent 100%);
  display: flex;
  align-items: center;
}

.hero-banner-text {
  padding: 0 40px;
  max-width: 600px;
}

.hero-banner-text h2 {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 900;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hero-banner-text h2 span { color: var(--gold-light); }

.hero-banner-text p {
  color: rgba(255,255,255,0.9);
  font-size: 1rem;
}

/* ===== CAROUSEL ===== */
.carousel-section {
  padding: 40px 0 20px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gray-800);
  text-align: center;
  margin-bottom: 24px;
}

.carousel-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  height: 260px;
  box-shadow: var(--shadow-lg);
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.4,0,0.2,1);
}

.carousel-slide {
  min-width: 100%;
  position: relative;
  overflow: hidden;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform 6s ease;
}

.carousel-slide.active img {
  transform: scale(1.05);
}

.carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px 24px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: var(--white);
}

.carousel-caption h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
}

.carousel-caption p { font-size: 0.875rem; opacity: 0.9; }

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background 0.2s;
  font-size: 1.2rem;
}

.carousel-btn:hover { background: rgba(255,255,255,0.35); }
.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }

.carousel-dots {
  position: absolute;
  bottom: 12px;
  right: 16px;
  display: flex;
  gap: 6px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  border: none;
  transition: all 0.3s;
  cursor: pointer;
}

.carousel-dot.active {
  background: white;
  width: 24px;
  border-radius: 4px;
}

/* ===== PHASES SECTION ===== */
.phases-section {
  padding: 40px 0;
  background: var(--white);
  margin: 0;
}

.phases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.phase-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  border: 2px solid var(--gray-200);
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
  display: block;
}

.phase-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.phase-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 1.5rem;
}

.phase-card:nth-child(1) .phase-icon { background: rgba(76,175,80,0.15); color: var(--phase2); }
.phase-card:nth-child(2) .phase-icon { background: rgba(33,150,243,0.15); color: var(--phase3); }
.phase-card:nth-child(3) .phase-icon { background: rgba(255,152,0,0.15); color: var(--phase4); }
.phase-card:nth-child(4) .phase-icon { background: rgba(156,39,176,0.15); color: var(--phase5); }
.phase-card:nth-child(5) .phase-icon { background: rgba(244,67,54,0.15); color: var(--phase6); }

.phase-card:nth-child(1):hover { background: rgba(76,175,80,0.08); border-color: var(--phase2); }
.phase-card:nth-child(2):hover { background: rgba(33,150,243,0.08); border-color: var(--phase3); }
.phase-card:nth-child(3):hover { background: rgba(255,152,0,0.08); border-color: var(--phase4); }
.phase-card:nth-child(4):hover { background: rgba(156,39,176,0.08); border-color: var(--phase5); }
.phase-card:nth-child(5):hover { background: rgba(244,67,54,0.08); border-color: var(--phase6); }

.phase-card h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 6px;
}

.phase-card p {
  font-size: 0.8rem;
  color: var(--gray-600);
}

/* ===== QUICK ACCESS ===== */
.quick-access {
  padding: 40px 0;
  background: var(--cream);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.quick-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: all 0.25s;
  text-decoration: none;
  display: block;
}

.quick-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold);
}

.quick-card-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.quick-card h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--burgundy);
  margin-bottom: 8px;
}

.quick-card p {
  font-size: 0.875rem;
  color: var(--gray-600);
}

/* ===== GENERAL PAGE STYLES ===== */
.page-header {
  background: linear-gradient(135deg, var(--burgundy) 0%, var(--burgundy-dark) 100%);
  color: var(--white);
  padding: 40px 0;
  margin-bottom: 0;
}

.page-header .page-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.page-header h1 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 900;
  margin-bottom: 12px;
}

.page-header p {
  font-size: 1rem;
  opacity: 0.9;
  max-width: 600px;
}

/* ===== MEDIACION PAGE ===== */
.mediacion-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 24px 0 0;
}

.tab-btn {
  padding: 10px 18px;
  border-radius: 20px;
  border: 2px solid var(--gray-200);
  background: var(--white);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--gray-600);
  transition: all 0.2s;
  cursor: pointer;
}

.tab-btn.active,
.tab-btn:hover {
  background: var(--burgundy);
  border-color: var(--burgundy);
  color: white;
}

.tab-content { display: none; padding: 32px 0; }
.tab-content.active { display: block; }

.phase-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border-left: 5px solid var(--gold);
}

.phase-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--gold-pale);
}

.phase-badge .phase-num {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
}

.phase-badge span:last-child {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.phase-info h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--burgundy);
  margin-bottom: 4px;
}

.phase-info p { color: var(--gray-600); font-size: 0.9rem; }

/* Books grid */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.book-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: all 0.25s;
  cursor: pointer;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--gold);
}

.book-cover {
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, var(--burgundy) 0%, var(--burgundy-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.book-cover img { width: 100%; height: 100%; object-fit: cover; }

.book-cover-placeholder {
  color: rgba(255,255,255,0.3);
  font-size: 3rem;
  text-align: center;
}

.book-cover-placeholder .book-title-preview {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.8);
  text-align: center;
  padding: 0 12px;
  margin-top: 8px;
}

.book-info {
  padding: 14px;
}

.book-info h3 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 4px;
  line-height: 1.3;
}

.book-info .author {
  font-size: 0.8rem;
  color: var(--gray-600);
  margin-bottom: 8px;
}

.book-info .book-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  background: var(--gold-pale);
  color: var(--gold);
}

.book-actions {
  padding: 0 14px 14px;
}

.btn-leer {
  width: 100%;
  padding: 8px;
  background: var(--burgundy);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-leer:hover { background: var(--burgundy-dark); }

/* ===== MODAL BOOK FICHA ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s;
  box-shadow: var(--shadow-xl);
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  gap: 20px;
  padding: 24px 24px 0;
}

.modal-cover {
  width: 100px;
  min-width: 100px;
  aspect-ratio: 3/4;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, var(--burgundy), var(--burgundy-light));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

.modal-cover img { width: 100%; height: 100%; object-fit: cover; }
.modal-cover span { font-size: 2.5rem; }

.modal-meta { flex: 1; }

.modal-meta h2 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--burgundy);
  margin-bottom: 4px;
}

.modal-meta .modal-author { color: var(--gray-600); font-size: 0.9rem; margin-bottom: 12px; }

.modal-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.modal-body { padding: 20px 24px; }

.modal-body h4 {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--gray-800);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  margin-top: 16px;
}

.modal-body h4:first-child { margin-top: 0; }

.modal-body p { color: var(--gray-600); font-size: 0.9rem; line-height: 1.6; }

.modal-footer {
  padding: 16px 24px 24px;
  display: flex;
  gap: 12px;
}

.btn-primary {
  flex: 1;
  padding: 12px;
  background: var(--burgundy);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover { background: var(--burgundy-dark); }

.btn-secondary {
  padding: 12px 20px;
  background: transparent;
  color: var(--gray-700);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-secondary:hover { border-color: var(--gray-400); }

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--gray-100);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--gray-600);
  transition: all 0.2s;
}

.modal-close:hover { background: var(--gray-200); }
.modal { position: relative; }

/* PDF Viewer Modal */
.pdf-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.pdf-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.pdf-modal-header {
  background: var(--gray-800);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}

.pdf-modal-header h3 { font-size: 1rem; font-weight: 600; }

.pdf-modal-body {
  flex: 1;
  position: relative;
}

.pdf-modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.pdf-close-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  padding: 6px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: background 0.2s;
}

.pdf-close-btn:hover { background: rgba(255,255,255,0.25); }

/* ===== STATISTICS ===== */
.stats-section { padding: 40px 0; }

.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.stat-card .stat-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.stat-card .stat-number {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--burgundy);
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-top: 4px;
}

.chart-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  margin-bottom: 24px;
}

.chart-card h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 16px;
}

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  background: var(--gray-50);
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-600);
  border-bottom: 2px solid var(--gray-200);
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gray-50); }

/* ===== MAP ===== */
.map-section { padding: 40px 0; }

#edomex-map {
  width: 100%;
  height: 500px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--gray-200);
  box-shadow: var(--shadow-md);
}

.map-legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 16px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--gray-700);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

/* ===== REGISTRO / AUTH ===== */
.auth-section { padding: 60px 0; }

.auth-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 40px;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
}

.auth-card h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--burgundy);
  text-align: center;
  margin-bottom: 8px;
}

.auth-card .auth-desc {
  text-align: center;
  color: var(--gray-600);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: var(--white);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--gray-600);
  transition: all 0.2s;
}

.auth-tab.active {
  background: var(--burgundy);
  color: white;
}

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--burgundy);
}

.btn-submit {
  width: 100%;
  padding: 12px;
  background: var(--burgundy);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  transition: background 0.2s;
  margin-top: 8px;
}

.btn-submit:hover { background: var(--burgundy-dark); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ===== REGISTRO ALUMNO / DIRECTOR / MAESTRO ===== */
.register-steps {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  position: relative;
}

.register-steps::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 40px;
  right: 40px;
  height: 2px;
  background: var(--gray-200);
}

.step {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 1;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  margin: 0 auto 8px;
  transition: all 0.3s;
}

.step.active .step-circle {
  background: var(--burgundy);
  color: white;
}

.step.done .step-circle {
  background: var(--gold);
  color: white;
}

.step p { font-size: 0.75rem; color: var(--gray-600); font-weight: 600; }

/* ===== ADMIN PANEL ===== */
.admin-layout {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 200px);
}

.admin-sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--gray-800);
  color: white;
  padding: 24px 0;
}

.admin-sidebar h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  padding: 0 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 8px;
  color: var(--gold-light);
}

.admin-sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s;
  text-decoration: none;
}

.admin-sidebar nav a:hover,
.admin-sidebar nav a.active {
  background: rgba(255,255,255,0.1);
  color: white;
  border-left: 3px solid var(--gold);
  padding-left: 17px;
}

.admin-main {
  flex: 1;
  padding: 32px;
  background: var(--gray-50);
}

.admin-main h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--gray-800);
  margin-bottom: 24px;
}

.admin-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  margin-bottom: 20px;
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.admin-card-header h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--gray-800);
}

.btn-add {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--burgundy);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-add:hover { background: var(--burgundy-dark); }

.btn-delete {
  padding: 6px 12px;
  background: rgba(244,67,54,0.1);
  color: #d32f2f;
  border: none;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-delete:hover { background: rgba(244,67,54,0.2); }

.btn-edit {
  padding: 6px 12px;
  background: rgba(33,150,243,0.1);
  color: #1565c0;
  border: none;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.2s;
  margin-right: 4px;
}

.btn-edit:hover { background: rgba(33,150,243,0.2); }

/* ===== MEDALS ===== */
.medal {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

.medal-gold { background: rgba(201,162,39,0.15); color: #8a6d00; }
.medal-silver { background: rgba(100,100,100,0.1); color: #555; }
.medal-bronze { background: rgba(176,94,44,0.15); color: #7a4520; }

/* ===== ALERTS / TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow-xl);
  border-left: 4px solid var(--burgundy);
  max-width: 320px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: slideIn 0.3s ease;
}

.toast.success { border-left-color: #4CAF50; }
.toast.error { border-left-color: #F44336; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-title { font-weight: 700; font-size: 0.875rem; color: var(--gray-800); }
.toast-msg { font-size: 0.8rem; color: var(--gray-600); }

/* ===== FOOTER ===== */
footer.main-footer {
  background: var(--white);
  border-top: 3px solid var(--gold);
  padding: 40px 0 0;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}

.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--burgundy);
  margin-bottom: 14px;
}

.footer-col ul { list-style: none; }

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col ul li a {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--gray-700);
  transition: color 0.2s;
}

.footer-col ul li a:hover { color: var(--burgundy); }

.footer-col ul li a::before {
  content: '›';
  color: var(--gold);
  font-weight: 700;
  flex-shrink: 0;
}

.footer-bottom {
  border-top: 1px solid var(--gray-200);
  padding: 16px 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--gray-400);
  background: var(--gray-50);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; min-width: auto; display: flex; flex-wrap: wrap; padding: 12px; }
  .admin-sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; }
  .admin-sidebar nav a { border-left: none !important; padding: 8px 12px !important; border-radius: var(--radius); }
}

@media (max-width: 768px) {
  .header-title h1 { font-size: 1rem; }
  .header-logo-edomex { height: 40px; }
  .hero-banner { height: 160px; }
  .hero-banner-text { padding: 0 20px; }
  .hero-banner-text h2 { font-size: 1.3rem; }
  .carousel-wrapper { height: 200px; }
  .phases-grid { grid-template-columns: repeat(2, 1fr); }
  .page-header h1 { font-size: 1.6rem; }
  .form-row { grid-template-columns: 1fr; }
  .auth-card { padding: 24px 20px; }
  .modal-header { flex-direction: column; }
  .modal-cover { width: 80px; min-width: 80px; }
  .books-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

@media (max-width: 480px) {
  .phases-grid { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
  .stats-overview { grid-template-columns: 1fr 1fr; }
}

/* ===== UTILITY ===== */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-8 { margin-bottom: 32px; }

.section-pad { padding: 48px 0; }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.alert-info { background: rgba(33,150,243,0.1); color: #1565c0; border: 1px solid rgba(33,150,243,0.2); }
.alert-success { background: rgba(76,175,80,0.1); color: #2e7d32; border: 1px solid rgba(76,175,80,0.2); }
.alert-warning { background: rgba(255,152,0,0.1); color: #e65100; border: 1px solid rgba(255,152,0,0.2); }

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--gray-400);
  font-size: 0.9rem;
  gap: 8px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--burgundy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-label {
  width: 160px;
  min-width: 160px;
  font-size: 0.8rem;
  color: var(--gray-700);
  font-weight: 600;
  text-align: right;
}

.bar-track {
  flex: 1;
  height: 22px;
  background: var(--gray-100);
  border-radius: 11px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 11px;
  background: linear-gradient(90deg, var(--burgundy), var(--burgundy-light));
  transition: width 1s ease;
}

.bar-value {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gray-600);
  min-width: 30px;
}

/* Section tabs (Promocion, Animacion) */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 32px 0;
}

.media-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: all 0.25s;
}

.media-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.media-thumbnail {
  aspect-ratio: 16/9;
  background: var(--gray-800);
  position: relative;
  overflow: hidden;
}

.media-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

.media-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  transition: background 0.2s;
}

.media-play-btn:hover { background: rgba(0,0,0,0.5); }

.play-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.media-info { padding: 16px; }

.media-info h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--gray-800);
  margin-bottom: 6px;
  font-weight: 700;
}

.media-info p { font-size: 0.85rem; color: var(--gray-600); }

.media-type-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--gold-pale);
  color: var(--gold);
  margin-bottom: 8px;
  text-transform: uppercase;
}

/* Embed modal */
.embed-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.embed-modal-overlay.open { opacity: 1; pointer-events: all; }

.embed-container {
  width: 100%;
  max-width: 900px;
  background: var(--gray-800);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.embed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--gray-800);
  color: white;
}

.embed-header h3 { font-size: 0.95rem; font-weight: 600; }

.embed-body {
  aspect-ratio: 16/9;
}

.embed-body iframe { width: 100%; height: 100%; border: none; }

/* Cuestionario (quiz) */
.quiz-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 0;
}

.quiz-progress {
  background: var(--gray-200);
  height: 6px;
  border-radius: 3px;
  margin-bottom: 24px;
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--burgundy), var(--gold));
  transition: width 0.5s;
}

.quiz-question {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.quiz-question h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--gray-800);
  margin-bottom: 16px;
  line-height: 1.5;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.quiz-option:hover { border-color: var(--burgundy); background: rgba(123,29,43,0.03); }
.quiz-option.selected { border-color: var(--burgundy); background: rgba(123,29,43,0.06); }
.quiz-option.correct { border-color: #4CAF50; background: rgba(76,175,80,0.08); }
.quiz-option.wrong { border-color: #F44336; background: rgba(244,67,54,0.08); }

.quiz-option-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.quiz-result {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--gray-200);
}

.result-medal {
  font-size: 4rem;
  margin-bottom: 16px;
}

.quiz-result h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--burgundy);
  margin-bottom: 8px;
}

.quiz-score {
  font-size: 3rem;
  font-family: var(--font-heading);
  font-weight: 900;
  color: var(--gold);
  margin: 12px 0;
}
