/* ============================================================
   AROCA CONSULTING — Estilos globales y componentes
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  font-family: var(--font-brand);
  font-size: var(--fs-body-lg);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body-lg);
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  max-width: 100%;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul { list-style: none; padding: 0; }
h1, h2, h3, h4 { font-weight: var(--fw-black); color: var(--ink); line-height: 1.15; overflow-wrap: break-word; }

/* ---------- Accesibilidad: foco visible global ---------- */
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* Skip link: visible solo al enfocar con teclado */
.skip-link {
  position: absolute;
  left: var(--gutter, 16px);
  top: 0;
  z-index: 10000;
  padding: 12px 18px;
  background: var(--navy);
  color: var(--white);
  font-weight: var(--fw-bold, 700);
  font-size: var(--fs-body);
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease-out, ease);
  border-radius: 2px;
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(12px);
  outline: 2px solid var(--green);
  outline-offset: 2px;
  color: var(--white);
}

/* Anclas bajo el header sticky */
#main-content,
#metodologia,
.svc-row[id],
.legal__doc-section[id] {
  scroll-margin-top: 110px;
}

/* Menú móvil abierto: bloquear scroll del body */
body.nav-open { overflow: hidden; }

/* ---------- Reveal al hacer scroll ---------- */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity var(--dur-reveal) ease, transform var(--dur-reveal) var(--ease-out);
  }
  [data-reveal].is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- Utilidades de layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  min-width: 0;
}
.section { padding-block: var(--section-y); }
.section--tint { background: var(--bg-subtle); }
.eyebrow {
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  color: var(--muted);
}
.section-title {
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  color: var(--ink);
}
.section-lead {
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body-lg);
  color: var(--text);
  width: 593px;
  max-width: 100%;
  margin-top: var(--sp-16);
}
.text-green { color: var(--green); }
.text-navy  { color: var(--navy); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  gap: 10px;
  padding: 14px 30px;
  font-size: 19px;
  font-weight: var(--fw-bold);
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.is-loading,
.btn.is-sent { opacity: 1; cursor: default; }
.btn.is-loading,
.btn.is-sent,
.btn.is-error {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn.is-sent {
  background: var(--green) !important;
  border-color: var(--green) !important;
  color: var(--white) !important;
}
.btn.is-sent:hover:not(:disabled) {
  background: var(--green-dark) !important;
  border-color: var(--green-dark) !important;
  color: var(--white) !important;
  transform: none;
}
.btn.is-error {
  border-color: #e5484d !important;
  color: #e5484d !important;
  background: #fff !important;
}
.btn__ico {
  display: inline-flex;
  flex: none;
  line-height: 0;
}
.btn__ico--spin {
  animation: btnSpin 0.7s linear infinite;
}
@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

.form__feedback {
  margin: 0 0 var(--sp-16);
  padding: 12px 14px;
  font-size: var(--fs-small);
  line-height: 1.45;
  border: 1px solid var(--border);
}
.form__feedback--error {
  color: #8b1e22;
  background: #fff5f5;
  border-color: #f0b4b6;
}

/* Toast global — esquina superior derecha (móvil: ancho completo arriba) */
.toast-host {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 14px 14px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-hover);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out);
}
.toast.is-in {
  opacity: 1;
  transform: translateY(0);
}
.toast.is-leaving {
  opacity: 0;
  transform: translateY(-8px);
}
.toast--success { border-left: 3px solid var(--green); }
.toast--error { border-left: 3px solid #e5484d; }
.toast__mark {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: var(--fw-bold);
  flex: none;
}
.toast--success .toast__mark {
  background: rgba(0, 191, 99, 0.12);
  color: var(--green-dark);
}
.toast--error .toast__mark {
  background: rgba(229, 72, 77, 0.12);
  color: #c23438;
}
.toast__title {
  margin: 0 0 4px;
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  color: var(--navy);
  line-height: 1.3;
}
.toast__text {
  margin: 0;
  font-size: var(--fs-small);
  color: var(--text);
  line-height: 1.45;
}
.toast__close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted-2);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  margin-top: -2px;
}
.toast__close:hover { color: var(--navy); }
.toast__close:focus-visible {
  outline: none;
  box-shadow: var(--ring-navy);
}

