/* =========================================================
   1. TOKENS DE DISEÑO & CONFIGURACIÓN BASE
   ========================================================= */
:root {
  --navy-blue: #0A2647;
  --blue-gradient: linear-gradient(135deg, #0A2647 0%, #1D5C96 100%);
  --blue-accent: #1D5C96;
  --text-dark: #2C3E50;
  --text-muted: #7F8C8D;
  --bg-light: #F8FAFC;
  --white: #FFFFFF;
  --radius: 10px;
  --navbar-height: 76px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  color: var(--text-dark);
  background-color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: 'Poppins', sans-serif; font-weight: 700; color: var(--navy-blue); }
a { text-decoration: none; color: inherit; }
img { width: 100%; height: 100%; object-fit: cover; display: block; }
button { font-family: inherit; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

/* SECCIONES */
.section { padding: 80px 0; }
.bg-light { background-color: var(--bg-light); }
.bg-white { background-color: var(--white); }
.text-center { text-align: center; }

.section-head { margin-bottom: 40px; }
.section-head h2 { font-size: 2rem; margin-bottom: 8px; }
.section-sub { font-size: 1.05rem; color: var(--blue-accent); font-weight: 500; font-style: italic; }

/* =========================================================
   2. NAVBAR SUPERIOR (blanca, fija)
   ========================================================= */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background-color: var(--white);
  box-shadow: 0 2px 12px rgba(10, 38, 71, 0.08);
  height: var(--navbar-height);
  display: flex; align-items: center;
}
.navbar-container { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 38px; height: 38px; }
.brand-name { font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 1.25rem; color: var(--navy-blue); letter-spacing: 1px; }
@media (max-width: 991px) {
  .brand-name { font-size: 0.85rem; letter-spacing: 0.5px; }
}

.nav-menu { display: flex; gap: 32px; }
.nav-link { color: var(--text-dark); font-size: 0.95rem; font-weight: 500; padding-bottom: 4px; border-bottom: 2px solid transparent; transition: all 0.25s ease; }
.nav-link:hover, .nav-link.active { color: var(--blue-accent); border-bottom-color: var(--blue-accent); }

/* Botón hamburguesa */
.hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; background: none; border: none; cursor: pointer;
  padding: 0; z-index: 110;
}
.hamburger span {
  display: block; width: 100%; height: 2px; background-color: var(--navy-blue);
  border-radius: 2px; transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   3. SECCIÓN HERO (imagen de fondo + degradado overlay)
   ========================================================= */
.hero {
  position: relative;
  min-height: 600px;
  margin-top: var(--navbar-height);
  display: flex;
  align-items: center;
  /* Reemplaza con tu imagen real de estudiantes/oficinas */
  background: #0A2647 url('img/fondo.png') no-repeat center center/cover;
}
.hero-overlay-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(10, 38, 71, 0.92) 0%, rgba(10, 38, 71, 0.75) 35%, rgba(29, 92, 150, 0.35) 100%);
  z-index: 1;
}
.hero-container { position: relative; z-index: 2; width: 100%; }
.hero-text { max-width: 560px; color: var(--white); }
.hero-text h1 { font-size: 2.8rem; color: var(--white); line-height: 1.2; margin-bottom: 18px; }
.hero-text p { font-size: 1.1rem; color: rgba(255, 255, 255, 0.9); margin-bottom: 32px; max-width: 460px; }

.btn-hero {
  display: inline-block; background-color: var(--white); color: var(--navy-blue);
  padding: 14px 30px; font-weight: 600; border-radius: 6px; font-size: 0.95rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15); transition: transform 0.3s ease;
}
.btn-hero:hover { transform: translateY(-2px); }

