/* =========================================================================
   Formulario único de precalificación (js/forms.js): incrustado y en hoja/modal.
   Marca: papel/crema, verde #1A4639, dorado solo en el filete de progreso y el folio.
   Compacto: una pregunta por pantalla, opciones de 52 px, sin nada sobredimensionado.
   ========================================================================= */

.fs { display: grid; gap: 16px; color: var(--tinta); font-family: var(--f-ui); }
.fs-head { display: flex; align-items: center; gap: 12px; min-height: 32px; }
.fs-kicker {
  flex: 1; min-width: 0; margin: 0;
  font: 600 .72rem/1.3 var(--f-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--bronce-txt);
  overflow-wrap: anywhere;
}
.fs-count { font: 600 .8125rem/1 var(--f-ui); color: var(--dorado-txt); font-variant-numeric: lining-nums tabular-nums; letter-spacing: .04em; }
.fs-x {
  display: inline-grid; place-items: center; width: 40px; height: 40px; margin: -4px -8px -4px 0;
  border: 0; border-radius: var(--r-pill); background: transparent; color: var(--tinta-2); cursor: pointer;
  transition: background-color .15s var(--ease-out);
}
.fs-x:hover { background: var(--verde-tinte); color: var(--verde-900); }
.fs-x .ic { width: 20px; height: 20px; }

.fs-track { height: 2px; background: var(--linea); border-radius: 2px; overflow: hidden; }
.fs-bar { display: block; height: 100%; width: 0; background: var(--dorado); transition: width .35s var(--ease-out); }

.fs-stage { display: grid; min-width: 0; }
.fs-slide { grid-area: 1 / 1; display: grid; gap: 12px; align-content: start; min-width: 0; }
.fs-title {
  margin: 0; font: 600 clamp(1.375rem, 1.1rem + 1vw, 1.75rem)/1.12 var(--f-display); color: var(--verde-900);
  letter-spacing: -.005em; text-wrap: balance;
}
.fs-title:focus { outline: none; }
.fs-title:focus-visible { outline: 2px solid var(--verde); outline-offset: 4px; }
.fs-sub { margin: -4px 0 0; font-size: .9375rem; line-height: 1.55; color: var(--tinta-2); }
.fs-sub a { color: var(--verde); font-weight: 600; }
.fs-help { margin: 0; font-size: .8125rem; line-height: 1.5; color: var(--tinta-3); }

.fs-opts { display: grid; gap: 8px; margin-top: 4px; }
.fs-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 52px; padding: 12px 16px; text-align: left;
  background: var(--blanco); color: var(--tinta); border: 1px solid var(--linea-fuerte); border-radius: var(--r-sm);
  font: 500 .9375rem/1.35 var(--f-ui); cursor: pointer;
  transition: background-color .16s var(--ease-out), border-color .16s var(--ease-out), color .16s var(--ease-out), transform .12s var(--ease-out);
}
.fs-opt .ic { flex: none; width: 18px; height: 18px; color: var(--tinta-3); transition: transform .2s var(--ease-out), color .16s var(--ease-out); }
.fs-opt:hover { border-color: var(--verde); background: var(--verde-tinte); }
.fs-opt:hover .ic { color: var(--verde); transform: translateX(2px); }
.fs-opt:active { transform: scale(.99); }
.fs-opt:focus-visible { outline: 2px solid var(--verde); outline-offset: 2px; }
.fs-opt[aria-pressed="true"] { background: var(--verde); border-color: var(--verde); color: var(--blanco); }
.fs-opt[aria-pressed="true"] .ic { color: var(--dorado); transform: none; }

.fs-form { display: grid; gap: 14px; margin-top: 4px; }
.fs-form .field > label { font-size: .8125rem; font-weight: 600; color: var(--tinta-2); }
.fs-form .opt { font-weight: 400; color: var(--tinta-3); text-transform: none; letter-spacing: 0; }
.fs-form .req { color: var(--error); margin-left: 2px; }
.fs-phone { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: 8px; }
@media (max-width: 419px) { .fs-phone { grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr); } }
/* Campo trampa contra bots: fuera de la vista y del lector de pantalla */
.fs .hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fs-phone .select { padding-right: 28px; }
.fs-consent { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; font-size: .8125rem; line-height: 1.5; color: var(--tinta-2); cursor: pointer; }
.fs-consent input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--verde); }
.fs-consent a { color: inherit; }
.fs-submit { min-height: 48px; }
.fs-end-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }

