/* ============================================================
   Elevance — styles.css
   Mobile-first. Sin frameworks.
   Tipografía: Inter (cuerpo/UI) + Fraunces (display, eje opsz).
   Paleta:
     --azul        #1B3A5B  (marca, autoridad)
     --azul-tinta  #0E2034  (fondo del hero, azul-tinta profundo)
     --verde       #2EA66B  (acento sobrio: personalidad, no solo botones)
     blancos y grises neutros como base
   ============================================================ */

/* ---------- Variables y reset ---------- */
:root {
  --azul: #1B3A5B;
  --azul-oscuro: #142C46;
  --azul-tinta: #0E2034;     /* deriva de --azul-oscuro: hero propio, no negro */
  --verde: #2EA66B;
  --verde-oscuro: #258757;
  --verde-claro: #7FD4A8;    /* verde legible sobre azul oscuro */
  --texto: #2B3440;
  --texto-suave: #5A6573;
  --gris-claro: #F5F6F8;
  --gris-borde: #DDE2E8;
  --blanco: #FFFFFF;
  --error: #C0392B;

  /* Tipografía */
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;

  /* Radios escalonados (criterio por jerarquía, no un 10px uniforme) */
  --radio-sm: 8px;
  --radio: 14px;
  --radio-lg: 22px;

  /* Sombras con intención (capas suaves, tono azul de marca) */
  --sombra-sm: 0 1px 2px rgba(14, 32, 52, 0.06),
               0 4px 10px rgba(14, 32, 52, 0.05);
  --sombra-md: 0 2px 6px rgba(14, 32, 52, 0.06),
               0 16px 34px rgba(14, 32, 52, 0.10);
  --sombra-lg: 0 4px 12px rgba(14, 32, 52, 0.08),
               0 28px 56px rgba(14, 32, 52, 0.16);
  --sombra-verde: 0 10px 28px rgba(46, 166, 107, 0.28);
  --sombra: var(--sombra-md);   /* alias de compatibilidad */
}

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

html {
  scroll-behavior: smooth;
  /* Compensa la cabecera fija al navegar por anclas */
  scroll-padding-top: 4.5rem;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;            /* 16px mínimo: legible sin zoom en móvil */
  line-height: 1.6;
  color: var(--texto);
  background: var(--blanco);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;          /* cinturón de seguridad contra scroll lateral */
}

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

/* ---------- Contenedores ---------- */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container-narrow { max-width: 640px; }

/* ---------- Tipografía ----------
   Display serif (Fraunces) para h1/h2: autoridad y contraste con el cuerpo.
   El eje óptico (opsz) se ajusta solo con font-optical-sizing según el tamaño. */
h1, h2 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
}

h1 {
  font-size: clamp(2.25rem, 6vw + 0.5rem, 4rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(1.7rem, 3.2vw + 0.6rem, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.018em;
  color: var(--azul);
  margin-bottom: 0.75rem;
}

/* h3 se queda en Inter: corta el riesgo "consultora solemne" y da ritmo moderno */
h3 {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--azul);
  margin-bottom: 0.5rem;
}

/* Kicker verde bajo los titulares de sección: personalidad moderna que
   contrarresta la solemnidad de la serif. Solo en secciones, no en legal. */
.section > .container > h2 {
  position: relative;
  padding-bottom: 0.85rem;
}

.section > .container > h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 2.75rem;
  height: 4px;
  border-radius: 2px;
  background: var(--verde);
}

.section-intro {
  color: var(--texto-suave);
  max-width: 38rem;
  margin-bottom: 2.5rem;
}

/* ---------- Botones (área táctil mínima 44x44) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radio);
  background: var(--verde);
  color: var(--blanco);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.btn:hover, .btn:focus-visible { background: var(--verde-oscuro); }
.btn:active { transform: scale(0.98); }

.btn-primary {
  padding: 0.95rem 2.1rem;
  font-size: 1.05rem;
  box-shadow: var(--sombra-verde);
}

.btn-primary:hover, .btn-primary:focus-visible {
  box-shadow: 0 14px 34px rgba(46, 166, 107, 0.38);
}
.btn-block { width: 100%; }
.btn-small { padding: 0.6rem 1.1rem; font-size: 0.95rem; }

.btn:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--verde);
  outline-offset: 2px;
}

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gris-borde);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--azul);
  text-decoration: none;
}

.nav-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none;
}

/* Enlaces de navegación: padding generoso = área táctil ≥44px */
.nav-list a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  color: var(--texto);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 6px;
  transition: color 0.2s ease;
}

.nav-list a:not(.btn):hover { color: var(--verde); }

/* En móvil ocultamos los enlaces de sección y dejamos solo logo + CTA:
   más limpio que un menú hamburguesa para una sola página */
