/* ==========================================================================
   Cresyva — sistema de diseño común
   Lo usan todas las páginas de cresyva.com (styles.css añade lo propio de la portada y de las
   páginas legales; formulacion/formulacion.css, lo de la página del programa).
   Tema claro: fondo blanco y gris muy claro, azul marino como color principal y el naranja de
   Cresyva solo como acento (botones principales y detalles). Una sola tipografía, sin degradados
   ni brillos. Los colores de texto cumplen el contraste AA sobre los fondos en que se usan.
   ========================================================================== */

:root {
  /* Color */
  --azul:          #1f3a5f;   /* principal: enlaces, iconos, botones secundarios */
  --azul-oscuro:   #152a45;   /* títulos */
  --azul-suave:    #e8eef6;   /* fondo de iconos y realces */
  --naranja:       #ff6b35;   /* acento: botón principal y detalles pequeños (nunca texto) */
  --naranja-hover: #f25a22;
  --texto:         #172235;   /* 15,9:1 sobre blanco */
  --texto-2:       #46505f;   /* 8,2:1 sobre blanco, 7,7:1 sobre gris */
  --texto-3:       #5c6776;   /* 5,7:1 sobre blanco, 5,3:1 sobre gris */
  --fondo:         #ffffff;
  --fondo-gris:    #f5f7fa;
  --borde:         #e2e7ee;
  --borde-fuerte:  #cfd7e2;
  --error:         #b42318;   /* 6,2:1 sobre blanco */
  --exito:         #1e6b45;

  /* Tipografía */
  --fuente: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Medidas */
  --radio:     12px;
  --radio-lg:  16px;
  --ancho:     1200px;
  --cabecera:  68px;
  --suave:     cubic-bezier(.22, .61, .36, 1);
  --sombra:    0 1px 2px rgba(23, 34, 53, .04), 0 12px 32px -18px rgba(23, 34, 53, .28);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--cabecera) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font: 400 16px/1.6 var(--fuente);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; font-family: var(--fuente); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; color: var(--azul-oscuro); }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); letter-spacing: -.03em; line-height: 1.08; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: 1.12rem; }
p { margin: 0; }
a { color: var(--azul); }
::selection { background: var(--azul); color: #fff; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--naranja); outline-offset: 3px; border-radius: 6px; }

/* Palabras destacadas dentro de un título: mismo color que el título, sin degradado. */
.grad { color: var(--azul); }

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 200; padding: 10px 16px; border-radius: 8px; background: var(--azul); color: #fff; font-weight: 600; text-decoration: none; }
.skip-link:focus { left: 16px; }

.container { width: 100%; max-width: var(--ancho); margin-inline: auto; padding-inline: 20px; }
.container-narrow { max-width: 840px; }
.nowrap { white-space: nowrap; }
.inline-link { color: var(--azul); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

/* Barra fina de lectura, arriba del todo: un detalle en naranja. */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; z-index: 150; height: 3px; background: var(--naranja); transform: scaleX(0); transform-origin: left center; pointer-events: none; }

/* ---------- Iconos de línea (todos con el mismo trazo) ---------- */

.icon { width: 24px; height: 24px; flex: none; fill: none; stroke: var(--azul); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 10px; background: var(--azul-suave); }
.card-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--azul); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Botones ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: 600 .95rem/1.2 var(--fuente);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s var(--suave), border-color .15s var(--suave), color .15s var(--suave);
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--naranja); color: #1b1006; }        /* 7,4:1 */
.btn-primary:hover { background: var(--naranja-hover); }
.btn-ghost { background: #fff; color: var(--azul); border-color: var(--borde-fuerte); }
.btn-ghost:hover { border-color: var(--azul); }
.btn-on-dark { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }
.btn-on-dark:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }
.btn[disabled] { opacity: .65; cursor: progress; }

/* ---------- Cabecera fija ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--suave), box-shadow .2s var(--suave);
}
.site-header.is-scrolled { border-bottom-color: var(--borde); box-shadow: 0 1px 8px rgba(23, 34, 53, .05); }
.header-inner { height: var(--cabecera); display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { display: block; width: 28px; height: 28px; flex: none; }
/* El logo es /favicon.svg: el mismo icono que la pestaña del navegador. */
.brand-name { font-weight: 700; font-size: 1.12rem; letter-spacing: -.02em; color: var(--azul-oscuro); }
.brand-name span { font-weight: 500; color: var(--texto-2); }