@media (max-width: 600px) {
  .toast-host {
    left: 16px;
    right: 16px;
    width: auto;
  }
}
.btn--primary { background: var(--green); color: var(--white); }
.btn--primary:hover:not(:disabled) { background: var(--green-dark); transform: translateY(-1px); }
.btn--primary:active:not(:disabled) { transform: translateY(1px); }
.btn--primary:focus-visible { outline: none; box-shadow: var(--ring-green); }
.btn--outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn--outline:hover:not(:disabled) { background: var(--navy); color: var(--white); }
.btn--outline:focus-visible { outline: none; box-shadow: var(--ring-navy); }
.btn--navy { background: var(--navy); color: var(--white); }
.btn--navy:hover:not(:disabled) { background: #013a75; transform: translateY(-1px); }
.btn--navy:focus-visible { outline: none; box-shadow: var(--ring-navy); }
/* CTA primario sobre fondo navy → halo blanco para contraste */
.cta-band .btn--primary:focus-visible { box-shadow: var(--ring-white); }
.btn--block { display: flex; width: 100%; }
.btn .ico { font-size: 18px; transition: transform var(--dur-fast) ease; }

/* Enlace con flecha (Explorar Servicio →) */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: var(--fw-bold);
  color: var(--navy);
  transition: gap var(--transition), color var(--transition);
}
.link-arrow .ico { font-size: 17px; }
.link-arrow:hover { gap: 16px; color: var(--green); }
.link-arrow--green { color: var(--green); }

/* Icono monocromo recoloreable vía máscara (hereda currentColor) */
.ico {
  display: inline-block;
  width: 1em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask: var(--i) no-repeat center / contain;
  mask: var(--i) no-repeat center / contain;
  flex: none;
}
/* Rutas relativas al CSS (portables en cualquier subdirectorio de hosting) */
.ico--trending-down  { --i: url(../assets/icons/trending-down.svg); }
.ico--money-off      { --i: url(../assets/icons/money-off.svg); }
.ico--rule-folder    { --i: url(../assets/icons/rule-folder.svg); }
.ico--account-balance{ --i: url(../assets/icons/account-balance.svg); }
.ico--real-estate    { --i: url(../assets/icons/real-estate.svg); }
.ico--account-tree   { --i: url(../assets/icons/account-tree.svg); }
.ico--trending-up    { --i: url(../assets/icons/trending-up.svg); }
.ico--wallet         { --i: url(../assets/icons/wallet.svg); }
.ico--arrow          { --i: url(../assets/icons/arrow-forward.svg); }
.ico--forum          { --i: url(../assets/icons/forum.svg); }
.ico--call           { --i: url(../assets/icons/call.svg); }
.ico--mail           { --i: url(../assets/icons/mail.svg); }
.ico--location       { --i: url(../assets/icons/location.svg); }
.ico--add            { --i: url(../assets/icons/add.svg); }

/* Icono cuadrado de tarjeta */
.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: var(--bg-subtle);
  flex: none;
}
.icon-badge { color: var(--navy); }
.icon-badge .ico { font-size: 30px; }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
/* El borde y sombra solo aparecen al hacer scroll (header pegado) */
.site-header.is-stuck {
  border-bottom-color: var(--border-navy);
  box-shadow: var(--shadow-nav);
}
/* Al hacer scroll (.is-stuck) el header se COMPACTA ~12%: logo, tipografía del nav y
   botón, con transición suave. */
.nav { transition: min-height var(--dur-mid) var(--ease-out); }
.nav__logo img { transition: height var(--dur-mid) var(--ease-out); }
.nav__links,
.nav__links a { transition: color var(--transition), font-size var(--dur-mid) var(--ease-out); }
.nav__cta {
  transition: background var(--transition), color var(--transition), border-color var(--transition),
              transform var(--transition), padding var(--dur-mid) var(--ease-out), font-size var(--dur-mid) var(--ease-out);
}
.site-header.is-stuck .nav { min-height: 80px; }
.site-header.is-stuck .nav__logo img { height: calc(50px * 0.88); }
.site-header.is-stuck .nav__links { font-size: calc(21px * 0.88); }
.site-header.is-stuck .nav__cta { padding: 12px 27px; font-size: calc(19px * 0.88); }
.nav {
  position: relative;   /* ancla del panel del menú móvil */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-32);
  min-height: 92px;
}
.nav__logo img { height: 50px; width: auto; aspect-ratio: 237.153 / 59.445; }
/* Bloque enlaces + CTA (en escritorio va pegado a la derecha) */
.nav__menu {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: var(--sp-32);
}
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--sp-32);
  font-size: 21px;
  font-weight: var(--fw-medium);
  color: var(--ink);
}
.nav__links a { position: relative; transition: color var(--transition); }
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-fast) var(--ease-out);
}
.nav__links a:hover, .nav__links a.is-active { color: var(--green); }
.nav__links a:hover::after, .nav__links a.is-active::after { transform: scaleX(1); }
.nav__cta { margin-left: var(--sp-8); }
.nav__toggle { display: none; background: none; border: 0; padding: 8px; }
.nav__toggle span {
  display: block; width: 26px; height: 2px; background: var(--navy);
  transition: transform var(--dur-mid) var(--ease-out), opacity var(--dur-fast) ease, background var(--dur-fast) ease;
}
.nav__toggle span + span { margin-top: 6px; }
.nav__toggle:hover span { background: var(--green); }
.nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.is-open .nav__toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
/* La sección se limita al ancho de diseño (1700px) y se centra: más allá de ese
   ancho aparecen márgenes blancos simétricos y el clip-path/foto dejan de escalarse
   (no se deforman). Por debajo de 1700px ocupa todo el ancho de forma fluida. */