@media (max-width: 700px) {
  .nav-list li:not(:last-child) { display: none; }
}

/* ---------- Hero ----------
   Fondo azul-tinta profundo PROPIO (distinto del gradiente de .section-dark).
   Dos capas decorativas en CSS puro, sin imágenes: rejilla técnica tenue
   (::before) y glow verde de marca (::after). El titular Fraunces manda. */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-color: var(--azul-tinta);
  color: var(--blanco);
  padding: 5rem 0 5.5rem;
  text-align: left;
}

/* Rejilla fina que se desvanece hacia los bordes (carácter, no ruido) */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(120% 90% at 18% 0%, #000 25%, transparent 72%);
          mask-image: radial-gradient(120% 90% at 18% 0%, #000 25%, transparent 72%);
}

/* Glow verde: el acento de marca como luz, anclado arriba a la derecha */
.hero::after {
  content: "";
  position: absolute;
  top: -28%;
  right: -12%;
  width: 560px;
  height: 560px;
  z-index: -1;
  background: radial-gradient(circle, rgba(46, 166, 107, 0.30) 0%, rgba(46, 166, 107, 0) 65%);
}

.hero .container { position: relative; }

.hero h1 {
  max-width: 16ch;
}

.hero h1 em {
  font-style: italic;            /* Fraunces tiene cursiva real: matiz editorial */
  color: var(--verde-claro);
}

.hero-sub {
  max-width: 40rem;
  margin: 1.75rem 0 2.5rem;
  font-size: clamp(1.05rem, 0.6vw + 0.95rem, 1.2rem);
  color: rgba(255, 255, 255, 0.82);
}

.hero-note {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.58);
}

/* ---------- Secciones ---------- */
.section { padding: 4rem 0; }
.section-alt { background: var(--gris-claro); }

.section-dark {
  background: linear-gradient(160deg, var(--azul) 0%, var(--azul-oscuro) 100%);
  color: var(--blanco);
}

.section-dark h2 { color: var(--blanco); }
.section-dark .section-intro { color: rgba(255, 255, 255, 0.8); }

/* ---------- Rejillas ---------- */
.grid-3, .grid-2 {
  display: grid;
  grid-template-columns: 1fr; /* móvil: una columna */
  gap: 1.25rem;
}

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

/* ---------- Tarjetas ---------- */
.card {
  position: relative;
  background: var(--blanco);
  border: 1px solid var(--gris-borde);
  border-radius: var(--radio-lg);
  padding: 1.85rem;
  box-shadow: var(--sombra-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Las tarjetas de problema/servicio reaccionan: dinamismo contenido */
.card.reveal:hover {
  transform: translateY(-4px);
  box-shadow: var(--sombra-md);
}

.card p { color: var(--texto-suave); font-size: 0.97rem; }

.card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  padding: 11px;
  border-radius: var(--radio-sm);
  background: rgba(46, 166, 107, 0.12);
  color: var(--verde);
}

/* Servicios protagonistas: el verde como MOMENTO de marca, no un filete.
   Icono en verde sólido, borde tintado, sombra verde y barra superior. */
.card-featured {
  border: 1px solid rgba(46, 166, 107, 0.30);
  border-radius: var(--radio-lg);
  padding: 2.4rem 1.9rem 2rem;
  box-shadow: var(--sombra-verde), var(--sombra-sm);
}

.card-featured::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1.9rem;
  right: 1.9rem;
  height: 4px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--verde), var(--verde-claro));
}

.card-featured .card-icon {
  background: linear-gradient(145deg, var(--verde), var(--verde-oscuro));
  color: var(--blanco);
  box-shadow: var(--sombra-verde);
}

.card-featured.reveal:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(46, 166, 107, 0.34), var(--sombra-md);
}

.feature-list {
  margin-top: 1rem;
  list-style: none;
}

.feature-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  color: var(--texto-suave);
}

.feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--verde);
  font-weight: 700;
}

/* Servicios secundarios: tarjeta compacta horizontal, jerarquía menor */
.services-secondary { margin-top: 1.25rem; }

/* Secundarias: blancas pero planas (sin sombra ni verde) sobre el gris de
   la sección → leen como jerarquía menor frente a las protagonistas. */
.card-compact {
  display: flex;
  gap: 1rem;
  padding: 1.35rem 1.6rem;
  border-radius: var(--radio);
  background: var(--blanco);
  border: 1px solid var(--gris-borde);
  box-shadow: none;
}

.card-compact.reveal:hover {
  transform: none;
  box-shadow: var(--sombra-sm);
}

.card-compact h3 { font-size: 1.05rem; }
.card-compact p { font-size: 0.92rem; }

.card-icon-small {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 9px;
  margin-bottom: 0;
}

