/* Maflo Instancia Educativa
   Paleta tomada del logotipo: magenta, cian y amarillo sobre el negro del texto "MAFLO".
   Magenta = acciones (botones, enlaces activos). Cian y amarillo = apoyo y acentos. */

:root {
  --magenta: #d62b61;       /* logo #e0336a, un tono más oscuro para contraste AA con texto blanco */
  --magenta-dark: #b01f4f;
  --cyan: #3fb6d9;
  --cyan-ink: #1b7fa1;      /* cian legible sobre fondo claro */
  --yellow: #f2c230;
  --ink: #15161b;           /* negro del texto del logo */

  --bg: #fbfbfc;
  --surface: #ffffff;
  --tint: #eef6fa;          /* cian muy suave */
  --text: #15161b;
  --muted: #50535c;
  --line: #d9dde3;
  --accent: var(--magenta);
  --focus: var(--cyan);

  --r: 6px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --shadow: 0 1px 2px rgb(21 22 27 / .05), 0 12px 32px -12px rgb(21 22 27 / .18);
  --wrap: 1200px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131419;
    --surface: #1a1c22;
    --tint: #080a0c;
    --text: #eef0f3;
    --muted: #aab0ba;
    --line: #2e323b;
    --accent: #f0588a;
    --cyan-ink: #5cc6e6;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 12px 32px -12px rgb(0 0 0 / .6);
  }
}
:root[data-theme="dark"] {
  --bg: #111217; --surface: #1a1c22; --tint: #151a20; --text: #eef0f3;
  --muted: #aab0ba; --line: #2e323b; --accent: #f0588a; --cyan-ink: #5cc6e6;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.01em; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 768px) { .wrap { padding-inline: 32px; } }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -48px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; border-radius: var(--r); }
.skip:focus { top: 8px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: 0 1.5rem;
  font: 600 .95rem/1 "Montserrat", sans-serif;
  text-decoration: none; white-space: nowrap;
  border: 2px solid transparent; border-radius: var(--r);
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--magenta); color: #fff; }
.btn--ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn--light { background: var(--yellow); color: var(--ink); }
.btn--sm { min-height: 40px; padding: 0 1.1rem; font-size: .88rem; }
.btn--block { width: 100%; }
.btn i { font-size: 1.2em; }
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: var(--magenta-dark); }
  .btn--ghost:hover { border-color: var(--cyan); }
  .btn--light:hover { background: #ffd24d; }
}
.btn[aria-busy="true"] { opacity: .75; pointer-events: none; }

/* ---------- Barra superior (estilo gob.mx) ---------- */
.topbar { background: var(--ink); color: #e6e8ec; font-size: .8rem; position: relative; }
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; z-index: 41;
  background: linear-gradient(90deg, var(--cyan) 0 33.33%, var(--yellow) 33.33% 66.66%, var(--magenta) 66.66%);
}
.topbar__inner { display: flex; justify-content: space-between; align-items: center; min-height: 36px; gap: 1rem; }
.topbar a { display: inline-flex; align-items: center; gap: .35rem; text-decoration: none; font-weight: 600; }
.topbar a:hover { color: var(--yellow); }
.topbar__campus { padding-left: 1rem; border-left: 1px solid rgb(255 255 255 / .18); }
@media (max-width: 520px) {
  .topbar__inner > span { display: none; }
  .topbar__inner { justify-content: flex-end; }
  /* En telefono manda el WhatsApp; el campus queda en el menu y el pie. */
  .topbar__campus { display: none; }
}

