/* ============================================================
   TRANSFORMACIÓN EDUCATIVA — Sistema de diseño
   Paleta: teal (confianza), coral (cercanía), verde (crecimiento), crema (calidez)
   Objetivo de accesibilidad: WCAG 2.1 AA (AAA en textos principales)
   ============================================================ */

:root {
  /* Colores */
  --teal-900: #134e4a;
  --teal-700: #0f766e;
  --teal-100: #ccfbf1;
  --teal-50:  #f0fdfa;
  --coral-600: #c2410c;      /* acento con contraste AA sobre textos claros */
  --coral-500: #f97362;
  --coral-100: #ffe4dd;
  --verde-700: #3f6212;
  --verde-600: #4d7c0f;
  --verde-100: #ecfccb;
  --crema-50:  #fdfaf5;
  --tinta:     #1f2a37;
  --tinta-suave: #4b5563;
  --blanco:    #ffffff;

  /* Radios y sombras */
  --radio-lg: 20px;
  --radio-pill: 999px;
  --sombra: 0 6px 24px rgba(19, 78, 74, 0.10);
  --sombra-hover: 0 10px 30px rgba(19, 78, 74, 0.16);

  /* Tamaño tipográfico base ajustable (botón Aa) */
  --texto-base: 1.1rem;
}

/* ---------- Reset y base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html { scroll-padding-top: 84px; } /* compensa header sticky en anclas */

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--texto-base);
  line-height: 1.7;
  color: var(--tinta);
  background-color: var(--crema-50);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { line-height: 1.25; color: var(--teal-900); }

h2 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.2rem); margin: 0 0 .6em; }

p { margin: 0 0 1em; }

a { color: var(--teal-700); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--teal-900); }

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

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

.skip-link {
  position: absolute; left: 16px; top: -60px;
  background: var(--teal-900); color: var(--blanco);
  padding: 12px 20px; border-radius: 0 0 12px 12px;
  font-weight: 600; z-index: 100;
  transition: top .2s ease;
}
.skip-link:focus { top: 0; }

/* ---------- Header / navegación ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(253, 250, 245, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(19, 78, 74, .12);
}

.nav {
  max-width: 1120px; margin: 0 auto; padding: 5px 20px;
  display: flex; align-items: center; gap: 16px;
  min-height: 74px;
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--teal-900); font-weight: 700;
}

.brand__mark {
  display: block;
  width: 60px; height: 60px;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(19, 78, 74, .18);
}

.brand__name strong { color: var(--teal-700); }

.nav-menu {
  display: flex; gap: 2px; list-style: none; margin: 0 0 0 auto; padding: 0;
}

.nav-menu a {
  display: block; padding: 10px 12px; border-radius: var(--radio-pill);
  text-decoration: none; color: var(--tinta); font-weight: 600; font-size: .95rem;
  white-space: nowrap;
}
.nav-menu a:hover { background: var(--teal-100); color: var(--teal-900); }
.nav-menu a.nav-menu__cta {
  background: var(--teal-700); color: var(--blanco);
}
.nav-menu a.nav-menu__cta:hover { background: var(--teal-900); color: var(--blanco); }

.nav-toggle {
  display: none;
  width: 48px; height: 48px; border-radius: 12px; cursor: pointer;
  border: 2px solid var(--teal-700); background: var(--blanco);
  flex-direction: column; align-items: center; justify-content: center;
}
.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  content: ""; display: block; width: 22px; height: 2.5px;
  background: var(--teal-700); border-radius: 2px; position: relative;
  transition: transform .2s ease, top .2s ease, background-color .2s ease;
}
.nav-toggle__bar::before { position: absolute; top: -7px; }
.nav-toggle__bar::after  { position: absolute; top: 7px; }

/* Estado abierto: la hamburguesa se transforma en X */
.nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after  { top: 0; transform: rotate(-45deg); }