/* ---------- Pasos (Cómo trabajamos) ---------- */
.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  list-style: none;
  counter-reset: paso;
}

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

/* El número de paso es otro momento de verde: tile con numeral serif grande
   y glow de marca. Numeral Fraunces = guiño editorial, sigue siendo ≥44px. */
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 1.15rem;
  border-radius: var(--radio);
  background: linear-gradient(145deg, var(--verde), var(--verde-oscuro));
  color: var(--blanco);
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 1.7rem;
  line-height: 1;
  box-shadow: var(--sombra-verde);
}

.step p { color: var(--texto-suave); font-size: 0.97rem; }

/* ---------- Formulario de contacto ---------- */
.contact-form { margin-top: 1rem; }

.form-field { margin-bottom: 1.25rem; }

.form-field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.optional { color: rgba(255, 255, 255, 0.6); font-weight: 400; }

.form-field input,
.form-field textarea {
  width: 100%;
  min-height: 48px;            /* cómodo de pulsar en móvil */
  padding: 0.75rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radio);
  background: var(--blanco);
  color: var(--texto);
  font-family: inherit;
  font-size: 1rem;             /* ≥16px: evita el zoom automático de iOS */
}

.form-field textarea { resize: vertical; min-height: 110px; }

/* Campo con error: borde rojo visible */
.form-field input.invalid,
.form-field textarea.invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 1px var(--error);
}

.field-error {
  display: none;
  margin-top: 0.35rem;
  font-size: 0.875rem;
  color: #FFB3A7;              /* rojo claro legible sobre fondo azul */
  font-weight: 500;
}

.field-error:not(:empty) { display: block; }

/* Consentimiento RGPD */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

.checkbox-label input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--verde);
  cursor: pointer;
}

/* El padding vertical (compensado con margen negativo) amplía el área
   táctil del enlace inline hasta ≥44px sin alterar el flujo del texto */
.checkbox-label a {
  color: #7FD4A8;
  padding: 0.8rem 0;
  margin: -0.8rem 0;
}

/* Honeypot: oculto a humanos, visible para bots */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Estado del envío */
.form-status {
  margin-top: 1rem;
  min-height: 1.5rem;
  font-weight: 500;
  text-align: center;
}

.form-status.is-sending { color: rgba(255, 255, 255, 0.8); }
.form-status.is-success { color: #7FD4A8; }
.form-status.is-error   { color: #FFB3A7; }

/* ---------- Precios ---------- */
.pricing-grid { align-items: stretch; }

.price-card { display: flex; flex-direction: column; }
.price-card .feature-list { flex-grow: 1; }
.price-card .btn { margin-top: 1.75rem; }

.price-desc {
  color: var(--texto-suave);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.price {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--azul);
}

.price-from {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--texto-suave);
}

.price-month {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--texto-suave);
}

.price-period {
  margin: 0.4rem 0 0.25rem;
  font-size: 0.85rem;
  color: var(--texto-suave);
}

/* La tarjeta del pack reserva espacio arriba para la insignia */
.price-card-featured { padding-top: 2.7rem; }

.badge-popular {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--verde), var(--verde-oscuro));
  color: var(--blanco);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: var(--sombra-verde);
}

.price-foot {
  margin-top: 2rem;
  text-align: center;
  color: var(--texto-suave);
  font-size: 0.97rem;
}

.price-foot strong { color: var(--azul); }

/* ---------- Pie ---------- */
.site-footer {
  background: var(--azul-oscuro);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;            /* área táctil */
  color: rgba(255, 255, 255, 0.7);
}

.site-footer a:hover { color: var(--blanco); }

/* ---------- Página de privacidad ---------- */
.legal-page { padding: 3rem 0 4rem; }
.legal-page h1 { color: var(--azul); font-size: 2rem; margin-bottom: 1.5rem; }
.legal-page h2 { font-size: 1.3rem; margin-top: 2rem; }
.legal-page p, .legal-page li { color: var(--texto-suave); margin-bottom: 0.75rem; }
.legal-page ul { padding-left: 1.5rem; }
.legal-page a { color: var(--verde-oscuro); }

/* ---------- Animaciones de scroll (solo si hay JS) ----------
   El JS añade la clase "js" a <html>; sin JS todo es visible. */
html.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

html.js .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Respeta la preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
  .card { transition: none; }
  .card.reveal:hover,
  .card-featured.reveal:hover,
  .card-compact.reveal:hover { transform: none; }
}

/* ---------- Ajustes de escritorio ---------- */
@media (min-width: 1024px) {
  .section { padding: 5.5rem 0; }
  .hero { padding: 6.5rem 0 7rem; }
  .grid-3, .grid-2 { gap: 1.75rem; }
}