/* El hero ocupa TODO el ancho (sin tope): en monitores muy anchos la foto se extiende
   lejos hacia la derecha; el CONTENIDO se mantiene contenido/centrado por .container.
   La foto no se distorsiona porque el recorte diagonal es de tamaño fijo (px). */
.hero { position: relative; overflow: hidden; background: var(--white); }
.hero__inner {
  position: relative;
  z-index: 1;
  padding-block: clamp(48px, 6vw, 104px);
}
.hero__content { max-width: 663px; }
/* Foto a sangre completa por la DERECHA: su borde izquierdo se ancla junto al texto
   (~30px después de la columna de contenido, gap constante en todo ancho) y se extiende
   hasta el borde derecho de la pantalla. Así en monitores anchos crece hacia la derecha
   y en pantallas chicas/medianas se sale por el borde. */
.hero__media {
  position: absolute;
  top: 0;
  right: 0;                 /* sangra al borde derecho de la pantalla */
  bottom: 0;
  /* La foto ocupa ~56% del ancho (borde izquierdo al 44%). El max() con la referencia
     de .container es un PISO de seguridad: en monitores chicos/medianos impide que el
     borde opaco de la foto (tras la diagonal) se monte sobre la columna de texto. */
  left: max(42%, calc((100% - min(100%, var(--container))) / 2 + var(--gutter) + 525px));
  z-index: 0;
  overflow: hidden;
  /* Geometría medida sobre el render de Figma: punta (vértice) a 18% de altura.
     Los puntos X se fijan en px (no en %) para que la muesca conserve el mismo
     tamaño y ángulo aunque cambie el ancho de la imagen al alejar/agrandar el sitio. */
  clip-path: polygon(0% 0%, 240px 18%, 130px 100%, 100% 100%, 100% 0%);
}
/* Cuadrícula fina dibujada con CSS (nítida y escalable, sin imagen) DETRÁS del texto y
   del logo — solo escritorio. Retícula compartida vía --hero-grid-img; con
   background-attachment:fixed la cuadrícula del header y la del hero quedan ALINEADAS
   (continuas). Variables para ajustar tamaño de celda e intensidad. */
.page-home {
  --hero-grid-cell: 16px;                          /* tamaño de la cuadrícula (más pequeño = celdas más finas) */
  --hero-grid-line: rgba(64, 84, 120, 0.55);       /* color de las líneas */
  --hero-grid-op: 0.10;                            /* intensidad global (arriba); la máscara la lleva a 0 abajo */
  --hero-grid-img:
    repeating-linear-gradient(to right,  var(--hero-grid-line) 0 1px, transparent 1px var(--hero-grid-cell)),
    repeating-linear-gradient(to bottom, var(--hero-grid-line) 0 1px, transparent 1px var(--hero-grid-cell));
}
.hero__texture { display: none; }
@media (min-width: 1201px) {
  .hero__texture {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;                 /* detrás del contenido (z1) y detrás de la foto (z0, posterior en el DOM) → nunca cubre la foto */
    pointer-events: none;
    background-image: var(--hero-grid-img);
    background-attachment: fixed;
    /* Recorte diagonal amplio, a la derecha de la diagonal de la foto: la foto tapa el
       sobrante, así el borde visible de la cuadrícula coincide con la diagonal de la foto */
    clip-path: polygon(0 0, 72% 0, 62% 100%, 0 100%);
    opacity: var(--hero-grid-op, 0.35);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0) 78%);
            mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0) 78%);
  }
  /* La MISMA retícula detrás del logo/header (solo inicio): background-attachment:fixed
     la alinea con la del hero. Va sobre el fondo blanco del header pero DEBAJO del logo
     y del nav (z-index:-1). Se oculta al hacer scroll (header queda limpio). */
  .page-home .site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: var(--hero-grid-img);
    background-attachment: fixed;
    /* Cuadrícula a lo ANCHO de todo el header (sin recorte) */
    opacity: var(--hero-grid-op, 0.32);
  }
  .page-home .site-header.is-stuck::before { display: none; }
}
.hero__title {
  font-size: var(--fs-hero);
  line-height: var(--lh-hero);
  font-weight: var(--fw-bold);   /* Figma: hero en Bold, no Black */
  color: var(--ink);
  overflow-wrap: break-word;
}
/* En escritorio: 64px como Figma; el ancho de 663px del contenido lo parte en 4 líneas */
@media (min-width: 1201px) {
  .hero__title { font-size: clamp(54px, 4.4vw, 64px); line-height: 1.1; }
}
.hero__lead {
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body-lg);
  color: var(--text);
  margin-top: var(--sp-24);
  max-width: 40ch;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-16);
  margin-top: var(--sp-40);
}
.hero__media img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transition: transform var(--dur-mid) var(--ease-out);
}
.hero__media:hover img { transform: scale(1.05); }