/* Resaltado visual de la sección activa (scrollspy) */
.nav-menu a.is-active {
  background: var(--teal-100);
  color: var(--teal-900);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-block;
  min-height: 52px; padding: 12px 28px;
  border-radius: var(--radio-pill); border: 2px solid transparent;
  font: inherit; font-weight: 700; font-size: 1.02rem;
  text-decoration: none; cursor: pointer; text-align: center;
}
.btn--primary { background: var(--teal-700); color: var(--blanco); }
.btn--primary:hover { background: var(--teal-900); color: var(--blanco); }
.btn--ghost { border-color: var(--teal-700); color: var(--teal-700); background: transparent; }
.btn--ghost:hover { background: var(--teal-50); }
.btn--lg { font-size: 1.12rem; padding: 14px 34px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 96px 20px 88px;
  background: linear-gradient(160deg, var(--teal-50) 0%, var(--crema-50) 70%);
}
.hero__blob {
  position: absolute; right: -140px; top: -120px;
  width: 480px; height: 480px; border-radius: 42% 58% 55% 45% / 50% 45% 55% 50%;
  background: radial-gradient(circle at 35% 35%, var(--coral-100) 0%, var(--teal-100) 60%);
  opacity: .8;
}
.hero__inner { position: relative; max-width: 860px; margin: 0 auto; }
.hero__kicker {
  font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--coral-600); font-size: .95rem;
}
.hero h1 { font-size: clamp(2.1rem, 1.4rem + 3.2vw, 3.2rem); margin: 0 0 .5em; }
.hero h1 .highlight {
  background: linear-gradient(transparent 62%, var(--coral-100) 62%);
}
.hero__lead { font-size: 1.18rem; color: var(--tinta-suave); max-width: 42ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 24px 0 28px; }

.hero__stats {
  display: flex; flex-wrap: wrap; gap: 12px; list-style: none; margin: 0; padding: 0;
}
.hero__stats li {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--blanco); border: 1.5px solid rgba(19, 78, 74, .15);
  padding: 10px 18px; border-radius: var(--radio-pill);
  font-weight: 600; color: var(--teal-900);
}

/* ---------- Secciones ---------- */
.section { padding: 84px 20px; }
.section--tinted { background: var(--teal-50); }
.section__inner { max-width: 1120px; margin: 0 auto; }
.section__lead { max-width: 62ch; color: var(--tinta-suave); font-size: 1.12rem; margin-bottom: 2.2em; }

/* ---------- Tarjetas ---------- */
.cards { display: grid; gap: 22px; }
.cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  background: var(--blanco);
  border-radius: var(--radio-lg);
  border: 1.5px solid rgba(19, 78, 74, .10);
  box-shadow: var(--sombra);
  padding: 28px;
}
.card__icon {
  width: 56px; height: 56px; display: grid; place-items: center;
  font-size: 1.6rem; border-radius: 16px; margin-bottom: 14px;
  background: var(--teal-100);
}
.card h3 { margin: 0 0 .5em; font-size: 1.2rem; }

.values { display: flex; flex-wrap: wrap; gap: 10px; margin: 2em 0 0; }
.chip {
  display: inline-block;
  background: var(--teal-100); color: var(--teal-900);
  font-weight: 600; font-size: .95rem;
  padding: 8px 16px; border-radius: var(--radio-pill);
}

/* Pilares (bloques de valor en Quiénes somos) */
.pillars {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px;
  margin: 2em 0 0;
}
.pillar {
  background: var(--blanco);
  border: 1.5px solid rgba(19, 78, 74, .10);
  border-radius: var(--radio-lg);
  box-shadow: var(--sombra);
  padding: 24px;
}
.pillar__icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  font-size: 1.4rem; border-radius: 14px;
  background: var(--teal-100);
  margin-bottom: 10px;
}
.pillar h3 { margin: 0 0 .4em; font-size: 1.08rem; }
.pillar p { margin: 0; color: var(--tinta-suave); font-style: italic; }

