/* ==========================================================================
   Preparatoria Marie Curie — Landing de Inscripciones
   Hoja de estilos única. Mobile-first: los estilos base son para teléfono
   y las @media (min-width) van ampliando hacia tablet y escritorio.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens de diseño
   -------------------------------------------------------------------------- */
:root {
  /* Paleta de marca (tomada del sitio original) */
  --mc-yellow: #fead16;
  --mc-yellow-dark: #e0871f;
  --mc-red: #c3363e;
  --mc-red-light: #dd5454;
  --mc-green: #25c05e;
  --mc-green-dark: #1da24d;

  /* Neutros */
  --ink: #16181d;
  --ink-soft: #3d424d;
  --ink-muted: #6b7280;
  --surface: #ffffff;
  --surface-alt: #f7f8fa;
  --line: #e3e6ec;

  /* Tipografía */
  --font-display: "Oswald", "Arial Narrow", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;

  /* Escala fluida: crece con el viewport sin saltos bruscos */
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --step-1: clamp(1.125rem, 1.06rem + 0.32vw, 1.25rem);
  --step-2: clamp(1.375rem, 1.24rem + 0.65vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.5rem + 1.2vw, 2.5rem);
  --step-4: clamp(2.125rem, 1.6rem + 2.6vw, 3.75rem);

  /* Ritmo vertical */
  --space-xs: 0.5rem;
  --space-sm: 0.875rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: clamp(3rem, 8vw, 5.5rem);

  --radius: 14px;
  --radius-lg: 24px;
  --shadow: 0 2px 4px rgb(0 0 0 / 6%), 0 12px 28px rgb(0 0 0 / 10%);

  /* Alto real del header fijo. Lo usa scroll-padding para que los anclajes
     no queden escondidos detrás de la barra. */
  --header-h: 60px;

  --wrap: 1180px;
}

@media (min-width: 768px) {
  :root {
    --header-h: 84px;
  }
}

/* --------------------------------------------------------------------------
   2. Fuentes locales (sin llamadas a servidores externos)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Oswald";
  src: url("../assets/font/Oswald-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Oswald";
  src: url("../assets/font/Oswald-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   3. Reset y bases
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Compensa el header fijo al saltar a un #ancla */
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink);
  background: var(--surface);
  /* Evita cualquier desbordamiento horizontal en móvil */
  overflow-x: hidden;
}

img,
svg,
iframe {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--mc-red);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.12;
  margin: 0 0 var(--space-sm);
  text-wrap: balance;
}

p {
  margin: 0 0 var(--space-sm);
  /* El original usaba text-align: justify, que en pantallas angostas abre
     "ríos" de espacio entre palabras. Alineado a la izquierda se lee mejor. */
  text-align: left;
  text-wrap: pretty;
}