/* ---------- Navegación ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__text strong { font-size: 1.2rem; font-weight: 800; letter-spacing: .02em; }
.brand__text small { font-size: .68rem; font-weight: 500; color: var(--muted); letter-spacing: .04em; margin-top: 3px; }
.brand--light, .brand--light small { color: #fff; }
.brand--light small { color: #b9bdc6; }

.nav__menu { display: flex; align-items: center; gap: 1.75rem; }
.nav__menu a:not(.btn) { text-decoration: none; font-weight: 500; font-size: .92rem; color: var(--muted); position: relative; }
.nav__menu a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  background: var(--magenta); transform: scaleX(0); transform-origin: left;
  transition: transform 200ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .nav__menu a:not(.btn):hover { color: var(--text); }
  .nav__menu a:not(.btn):hover::after { transform: scaleX(1); }
}
.nav__toggle { display: none; background: none; border: 0; color: var(--text); font-size: 1.6rem; width: 48px; height: 48px; cursor: pointer; }

@media (max-width: 860px) {
  .nav__toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav__menu {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: .5rem 16px 1rem;
    opacity: 0; transform: translateY(-8px); visibility: hidden;
    transition: opacity 180ms ease, transform 200ms var(--ease-out), visibility 0s linear 200ms;
  }
  .nav__menu a:not(.btn) { padding: .85rem 0; border-bottom: 1px solid var(--line); color: var(--text); }
  .nav__menu a:not(.btn)::after { display: none; }
  .nav__menu .btn { margin-top: 1rem; }
  .nav.is-open .nav__menu { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
}

/* ---------- Hero ---------- */
.hero { padding: 3rem 0 3.5rem; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto auto; width: 46%; height: 100%;
  background: var(--tint); z-index: -1;
}
.hero__grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 900px) {
  .hero { padding: 4rem 0 4.5rem; min-height: min(calc(100dvh - 104px), 720px); display: flex; align-items: center; }
  .hero__grid { grid-template-columns: 1.1fr .9fr; gap: 4rem; }
}
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 600; color: var(--accent);
  letter-spacing: .06em; text-transform: uppercase;
  padding-bottom: .5rem; border-bottom: 2px solid var(--yellow); margin-bottom: 1.5rem;
}
.hero h1 { font-size: clamp(2.3rem, 5.2vw, 4rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.08; }
.hero h1 em { font-style: normal; color: var(--accent); white-space: nowrap; }
.hero__sub { margin-top: 1.25rem; font-size: 1.15rem; color: var(--muted); max-width: 38ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.hero__media { margin: 0; position: relative; }
.hero__media img { width: 100%; aspect-ratio: 5 / 6; object-fit: cover; border-radius: var(--r); box-shadow: var(--shadow); }
.hero__media::after {
  content: ""; position: absolute; inset: 18px -18px -18px 18px;
  border: 2px solid var(--cyan); border-radius: var(--r); z-index: -1;
}
@media (max-width: 899px) { .hero::before { display: none; } .hero__media img { aspect-ratio: 4 / 3; } .hero__media::after { inset: 12px -8px -12px 12px; } }

/* Entrada del hero */
@media (prefers-reduced-motion: no-preference) {
  .hero__copy > * { animation: rise 700ms var(--ease-out) both; }
  .hero__copy > *:nth-child(2) { animation-delay: 60ms; }
  .hero__copy > *:nth-child(3) { animation-delay: 120ms; }
  .hero__copy > *:nth-child(4) { animation-delay: 180ms; }
  .hero__media { animation: reveal-img 900ms var(--ease-out) 120ms both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes reveal-img { from { opacity: 0; clip-path: inset(0 0 12% 0); transform: translateY(12px); } to { clip-path: inset(0 0 0 0); } }

/* ---------- Franja de datos ---------- */
.facts { background: var(--ink); color: #fff; }
.facts__grid { display: grid; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .facts__grid { grid-template-columns: repeat(4, 1fr); } }
.fact { padding: 1.75rem 1rem; display: flex; flex-direction: column; gap: .25rem; border-left: 1px solid rgb(255 255 255 / .14); }
.fact:first-child { border-left: 0; }
@media (max-width: 767px) { .fact:nth-child(3) { border-left: 0; } .fact:nth-child(n+3) { border-top: 1px solid rgb(255 255 255 / .14); } }
.fact strong { font-size: 2.6rem; font-weight: 800; line-height: 1; color: var(--cyan); font-variant-numeric: tabular-nums; }
.fact:nth-child(2) strong { color: var(--yellow); }
.fact:nth-child(3) strong { color: #f0588a; }
.fact:nth-child(4) strong { color: #fff; }
.fact span { font-size: .9rem; color: #c9ccd3; }

/* ---------- Secciones ---------- */
.section { padding: 4.5rem 0; }
@media (min-width: 900px) { .section { padding: 6rem 0; } }
.section--tint { background: var(--tint); }
.h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); font-weight: 700; max-width: 22ch; margin-bottom: 2.5rem; }
.h2::after {
  content: ""; display: block; width: 60px; height: 4px; margin-top: 1rem; border-radius: 2px;
  background: linear-gradient(90deg, var(--cyan) 0 33.33%, var(--yellow) 33.33% 66.66%, var(--magenta) 66.66%);
}

/* Pasos: línea horizontal conectada */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2rem; counter-reset: s; }
@media (min-width: 860px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; position: relative; }
  .steps::before { content: ""; position: absolute; top: 24px; left: 24px; right: 24px; height: 2px; background: var(--line); }
}
.step { position: relative; }
.step__num {
  display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--cyan); color: var(--text);
  font-weight: 800; font-size: 1.1rem; margin-bottom: 1.25rem; position: relative;
}
.step:nth-child(2) .step__num { border-color: var(--yellow); }
.step:nth-child(3) .step__num { border-color: var(--magenta); }
.step h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: .5rem; }
.step p { color: var(--muted); max-width: 34ch; }

/* Bento */
.bento { display: grid; gap: 1rem; }
@media (min-width: 860px) {
  .bento { grid-template-columns: 1.2fr 1fr 1fr; grid-template-rows: repeat(2, minmax(220px, auto)); }
  .tile--magenta { grid-row: span 2; }
  .tile--photo { grid-column: span 2; }
}
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 2rem; display: flex; flex-direction: column; justify-content: flex-end; gap: .6rem;
  position: relative; overflow: hidden; min-height: 220px;
}
.tile h3 { font-size: 1.25rem; font-weight: 700; }
.tile p { color: var(--muted); max-width: 38ch; }
.tile__icon { font-size: 2.2rem; color: var(--cyan-ink); margin-bottom: auto; }
.tile--magenta { background: var(--magenta); border-color: var(--magenta); color: #fff; }
.tile--magenta p { color: #fde7ee; }
.tile--magenta .tile__icon { color: #fff; font-size: 3rem; }
.tile--magenta h3 { font-size: 1.6rem; }
.tile--yellow { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.tile--yellow p { color: #3a3212; }
.tile--yellow .tile__icon { color: var(--ink); }
.tile--photo { padding: 0; border: 0; min-height: 280px; }
.tile--photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile__over {
  position: relative; margin-top: auto; padding: 2rem; color: #fff;
  background: linear-gradient(to top, rgb(21 22 27 / .9), rgb(21 22 27 / .55) 60%, transparent);
}
.tile__over p { color: #e8eaee; }

/* Becas */
.becas { background: var(--ink); color: #fff; padding: 4.5rem 0; }
@media (min-width: 900px) { .becas { padding: 6rem 0; } }
.becas__grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 900px) { .becas__grid { grid-template-columns: .9fr 1.1fr; gap: 4rem; } }
.becas__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r); }
.becas .h2 { color: #fff; }
.beca { display: flex; gap: 1rem; padding: 1.25rem 0; border-top: 1px solid rgb(255 255 255 / .16); }
.beca:last-of-type { border-bottom: 1px solid rgb(255 255 255 / .16); margin-bottom: 2rem; }
.beca > i { font-size: 1.75rem; color: var(--yellow); flex: none; margin-top: .1rem; }
.beca + .beca > i { color: var(--cyan); }
.beca h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: .3rem; }
.beca p { color: #c9ccd3; max-width: 46ch; }

/* Requisitos */
.docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 600px) { .docs { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .docs { grid-template-columns: repeat(6, 1fr); } .doc { grid-column: span 2; } .doc:nth-child(4) { grid-column: 2 / span 2; } }
.doc {
  display: flex; gap: 1rem; align-items: center; padding: 1.25rem 1.25rem;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--cyan); border-radius: var(--r);
}
.doc:nth-child(3n+2) { border-left-color: var(--yellow); }
.doc:nth-child(3n) { border-left-color: var(--magenta); }
.doc i { font-size: 1.9rem; color: var(--text); flex: none; }
.doc strong { display: block; font-weight: 700; }
.doc span { font-size: .9rem; color: var(--muted); }

/* FAQ */
.faq { display: grid; gap: 1rem; }
@media (min-width: 900px) { .faq { grid-template-columns: .8fr 1.2fr; gap: 4rem; align-items: start; } }
.faq__list { border-top: 1px solid var(--line); }
.qa { border-bottom: 1px solid var(--line); }
.qa summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.25rem 0; font-weight: 600; font-size: 1.05rem;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary i { flex: none; font-size: 1.2rem; color: var(--accent); transition: transform 200ms var(--ease-out); }
.qa[open] summary i { transform: rotate(45deg); }
.qa__body { padding: 0 0 1.25rem; color: var(--muted); max-width: 60ch; }
@media (prefers-reduced-motion: no-preference) {
  .qa[open] .qa__body { animation: rise 260ms var(--ease-out); }
}

/* Inscripción */
.signup { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .signup { grid-template-columns: 1fr 1fr; gap: 5rem; align-items: start; } }
.signup__copy p { color: var(--muted); max-width: 42ch; }
.signup__phone {
  display: inline-flex; align-items: center; gap: .6rem; margin-top: 2rem;
  font-size: 1.9rem; font-weight: 800; text-decoration: none; color: var(--text);
}
.signup__phone i { color: #1f9d55; font-size: 2.2rem; }

.form {
  background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--magenta);
  border-radius: var(--r); padding: 2rem; display: grid; gap: 1.25rem; box-shadow: var(--shadow);
}
.field { display: grid; gap: .45rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.field label, .field legend { font-weight: 600; font-size: .92rem; padding: 0; }
.field input[type="text"], .field input[type="tel"], .field input[type="email"] {
  width: 100%; min-height: 48px; padding: 0 .9rem;
  font: 500 1rem "Montserrat", sans-serif; color: var(--text);
  background: var(--bg); border: 1.5px solid #878b94; border-radius: var(--r);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.field input:focus { outline: none; border-color: var(--cyan-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cyan) 40%, transparent); }
.field__opt { font-weight: 500; color: var(--muted); }
.field__hint { font-size: .82rem; color: var(--muted); }
.field__error { display: none; font-size: .85rem; font-weight: 600; color: #b3261e; }
.field.is-invalid input { border-color: #b3261e; }
.field.is-invalid .field__error { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .field__error { color: #ff8a80; } :root:not([data-theme="light"]) .field.is-invalid input { border-color: #ff8a80; } }
.choice { display: flex; gap: 1.5rem; }
.choice label { display: inline-flex; align-items: center; gap: .45rem; font-weight: 500; cursor: pointer; }
.choice input { accent-color: var(--magenta); width: 18px; height: 18px; }
.hp { position: absolute; left: -9999px; }
.form__legal { font-size: .8rem; color: var(--muted); text-align: center; }
.form__status { padding: .85rem 1rem; border-radius: var(--r); font-weight: 600; font-size: .92rem; }
.form__status--ok { background: #e3f3e8; color: #14532d; }
.form__status--error { background: #fbe4e2; color: #8a1c14; }

/* Footer */
.footer { background: var(--ink); color: #d6d9df; padding: 4rem 0 0; }
.footer__grid { display: grid; gap: 2.5rem; padding-bottom: 3rem; }
@media (min-width: 768px) { .footer__grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer__note { margin-top: 1rem; font-size: .9rem; max-width: 44ch; color: #a9aeb8; }
.footer__h { font-size: .95rem; font-weight: 700; color: #fff; margin-bottom: 1rem; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; font-size: .92rem; }
.footer a { text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.footer a:hover { color: var(--yellow); }
.footer__base {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem;
  padding-block: 1.25rem; border-top: 1px solid rgb(255 255 255 / .12); font-size: .8rem; color: #9097a3;
}

/* WhatsApp flotante */
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.9rem; color: #fff; background: #1f9d55;
  box-shadow: 0 10px 28px -8px rgb(0 0 0 / .45);
  transition: transform 160ms var(--ease-out);
}
.wa-float:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .wa-float:hover { transform: translateY(-2px); } }

/* Aparición al hacer scroll (solo si JS está activo) */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); transition-delay: calc(var(--i, 0) * 60ms); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { transform: none; transition: opacity 200ms ease; }
}