/* Stats */
.stats {
  display: inline-flex;
  align-items: stretch;
  margin-top: var(--sp-48);
  padding-top: var(--sp-32);
  border-top: 1px solid var(--border);
}
.stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-inline: 32px;
}
.stat:first-child { padding-left: 0; }
.stat:last-child  { padding-right: 0; }
/* Barra vertical entre columnas */
.stat + .stat { border-left: 1px solid var(--border); }
.stat__num {
  font-size: var(--fs-display);
  font-weight: var(--fw-black);
  color: var(--navy);
  line-height: 1;
}
.stat__label {
  display: block;
  margin-top: var(--sp-8);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  color: var(--muted);
  white-space: nowrap;
}

/* ============================================================
   TARJETAS (problemas / pilares)
   ============================================================ */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-32);
  margin-top: var(--sp-48);
}
.card {
  background: var(--white);
  border: 1px solid var(--border-navy);
  padding: var(--sp-48);
  display: flex;
  flex-direction: column;
  transition: transform var(--dur-mid) var(--ease-out),
              box-shadow var(--dur-mid) var(--ease-out),
              border-color var(--dur-fast) ease;
}
.card:hover {
  transform: translateY(-4px);
  /* Sombra suave (antes --shadow-hover 0 16px 40px 0.10 se veía agresiva) */
  box-shadow: 0 6px 16px rgba(0, 40, 82, 0.06);
  border-color: var(--navy);
}
.card:focus-within {
  box-shadow: var(--shadow-card);
  border-color: var(--green);
}
.card__title {
  font-size: var(--fs-card);
  line-height: var(--lh-card);
  font-weight: var(--fw-bold);
  color: var(--ink);
  margin-top: var(--sp-32);
}
.card__text {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  margin-top: var(--sp-16);
}
.card__foot { margin-top: auto; padding-top: var(--sp-24); }

/* Tarjeta clicable → WhatsApp (enlace a pantalla completa) */
.card--clickable { position: relative; cursor: pointer; }
.card--clickable .card__wa {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}
.card--clickable .card__wa:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

/* Tarjeta destacada autodiagnóstico */
.card--accent {
  background: rgba(0, 191, 99, 0.04);
  border: 1px dashed var(--green);
  align-items: center;
  justify-content: center;
  text-align: center;
}
.card--accent:hover { background: rgba(0, 191, 99, 0.07); border-color: var(--green); }
.card__icon { color: var(--green); line-height: 0; }
.card__icon img { height: 56px; width: auto; display: block; }
.card--accent .card__title { margin-top: var(--sp-24); }
.card--accent .card__foot { margin-top: var(--sp-32); padding-top: 0; }

/* Pilares: variante con más aire y CTA inferior */
.pillars-grid .card { padding-block: var(--sp-48); }

/* ============================================================
   RESULTADOS (metodología)
   ============================================================ */
