/* =====================================================================
   PUENTE DE APRENDIZAJE - Estilos principales
   =====================================================================
   PERSONALIZACIÓN RÁPIDA:
   👉 Cambia los colores en :root (líneas siguientes)
   👉 Cambia las tipografías en --font-display y --font-body
   👉 Las imágenes se reemplazan en /assets/img/ con los mismos nombres
   ===================================================================== */

/* ---------- TIPOGRAFÍAS (importadas desde Google Fonts en index.php) ---------- */

:root {
  /* ============ 🎨 COLORES (cambia aquí toda la paleta) ============ */
  --color-primary: #123F85;        /* Azul profundo - color principal */
  --color-primary-dark: #0C2F66;   /* Versión oscura del primario */
  --color-accent: #C11734;         /* Rojo - acentos */
  --color-accent-light: #E84A66;   /* Rojo claro */
  --color-bg: #FAF7F2;             /* Crema - fondo general */
  --color-bg-alt: #F2EDE3;         /* Crema alternativo */
  --color-text: #2A2A2A;           /* Texto principal */
  --color-text-soft: #5A5A5A;      /* Texto secundario */
  --color-border: #E5DED1;         /* Bordes suaves */
  --color-success: #4A8B6F;        /* Verde para éxito */
  --color-error: #B85450;          /* Rojo para errores */

  /* ============ 📝 TIPOGRAFÍAS ============ */
  --font-display: 'Montserrat', -apple-system, sans-serif;  /* Títulos */
  --font-body: 'Montserrat', -apple-system, sans-serif;     /* Cuerpo */

  /* ============ 📐 ESPACIADO Y RADIOS ============ */
  --radius-sm: 6px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 12px rgba(18, 63, 133, 0.06);
  --shadow-md: 0 8px 28px rgba(18, 63, 133, 0.10);
  --shadow-lg: 0 24px 60px rgba(18, 63, 133, 0.14);

  /* Transiciones */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- RESET BÁSICO ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* =====================================================================
   NAVBAR
   ===================================================================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 18px 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(250, 247, 242, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.navbar.scrolled { border-bottom-color: var(--color-border); }

.navbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
/* 👉 LOGO: cambia /assets/img/logo.png por tu logo real */
.navbar__logo {
  height: 42px;
  width: auto;
}
.navbar__brand-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--color-primary);
}

.navbar__cta {
  font-size: 0.9rem;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--color-primary);
  color: var(--color-bg);
  font-weight: 500;
  transition: all 0.3s var(--ease);
  letter-spacing: 0.02em;
}
.navbar__cta:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* =====================================================================
   HERO
   ===================================================================== */
.hero {
  min-height: 100vh;
  padding: 140px 5% 80px;
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
  overflow: hidden;
}

/* Decoración de fondo del hero */
.hero::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--color-accent-light) 0%, transparent 70%);
  opacity: 0.4;
  border-radius: 50%;
  z-index: 0;
  animation: float 12s ease-in-out infinite;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -150px; left: -150px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
  opacity: 0.08;
  border-radius: 50%;
  z-index: 0;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-30px, 30px); }
}

.hero__content {
  position: relative;
  z-index: 1;
  animation: fadeInUp 1s var(--ease) both;
}

.hero__eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: 24px;
  padding-left: 50px;
  position: relative;
}
.hero__eyebrow::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 36px;
  height: 1px;
  background: var(--color-accent);
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--color-primary);
  margin-bottom: 28px;
}
.hero__title em {
  font-style: italic;
  color: var(--color-accent);
  font-weight: 400;
}

.hero__lead {
  font-size: 1.15rem;
  color: var(--color-text-soft);
  max-width: 540px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: all 0.3s var(--ease);
  text-decoration: none;
}
.btn--primary {
  background: var(--color-primary);
  color: var(--color-bg);
}
.btn--primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn--ghost {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-border);
}
.btn--ghost:hover {
  border-color: var(--color-primary);
  background: var(--color-bg-alt);
}

/* Imagen / visual del hero */
.hero__visual {
  position: relative;
  z-index: 1;
  animation: fadeInRight 1.2s var(--ease) both;
}
.hero__visual-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}
/* 👉 IMAGEN HERO: reemplaza /assets/img/hero.jpg por la imagen real */
.hero__visual-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__visual-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, transparent 50%, rgba(18, 63, 133, 0.3));
}
.hero__badge {
  position: absolute;
  bottom: -30px; left: -30px;
  background: var(--color-bg);
  padding: 24px 28px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}
.hero__badge-num {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--color-accent);
  line-height: 1;
}
.hero__badge-label {
  font-size: 0.85rem;
  color: var(--color-text-soft);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* =====================================================================
   SECCIÓN PROGRAMAS / FLYERS
   ===================================================================== */
.programs {
  padding: 120px 5% 100px;
  position: relative;
}

.section-head {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 70px;
}
.section-head__eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: 16px;
}
.section-head__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 500;
  line-height: 1.15;
  color: var(--color-primary);
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}
.section-head__lead {
  color: var(--color-text-soft);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* Grid de flyers (cards) */
.programs__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  max-width: 1100px;
  margin: 0 auto;
}

/* Tarjeta de programa */
.flyer {
  position: relative;
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all 0.5s var(--ease);
  display: flex;
  flex-direction: column;
  min-height: 460px;
}

.flyer:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-accent-light);
}

