/* Admisión TCI Fellows
   Paleta tomada del escudo: azul TCI, rojo de la banda superior y blanco. */

:root {
  --tci-blue: #00447e;
  --tci-deep: #06284a;
  --tci-red: #bc0723;
  --mist: #e9eff5;
  --paper: #ffffff;
  --ink: #12283d;
  --slate: #4b5d70;
  --line: #c9d6e3;

  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max: 1180px;

  /* Altura del iframe: cubre la primera sección completa del Google Form
     para evitar el doble scroll. Ajustar si se agregan o quitan preguntas. */
  --form-h: 4220px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--mist);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--tci-blue);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--tci-red);
  outline-offset: 3px;
  border-radius: 2px;
}

h1,
h2 {
  font-family: var(--sans);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  background: var(--paper);
  padding: 0.6rem 1rem;
}

.skip:focus {
  top: 1rem;
}

/* ---------- Hero ----------
   Foto del TCI Center for Growth a pantalla completa, escudo en una pestaña
   que cuelga del borde superior y un titular grande y ligero abajo. */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--paper);
  isolation: isolate;
  overflow: hidden;
}

.hero__photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 42% 40%;
}

/* Degradado en el azul profundo del escudo, no en negro. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom, rgba(6, 40, 74, 0.55) 0%, rgba(6, 40, 74, 0) 22%),
    linear-gradient(to top, rgba(6, 40, 74, 0.95) 0%, rgba(6, 40, 74, 0.82) 30%, rgba(6, 40, 74, 0.45) 52%, rgba(6, 40, 74, 0) 78%);
}

.hero__bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 var(--gutter);
}

.crest {
  display: block;
  width: 116px;
  padding: 1.1rem 0.9rem 0.9rem;
  background: var(--paper);
  border-top: 8px solid var(--tci-red);
  box-shadow: 0 10px 30px rgba(6, 40, 74, 0.25);
}

.crest img {
  width: 100%;
  height: auto;
}

.hero__nav {
  display: flex;
  margin-top: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.hero__nav-link {
  padding: 0.75rem 1.25rem;
  color: var(--paper);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.hero__nav-link + .hero__nav-link {
  border-left: 1px solid rgba(255, 255, 255, 0.7);
}

.hero__nav-link:hover {
  background: var(--paper);
  color: var(--tci-blue);
}

.hero__nav-link:focus-visible,
.hero__cta:focus-visible {
  outline-color: var(--paper);
}

.hero__content {
  display: flex;
  flex-direction: column;
  padding: 0 var(--gutter) clamp(1.5rem, 4vw, 2.75rem);
}

.hero__rule {
  order: -1;
  height: 1px;
  background: rgba(255, 255, 255, 0.45);
}

.hero__intro {
  order: -2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 3rem;
  padding-bottom: 1.5rem;
}

.hero__intro p {
  margin: 0;
  max-width: 24ch;
  font-size: clamp(1.4rem, 2.3vw, 2.15rem);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: #eef3f8;
}

.hero__cta {
  flex-shrink: 0;
  display: inline-block;
  padding: 0.95rem 1.5rem;
  background: var(--paper);
  color: var(--tci-blue);
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.15s;
}

.hero__cta:hover {
  background: var(--mist);
}

.hero__title {
  margin-top: 0.35em;
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(3.1rem, 9.4vw, 12.5rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
  color: #eef3f8;
}

/* Animaciones (GSAP, js/animaciones.js) */
.anim [data-anim-hide] {
  visibility: hidden;
}

.hero__title .hero__line {
  padding-bottom: 0.06em;
}

/* ---------- Formulario ---------- */

.apply {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5rem) var(--gutter);
  display: grid;
  grid-template-columns: minmax(280px, 370px) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

/* La columna ocupa todo el alto para que la guía pueda quedarse fija al bajar. */
.apply__guide {
  align-self: stretch;
}

/* Guía: bloque azul profundo con la banda del escudo, alineado con el marco del formulario. */
.guide {
  position: sticky;
  top: 1.5rem;
  background: var(--tci-deep);
  color: #c7d5e3;
  border-top: 10px solid var(--tci-red);
  box-shadow: inset 0 8px 0 var(--tci-blue);
  padding: 2rem 1.9rem 1.75rem;
}

.guide__title {
  font-weight: 400;
  font-size: clamp(1.9rem, 2.6vw, 2.3rem);
  line-height: 1;
  letter-spacing: -0.035em;
  color: #eef3f8;
}

.guide__lead {
  margin: 0.75rem 0 1.25rem;
  font-size: 1rem;
  line-height: 1.5;
}

/* Numerados porque siguen el orden real de las secciones del formulario. */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

.steps__item {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  column-gap: 0.75rem;
  padding: 0.7rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.steps__item::before {
  content: counter(step);
  grid-row: span 2;
  font-size: 1.75rem;
  font-weight: 300;
  line-height: 1;
  color: #7f9cba;
  font-variant-numeric: tabular-nums;
}

.steps__name {
  color: var(--paper);
  font-weight: 600;
  line-height: 1.3;
}

.steps__detail {
  font-size: 0.92rem;
  line-height: 1.4;
  color: #a9bdd1;
}

.guide__help {
  margin-top: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.45);
}