/* =========================================================
   4. TARJETAS DE SERVICIOS / CARRERAS
   ========================================================= */
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.career-card {
  background-color: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 4px 25px rgba(0,0,0,0.06); border: 1px solid #EAEFF4;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.career-card:hover { transform: translateY(-6px); box-shadow: 0 12px 30px rgba(10,38,71,0.12); }
.card-img-wrap { aspect-ratio: 4 / 3; }
.card-body { padding: 24px; text-align: left; }
.card-body h3 { font-size: 1.2rem; margin-bottom: 10px; }
.card-divider { display: block; width: 40px; height: 3px; background-color: var(--blue-accent); border-radius: 2px; margin-bottom: 14px; }
.card-body p { color: var(--text-muted); font-size: 0.92rem; }

.btn-malla {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 18px;
  background-color: transparent;
  color: var(--blue-accent);
  border: 1.5px solid var(--blue-accent);
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease;
}
.btn-malla:hover { background-color: var(--blue-accent); color: var(--white); }

/* =========================================================
   4.1 MODAL DE MALLA CURRICULAR
   ========================================================= */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(10, 38, 71, 0.6);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.is-open { display: flex; }

.modal-box {
  background-color: var(--white);
  border-radius: var(--radius);
  max-width: 780px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.modal-close {
  position: sticky;
  top: 0;
  float: right;
  margin-top: -12px;
  margin-right: -12px;
  width: 36px;
  height: 36px;
  border: none;
  background-color: var(--bg-light);
  color: var(--navy-blue);
  font-size: 1.4rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.modal-close:hover { background-color: #E2E8F0; }

.modal-box h3 { font-size: 1.4rem; margin-bottom: 6px; padding-right: 20px; }
.modal-meta { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 24px; }

.malla-year {
  border: 1px solid #EAEFF4;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.malla-year summary {
  padding: 14px 18px;
  background-color: var(--bg-light);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: var(--navy-blue);
  cursor: pointer;
  font-size: 0.95rem;
}
.malla-year[open] summary { border-bottom: 1px solid #EAEFF4; }

.table-scroll { overflow-x: auto; }
.malla-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.malla-table th, .malla-table td { padding: 10px 14px; text-align: left; white-space: nowrap; }
.malla-table th {
  background-color: var(--white);
  color: var(--blue-accent);
  font-weight: 600;
  border-bottom: 2px solid #EAEFF4;
}
.malla-table td { border-bottom: 1px solid #F1F4F8; color: var(--text-dark); }
.malla-table td:nth-child(2) { white-space: normal; min-width: 220px; }
.malla-table tbody tr:hover { background-color: var(--bg-light); }

/* =========================================================
   5. SECCIÓN ACERCA DE
   ========================================================= */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.about-text h2 { font-size: 2rem; margin-bottom: 6px; }
.about-desc { margin-top: 20px; color: var(--text-dark); font-size: 1rem; }
.about-img-wrap { aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.08); }

/* Tarjetas de Misión y Visión (reemplazan la imagen) */
.mv-stack { display: flex; flex-direction: column; gap: 24px; }
.mv-card {
  background-color: var(--white);
  border-radius: var(--radius);
  padding: 28px 30px;
  box-shadow: 0 4px 25px rgba(0,0,0,0.06);
  border: 1px solid #EAEFF4;
  border-left: 4px solid var(--blue-accent);
}
.mv-icon { font-size: 1.6rem; display: block; margin-bottom: 8px; }
.mv-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.mv-card p { color: var(--text-muted); font-size: 0.95rem; }

/* =========================================================
   6. ADMISIÓN: REQUISITOS Y PASOS
   ========================================================= */
.admision-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }
.admision-col-title { font-size: 1.3rem; margin-bottom: 20px; }

.req-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.req-list li {
  position: relative;
  padding-left: 30px;
  color: var(--text-dark);
  font-size: 0.98rem;
}
.req-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: -1px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background-color: var(--blue-accent);
  color: var(--white);
  font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
}

.steps-list { list-style: none; display: flex; flex-direction: column; gap: 22px; }
.steps-list li { display: flex; gap: 16px; align-items: flex-start; }
.step-num {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  background-color: var(--navy-blue);
  color: var(--white);
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
}
.steps-list strong { display: block; color: var(--navy-blue); font-size: 1rem; margin-bottom: 4px; }
.steps-list p { color: var(--text-muted); font-size: 0.92rem; }

/* Formulario de preinscripción: botón que abre el modal */
.preinscripcion { margin-top: 28px; padding-top: 24px; border-top: 1px solid #EAEFF4; }
.preinscripcion-title { font-size: 1.05rem; margin-bottom: 4px; }
.preinscripcion-sub { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 16px; }

.btn-preinscripcion {
  display: inline-block;
  padding: 12px 22px;
  background-color: var(--blue-accent);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.25s ease;
}
.btn-preinscripcion:hover { background-color: var(--navy-blue); }

/* Modal del formulario (más ancho que el de mallas) */
.modal-box-form { max-width: 640px; }
.gform-wrap {
  width: 100%;
  height: 65vh;
  max-height: 600px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #EAEFF4;
}

/* =========================================================
   7. CONTACTO: BOTONES DIRECCIONALES + MAPA
   ========================================================= */
.form-instruction { margin: 16px 0 24px; color: var(--text-muted); font-size: 0.95rem; }

.contact-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 60px; align-items: center; }

.contact-buttons { display: flex; flex-direction: column; gap: 14px; max-width: 380px; }
.contact-btn {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--white);
  transition: transform 0.2s ease, filter 0.2s ease;
}
.contact-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.contact-btn-wa { background-color: #25D366; }
.contact-btn-call { background-color: var(--blue-accent); }
.contact-btn-mail { background-color: var(--navy-blue); }

.contact-map-side {
  aspect-ratio: 4 / 3;
  max-height: 320px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
.contact-map-side iframe { width: 100%; height: 100%; }

/* =========================================================
   7. FOOTER
   ========================================================= */
.main-footer { background-color: var(--navy-blue); color: rgba(255, 255, 255, 0.7); padding: 40px 0; font-size: 0.9rem; }
.footer-container { display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.copyright { border-top: 1px solid rgba(255,255,255,0.1); width: 100%; padding-top: 20px; }

/* =========================================================
   7.1 BOTONES FLOTANTES DE REDES SOCIALES
   ========================================================= */
.floating-social {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  border-radius: 10px;
  overflow: hidden;
}
.float-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  color: var(--white);
  transition: filter 0.2s ease, transform 0.2s ease;
}
.float-btn:hover { filter: brightness(1.1); transform: scale(1.05); }
.float-fb { background-color: var(--navy-blue); }
.float-wa { background-color: #25D366; }

/* =========================================================
   8. RESPONSIVE
   ========================================================= */
@media (max-width: 991px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid, .contact-grid, .admision-grid { grid-template-columns: 1fr; gap: 40px; }
  .contact-map-side { order: -1; max-width: 420px; margin: 0 auto; max-height: 260px; }
}

@media (max-width: 768px) {
  .hero { min-height: 460px; }
  .hero-text h1 { font-size: 2rem; }
  .cards-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .gform-wrap { height: 70vh; }

  /* Menú hamburguesa activo */
  .hamburger { display: flex; }
  .nav-menu {
    position: fixed;
    top: var(--navbar-height);
    left: 0; right: 0;
    background-color: var(--white);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    box-shadow: 0 8px 20px rgba(10,38,71,0.1);
  }
  .nav-menu.is-open { max-height: 320px; }
  .nav-link {
    width: 100%; padding: 16px 24px; border-bottom: 1px solid #EEF2F6;
    border-left: 3px solid transparent;
  }
  .nav-link.active, .nav-link:hover { border-bottom-color: #EEF2F6; border-left-color: var(--blue-accent); background-color: var(--bg-light); }
}

@media (max-width: 480px) {
  .floating-social { right: 16px; bottom: 16px; }
  .float-btn { width: 48px; height: 48px; }
  .float-btn svg { width: 22px; height: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}