.results__grid {
  display: grid;
  grid-template-columns: 0.85fr 1fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
  min-width: 0;
}
.results__content { min-width: 0; }
.results__media { aspect-ratio: 3 / 4; overflow: hidden; min-width: 0; }
.results__media img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transition: transform var(--dur-mid) var(--ease-out);
}
.results__media:hover img { transform: scale(1.04); }
.steps { margin-top: var(--sp-32); display: grid; gap: var(--sp-16); }
.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-24);
  align-items: start;
  padding: var(--sp-24);
  border: 1px solid var(--border);
  transform: translateX(0);
  /* Salida rápida al desactivar */
  transition:
    border-color var(--dur-fast) ease,
    box-shadow 190ms var(--ease-out),
    transform 190ms var(--ease-out);
}
.step--active,
.step:hover {
  border-color: var(--green);
  box-shadow: var(--shadow-card);
  transform: translateX(8px);
  /* Entrada suave al activar */
  transition:
    border-color var(--dur-fast) ease,
    box-shadow 520ms var(--ease-out),
    transform 520ms var(--ease-out);
}
.step__num {
  font-size: var(--fs-hero);
  font-weight: var(--fw-black);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px #c5c5c5;
  transition: color 150ms ease, -webkit-text-stroke 150ms ease;
}
.step--active .step__num,
.step:hover .step__num {
  color: var(--green);
  -webkit-text-stroke: 0;
  transition: color 480ms var(--ease-out), -webkit-text-stroke 480ms var(--ease-out);
}
.step__title { font-size: var(--fs-card); font-weight: var(--fw-bold); color: var(--ink); }
.step__text { font-size: var(--fs-body); line-height: var(--lh-body); color: var(--text); margin-top: 6px; }

/* ============================================================
   CONTACTO (bloque en Inicio y página)
   ============================================================ */
.contact__grid {
  display: grid;
  grid-template-columns: 0.85fr 1fr;
  gap: clamp(32px, 5vw, 80px);
}
.contact-method {
  border: 1px solid var(--border-navy);
  background-color: var(--white);
  padding: var(--sp-32);
}
.contact-method + .contact-method { margin-top: var(--sp-24); }
.contact-method__head { display: flex; align-items: center; gap: 14px; }
.contact-method__head .icon-badge { width: 44px; height: 44px; background: transparent; }
.contact-method__head .icon-badge .ico { font-size: 26px; }
.icon-badge--green { color: var(--green); }
.contact-method__title { font-size: var(--fs-card); font-weight: var(--fw-bold); color: var(--ink); }
.contact-method__text { font-size: var(--fs-body); color: var(--text); margin: 10px 0 20px; }

/* Formulario (tarjeta) */
.form {
  display: grid;
  gap: var(--sp-24);
  border: 1px solid var(--border-navy);
  padding: var(--sp-48);
  background: var(--white);
}
.form__title { font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: var(--fw-bold); color: var(--ink); }
.field { display: grid; gap: 8px; align-content: start; }
.field label { font-size: var(--fs-body); color: var(--text); }
.field input:not([type="hidden"]),
.field select,
.field textarea {
  box-sizing: border-box;
  font: inherit;
  font-size: var(--fs-body);
  line-height: 1.35;
  color: var(--ink);
  background: rgba(0, 124, 255, 0.02);
  border: 1px solid var(--border-navy);
  border-radius: var(--radius);
  width: 100%;
  max-width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:not([type="hidden"]),
.field select {
  height: 52px;
  min-height: 52px;
  padding: 0 24px;
}
.field textarea {
  min-height: 200px;
  padding: 15px 24px;
  resize: vertical;
}
.field input::placeholder,
.field textarea::placeholder { color: rgba(0, 0, 0, 0.5); }
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: #c9d3e0; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--green);
  /* Anillo completo (evita recorte lateral por overflow de padres) */
  box-shadow: 0 0 0 3px rgba(0, 191, 99, 0.22);
}
/* Espacio interno para que el aura no se recorte */
.form,
.svc-contact__form,
.ad-cta__form {
  overflow: visible;
}
.form__row,
.field {
  overflow: visible;
}
/* Evita que el autofill del navegador cambie la altura visual */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 52px rgba(0, 124, 255, 0.02) inset;
  transition: background-color 99999s ease-out;
}
.field input:-webkit-autofill:focus {
  border-color: var(--green);
  -webkit-box-shadow:
    0 0 0 52px rgba(0, 124, 255, 0.02) inset,
    0 0 0 3px rgba(0, 191, 99, 0.22);
}
.form__note { font-size: var(--fs-small); color: var(--muted-2); text-align: center; }