.guide__help p {
  margin: 0 0 0.75rem;
  color: var(--paper);
  font-weight: 600;
}

.guide__buttons {
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.guide__buttons a {
  flex: 1;
  padding: 0.75rem 1rem;
  text-align: center;
  color: var(--paper);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.guide__buttons a + a {
  border-left: 1px solid rgba(255, 255, 255, 0.7);
}

.guide__buttons a:hover {
  background: var(--paper);
  color: var(--tci-blue);
}

.guide__out {
  display: inline-block;
  margin-top: 1.1rem;
  color: #c7d5e3;
  font-size: 0.92rem;
}

.guide__out:hover {
  color: var(--paper);
}

.guide :focus-visible {
  outline-color: var(--paper);
}

/* El Google Form embebido tiene fondo transparente y tarjetas blancas,
   así que lo dejamos asentarse sobre el fondo de la página. */
.form-frame {
  position: relative;
  border-top: 10px solid var(--tci-red);
  box-shadow: inset 0 8px 0 var(--tci-blue);
  padding-top: 8px;
}

.form-frame iframe {
  display: block;
  width: 100%;
  height: var(--form-h);
  border: 0;
  background: var(--mist);
  /* El form centra sus tarjetas a 640–770px; limitamos el ancho para que no flote en un mar vacío. */
  max-width: 820px;
}

.form-frame__loading {
  position: absolute;
  top: 3rem;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  color: var(--slate);
}

.form-frame[data-state="ready"] .form-frame__loading {
  display: none;
}

.form-frame[data-state="loading"] iframe {
  opacity: 0;
}

/* ---------- Galería ---------- */

.gallery {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(3rem, 7vw, 5rem);
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0.75rem;
}

.gallery__item {
  position: relative;
  margin: 0;
  min-height: 0;
  overflow: hidden;
}

.gallery__item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__item--wide {
  grid-row: span 2;
  aspect-ratio: 3 / 2;
}

/* ---------- Footer ---------- */

.footer {
  background: var(--tci-deep);
  color: #a9bdd1;
  border-top: 10px solid var(--tci-red);
  box-shadow: inset 0 8px 0 var(--tci-blue);
}

.footer a {
  color: var(--paper);
}

.footer :focus-visible {
  outline-color: var(--paper);
}

.footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 4.5rem) var(--gutter) 2.5rem;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 3rem;
}

.footer__brand img {
  width: 190px;
  height: auto;
  margin-bottom: 1.75rem;
}

.footer__brand address {
  font-style: normal;
  font-size: 1rem;
  line-height: 1.55;
}

/* Cada contacto es una fila grande y tocable, separada por líneas finas. */
.footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 2rem;
  align-content: start;
}

.footer__links a {
  display: block;
  padding: 1rem 0 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.25;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.footer__links span {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  letter-spacing: 0;
  color: #8fa7bf;
}

.footer__links a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.footer__legal {
  width: calc(100% - 2 * var(--gutter));
  max-width: calc(var(--max) - 2 * var(--gutter));
  margin: 0 auto;
  padding: 1.25rem 0 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  color: #8fa7bf;
}

.footer__legal p {
  margin: 0;
}

.footer__legal a {
  color: #c7d5e3;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .apply {
    grid-template-columns: 1fr;
  }

  .guide {
    position: static;
  }

  .form-frame iframe {
    max-width: none;
  }

  .footer__inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  :root {
    --form-h: 4580px;
  }

  .crest {
    width: 84px;
    padding: 0.8rem 0.65rem 0.65rem;
    border-top-width: 6px;
  }

  .hero__nav {
    margin-top: 1rem;
  }

  .hero__nav-link--secondary {
    display: none;
  }

  .hero__nav-link {
    padding: 0.6rem 1rem;
  }

  .hero__intro {
    flex-direction: column;
    align-items: flex-start;
  }

  /* En móvil el form ocupa todo el ancho: sus propias tarjetas ya traen margen. */
  .apply {
    padding-left: 0;
    padding-right: 0;
  }

  .guide {
    padding: 2rem var(--gutter) 1.75rem;
  }

  .gallery {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }

  .gallery__item {
    aspect-ratio: 4 / 3;
  }

  .gallery__item--wide {
    grid-row: auto;
    grid-column: 1 / -1;
    aspect-ratio: 3 / 2;
  }

  .footer__inner {
    gap: 2.25rem;
    padding-top: 2.75rem;
  }

  .footer__inner {
    text-align: center;
  }

  .footer__brand img {
    width: 170px;
    margin: 0 auto 1.25rem;
  }

  .footer__links {
    grid-template-columns: 1fr;
  }

  .footer__links a {
    padding: 0.95rem 0 1rem;
  }

  .footer__legal {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1.75rem;
  }
}

/* En pantallas bajas la guía no cabe fija. */
@media (max-height: 760px) {
  .guide {
    position: static;
  }
}

@media (max-width: 360px) {
  :root {
    --form-h: 4820px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

}
