/* Auditoría — piel "Widgets" (ver DESIGN.md). Este archivo: tokens, base, barra, formulario y pantalla de carga.
   El informe vive en informe.css. style.css queda solo para el panel de leads. */
:root {
  --fondo: #FFFFFF;
  --widget: #F2F2F7;       /* módulos: gris claro, sin borde ni sombra */
  --tinta: #1C1C1E;
  --gris: #5E5E66;         /* texto de apoyo, 6.3:1 sobre blanco y 5.6:1 sobre el módulo */
  --espera: #6E6E76;       /* estados en espera (≥ 4.5:1 sobre blanco) */
  --linea: #E3E3E8;
  --rojo: #B42318;  --rojo-suave: #FBE9E7;  --rojo-oscuro-fondo: #FF9B8F; /* rojo legible sobre módulo oscuro */
  --verde: #067647; --verde-suave: #E3F4EA;
  --azul: #2563EB;  --azul-press: #1D4ED8;  /* solo botones y enlaces */
  --agua: #D8DDE5;  --agua-borde: #9BA3B0;
  --oscuro-2: #3A3A3C;
  --radio: 26px;
  --f: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --curva: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fondo); color: var(--tinta);
  font: 500 16px/1.5 var(--f); font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
p, h1, h2, h3, h4 { margin: 0; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid rgba(37, 99, 235, .4); outline-offset: 2px; border-radius: 8px; }
.icono { width: 18px; height: 18px; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mal-t { color: var(--rojo); } .bien-t { color: var(--verde); }
.mt { margin-top: 14px; }

/* ---------- Botones y enlaces (azul = acción, nada más) ---------- */
.b-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; background: var(--azul); color: #fff;
  font: 700 15px/1 var(--f); text-decoration: none; padding: 13px 18px; min-height: 44px; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease;
}
.b-btn:hover { background: var(--azul-press); }
.b-btn:active { transform: scale(.97); }
.b-btn:disabled { opacity: .6; cursor: progress; }
.b-btn svg, .b-btn .icono { width: 17px; height: 17px; }
.b-btn--grande { width: 100%; font-size: 16px; padding: 17px 20px; min-height: 54px; }
.b-btn--chico { padding: 10px 16px; min-height: 40px; font-size: 14px; }
.b-link {
  display: inline-flex; align-items: center; gap: 4px; padding: 8px 2px; background: none; border: 0;
  font: 700 15px/1 var(--f); color: var(--azul); text-decoration: none; cursor: pointer;
}
.b-link svg, .b-link .icono { width: 16px; height: 16px; }