/* Honeypot anti-bots: fuera del flujo, del tab y del árbol accesible */
.hp-field {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.hp-field input {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ============================================================
   CTA BAND
   ============================================================ */
.cta-band { background: var(--navy); color: var(--white); text-align: center; }
.cta-band__inner { padding-block: clamp(56px, 7vw, 96px); }
.cta-band__title {
  font-size: var(--fs-hero);
  line-height: var(--lh-hero);
  color: var(--white);
  max-width: 30ch;
  margin-inline: auto;
  text-wrap: balance;
}
.cta-band__text {
  font-size: var(--fs-body-lg);
  color: #fefefe;
  max-width: 52ch;
  margin: var(--sp-24) auto var(--sp-40);
}

/* ============================================================
   FOOTER
   ============================================================ */
/* Footer (Figma 123:366): columnas sobre BLANCO + banda inferior tintada full-bleed */
.site-footer { background: var(--white); }
.footer__grid {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr;
  gap: clamp(32px, 4vw, 64px);
  padding-block: clamp(56px, 6vw, 107px);
}
.footer__col h4 {
  font-size: var(--fs-card);
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-bottom: var(--sp-24);
}
.footer__col ul { display: grid; gap: 16px; }
.footer__col a { color: var(--text); transition: color var(--transition); }
.footer__col a:hover { color: var(--green); }
/* Columna de contacto: iconos navy en línea con el texto navy */
.footer__contact li { display: flex; align-items: center; gap: 12px; color: var(--navy); font-weight: var(--fw-medium); }
.footer__contact .ico { font-size: 20px; color: var(--navy); flex: none; }
.footer__contact a { color: var(--navy); }
.footer__contact a:hover { color: var(--green); }

/* Banda inferior tintada, a sangre completa (color y borde exactos de Figma) */
.footer__band {
  background: rgba(0, 124, 255, 0.02);
  border-top: 1px solid rgba(0, 40, 82, 0.1);
}
.footer__band-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-40);
  padding-top: clamp(48px, 5vw, 80px);
}
.footer__brand { display: flex; flex-direction: column; gap: var(--sp-24); max-width: 566px; }
.footer__brand img {
  height: calc(44px * 1.3);
  width: auto;
  flex: none;
  align-self: flex-start;
  aspect-ratio: 237.153 / 59.445;
}
.footer__brand p { color: var(--text); }
.footer__copy {
  flex: none;
  align-self: flex-end;
  text-align: right;
  color: var(--muted-2);
  font-size: var(--fs-body);
  line-height: 1.6;
}
.footer__divider { border: 0; border-top: 1px solid var(--border); margin-block: clamp(32px, 4vw, 48px); }
.footer__legal { display: flex; gap: var(--sp-32); padding-bottom: clamp(40px, 5vw, 48px); font-size: var(--fs-body); }
.footer__legal a { color: var(--text); transition: color var(--transition); }
.footer__legal a:hover { color: var(--green); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* El hero con foto a sangre y recorte diagonal necesita ancho; por debajo de
   1200px se apila (texto arriba, foto banner abajo) para evitar solapes. */
@media (max-width: 1200px) {
  .hero { display: flex; flex-direction: column; }
  .hero__inner { order: 1; }
  .hero__content { max-width: none; }
  .hero__lead { max-width: 52ch; }
  .hero__media::after { display: none; }   /* textura de cuadrícula solo en escritorio */
  .hero__media {
    order: 2;
    position: static;
    /* Alinea el banner con el contenido de arriba (mismos márgenes que el
       .container): no se pega a los bordes de la pantalla */
    width: auto;
    margin-inline: calc((100% - min(100%, var(--container))) / 2 + var(--gutter));
    aspect-ratio: 16 / 10;
    clip-path: none;
  }
}

@media (max-width: 1024px) {
  :root { --fs-hero: 44px; --fs-display: 34px; --fs-cta: 40px; }
  .nav__links { gap: var(--sp-24); }              /* 769–1024: evita desborde */
  .results__grid,
  .contact__grid { grid-template-columns: 1fr; min-width: 0; }
  .results__grid > *,
  .contact__grid > * { min-width: 0; max-width: 100%; }
  .results__media {
    aspect-ratio: 16 / 10;
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
  }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

/* Menú hamburguesa hasta 1080px: el nav de escritorio (logo + 4 enlaces + CTA)
   no cabe en tablets y se parte en 2 líneas entre ~769 y ~1070px, así que en
   todo ese rango se usa el menú compacto. */
@media (max-width: 1080px) {
  .nav__menu { display: none; }
  .nav__toggle { display: block; }

  /* Panel desplegable: enlaces apilados + CTA, con divisores y sombra */
  .nav.is-open .nav__menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: absolute;
    left: 0; right: 0; top: 100%;
    margin: 0;
    background: var(--white);
    border-top: 1px solid var(--border);
    box-shadow: var(--shadow-nav);
    padding: var(--sp-8) var(--gutter) var(--sp-24);
    animation: navDrop var(--dur-mid) var(--ease-out);
  }
  .nav.is-open .nav__links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }
  .nav.is-open .nav__links li + li { border-top: 1px solid var(--border); }
  .nav.is-open .nav__links a {
    display: block;
    width: 100%;
    padding: 18px 2px;
    color: var(--ink);
  }
  .nav.is-open .nav__links a::after { display: none; }        /* sin subrayado en el menú */
  .nav.is-open .nav__links a:hover,
  .nav.is-open .nav__links a.is-active { color: var(--green); }
  .nav.is-open .nav__cta {
    display: inline-flex;
    justify-content: center;
    width: 100%;
    margin: var(--sp-16) 0 0;
  }
}
@keyframes navDrop {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   TABLET (769–1200): ritmo propio — no toca desktop (≥1201)
   ni teléfono (≤768, que redefine abajo).
   ============================================================ */
@media (min-width: 769px) and (max-width: 1200px) {
  :root {
    --fs-hero: 40px;
    --fs-display: 32px;
    --fs-h3: 26px;
    --fs-card: 22px;
    --fs-body-lg: 18px;
    --fs-body: 16px;
    --section-y: clamp(56px, 6.5vw, 80px);
  }

  /* Hero: foto arriba del mensaje (no debajo de los stats) */
  .hero__media {
    order: -1;
    aspect-ratio: 21 / 9;
    max-height: 260px;
  }
  .hero__inner {
    padding-block: var(--sp-40) var(--sp-48);
  }
  .hero__title {
    font-size: clamp(36px, 4.4vw, 42px);
    line-height: 1.12;
    letter-spacing: -0.015em;
  }
  .hero__lead {
    margin-top: var(--sp-16);
    max-width: 48ch;
  }
  .hero__actions { margin-top: var(--sp-32); }
  .stats {
    margin-top: var(--sp-40);
    padding-top: var(--sp-24);
  }
  .stat__num { font-size: 30px; }

  .section-title {
    font-size: clamp(30px, 3.6vw, 34px);
    letter-spacing: -0.012em;
  }
  .section-lead { margin-top: 12px; }

  .grid-3 { gap: var(--sp-24); margin-top: var(--sp-40); }
  .card { padding: var(--sp-40); }
  .pillars-grid .card { padding-block: var(--sp-40); }
  .icon-badge { width: 56px; height: 56px; }
  .icon-badge .ico { font-size: 28px; }

  .btn {
    padding: 13px 26px;
    font-size: 17px;
  }

  .results__media {
    aspect-ratio: 16 / 10;
    max-height: 300px;
  }
  .step__num { font-size: 32px; }

  .cta-band__title {
    font-size: clamp(32px, 4vw, 40px);
    line-height: 1.15;
  }
  .cta-band__inner { padding-block: var(--sp-64); }
  .cta-band__text { margin: var(--sp-16) auto var(--sp-32); }

  .nav { min-height: 84px; }
  .site-header.is-stuck .nav { min-height: 72px; }

  /* Footer tablet: mismas piezas que desktop, ritmo limpio */
  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-40) var(--sp-32);
    padding-block: var(--sp-64);
  }
  .footer__contact {
    grid-column: 1 / -1;
    padding-top: var(--sp-8);
  }
  .footer__contact ul {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--sp-16) var(--sp-24);
  }
  .footer__col h4 {
    font-size: 20px;
    margin-bottom: var(--sp-16);
  }
  .footer__col ul { gap: 14px; }
  .footer__band-top {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-32);
    padding-top: var(--sp-48);
  }
  .footer__brand {
    max-width: 100%;
    gap: var(--sp-16);
  }
  .footer__brand img { height: 48px; }
  .footer__brand p {
    max-width: 52ch;
    font-size: var(--fs-body);
    line-height: 1.55;
  }
  .footer__copy {
    align-self: flex-start;
    text-align: left;
  }
  .footer__divider { margin-block: var(--sp-32); }
  .footer__legal {
    flex-wrap: wrap;
    gap: var(--sp-16) var(--sp-32);
    padding-bottom: var(--sp-40);
  }
}