.flyer__image {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
}
/* 👉 IMÁGENES DE FLYERS: reemplaza flyer-1.jpg, flyer-2.jpg, etc. */
.flyer__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.7s var(--ease);
}
.flyer:hover .flyer__image img {
  transform: scale(1.04);
}
.flyer__number {
  position: absolute;
  top: 18px; left: 18px;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  letter-spacing: 0.05em;
  z-index: 2;
}

.flyer__body {
  padding: 26px 26px 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.flyer__date {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-soft);
  margin-bottom: 6px;
}
.flyer__title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-primary);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}
.flyer__objective {
  font-size: 0.92rem;
  color: var(--color-text-soft);
  line-height: 1.65;
  margin-bottom: 22px;
  flex: 1;
  /* Truncar con ellipsis si excede 4 líneas */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.flyer__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  border-top: 1px solid var(--color-border);
}
.flyer__cupos {
  font-size: 0.8rem;
  color: var(--color-text-soft);
  letter-spacing: 0.04em;
}
.flyer__cupos strong {
  color: var(--color-success);
  font-weight: 600;
}
.flyer__arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  transition: all 0.3s var(--ease);
}
.flyer:hover .flyer__arrow {
  background: var(--color-accent);
  color: white;
  transform: rotate(-45deg);
}

/* Estado: cupos agotados */
.flyer--agotado {
  cursor: not-allowed;
  opacity: 0.55;
  filter: grayscale(0.9);
  pointer-events: none; /* bloqueo total */
}

/* =====================================================================
   FOOTER
   ===================================================================== */
.footer {
  padding: 60px 5% 30px;
  background: var(--color-primary);
  color: rgba(250, 247, 242, 0.85);
  text-align: center;
}
.footer__brand {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--color-bg);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}
.footer__text {
  max-width: 540px;
  margin: 0 auto 28px;
  font-size: 0.95rem;
  line-height: 1.7;
}
.footer__copy {
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  padding-top: 20px;
  border-top: 1px solid rgba(250, 247, 242, 0.15);
  margin-top: 40px;
  opacity: 0.7;
}

/* =====================================================================
   MODAL / FORMULARIO
   ===================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.is-open { display: flex; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 47, 102, 0.55);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.3s var(--ease);
}
.modal__panel {
  position: relative;
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 44px 40px 36px;
  box-shadow: var(--shadow-lg);
  animation: panelIn 0.4s var(--ease);
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal__close {
  position: absolute;
  top: 18px; right: 18px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-soft);
  transition: all 0.2s var(--ease);
  font-size: 1.1rem;
}
.modal__close:hover {
  background: var(--color-error);
  color: white;
}

.modal__eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: 8px;
}
.modal__title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--color-primary);
  line-height: 1.2;
  margin-bottom: 22px;
  letter-spacing: -0.01em;
}

/* Campos del formulario */
.field {
  margin-bottom: 18px;
}

/* Fila de 3 selects (Nivel · Grado · Sección) alineados horizontalmente */
.field-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.field-row .field { margin-bottom: 0; }
@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; gap: 14px; }
}

/* Estilo nativo de los <select> dentro del formulario */
.field__input--select {
  appearance: none;
  -webkit-appearance: none;
  background-color: white;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%235A5A5A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  padding-right: 36px;
  cursor: pointer;
}
.field__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 7px;
  letter-spacing: 0.02em;
}
.field__input {
  width: 100%;
  padding: 13px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-text);
  background: white;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: all 0.2s var(--ease);
}
.field__input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(18, 63, 133, 0.1);
}
.field__input[readonly] {
  background: var(--color-bg-alt);
  color: var(--color-text-soft);
  font-style: italic;
  cursor: not-allowed;
}
.field__error {
  display: none;
  color: var(--color-error);
  font-size: 0.82rem;
  margin-top: 6px;
}
.field--has-error .field__input {
  border-color: var(--color-error);
}
.field--has-error .field__error {
  display: block;
}

.modal__submit {
  width: 100%;
  padding: 16px;
  background: var(--color-primary);
  color: var(--color-bg);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-top: 8px;
  transition: all 0.3s var(--ease);
}
.modal__submit:hover:not(:disabled) {
  background: var(--color-primary-dark);
}
.modal__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.modal__feedback {
  display: none;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 0.9rem;
}
.modal__feedback.is-success {
  display: block;
  background: rgba(74, 139, 111, 0.12);
  color: var(--color-success);
  border: 1px solid rgba(74, 139, 111, 0.3);
}
.modal__feedback.is-error {
  display: block;
  background: rgba(184, 84, 80, 0.10);
  color: var(--color-error);
  border: 1px solid rgba(184, 84, 80, 0.3);
}

/* =====================================================================
   ANIMACIONES UTILITARIAS
   ===================================================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Reveal al hacer scroll */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 120px 5% 60px;
    text-align: center;
  }
  .hero__eyebrow { padding-left: 0; }
  .hero__eyebrow::before { display: none; }
  .hero__lead { margin-left: auto; margin-right: auto; }
  .hero__actions { justify-content: center; }
  .hero__visual { max-width: 420px; margin: 0 auto; }
  .hero__badge { left: 20px; }
}

@media (max-width: 600px) {
  .navbar__brand-text { display: none; }
  .navbar__cta { padding: 8px 16px; font-size: 0.85rem; }
  .programs { padding: 80px 5% 60px; }
  .section-head { margin-bottom: 50px; }
  .modal__panel { padding: 36px 24px 28px; }
  .modal__title { font-size: 1.4rem; }
  .hero__title { font-size: 2.4rem; }
  .programs__grid { gap: 20px; grid-template-columns: 1fr; }
}