/* ---------- Áreas de capacitación ---------- */
.area {
  background: var(--blanco);
  border-radius: var(--radio-lg);
  border: 1.5px solid rgba(19, 78, 74, .10);
  box-shadow: var(--sombra);
  padding: 28px;
  display: flex; flex-direction: column;
}
.area--highlight { border: 2px solid var(--verde-600); }
.area__head { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; margin-bottom: 14px; }
.area__icon {
  grid-row: 1 / span 2;
  width: 56px; height: 56px; display: grid; place-items: center;
  font-size: 1.6rem; border-radius: 16px; background: var(--teal-100);
}
.area--highlight .area__icon { background: var(--verde-100); }
.area__head h3 { margin: 0; font-size: 1.2rem; }
.area__sub { margin: 4px 0 0; color: var(--tinta-suave); font-size: .98rem; grid-column: 2; }

.area__topics { margin: 0 0 12px; padding-left: 1.2em; }
.area__topics li { margin-bottom: 6px; }

/* Subgrupos dentro de cada área (Programas y talleres) */
.area__group h4 {
  margin: 16px 0 4px;
  font-size: 1.02rem;
  color: var(--teal-900);
}
.area__group:first-of-type h4 { margin-top: 6px; }
.area__group ul { margin: 0; padding-left: 1.2em; }
.area__group li { margin-bottom: 4px; }

/* Colapso de listas largas (máx. 6 ítems visibles) */
.area__topics[data-collapsed="true"] li:nth-child(n+7) { display: none; }