@media (max-width: 768px) {
  /* Escala tipográfica móvil: 1–2px más contenida → más limpia y profesional */
  :root {
    --fs-hero: 34px;
    --fs-display: 30px;
    --fs-h3: 24px;
    --fs-card: 20px;
    --fs-body-lg: 17px;
    --fs-body: 15px;
    --fs-small: 14px;
    --section-y: clamp(64px, 12vw, 88px);
    --gutter: 20px;
  }

  .grid-3 {
    grid-template-columns: 1fr;
    gap: var(--sp-24);
    margin-top: var(--sp-40);
  }

  /* HERO móvil: sin imagen — el mensaje es el protagonista en viewport estrecho */
  .hero__media { display: none; }
  .hero__inner {
    padding-block: var(--sp-40) var(--sp-48);
  }
  .hero__content { max-width: none; }
  .hero__title {
    font-size: clamp(30px, 7.2vw, 34px);
    line-height: 1.12;
    letter-spacing: -0.02em;
  }
  .hero__lead {
    max-width: none;
    margin-top: var(--sp-16);
    font-size: var(--fs-body-lg);
  }
  .hero__actions {
    margin-top: var(--sp-32);
    gap: 12px;
  }

  .section-title {
    font-size: clamp(26px, 6.5vw, 30px);
    line-height: 1.18;
    letter-spacing: -0.015em;
  }
  .section-lead { margin-top: 12px; }

  /* Stats apilados a todo el ancho */
  .stats {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    margin-top: var(--sp-40);
    padding-top: var(--sp-24);
  }
  .stat { padding-inline: 0; padding-block: 12px; }
  .stat:first-child { padding-top: 0; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--border); }
  .stat__label { white-space: normal; }
  .stat__num { font-size: 28px; }

  .card {
    padding: var(--sp-32);
  }
  .card:hover { transform: none; }
  .card__title { margin-top: var(--sp-24); }
  .icon-badge { width: 52px; height: 52px; }
  .icon-badge .ico { font-size: 26px; }
  .card__icon img { height: 48px; }
  .pillars-grid .card { padding-block: var(--sp-32); }

  /* Resultados: imagen más contenida, no domina el scroll */
  .results__media {
    aspect-ratio: 16 / 10;
    max-height: 220px;
  }

  .step--active,
  .step:hover { transform: none; }
  .step { grid-template-columns: auto 1fr; gap: var(--sp-16); }
  .step__num { font-size: 28px; }

  .btn {
    padding: 12px 22px;
    font-size: 16px;
  }

  /* Footer móvil: completo (logo, frase, columnas, legales) con mejor aire */
  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--sp-32);
    padding-block: var(--sp-48);
  }
  .footer__col h4 {
    font-size: 18px;
    margin-bottom: 12px;
  }
  .footer__col ul { gap: 12px; }
  .footer__contact li {
    align-items: flex-start;
    gap: 10px;
  }
  .footer__contact a,
  .footer__contact li {
    overflow-wrap: anywhere;
  }
  .footer__band-top {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-24);
    padding-top: var(--sp-40);
  }
  .footer__brand {
    max-width: 100%;
    gap: 12px;
  }
  .footer__brand img { height: 42px; }
  .footer__brand p {
    font-size: var(--fs-body);
    line-height: 1.55;
    max-width: 36ch;
  }
  .footer__copy {
    text-align: left;
    align-self: flex-start;
    font-size: var(--fs-small);
  }
  .footer__divider { margin-block: var(--sp-24); }
  .footer__legal {
    flex-wrap: wrap;
    gap: 12px 20px;
    padding-bottom: var(--sp-32);
    font-size: var(--fs-small);
  }

  .cta-band__title {
    font-size: clamp(28px, 7vw, 34px);
    line-height: 1.15;
  }
  .cta-band__inner {
    padding-inline: var(--gutter);
    padding-block: var(--sp-64);
  }
  .cta-band__text { margin: var(--sp-16) auto var(--sp-32); }
  .cta-band .btn { width: 100%; max-width: 100%; }

  .nav { min-height: 72px; gap: var(--sp-16); }
  .site-header.is-stuck .nav { min-height: 64px; }
}

@media (max-width: 480px) {
  :root {
    --fs-hero: 30px;
    --fs-display: 28px;
    --fs-card: 19px;
    --fs-body-lg: 16px;
  }

  .card, .contact-method { padding: 22px; }
  .form { padding: 22px; }

  .btn {
    white-space: normal;
    text-align: center;
    max-width: 100%;
    padding: 12px 18px;
    font-size: 15px;
  }

  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; }
  .hero__title { font-size: 44px; }

  .nav__logo img { height: 37px; }
  .nav { min-height: 64px; }

  .section-title { font-size: clamp(24px, 6.8vw, 28px); line-height: 1.18; }
  .field input:not([type="hidden"]),
  .field select {
    height: 48px;
    min-height: 48px;
    padding: 0 14px;
  }
  .field textarea { padding: 12px 14px; }

  .results__media { max-height: 180px; }
  .cta-band__title { font-size: clamp(26px, 7vw, 30px); }
}