.fs-foot { display: flex; min-height: 40px; }
.fs-foot:has(.fs-back[hidden]) { display: none; }
.fs-back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 8px 0 2px;
  border: 0; background: none; color: var(--tinta-2); font: 600 .875rem/1 var(--f-ui); cursor: pointer; border-radius: var(--r-sm);
}
.fs-back .ic { width: 18px; height: 18px; }
.fs-back:hover { color: var(--verde-900); }
.fs-back:focus-visible { outline: 2px solid var(--verde); outline-offset: 2px; }
.fs-back[hidden] { display: none; }

.fs-ghl { width: 100%; min-height: 560px; border: 0; }
.fs-loading { min-height: 320px; }
.fs-host { min-height: 360px; }

/* Transición entre pantallas (solo si el usuario no pidió reducir movimiento) */
@media (prefers-reduced-motion: no-preference) {
  .fs-slide.from-next { animation: fs-in-r .3s var(--ease-out) both; }
  .fs-slide.from-prev { animation: fs-in-l .3s var(--ease-out) both; }
  .fs-slide.to-prev { animation: fs-out-l .2s var(--ease-out) both; pointer-events: none; }
  .fs-slide.to-next { animation: fs-out-r .2s var(--ease-out) both; pointer-events: none; }
}
@keyframes fs-in-r { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes fs-in-l { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes fs-out-l { to { opacity: 0; transform: translateX(-16px); } }
@keyframes fs-out-r { to { opacity: 0; transform: translateX(16px); } }

/* ---------- Hoja (móvil) / diálogo (escritorio) ---------- */
.fs-lock, .fs-lock body { overflow: hidden; }
.fs-modal { position: fixed; inset: 0; z-index: calc(var(--z-sheet, 60) + 5); display: flex; align-items: flex-end; justify-content: center; }
.fs-modal[hidden] { display: none; }
.fs-backdrop { position: absolute; inset: 0; background: rgba(9, 32, 25, .5); }
.fs-dialog {
  position: relative; width: 100%; max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--papel); border-radius: 16px 16px 0 0; box-shadow: var(--shadow-2);
  padding: 16px var(--gutter, 16px) calc(16px + env(safe-area-inset-bottom));
}
.fs-dialog::before { content: ''; display: block; width: 36px; height: 4px; margin: 0 auto 12px; border-radius: 2px; background: var(--linea-fuerte); }
@media (prefers-reduced-motion: no-preference) {
  .fs-modal:not([hidden]) .fs-backdrop { animation: fs-fade .2s var(--ease-out); }
  .fs-modal:not([hidden]) .fs-dialog { animation: fs-sheet .32s var(--ease-out); }
  .fs-modal.is-closing .fs-backdrop { animation: fs-fade .2s var(--ease-out) reverse forwards; }
  .fs-modal.is-closing .fs-dialog { animation: fs-sheet .2s var(--ease-out) reverse forwards; }
}
@keyframes fs-fade { from { opacity: 0; } }
@keyframes fs-sheet { from { transform: translateY(24px); opacity: 0; } }
@media (min-width: 720px) {
  .fs-modal { align-items: center; padding: 24px; }
  .fs-dialog { max-width: 560px; max-height: min(88vh, 760px); border-radius: var(--r-card); padding: 24px 32px 20px; border: 1px solid var(--linea); }
  .fs-dialog::before { display: none; }
}

/* Dentro de secciones oscuras, el formulario va sobre su tarjeta clara */
.on-dark .fs { color: var(--tinta); }
.on-dark .form-card .fs-kicker { color: var(--bronce-txt); }
.on-dark .form-card .fs-help { color: var(--tinta-3); }

/* ---------- Página de gracias ---------- */
.gracias { min-height: 60vh; display: grid; align-items: center; }
.gracias .lead { margin-top: 12px; }
.gracias .split-actions { margin-top: 24px; }

/* Ficha: "Consultar" de cada tipología abre el formulario (antes era verde WhatsApp) */
.unit .u-cta { color: var(--verde); }
.unit .u-cta:hover { border-color: var(--verde); background: var(--verde-tinte); }