.nav { display: flex; align-items: center; gap: 26px; }
.nav > a:not(.btn) { font-size: .93rem; font-weight: 500; color: var(--texto-2); text-decoration: none; transition: color .15s var(--suave); }
.nav > a:not(.btn):hover { color: var(--azul); }
.nav-cta { padding: 9px 16px; font-size: .9rem; }
.nav-toggle { display: none; width: 42px; height: 42px; padding: 0; border: 1px solid var(--borde-fuerte); border-radius: 8px; background: #fff; cursor: pointer; }
.nav-toggle span { display: block; width: 18px; height: 2px; margin: 3.5px auto; border-radius: 2px; background: var(--azul); transition: transform .2s var(--suave), opacity .2s var(--suave); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ---------- Secciones ---------- */

.section { padding-block: clamp(72px, 9vw, 112px); }
.section-tight { padding-block: clamp(44px, 5vw, 64px); }
.section-alt { background: var(--fondo-gris); border-block: 1px solid var(--borde); }
.section-head { max-width: 720px; margin-bottom: clamp(40px, 5vw, 56px); }
.section-head--centro { margin-inline: auto; text-align: center; }
.section-sub { margin-top: 14px; max-width: 62ch; color: var(--texto-2); font-size: 1.04rem; }
.section-head--centro .section-sub { margin-inline: auto; }
.lead { margin-top: 22px; max-width: 60ch; color: var(--texto-2); font-size: clamp(1.05rem, 1.6vw, 1.2rem); }

/* Antetítulo: mayúsculas en azul con una raya naranja delante. */
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: .8rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--azul); }
.eyebrow .dot { display: inline-block; width: 18px; height: 2px; background: var(--naranja); }
.section-head--centro .eyebrow { justify-content: center; }

/* ---------- Tarjetas ---------- */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px 26px;
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  transition: border-color .2s var(--suave), box-shadow .2s var(--suave);
}
.card:hover { border-color: var(--borde-fuerte); box-shadow: var(--sombra); }
.card .card-icon { margin-bottom: 20px; }
.card > p { margin-top: 8px; color: var(--texto-2); font-size: .96rem; }
.card-list { list-style: none; margin: 20px 0 24px; padding: 0; display: grid; gap: 10px; font-size: .94rem; }
.card-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--texto); }
.card-list li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 9px; border-radius: 50%; background: var(--azul); }
.card-link { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-size: .94rem; font-weight: 600; color: var(--azul); text-decoration: none; }
.card-link span { transition: transform .2s var(--suave); }
.card-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.card-link:hover span { transform: translateX(3px); }