.link-more {
  align-self: flex-start; margin-top: auto;
  background: none; border: none; cursor: pointer;
  color: var(--teal-700); font: inherit; font-weight: 700;
  padding: 10px 0; min-height: 44px; text-align: left;
}
.link-more:hover { color: var(--teal-900); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ---------- Testimonios ---------- */
.testimonial {
  margin: 0; padding: 28px;
  background: var(--blanco);
  border-radius: var(--radio-lg);
  border-top: 6px solid var(--coral-500);
  box-shadow: var(--sombra);
}
.testimonial blockquote {
  margin: 0 0 14px; font-size: 1.08rem; color: var(--tinta);
}
.testimonial figcaption { color: var(--tinta-suave); font-size: .98rem; }
.testimonial figcaption strong { color: var(--teal-900); }

/* ---------- Aguja CTA (Agenda) ---------- */
.agenda { max-width: 1120px; margin: 0 auto; }
.agenda__inner {
  background: linear-gradient(140deg, var(--teal-700), var(--teal-900));
  color: var(--blanco);
  border-radius: var(--radio-lg);
  padding: 56px 40px;
  text-align: center;
}
.agenda__inner h2 { color: var(--blanco); }
.agenda__steps {
  max-width: 560px; margin: 1.6em auto 2em; padding-left: 1.4em; text-align: left;
  font-size: 1.1rem;
}
.agenda__steps li { margin-bottom: 12px; }
.agenda__inner .btn--primary { background: var(--blanco); color: var(--teal-900); }
.agenda__inner .btn--primary:hover { background: var(--teal-100); color: var(--teal-900); }

/* ---------- Formulario ---------- */
.form {
  max-width: 720px; margin: 0 auto;
  background: var(--blanco);
  border-radius: var(--radio-lg);
  border: 1.5px solid rgba(19, 78, 74, .10);
  box-shadow: var(--sombra);
  padding: 36px;
}
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form__field { margin-bottom: 18px; }
.form__field label {
  display: block; font-weight: 700; margin-bottom: 6px; color: var(--teal-900);
}
.form__optional { font-weight: 500; color: var(--tinta-suave); font-size: .95rem; }
.form__field input,
.form__field select,
.form__field textarea {
  width: 100%;
  min-height: 52px; padding: 12px 16px;
  font: inherit; color: var(--tinta);
  border: 2px solid rgba(19, 78, 74, .25);
  border-radius: 14px; background: var(--blanco);
}
.form__field textarea { min-height: 140px; resize: vertical; }
.form__field input:focus,
.form__field select:focus,
.form__field textarea:focus {
  border-color: var(--teal-700);
  outline: 3px solid rgba(15, 118, 110, .25);
  outline-offset: 2px;
}
.form__field input[aria-invalid="true"],
.form__field select[aria-invalid="true"],
.form__field textarea[aria-invalid="true"] { border-color: #b3261e; }

.form__error { color: #8f1d16; font-weight: 600; margin: 6px 0 0; }
.form__hint { color: var(--tinta-suave); font-size: .98rem; margin: 14px 0 0; }

/* ---------- Canales de contacto (WhatsApp / teléfono) ---------- */
.contact-channels {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px;
  max-width: 860px; margin: 0 auto 32px;
}
.channel {
  display: flex; align-items: center; gap: 14px;
  background: var(--blanco);
  border: 2px solid rgba(19, 78, 74, .12);
  border-radius: var(--radio-lg);
  padding: 16px 20px;
  text-decoration: none; color: var(--tinta);
  box-shadow: var(--sombra);
  transition: transform .15s ease, box-shadow .15s ease;
}
.channel:hover { transform: translateY(-3px); box-shadow: var(--sombra-hover); }
.channel__icon {
  flex: 0 0 auto;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 16px;
}
.channel__icon--whatsapp { background: #25d366; color: #0b3d2c; }
.channel__icon--tel { background: var(--teal-100); color: var(--teal-900); }
.channel__icon--mail { background: var(--coral-100); color: var(--coral-600); }
.channel__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.channel__text strong { color: var(--teal-900); font-size: 1.05rem; }
.channel__text span { color: var(--tinta-suave); font-size: .95rem; overflow-wrap: anywhere; }

.modalidades__note {
  max-width: 62ch; margin: 2em auto 0; text-align: center;
  font-size: 1.1rem; color: var(--tinta-suave);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--teal-900); color: rgba(255, 255, 255, .92);
  padding: 48px 20px; text-align: center;
}
.site-footer a { color: var(--teal-100); }
.site-footer__inner { max-width: 720px; margin: 0 auto; }
.site-footer__logo {
  display: block;
  width: min(340px, 82%);
  margin: 0 auto 16px;
  border-radius: 20px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .22);
}
.site-footer__small { font-size: .9rem; color: rgba(255, 255, 255, .7); margin-top: 18px; }

/* ---------- Botón "Volver arriba" ---------- */
.to-top {
  position: fixed;
  right: 22px; bottom: 96px;
  z-index: 60;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: var(--teal-700); color: var(--blanco);
  box-shadow: 0 6px 20px rgba(19, 78, 74, .35);
  cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease, background-color .2s ease;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--teal-900); }
.to-top:focus-visible { outline: 3px solid var(--coral-600); outline-offset: 3px; }

/* ---------- Botón flotante de WhatsApp ---------- */
.wa-float {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 60;
  width: 62px; height: 62px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #25d366;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(18, 140, 126, .45);
  transition: transform .15s ease, box-shadow .15s ease, opacity .2s ease;
}
/* Oculto mientras el menú móvil está abierto (no tapa opciones) */
body.menu-open .wa-float { opacity: 0; pointer-events: none; }
.wa-float:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 26px rgba(18, 140, 126, .55);
  color: #ffffff;
}
.wa-float svg { display: block; }
.wa-float:focus-visible { outline: 3px solid var(--coral-600); outline-offset: 3px; }

@media (max-width: 480px) {
  .wa-float { width: 56px; height: 56px; right: 16px; bottom: 16px; }
  .wa-float svg { width: 28px; height: 28px; }
  .to-top { right: 16px; bottom: 84px; }
}

/* ---------- Responsivo ---------- */
@media (max-width: 1000px) {
  .cards--3, .cards--2 { grid-template-columns: 1fr; }
  .form__row { grid-template-columns: 1fr; }
  .contact-channels { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: 1fr; }
  .section { padding: 64px 20px; }

  /* Menú móvil */
  .nav-toggle { display: flex; margin-left: auto; }
  .nav { flex-wrap: wrap; min-height: 64px; }
  .brand__mark { width: 52px; height: 52px; }
  .nav-menu {
    order: 5;
    flex-basis: 100%;
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 10px 0 14px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
  }
  .nav-menu.is-open { display: flex; }
  .nav-menu a { font-size: 1.08rem; padding: 14px 16px; }
}

@media (max-width: 480px) {
  .hero { padding: 64px 18px; }
  .hero__actions .btn { flex-basis: 100%; }
  .agenda__inner { padding: 40px 22px; }
  .form { padding: 24px 18px; }
}