/* Accesibilidad: foco siempre visible */
:focus-visible {
  outline: 3px solid var(--mc-red);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Enlace para saltar al contenido (usuarios de teclado / lector de pantalla) */
.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 999;
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: #fff;
  border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* --------------------------------------------------------------------------
   4. Utilidades de layout
   -------------------------------------------------------------------------- */
.wrap {
  width: min(100% - 2rem, var(--wrap));
  margin-inline: auto;
}

.section {
  padding-block: var(--space-xl);
}

.section__title {
  font-size: var(--step-3);
  color: var(--mc-red);
  text-align: center;
  margin-bottom: var(--space-lg);
}

/* --------------------------------------------------------------------------
   5. Botones — mínimo 48px de alto para cumplir con tap targets táctiles
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease,
    box-shadow 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--green {
  background: var(--mc-green);
  color: #fff;
  box-shadow: 0 4px 14px rgb(37 192 94 / 35%);
}
.btn--green:hover {
  background: var(--mc-green-dark);
}

.btn--red {
  background: var(--mc-red);
  color: #fff;
  box-shadow: 0 4px 14px rgb(195 54 62 / 30%);
}
.btn--red:hover {
  background: #a82b32;
}

/* Botón secundario para el header: blanco con borde, sobre el fondo amarillo */
.btn--outline {
  background: rgb(255 255 255 / 92%);
  color: var(--mc-red);
  border: 2px solid #fff;
}
.btn--outline:hover {
  background: #fff;
}

.btn--block {
  display: flex;
  width: 100%;
}

@media (min-width: 480px) {
  .btn--block {
    width: auto;
    min-width: 260px;
  }
}

/* --------------------------------------------------------------------------
   6. Header fijo y compacto
   El header original ocupaba 154px (19% de la pantalla de un teléfono).
   Aquí baja a 60px en móvil, recuperando espacio útil.
   -------------------------------------------------------------------------- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--mc-yellow);
  box-shadow: 0 2px 10px rgb(0 0 0 / 12%);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  height: 100%;
}

.header__logos {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 1;
  min-width: 0;
}

.header__logo {
  height: 38px;
  width: auto;
}

.header__logo--buap {
  height: 34px;
}

@media (min-width: 768px) {
  .header__logo {
    height: 58px;
  }
  .header__logo--buap {
    height: 54px;
  }
}

/* Grupo de botones del header */
.header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* CTA del header: compactos en móvil para que quepan dos botones */
.header__cta {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0.5rem 0.8rem;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.header__cta .header__cta-long {
  display: none;
}

@media (min-width: 640px) {
  .header__actions {
    gap: 0.625rem;
  }
  .header__cta {
    min-height: 48px;
    padding: 0.75rem 1.3rem;
    font-size: var(--step-0);
  }
  .header__cta .header__cta-short {
    display: none;
  }
  .header__cta .header__cta-long {
    display: inline;
  }
}

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   7. Hero
   El original usaba una imagen PNG con el texto incrustado: no escalaba,
   no se podía leer con lector de pantalla y no servía para SEO.
   Aquí el titular es texto real.
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  margin-top: var(--header-h);
  padding-block: var(--space-lg) calc(var(--space-xl) + 60px);
  background: linear-gradient(160deg, var(--mc-yellow) 0%, var(--mc-yellow-dark) 100%);
  color: #fff;
  text-align: center;
  overflow: hidden;
}

.hero__eyebrow {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
  opacity: 0.95;
}

.hero__title {
  font-size: var(--step-4);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin: 0.15em 0;
  text-shadow: 0 3px 0 rgb(0 0 0 / 12%);
}

.hero__subtitle {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0 0 var(--space-md);
}

.hero__lead {
  font-size: var(--step-1);
  font-style: italic;
  max-width: 34ch;
  margin-inline: auto;
  text-align: center;
}

.hero__badges {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

@media (min-width: 640px) {
  .hero__badges {
    flex-direction: row;
    justify-content: center;
    gap: var(--space-lg);
  }
}

.hero__badge {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgb(255 255 255 / 18%);
  border: 2px solid rgb(255 255 255 / 55%);
  border-radius: 999px;
  padding: 0.5rem 1.25rem;
  margin: 0;
}

/* Curva decorativa que separa el hero del formulario */
.hero__curve {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  width: 100%;
  height: 60px;
  fill: var(--surface-alt);
}

/* --------------------------------------------------------------------------
   8. Formulario de registro
   -------------------------------------------------------------------------- */
.registro {
  background: var(--surface-alt);
  padding-bottom: var(--space-xl);
}

.card-form {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(1.5rem, 5vw, 3rem);
  max-width: 640px;
  margin-inline: auto;
  margin-top: calc(var(--space-xl) * -1);
  position: relative;
  z-index: 2;
}

.card-form__title {
  font-size: var(--step-3);
  color: var(--mc-red);
  text-align: center;
}

.card-form__lead {
  text-align: center;
  color: var(--ink-soft);
  margin-bottom: var(--space-md);
}

.field {
  margin-bottom: var(--space-md);
}

.field__label {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.375rem;
  color: var(--ink-soft);
}

.field__req {
  color: var(--mc-red);
}

/* font-size: 16px es obligatorio: por debajo de eso Safari en iOS hace
   zoom automático al enfocar el campo y descuadra la página. */
.field__input {
  width: 100%;
  min-height: 52px;
  padding: 0.8rem 1rem;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field__input::placeholder {
  color: var(--ink-muted);
}

.field__input:focus {
  outline: none;
  border-color: var(--mc-red);
  box-shadow: 0 0 0 4px rgb(195 54 62 / 12%);
}

.field__input[aria-invalid="true"] {
  border-color: var(--mc-red);
  background: #fff6f6;
}

.field__error {
  display: none;
  margin: 0.375rem 0 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--mc-red);
}

.field__error.is-visible {
  display: block;
}

.form__status {
  margin-top: var(--space-sm);
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
}

.form__status[data-state="ok"] {
  background: #e8f8ee;
  color: #14663a;
}

.form__status[data-state="error"] {
  background: #fdeaea;
  color: #8f2129;
}

.form__note {
  margin-top: var(--space-sm);
  font-size: 0.875rem;
  color: var(--ink-muted);
  text-align: center;
}

/* --------------------------------------------------------------------------
   9. Sesión informativa
   -------------------------------------------------------------------------- */
.sesion {
  background: var(--surface);
  text-align: center;
}

.sesion__icon {
  width: 64px;
  height: 64px;
  margin-inline: auto;
  margin-bottom: var(--space-sm);
}

.sesion__title {
  font-size: var(--step-3);
  color: var(--mc-red);
}

.sesion__date {
  font-size: var(--step-2);
  font-family: var(--font-display);
  color: var(--ink);
  margin-bottom: var(--space-md);
  text-align: center;
}

/* --------------------------------------------------------------------------
   10. Tarjetas "¿Por qué estudiar en Marie Curie?"
   -------------------------------------------------------------------------- */
.porque {
  background: var(--surface-alt);
}

/* auto-fit + minmax: 1 columna en móvil, 2 en tablet, 3 en escritorio,
   sin necesidad de media queries. */
.cards {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card__media {
  aspect-ratio: 16 / 10;
  width: 100%;
  object-fit: cover;
}

.card__body {
  padding: var(--space-md);
  flex: 1;
}

.card__title {
  font-size: var(--step-2);
  color: var(--mc-red);
}

.card__text {
  color: var(--ink-soft);
  margin-bottom: 0;
}

.porque__cta {
  display: flex;
  justify-content: center;
  margin-top: var(--space-lg);
}

/* --------------------------------------------------------------------------
   11. Videos — contenedor con aspect-ratio 16:9
   El original tenía width="560" height="315" fijos, así que en móvil el
   iframe se comprimía a 315px de ancho pero conservaba 315px de alto:
   de ahí las franjas negras.
   -------------------------------------------------------------------------- */
.videos {
  background: var(--surface);
}

.videos__grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .videos__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
  }
}

.video__title {
  font-size: var(--step-2);
  color: var(--mc-red);
  text-align: center;
}

/* Fachada: muestra la miniatura y sólo carga el iframe de YouTube al hacer
   clic. Evita ~1MB de scripts de terceros en la carga inicial. */
.video__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  cursor: pointer;
  padding: 0;
  display: block;
}