/* Lista con marcas de verificación */
.checks { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; font-size: .97rem; color: var(--texto); }
.checks svg { width: 20px; height: 20px; flex: none; margin-top: 2px; fill: none; stroke: var(--azul); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Capturas del programa ---------- */

.captura { margin: 0; overflow: hidden; background: #fff; border: 1px solid var(--borde-fuerte); border-radius: var(--radio); box-shadow: var(--sombra); }
.captura img { width: 100%; }

/* ---------- Preguntas frecuentes ---------- */

.faq { display: grid; gap: 10px; }
.faq-item { background: #fff; border: 1px solid var(--borde); border-radius: 10px; }
.faq-item[open] { border-color: var(--borde-fuerte); }
.faq-item summary { position: relative; padding: 18px 52px 18px 22px; font-weight: 600; color: var(--azul-oscuro); cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--azul);
  border-bottom: 2px solid var(--azul);
  transform: translateY(-70%) rotate(45deg);
  transition: transform .2s var(--suave);
}
.faq-item[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq-body { padding: 0 22px 18px; color: var(--texto-2); }

/* ---------- Pie ---------- */

.site-footer { background: #fff; border-top: 1px solid var(--borde); padding-top: clamp(44px, 6vw, 64px); padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
.footer-inner { display: grid; grid-template-columns: 1.1fr 1.4fr; gap: clamp(32px, 5vw, 64px); padding-bottom: 40px; }
.footer-brand p { margin-top: 14px; max-width: 38ch; color: var(--texto-2); font-size: .92rem; }
.footer-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-nav h4 { margin-bottom: 12px; font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--texto-3); }
.footer-nav a { display: block; padding: 5px 0; font-size: .92rem; color: var(--texto); text-decoration: none; }
.footer-nav a:hover { color: var(--azul); text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding-top: 18px; border-top: 1px solid var(--borde); font-size: .84rem; color: var(--texto-3); }
.footer-legal { display: flex; gap: 18px; }
.footer-legal a { color: var(--texto-3); text-decoration: none; }
.footer-legal a:hover { color: var(--azul); text-decoration: underline; }

/* Pie reducido (página del programa) */
.site-footer.footer-reducido { padding-top: 32px; }
.footer-compacto { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; padding-bottom: 24px; }
.footer-lema { color: var(--texto-2); font-size: .92rem; }
.footer-contacto { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-left: auto; font-size: .92rem; }
.footer-contacto a { color: var(--texto); text-decoration: none; }
.footer-contacto a:hover { color: var(--azul); text-decoration: underline; }

/* ---------- Aparición al hacer scroll (solo con JavaScript) ---------- */

.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--suave), transform .5s var(--suave); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .nav { gap: 18px; }
  .nav > a:not(.btn) { font-size: .88rem; }
}

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed;
    inset: var(--cabecera) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100dvh - var(--cabecera));
    overflow-y: auto;
    padding: 8px 20px calc(22px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-bottom: 1px solid var(--borde);
    box-shadow: 0 12px 24px -16px rgba(23, 34, 53, .25);
    transform: translateY(-120%);
    visibility: hidden;
    transition: transform .25s var(--suave), visibility 0s linear .25s;
  }
  .nav.is-open { transform: none; visibility: visible; transition: transform .25s var(--suave); }
  .nav > a:not(.btn) { padding: 14px 2px; font-size: 1rem; border-bottom: 1px solid var(--borde); }
  .nav-cta { margin-top: 16px; padding: 13px 16px; font-size: .98rem; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .brand-name { font-size: 1rem; }
  .btn-lg { width: 100%; }
  .footer-nav { grid-template-columns: 1fr 1fr; }
  .footer-contacto { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Formulario de contacto (portada y /formulacion/) ---------- */

.contact-form { display: grid; gap: 18px; padding: clamp(24px, 3vw, 34px); background: #fff; border: 1px solid var(--borde); border-radius: var(--radio-lg); box-shadow: var(--sombra); }
.field { display: grid; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { font-size: .88rem; font-weight: 600; color: var(--texto); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 13px;
  font: 400 .97rem/1.4 var(--fuente);
  color: var(--texto);
  background: #fff;
  border: 1px solid var(--borde-fuerte);
  border-radius: 8px;
  transition: border-color .15s var(--suave), box-shadow .15s var(--suave);
}
.field textarea { min-height: 110px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--texto-3); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px var(--azul-suave); }
.field select {
  appearance: none;
  padding-right: 38px;
  cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%231f3a5f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 12px center / 16px no-repeat;
}
.field.has-error input, .field.has-error textarea { border-color: var(--error); }
.error { font-size: .84rem; color: var(--error); }
.error:empty { display: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--texto-2); }
.check input { width: 18px; height: 18px; flex: none; margin-top: 2px; accent-color: var(--azul); cursor: pointer; }
.form-note { text-align: center; font-size: .82rem; color: var(--texto-3); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-fail { padding: 13px 16px; text-align: center; font-size: .92rem; color: var(--error); background: #fdf0ef; border: 1px solid #f3c2bd; border-radius: 8px; }
.form-success { padding: 13px 16px; text-align: center; font-size: .92rem; font-weight: 600; color: var(--exito); background: #eaf6ef; border: 1px solid #bfe0cd; border-radius: 8px; }

@media (max-width: 760px) {
  .field-row { grid-template-columns: 1fr; }
}