/* ---------- Barra ---------- */
.barra { position: sticky; top: 0; z-index: 20; background: var(--fondo); }
.barra-in { max-width: 1120px; margin: 0 auto; padding: 14px 18px 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.marca { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; }
.marca svg { width: 26px; height: 26px; }
.barra-der { display: flex; align-items: center; gap: 12px; min-width: 0; }
.barra-estado { font-size: 13.5px; font-weight: 700; color: var(--gris); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body[data-vista="vista-form"] .barra-estado { color: var(--verde); background: var(--verde-suave); border-radius: 999px; padding: 7px 12px; }
.barra-progreso { display: none; }
@media (max-width: 640px) { .barra-der:has(#barra-cta:not([hidden])) .barra-estado { display: none; } }
.aviso-demo { background: var(--widget); color: var(--gris); text-align: center; font-size: 14px; font-weight: 600; padding: 8px 16px; }

/* ---------- Estructura ---------- */
.vista { max-width: 760px; margin: 0 auto; padding: 8px 16px 72px; }
.vista-form, .vista-trabajo { max-width: 1120px; }
.pie { text-align: center; color: var(--gris); font-size: 13px; padding: 28px 16px 40px; }
.centrado { text-align: center; }
.error { color: var(--rojo); font-size: 14.5px; font-weight: 600; min-height: 0; margin: 10px 4px 0; }
.error:empty { display: none; }

/* Módulos (widgets): la pieza de todo el sistema */
.w { background: var(--widget); border-radius: var(--radio); padding: 18px; }
.w + .w { margin-top: 12px; }
.w-oscuro { background: var(--tinta); color: #fff; }
.w-cab { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--gris); margin-bottom: 10px; }
.w-cab .icono, .w-cab svg { width: 18px; height: 18px; flex: none; }
.w-pie { color: var(--gris); font-size: 13.5px; line-height: 1.4; margin-top: 6px; }
.w-pie.fuerte { font-weight: 700; margin-top: 0; }
.w-cab.mal-t, .w-pie.mal-t, .cifra.mal-t { color: var(--rojo); }
.w-cab.bien-t, .w-pie.bien-t, .cifra.bien-t { color: var(--verde); }
.cifra { font-size: 30px; font-weight: 800; letter-spacing: -.035em; line-height: 1; }
.cifra small { font-size: 15px; font-weight: 700; letter-spacing: -.01em; color: var(--gris); margin-left: 3px; }
.b-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.b-grid > .w { margin-top: 0; }
.b-titular { font-size: clamp(31px, 7.6vw, 52px); line-height: 1.08; font-weight: 800; letter-spacing: -.035em; text-wrap: balance; margin: 8px 2px 10px; }
.b-titular em { font-style: normal; color: var(--rojo); }
.b-bajada { color: var(--gris); font-size: 16px; line-height: 1.5; margin: 0 2px 18px; max-width: 60ch; }
.b-sec { font-size: clamp(22px, 4.2vw, 28px); line-height: 1.2; font-weight: 800; letter-spacing: -.03em; margin: 36px 2px 12px; text-wrap: balance; }
.b-sec:has(+ .b-sec-baj) { margin-bottom: 4px; }
.b-sec-baj { color: var(--gris); font-size: 14.5px; line-height: 1.5; margin: 0 2px 14px; max-width: 62ch; }
.ini { width: 48px; height: 48px; flex: none; border-radius: 999px; background: var(--tinta); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 16px; }
.firma { display: flex; align-items: center; gap: 10px; margin-top: 18px; color: #fff; font-weight: 700; font-size: 15px; }
.firma .ini { width: 36px; height: 36px; font-size: 14px; background: var(--oscuro-2); }

/* ---------- 1. Precarga: portada + formulario ---------- */
.pre-grid { display: grid; gap: 12px; }
.pre-grid > .w { margin-top: 0; }
.form { padding: 18px; }
.paso-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.paso-top .b-link { margin-left: auto; }
.aro { width: 46px; height: 46px; flex: none; }
.aro circle { fill: none; stroke-width: 6; }
.aro .aro-fondo { stroke: var(--linea); }
.aro .aro-valor { stroke: var(--tinta); stroke-linecap: round; transition: stroke-dasharray .5s var(--curva); }
.aro text { font: 800 14px var(--f); fill: var(--tinta); }
.paso-num { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.paso-sub { font-size: 13.5px; color: var(--gris); font-weight: 500; margin-top: 2px; }
.paso { display: none; border: 0; margin: 0; padding: 0; min-width: 0; }
.paso.activo { display: block; }
@media (prefers-reduced-motion: no-preference) { .paso.activo { animation: entrar .35s var(--curva); } }
.pregunta { display: block; padding: 0; font-size: 21px; line-height: 1.25; font-weight: 800; letter-spacing: -.025em; margin-bottom: 6px; text-wrap: balance; }
.opcional { display: inline-block; vertical-align: middle; font-size: 12.5px; font-weight: 700; color: var(--gris); background: #fff; border-radius: 999px; padding: 4px 9px; margin-left: 6px; letter-spacing: 0; }
.ayuda { color: var(--gris); font-size: 14px; line-height: 1.45; margin-bottom: 14px; }
.ayuda-abajo { margin: 8px 4px 0; }
.pregunta + .campo { margin-top: 14px; }
.campo { display: flex; align-items: center; background: #fff; border-radius: 16px; border: 2px solid transparent; min-height: 56px; padding: 0 16px; transition: border-color .15s ease; }
.campo:focus-within { border-color: var(--tinta); }
.campo :focus-visible { outline: none; }
.campo .pre { font-size: 18px; font-weight: 800; color: var(--gris); margin-right: 4px; }
.campo input, .campo textarea, .campo select { flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font: 600 17px/1.4 var(--f); color: var(--tinta); padding: 0; }
.campo input::placeholder, .campo textarea::placeholder { color: #75757D; font-weight: 500; }
.campo--area { align-items: flex-start; padding: 14px 16px; }
.campo--area textarea { resize: none; height: 96px; font-size: 16px; font-weight: 500; }
.campo--select select { appearance: none; height: 52px; cursor: pointer; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235E5E66' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right center / 18px no-repeat; }
.campo--sep { margin-top: 10px; }
.campo--tel select { flex: 0 0 auto; width: auto; font-weight: 800; color: var(--gris); margin-right: 10px; padding-right: 6px; border-right: 1.5px solid #E2E2E6; cursor: pointer; }
.grupo + .grupo { margin-top: 12px; }
.pregunta + .grupo { margin-top: 14px; }
.etq { display: block; font-size: 13.5px; font-weight: 700; color: var(--gris); margin: 0 4px 6px; }
.dos { display: grid; gap: 12px; }
.ayuda-abajo + .dos { margin-top: 14px; }
.dos .grupo + .grupo { margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { border: 0; background: #fff; color: var(--tinta); font: 600 14px/1 var(--f); border-radius: 999px; padding: 11px 14px; min-height: 40px; cursor: pointer; }
.chip:hover { background: #E8E8ED; }
.chip.elegida { background: var(--tinta); color: #fff; }
.opciones { display: grid; gap: 8px; margin-top: 14px; }
.opciones-lista { grid-template-columns: 1fr; }
.opcion { display: grid; gap: 3px; text-align: left; border: 2px solid transparent; background: #fff; border-radius: 16px; padding: 15px 16px; cursor: pointer; transition: border-color .15s ease; }
.opcion b { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.opcion span { font-size: 13.5px; color: var(--gris); }
.opcion:hover { border-color: var(--linea); }
.opcion.elegida { border-color: var(--tinta); }
.acciones { margin-top: 16px; }
.valor { display: flex; justify-content: center; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-top: 14px; font-size: 14.5px; font-weight: 600; }
.valor s { color: var(--gris); }
.valor b { color: var(--verde); font-weight: 800; }

/* Adelanto borroso del informe */
.w-adelanto { padding: 18px 12px 16px; }
.adel-tit { font-size: 19px; font-weight: 800; letter-spacing: -.025em; line-height: 1.25; margin: 0 6px 4px; }
.adel-baj { color: var(--gris); font-size: 14px; line-height: 1.45; margin: 0 6px 12px; }
.velo { position: relative; background: #fff; border-radius: 20px; padding: 14px 10px 12px; overflow: hidden; }
.velo .borroso { filter: blur(3.5px); opacity: .85; }
.velo svg { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto; }
.velo .barras { display: grid; gap: 8px; margin: 10px 8px 0; }
.velo .barras span { display: block; height: 10px; border-radius: 6px; background: #C9CCD3; }
.rotulo-fuga { display: flex; align-items: center; justify-content: center; gap: 8px; width: fit-content; background: #fff; color: var(--rojo); font-weight: 800; font-size: 15.5px; border-radius: 999px; padding: 10px 18px; }
.rotulo-fuga .icono { width: 16px; height: 16px; }
.velo .rotulo-fuga { position: absolute; left: 50%; top: 42%; translate: -50% -50%; white-space: nowrap; box-shadow: 0 0 0 1px var(--linea); }
.adel-pie { display: flex; align-items: center; gap: 8px; margin: 12px 6px 0; font-size: 13.5px; color: var(--gris); font-weight: 600; }
.adel-pie .icono { width: 16px; height: 16px; }

/* Qué revisamos */
.rev { display: flex; flex-direction: column; gap: 10px; }
.ico { width: 44px; height: 44px; border-radius: 14px; background: #fff; display: grid; place-items: center; color: var(--tinta); }
.ico .icono { width: 24px; height: 24px; }
.rev h3 { font-size: 15.5px; font-weight: 800; letter-spacing: -.015em; line-height: 1.25; }
.rev p { color: var(--gris); font-size: 13px; line-height: 1.4; margin-top: 3px; }
.rev.w-oscuro .ico { background: var(--oscuro-2); color: #fff; }
.rev.w-oscuro p { color: #C7C7CC; }
.rev .cifra { font-size: 30px; margin: 0; color: #fff; }
.rev.w-oscuro .cifra small { color: #C7C7CC; }
.w-firma { display: flex; gap: 14px; align-items: center; margin-top: 12px; }
.w-firma p { font-size: 14.5px; line-height: 1.45; }
.w-firma b { font-weight: 800; }
.volver { margin-top: 16px; }

@media (min-width: 760px) {
  .vista { padding-top: 24px; }
  .dos { grid-template-columns: 1fr 1fr; }
  .opciones-lista { grid-template-columns: 1fr 1fr; }
  .b-grid--4 { grid-template-columns: repeat(4, 1fr); }
  .volver { display: none; } /* en pantalla grande el formulario siempre está a la vista */
}
@media (min-width: 1024px) {
  .pre-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); grid-template-areas: "hero hero" "form adel"; gap: 16px 20px; align-items: start; }
  .pre-hero { grid-area: hero; padding: 24px 0 8px; max-width: 860px; }
  .form { grid-area: form; padding: 26px; }
  .w-adelanto { grid-area: adel; margin-top: 0; }
  .pregunta { font-size: 24px; }
  .pre-revisamos { margin-top: 24px; }
}

/* ---------- 2. Pantalla de carga ---------- */
.vista-trabajo { padding-bottom: 120px; }
.tr-col > .w + .w, .tr-col > .w + aside, .tr-col > aside + .w { margin-top: 12px; }
.w-hero { text-align: center; padding: 22px 18px; margin-top: 6px; transition: opacity .22s ease; }
.w-hero.cambiando .fase-titulo, .w-hero.cambiando .fase-detalle { opacity: .25; }
.anillo-caja { position: relative; width: 196px; height: 196px; margin: 0 auto 16px; }
.anillo-fases { display: block; width: 100%; height: 100%; }
.anillo-fases circle { fill: none; stroke-width: 16; stroke-linecap: round; }
.anillo-fases .tramo-base { stroke: var(--linea); }
.anillo-fases .tramo { stroke: transparent; transition: stroke .3s ease; }
.anillo-fases .tramo.hecho { stroke: var(--verde); }
.anillo-fases .tramo.omitido { stroke: #8E8E96; }
.anillo-fases .tramo.activo { stroke: var(--tinta); stroke-dasharray: 17.4 503; }
.anillo-centro { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.anillo-centro > span { font-size: 15px; font-weight: 700; color: var(--gris); }
.anillo-centro b { font-size: 40px; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; }
.anillo-centro small { font-size: 20px; font-weight: 700; color: var(--gris); letter-spacing: 0; margin-left: 6px; }
.fase-titulo { font-size: 26px; line-height: 1.12; font-weight: 800; letter-spacing: -.03em; text-wrap: balance; transition: opacity .2s ease; }
.fase-detalle { color: var(--gris); font-size: 15px; line-height: 1.45; margin: 6px auto 0; max-width: 30ch; transition: opacity .2s ease; }

.w-tanque-carga { display: flex; align-items: center; gap: 14px; padding: 16px 18px 16px 10px; }
.tanque-carga { width: 120px; height: auto; flex: none; display: block; }
.liquido { transform: translateY(96px); transition: transform 1.2s var(--curva); }
.w-tit { font-size: 17px; line-height: 1.25; font-weight: 800; letter-spacing: -.02em; }
.w-tanque-carga .w-cab { margin-bottom: 6px; }

.w-tip .tip { font-size: 16px; line-height: 1.45; font-weight: 600; letter-spacing: -.01em; min-height: 4.4em; transition: opacity .25s ease; }
.w-tip .tip.cambiando { opacity: 0; }
.tip-puntos { display: flex; gap: 5px; margin-top: 14px; }
.tip-puntos i { width: 6px; height: 6px; border-radius: 999px; background: #C9CCD3; transition: width .3s ease, background-color .3s ease; }
.tip-puntos i.on { width: 18px; background: var(--tinta); }

.equipo { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.ag { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 16px; padding: 9px 12px 9px 9px; font-size: 14.5px; font-weight: 600; }
.ag .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--widget); color: var(--espera); transition: background-color .3s ease, color .3s ease; }
.ag .ic .icono { width: 18px; height: 18px; }
.ag .est { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--espera); white-space: nowrap; }
.ag .est .icono { width: 16px; height: 16px; }
.ag.espera { color: var(--gris); }
.ag.hecho .ic { background: var(--verde-suave); color: var(--verde); }
.ag.hecho .est { color: var(--verde); }
.ag.activo { box-shadow: inset 0 0 0 2px var(--tinta); }
.ag.activo .ic { background: var(--tinta); color: #fff; }
.ag.activo .est { color: var(--tinta); }
.ag.omitido .est { color: var(--gris); }
.giro { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--linea); border-top-color: var(--tinta); flex: none; }
.equipo-pie { color: var(--gris); font-size: 13px; margin: 10px 4px 0; }

.w-jesus { padding: 22px 20px; }
.w-jesus h2 { font-size: 20px; line-height: 1.25; font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px; }
.w-jesus p { color: #D1D1D6; font-size: 15px; line-height: 1.5; }
.w-jesus b { color: #fff; font-weight: 800; }
.w-jesus s { text-decoration-thickness: 1.5px; }
.w-jesus .puente { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--oscuro-2); }

.b-fija { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: #fff; border-top: 1px solid var(--linea); padding: 12px 18px calc(16px + env(safe-area-inset-bottom)); }
.b-fija-in { max-width: 1120px; margin: 0 auto; }
.tr-fija .fila { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; font-weight: 600; color: var(--gris); }
.tr-fija .fila b { color: var(--tinta); font-weight: 800; }
.riel { height: 6px; border-radius: 999px; background: var(--linea); overflow: hidden; margin-top: 9px; }
.riel i { display: block; height: 100%; width: 0; background: var(--tinta); border-radius: inherit; transition: width .6s var(--curva); }

@media (min-width: 1024px) {
  .tr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; margin-top: 16px; }
  .tr-col + .tr-col { margin-top: 0; }
  .w-hero { margin-top: 0; padding: 32px 24px; }
  .anillo-caja { width: 220px; height: 220px; }
  .fase-titulo { font-size: 30px; }
}
@media (max-width: 1023px) { .tr-col + .tr-col { margin-top: 12px; } .vista-trabajo { max-width: 760px; } }

/* ---------- Movimiento: sobrio, y quieto con "reducir movimiento" ---------- */
@keyframes entrar { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes tramo { 0% { stroke-dasharray: 0 503; } 70%, 100% { stroke-dasharray: 34.8 503; } }
@keyframes gira { to { transform: rotate(360deg); } }
@keyframes mide { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(78px); } }
@media (prefers-reduced-motion: no-preference) {
  .anillo-fases .tramo.activo { animation: tramo 2.3s cubic-bezier(.4, 0, .2, 1) infinite; }
  .giro { animation: gira .9s linear infinite; }
  .regla { animation: mide 3.2s ease-in-out infinite; }
  .revelar { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--curva) var(--retraso, 0ms), transform .6s var(--curva) var(--retraso, 0ms); }
  .revelar.visible { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