.video__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
  transition: opacity 0.2s ease, transform 0.3s ease;
}

.video__frame:hover .video__thumb {
  opacity: 1;
  transform: scale(1.03);
}

.video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 48px;
  pointer-events: none;
}

.video__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* --------------------------------------------------------------------------
   12. Sección de tecnología e instalaciones
   En el sitio original este bloque tenía texto negro (#000) sobre fondo
   negro: era literalmente ilegible. Aquí va sobre fondo claro.
   -------------------------------------------------------------------------- */
.tech {
  background: var(--surface-alt);
}

.tech__grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .tech__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .tech__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.tech__item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tech__media {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #fff;
  padding: var(--space-sm);
  border-bottom: 1px solid var(--line);
}

.tech__body {
  padding: var(--space-md);
}

.tech__text {
  color: var(--ink-soft);
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   13. Footer
   -------------------------------------------------------------------------- */
.footer {
  background: var(--ink);
  color: #fff;
  padding-block: var(--space-lg);
  text-align: center;
}

.footer__logo {
  height: 64px;
  width: auto;
  margin-inline: auto;
  margin-bottom: var(--space-md);
}

.footer__title {
  font-size: var(--step-2);
  color: var(--mc-yellow);
}

.footer__phones {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

@media (min-width: 480px) {
  .footer__phones {
    flex-direction: row;
    justify-content: center;
    gap: var(--space-md);
  }
}

/* Tap target completo para los teléfonos: antes medían 19px de alto */
.footer__phone {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0.5rem 1rem;
  color: #fff;
  font-size: var(--step-1);
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius);
}

.footer__phone:hover {
  background: rgb(255 255 255 / 10%);
  text-decoration: underline;
}

.footer__social {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgb(255 255 255 / 10%);
  transition: background-color 0.15s ease;
}

.footer__social a:hover {
  background: rgb(255 255 255 / 22%);
}

.footer__social img {
  width: 26px;
  height: 26px;
}

.footer__legal {
  margin: var(--space-md) 0 0;
  font-size: 0.875rem;
  color: rgb(255 255 255 / 60%);
  text-align: center;
}

/* --------------------------------------------------------------------------
   14. Botón flotante de WhatsApp
   Se separa del borde con safe-area para no chocar con la barra de gestos
   del iPhone.
   -------------------------------------------------------------------------- */
.wa-float {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--mc-green);
  box-shadow: 0 6px 20px rgb(0 0 0 / 28%);
  transition: transform 0.15s ease;
}

.wa-float:hover {
  transform: scale(1.06);
}

.wa-float img {
  width: 32px;
  height: 32px;
}

@media print {
  .header,
  .wa-float,
  .skip-link {
    display: none !important;
  }
}
