/* =========================================================
   TOWIRED — Blueprint Preview · dashboard app (glassmorphism)
   Sistema visual tomado del prototipo de diseño de Mikestif Studio
   ("Business Blueprint - Towired"). El contenido — preguntas, campos y
   secciones del resultado — es el del backend, sin cambios.
   ========================================================= */
:root {
  --violet-700: #3a1c8c; --violet-600: #4a1fb0; --violet-500: #5b21f4;
  --violet-400: #6d42f6; --violet-300: #8a6af8; --violet-100: #ece7fe;
  --cyan: #00c2ff; --green: #22c55e; --blue: #2f80ed; --yellow: #f59e0b; --red: #ef4444;

  --ink: #1a1730; --ink-soft: #5b5875; --muted: #918ea8; --line: #ececf6;

  /* alias de estado — el JS compone var(--success|warning|danger) desde estadoDeScore() */
  --success: #22c55e; --warning: #f59e0b; --danger: #ef4444;

  --grad: linear-gradient(120deg, #6d42f6, #00c2ff);
  --grad-btn: linear-gradient(135deg, #6d42f6 0%, #8a6af8 100%);
  --grad-purple: linear-gradient(160deg, #7c53f8 0%, #5b21f4 55%, #3a1c8c 100%);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-sm: 0 8px 22px -12px rgba(46, 25, 110, 0.22);
  --shadow: 0 20px 48px -22px rgba(46, 25, 110, 0.30);
  --shadow-lg: 0 50px 120px -50px rgba(46, 25, 110, 0.55);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Lexend", system-ui, sans-serif; color: var(--ink);
  background: #eceafb; min-height: 100svh; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }
a { color: inherit; }

/* ===================== FONDO claro + video sutil + luces ===================== */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background:
    radial-gradient(50% 45% at 15% 15%, rgba(138,106,248,0.28), transparent 70%),
    radial-gradient(45% 45% at 88% 20%, rgba(0,194,255,0.20), transparent 70%),
    radial-gradient(55% 55% at 80% 90%, rgba(124,83,248,0.22), transparent 72%),
    radial-gradient(45% 45% at 10% 88%, rgba(0,194,255,0.16), transparent 72%),
    linear-gradient(160deg, #eef0fc 0%, #f3edfd 50%, #eae7fb 100%);
}
/* opacity 0.1 es una decisión de Imderf (2026-08-26), no el valor del prototipo (0.95):
   el video queda como textura de fondo, no como imagen protagonista. */
.bg__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.1; }

/* ===================== APP (contenedor flotante) ===================== */
.app {
  position: relative; z-index: 10; max-width: 1260px; margin: clamp(14px, 3vw, 34px) auto;
  min-height: calc(100svh - clamp(28px, 6vw, 68px));
  display: grid; grid-template-columns: 232px 1fr; gap: 0;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(34px) saturate(170%); -webkit-backdrop-filter: blur(34px) saturate(170%);
  border: none; border-radius: 28px;
  box-shadow: var(--shadow-lg); overflow: hidden;
  transition: opacity 0.45s var(--ease);
}
body.is-takeover .app { opacity: 0; pointer-events: none; }

/* ---- Sidebar morado (fases) ---- */
.nav {
  position: relative; background: linear-gradient(180deg, #b79bf7 0%, #9a72ef 12%, #7a4be6 30%, #5c2fd0 50%, #401ca6 72%, #250c66 100%);
  color: #fff; padding: 26px 20px; display: flex; flex-direction: column; overflow: hidden;
}
.nav::before { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; background: rgba(180,150,255,0.42); filter: blur(60px); top: -90px; right: -90px; }
.nav__logo { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; padding-bottom: 20px; margin-bottom: 22px; border-bottom: 1px solid rgba(255,255,255,0.14); }
.nav__logo img { height: 22px; width: auto; }
.nav__steps { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 4px; }
.nstep { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: rgba(255,255,255,0.55); font-size: 0.92rem; font-weight: 500; transition: 0.3s var(--ease); }
.nstep__ic { width: 24px; height: 24px; display: grid; place-items: center; background: transparent; flex-shrink: 0; color: currentColor; transition: 0.3s var(--ease); }
.nstep__ic svg { width: 18px; height: 18px; }
.nstep.is-active { background: rgba(255,255,255,0.16); color: #fff; }
.nstep.is-active .nstep__ic { color: #fff; }
.nstep.is-done { color: rgba(255,255,255,0.82); }
.nav__card { position: relative; z-index: 1; margin-top: auto; padding: 16px; border-radius: 16px; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.18); backdrop-filter: blur(6px); }
.nav__card b { display: block; font-size: 0.9rem; }
.nav__card span { font-size: 0.78rem; color: rgba(255,255,255,0.7); }

/* ---- Workspace ---- */
.work { display: flex; flex-direction: column; min-width: 0; padding: 22px clamp(18px, 2.4vw, 30px) 30px; }
.work__head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.work__title { font-weight: 800; font-size: 1.15rem; }
.work__title span { display: block; font-size: 0.74rem; font-weight: 500; color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; }
.work__prog { flex: 1; display: flex; align-items: center; gap: 12px; }
.steps__track { flex: 1; height: 8px; border-radius: 999px; background: #e4e0f2; overflow: hidden; }
.steps__fill { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg,#6d42f6,#8a6af8 55%,#00c2ff); box-shadow: 0 0 14px rgba(0,194,255,0.6), 0 0 22px rgba(124,83,248,0.5); transition: width 0.7s var(--ease); }
.steps__label { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 700; white-space: nowrap; }
.lang { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.lang__btn { border: none; background: transparent; color: var(--muted); font-weight: 700; font-size: 0.74rem; padding: 6px 11px; border-radius: 999px; transition: 0.2s var(--ease); }
.lang__btn.is-active { background: rgba(124,83,248,0.12); color: var(--violet-500); }

/* ---- Grid de paneles ---- */
.dash { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; flex: 1; }
.dash--full { grid-template-columns: 1fr; }
.dash--full .dash__side { display: none; }
.dash__main { min-width: 0; }

/* panel base (glass claro) */
.card, .panel, .side {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255,255,255,0.85); border-radius: 22px;
  box-shadow: var(--shadow-sm); backdrop-filter: blur(14px);
}
.card { padding: clamp(22px, 2.6vw, 34px); animation: screen-in 0.5s var(--ease) both; margin-bottom: 16px; }
.card:last-child { margin-bottom: 0; }
.panel { padding: 18px; }
@keyframes screen-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 15px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--violet-500); padding: 6px 12px; border-radius: 999px; background: rgba(124,83,248,0.1); border: 1px solid rgba(138,106,248,0.24); }
.eyebrow__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px 2px rgba(0,194,255,0.5); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(0,194,255,0.5); } 70% { box-shadow: 0 0 0 8px rgba(0,194,255,0); } 100% { box-shadow: 0 0 0 0 rgba(0,194,255,0); } }
.q-title { font-size: clamp(1.4rem, 2.5vw, 1.95rem); font-weight: 800; line-height: 1.14; letter-spacing: -0.02em; margin: 0 0 8px; }
.q-title .hl, .hl { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.q-sub { color: var(--ink-soft); font-weight: 300; font-size: clamp(0.96rem, 1.2vw, 1.05rem); margin: 0 0 22px; max-width: 54ch; }
/* separación entre bloques internos del panel de resultado */
.block { margin-top: 18px; }

/* form */
.field { margin-bottom: 15px; }
.field__label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 7px; }
.input { width: 100%; padding: 13px 15px; border-radius: 13px; color: var(--ink); font-size: 1rem; background: rgba(255,255,255,0.7); border: 1px solid var(--line); transition: 0.2s var(--ease); }
.input::placeholder { color: #b3b0c4; }
.input:focus { outline: none; border-color: var(--violet-300); background: #fff; box-shadow: 0 0 0 4px rgba(124,83,248,0.14); }
textarea.input { resize: vertical; min-height: 88px; }

/* botones */
.actions { display: flex; align-items: center; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 12px 22px; border-radius: 999px; border: none; font-weight: 700; font-size: 0.94rem; white-space: nowrap; line-height: 1.1; text-decoration: none; transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), opacity .2s, filter .2s; }
.btn--primary { background: var(--grad-btn); color: #fff; box-shadow: 0 12px 26px -12px rgba(109, 66, 246, 0.75); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -12px rgba(109, 66, 246, 0.9); filter: brightness(1.05); }
.btn--ghost { background: rgba(255,255,255,0.7); color: var(--ink); border: 1px solid var(--line); }
.btn--ghost:hover { border-color: var(--violet-300); color: var(--violet-500); }
.btn--lg { padding: 14px 26px; font-size: 0.98rem; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.btn__spacer { flex: 1; }
.btn svg { width: 17px; height: 17px; }
.link-back { background: none; border: none; color: var(--muted); font-weight: 600; font-size: 0.9rem; padding: 8px 4px; }
.link-back:hover { color: var(--ink); }
/* íconos de estado minimalistas (planos, unicolor, sin cajas) — igual que el prototipo:
   el !important vacía la caja de color y deja solo el trazo. Dentro del overlay morado sí
   conservan su caja, porque `.overlay .scan__ic` gana por especificidad. */
.find__ic, .scanline__ic, .sline__ic, .scan__ic { background: transparent !important; border: none !important; }

/* opciones (mismo look del prototipo; el input real queda oculto para no cambiar
   la lectura de valores del wizard, que sigue leyendo input:checked) */
.options { display: flex; flex-direction: column; gap: 10px; }
.opt { display: flex; align-items: flex-start; gap: 12px; text-align: left; width: 100%; padding: 14px 16px; border-radius: 14px; color: var(--ink); background: rgba(255,255,255,0.6); border: 1px solid var(--line); cursor: pointer; transition: 0.2s var(--ease); }
.opt:hover { border-color: var(--violet-300); background: #fff; transform: translateX(3px); }
.opt.is-selected { border-color: var(--violet-500); background: #f4efff; box-shadow: 0 0 0 1px var(--violet-500), 0 12px 26px -16px rgba(109,66,246,0.6); }
.opt input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.opt__mark { flex-shrink: 0; width: 23px; height: 23px; border-radius: 50%; margin-top: 1px; border: 2px solid #d5d1e6; display: grid; place-items: center; transition: 0.2s var(--ease); color: #fff; }
.opt--multi .opt__mark { border-radius: 8px; }
.opt.is-selected .opt__mark { border-color: transparent; background: var(--grad-btn); }
.opt__mark svg { width: 12px; height: 12px; opacity: 0; transform: scale(0.6); transition: 0.2s var(--ease); }
.opt.is-selected .opt__mark svg { opacity: 1; transform: scale(1); }
.opt__body { flex: 1; display: flex; flex-direction: column; }
.opt__title { font-weight: 600; font-size: 0.98rem; }
.opt__desc { display: block; color: var(--muted); font-weight: 300; font-size: 0.86rem; margin-top: 2px; }

/* candidatos de identidad (Paso 1) */
.found-card { display: flex; align-items: center; gap: 15px; padding: 16px; border-radius: 15px; background: rgba(255,255,255,0.6); border: 1px solid var(--line); margin-bottom: 18px; cursor: pointer; text-align: left; width: 100%; transition: 0.2s var(--ease); }
.found-card:hover { border-color: var(--violet-400); background: #fff; transform: translateX(3px); }
.found-card__logo { width: 50px; height: 50px; border-radius: 14px; background: var(--grad-btn); color: #fff; display: grid; place-items: center; flex-shrink: 0; font-weight: 800; font-size: 1.15rem; object-fit: cover; overflow: hidden; }
.found-card__name { font-weight: 700; font-size: 1.05rem; }
.found-card__meta { color: var(--muted); font-size: 0.86rem; margin-top: 1px; }

/* scan (radar) */
.scan { text-align: center; padding: 10px 0 4px; min-height: 58vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.radar { position: relative; width: 248px; height: 248px; margin: 4px auto 28px; }
.radar__ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(138,106,248,0.28); }
.radar__ring:nth-child(2) { inset: 32px; border-color: rgba(0,194,255,0.24); }
.radar__ring:nth-child(3) { inset: 66px; border-color: rgba(138,106,248,0.2); }
.radar__pulse { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(124,83,248,0.5); animation: radar 2.2s var(--ease) infinite; }
@keyframes radar { 0% { transform: scale(0.3); opacity: 0.9; } 100% { transform: scale(1); opacity: 0; } }
.radar__core { position: absolute; inset: 92px; border-radius: 50%; background: var(--grad-btn); box-shadow: 0 10px 34px rgba(124,83,248,0.55); display: grid; place-items: center; }
.radar__core svg { width: 32px; height: 32px; }
.radar__sweep { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0deg, rgba(124,83,248,0.22) 40deg, transparent 80deg); animation: sweep 2s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
.scan__log { max-width: 340px; margin: 0 auto; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.scan__item { display: flex; align-items: center; gap: 11px; font-size: 0.9rem; color: var(--muted); opacity: 0.4; transition: 0.4s var(--ease); }
.scan__item.is-doing { opacity: 1; }
.scan__item.is-done { opacity: 1; color: var(--ink); }
.scan__ic { width: 22px; height: 22px; border-radius: 7px; background: #f0eef8; border: 1px solid var(--line); display: grid; place-items: center; flex-shrink: 0; color: var(--muted); }
.scan__item.is-done .scan__ic { background: rgba(34,197,94,0.14); border-color: rgba(34,197,94,0.4); color: var(--green); }
.scan__ic svg { width: 12px; height: 12px; }
.scan__item.is-doing .scan__ic { animation: pulse 1.6s infinite; }

/* ===== OVERLAY pantalla completa (escaneo, morado glass) ===== */
.overlay { position: fixed; inset: 0; z-index: 120; display: none; }
.overlay.is-on { display: flex; align-items: center; justify-content: center; padding: 24px;
  background: linear-gradient(160deg, rgba(83,38,216,0.62) 0%, rgba(46,18,122,0.7) 55%, rgba(30,12,80,0.78) 100%);
  -webkit-backdrop-filter: blur(22px) saturate(125%); backdrop-filter: blur(22px) saturate(125%);
  animation: screen-in 0.5s var(--ease) both; }
.overlay .card { background: transparent; border: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; width: 100%; max-width: 760px; padding: 0; animation: none; margin: 0; }
.overlay .scan { min-height: auto; }
.overlay .q-title { color: #fff; }
.overlay .q-sub { color: rgba(255,255,255,0.85); margin-inline: auto; }
.overlay .scan__item { color: rgba(255,255,255,0.5); }
.overlay .scan__item.is-done { color: #fff; }
.overlay .scan__ic { background: rgba(255,255,255,0.12) !important; border: 1px solid rgba(255,255,255,0.26) !important; color: rgba(255,255,255,0.7); }
.overlay .scan__item.is-done .scan__ic { background: rgba(255,255,255,0.22) !important; border-color: rgba(255,255,255,0.5) !important; color: #fff; }
.overlay .radar__ring { border-color: rgba(255,255,255,0.3); }
.overlay .radar__ring:nth-child(2) { border-color: rgba(255,255,255,0.24); }
.overlay .radar__ring:nth-child(3) { border-color: rgba(255,255,255,0.2); }
.overlay .radar__sweep { background: conic-gradient(from 0deg, transparent 0deg, rgba(255,255,255,0.3) 40deg, transparent 80deg); }
.overlay .radar__pulse { border-color: rgba(255,255,255,0.65); }
.overlay .radar__core { background: rgba(255,255,255,0.18); box-shadow: 0 12px 36px rgba(0,0,0,0.32); }
.overlay .radar__core svg { color: #fff; }

/* ===================== SIDEBAR (Blueprint en vivo) ===================== */
.side { padding: 0; overflow: hidden; }
.side__score { position: relative; padding: 20px; margin: 13px 13px 0; border-radius: 20px; background: var(--grad-purple); color: #fff; overflow: hidden; box-shadow: 0 16px 34px -16px rgba(91,33,244,0.55); }
.side__score::before { content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%; background: rgba(0,194,255,0.35); filter: blur(46px); top: -60px; right: -50px; }
.side__score::after { content: ""; position: absolute; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,0.2); filter: blur(44px); bottom: -60px; left: -40px; }
.side__shine { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(115deg, transparent 36%, rgba(255,255,255,0.28) 50%, transparent 64%); transform: translateX(-120%); animation: shine 2.6s ease-in-out infinite; }
.side__head { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.side__title { font-weight: 800; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__state { font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.85); font-weight: 700; white-space: nowrap; }
.ring { position: relative; z-index: 1; width: 128px; height: 128px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; transition: background 0.9s var(--ease); }
.ring::after { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: rgba(58,28,140,0.55); }
.ring__num { position: relative; z-index: 2; font-size: 2.1rem; font-weight: 800; color: #fff; }
.ring__lbl { position: relative; z-index: 1; text-align: center; font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.75); font-weight: 700; margin-bottom: 2px; }
.side__body { padding: 16px 18px 18px; }
.side__block-t { font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 0 0 10px; }
.mini + .side__block-t, .sline + .side__block-t, .side__link + .side__block-t { margin-top: 16px; }
.mini { margin-bottom: 10px; }
.mini__top { display: flex; align-items: center; justify-content: space-between; font-size: 0.8rem; margin-bottom: 4px; gap: 8px; }
.mini__name { font-weight: 600; display: flex; align-items: center; gap: 6px; min-width: 0; }
.mini__name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini__val { font-weight: 800; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.mini__bar { height: 7px; border-radius: 999px; background: #ecebf5; overflow: hidden; }
.mini__fill { display: block; height: 100%; width: 0; border-radius: 999px; transition: width 0.9s var(--ease); }
.mini__fill.mini--crit { background: linear-gradient(90deg,#ef4444,#f97316); }
.mini__fill.mini--warn { background: linear-gradient(90deg,#f59e0b,#fbbf24); }
.mini__fill.mini--good { background: linear-gradient(90deg,#22c55e,#4ade80); }
/* En el costado del wizard cada fila es de una sola línea (solo la etiqueta), así que va
   centrada igual que en el prototipo. El detalle de cada señal vive en el resultado. */
.sline { display: flex; align-items: center; gap: 9px; font-size: 0.8rem; padding: 4px 0; color: var(--ink-soft); animation: screen-in .45s var(--ease) both; }
.sline__ic { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; flex-shrink: 0; margin-top: 1px; }
.sline__ic svg { width: 11px; height: 11px; }
.sline--ok .sline__ic { background: rgba(34,197,94,0.14); color: var(--green); }
.sline--warn .sline__ic { background: rgba(245,158,11,0.14); color: var(--yellow); }
.sline--miss .sline__ic { background: rgba(239,68,68,0.14); color: var(--red); }
.sline b { font-weight: 600; display: block; }
.sline .txt { color: var(--muted); font-weight: 300; }
.side__link { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; font-size: 0.8rem; text-decoration: none; color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.side__link:last-of-type { border-bottom: none; }
.side__link span.go { color: var(--muted); font-size: 0.74rem; white-space: nowrap; }
.side__biz { display: flex; align-items: center; gap: 11px; padding: 14px 18px 0; }
.side__biz img { width: 40px; height: 40px; border-radius: 11px; object-fit: cover; flex-shrink: 0; }
.side__biz b { font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===================== RESULTADO ===================== */
.dash-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.dash-head__biz { display: flex; align-items: center; gap: 14px; }
.dash-head__biz img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; }
.dash-cols { display: grid; grid-template-columns: 1fr 1.15fr; gap: 12px; margin: 18px 0; align-items: start; }
.p2 { padding: 16px; border-radius: 16px; background: rgba(255,255,255,0.62); border: 1px solid var(--line); }
.panel__title { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 11px; }
.scanline { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 0.86rem; animation: screen-in .45s var(--ease) both; }
.scanline:last-child { border-bottom: none; }
.scanline__ic { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex-shrink: 0; margin-top: 1px; }
.scanline--ok .scanline__ic { background: rgba(34,197,94,0.14); color: var(--green); }
.scanline--warn .scanline__ic { background: rgba(245,158,11,0.14); color: var(--yellow); }
.scanline--miss .scanline__ic { background: rgba(239,68,68,0.14); color: var(--red); }
.scanline__ic svg { width: 12px; height: 12px; }
.scanline b { font-weight: 600; display: block; }
.scanline .txt { color: var(--muted); font-weight: 300; }
.route { background: linear-gradient(150deg, rgba(124,83,248,0.14), rgba(0,194,255,0.08)); border: 1px solid rgba(138,106,248,0.32); display: flex; flex-direction: column; }
.route__tag { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--violet-500); font-weight: 700; }
.route__name { font-size: 1.3rem; font-weight: 800; margin: 7px 0; }
.route__text { color: var(--ink-soft); font-weight: 300; font-size: 0.9rem; }
.route__note { color: var(--muted); font-size: 0.8rem; margin: 12px 0 0; }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0; }
.kpi { display: flex; align-items: center; gap: 13px; padding: 17px 18px; border-radius: 16px; background: rgba(255,255,255,0.72); border: 1px solid var(--line); }
.kpi__ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: #f3f1fb; color: #5b21f4; }
.kpi__ic svg { width: 21px; height: 21px; }
.kpi__val { font-size: 1.8rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.kpi__val small { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.kpi__lbl { font-size: 0.77rem; color: var(--muted); margin-top: 3px; }

/* charts */
.charts { display: grid; grid-template-columns: 1.25fr 1fr; gap: 12px; margin: 16px 0; }
.chart-card { display: flex; flex-direction: column; align-items: center; }
.chart-card .panel__title { align-self: flex-start; }
.chart-flex { display: flex; align-items: center; gap: 6px; width: 100%; }
.chart-flex .radar-chart { flex: 0 0 54%; }
.radar-chart { width: 100%; max-width: 250px; height: auto; }
.donut { width: 134px; height: 134px; }
.barschart { width: 100%; max-width: 300px; height: auto; }
.chart-cap { font-size: 0.76rem; color: var(--muted); margin-top: 6px; text-align: center; }
.legend { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.legend__i { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; }
.legend__ic { width: 15px; height: 15px; display: inline-flex; flex-shrink: 0; color: #5b21f4; }
.legend__ic svg { width: 15px; height: 15px; }
.legend__dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.legend__n { flex: 1; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend__i b { font-weight: 800; color: var(--ink); }

/* dimensiones (tarjetas del diagnóstico) */
.dims { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.dim__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.dim__name { font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; }
.dim__val { font-weight: 800; font-size: 1.05rem; }
.dim__ic { display: inline-flex; width: 18px; height: 18px; color: var(--violet-500); flex-shrink: 0; }
.dim__ic svg { width: 18px; height: 18px; }
.dim__state { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; margin-left: 8px; white-space: nowrap; }
.dim--crit .dim__state { background: rgba(239,68,68,0.14); color: #c62828; }
.dim--warn .dim__state { background: rgba(245,158,11,0.16); color: #b06f00; }
.dim--good .dim__state { background: rgba(34,197,94,0.16); color: #1a8f4a; }
.dim__bar { height: 9px; border-radius: 999px; background: #ecebf5; overflow: hidden; }
.dim__fill { display: block; height: 100%; width: 0; border-radius: 999px; transition: width 1.1s var(--ease); }
.dim--crit .dim__fill { background: linear-gradient(90deg, #ef4444, #f97316); }
.dim--warn .dim__fill { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.dim--good .dim__fill { background: linear-gradient(90deg, #22c55e, #4ade80); }
.dim__line { margin: 5px 0 0; font-size: 0.87rem; color: var(--muted); font-weight: 300; }
.dim__line b { font-weight: 700; }
.dim__line span { color: var(--muted); font-weight: 300; }
.dim-chart { display: grid; place-items: center; }

/* barras de puntaje por señal */
.scorebars { display: grid; gap: 2px 28px; }
.scorebar { margin-bottom: 12px; }
.scorebar__top { display: flex; justify-content: space-between; gap: 10px; font-size: 0.82rem; font-weight: 600; margin-bottom: 5px; }
.scorebar__track { height: 8px; border-radius: 999px; background: #ecebf5; overflow: hidden; }
.scorebar__fill { height: 100%; border-radius: 999px; transition: width .8s var(--ease); }

/* tarjetas sociales / competidores */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.pcard { background: rgba(255,255,255,0.78); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; text-decoration: none; color: inherit; display: block; transition: 0.2s var(--ease); }
a.pcard:hover { border-color: var(--violet-300); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.pcard__cover { height: 72px; background: var(--grad-purple); background-size: cover; background-position: center; }
.pcard__body { padding: 0 16px 16px; margin-top: -28px; }
.pcard__body--nogap { margin-top: 12px; }
.pcard__avatar { width: 52px; height: 52px; border-radius: 50%; border: 3px solid #fff; background: var(--violet-100); object-fit: cover; display: block; }
.pcard__plat { font-size: 0.68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 10px 0 2px; }
.pcard__big { font-size: 1.25rem; font-weight: 800; margin: 0 0 6px; }
.pcard__meta { color: var(--muted); font-size: 0.78rem; margin: 2px 0 6px; }
.pcard__find { font-size: 0.82rem; color: var(--ink-soft); font-weight: 300; margin: 0; }

/* plan de acción */
.arow { display: flex; gap: 12px; align-items: flex-start; padding: 13px 0; border-bottom: 1px solid var(--line); }
.arow:last-child { border-bottom: none; }
.anum { flex: 0 0 auto; width: 27px; height: 27px; border-radius: 50%; background: rgba(124,83,248,0.12); color: var(--violet-500); display: grid; place-items: center; font-weight: 800; font-size: 0.78rem; }
.anum--crit { background: rgba(239,68,68,0.14); color: var(--red); }
.anum--warn { background: rgba(245,158,11,0.16); color: #b06f00; }
.arow__t { font-size: 0.86rem; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.arow__t .dim__ic { width: 16px; height: 16px; }
.arow__t .dim__ic svg { width: 16px; height: 16px; }
.arow p { margin: 5px 0 0; font-size: 0.88rem; }
.arow p.prob { color: var(--muted); font-weight: 300; }

/* error */
.errbox { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #a51f1f; border-radius: 13px; padding: 12px 15px; margin-bottom: 14px; font-size: 0.88rem; }

/* generando (morado, pantalla completa dentro del workspace) */
.gen { position: relative; overflow: hidden; border: none; text-align: center; padding: clamp(32px, 6vw, 70px) 24px; min-height: 62vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #5326d8 0%, #3a1a9e 42%, #250c72 100%); color: #fff; border-radius: 22px; }
.gen__shine { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,0.16) 50%, transparent 62%); transform: translateX(-120%); animation: shine 2.6s ease-in-out infinite; }
@keyframes shine { to { transform: translateX(120%); } }
.gen__eye { position: relative; z-index: 1; font-size: 0.68rem; letter-spacing: 0.2em; font-weight: 700; color: rgba(255,255,255,0.85); }
.gen__title { position: relative; z-index: 1; font-size: clamp(1.5rem, 2.6vw, 2.15rem); font-weight: 800; color: #fff; margin: 12px 0 8px; }
.gen__sub { position: relative; z-index: 1; color: rgba(255,255,255,0.8); font-size: 0.98rem; margin: 0 0 6px; max-width: 46ch; }
.gen__ringbig { width: 150px; height: 150px; margin: 26px auto 14px; border-radius: 50%; border: 7px solid rgba(255,255,255,0.16); border-top-color: #fff; animation: spin 0.9s linear infinite; position: relative; z-index: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
.gen__proc { position: relative; z-index: 1; font-size: 0.66rem; letter-spacing: 0.22em; color: rgba(255,255,255,0.7); margin-bottom: 26px; }
.gen__bars { display: grid; gap: 12px; width: min(360px, 82%); position: relative; z-index: 1; }
.genrow { height: 12px; border-radius: 6px; background: rgba(255,255,255,0.15); overflow: hidden; }
.genrow__bar { display: block; height: 100%; width: 30%; border-radius: 6px; background: rgba(255,255,255,0.62); animation: genfill 1.7s ease-in-out infinite; }
@keyframes genfill { 0% { width: 14%; } 50% { width: 86%; } 100% { width: 14%; } }

/* ===== bloque de conversión: "reporte completo bloqueado" ===== */
.pwlock { background: linear-gradient(160deg, #3a1a95 0%, #2a1178 42%, #1c0b58 100%); border: none; padding: 0; overflow: hidden; border-radius: 22px; box-shadow: 0 30px 70px -24px rgba(30,10,80,0.6); margin-top: 26px; }
.pwlock__grid { display: grid; grid-template-columns: 0.92fr 1.08fr; }
.pwlock__teaser { position: relative; background: #2c1480; padding: 40px; display: flex; align-items: center; justify-content: center; min-height: 360px; overflow: hidden; }
.pwl__doc { width: 100%; filter: blur(3.5px); opacity: 0.5; }
.pwl__kpis { display: flex; gap: 12px; margin-bottom: 24px; }
.pwl__kpis span { flex: 1; height: 56px; background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.08)); border-radius: 11px; }
.pwl__row { margin: 15px 0; }
.pwl__bar { display: block; height: 14px; background: linear-gradient(90deg, rgba(255,255,255,0.24), rgba(255,255,255,0.08)); border-radius: 7px; }
.pwlock__veil { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: radial-gradient(120% 90% at 50% 42%, rgba(44,20,128,0.1) 0%, rgba(30,12,80,0.8) 60%, #23106e 100%); }
.pwlock__lockbig { width: 78px; height: 78px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.28); box-shadow: 0 0 0 10px rgba(255,255,255,0.04); }
.pwlock__lockbig svg { width: 34px; height: 34px; stroke: #fff; }
.pwlock__veiltxt { font-size: 0.82rem; letter-spacing: 0.04em; font-weight: 600; color: rgba(255,255,255,0.82); }
.pwlock__body { padding: 44px 42px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.pwlock__eye { display: inline-flex; align-items: center; gap: 8px; font-size: 0.7rem; letter-spacing: 0.18em; font-weight: 700; color: #cbbef7; text-transform: uppercase; margin-bottom: 15px; }
.pwlock__eye svg { width: 13px; height: 13px; stroke: #cbbef7; }
.pwlock__title { font-size: clamp(1.6rem, 2.4vw, 2.1rem); line-height: 1.1; font-weight: 800; color: #fff; margin: 0 0 13px; }
.pwlock__sub { color: #c3b9e8; font-size: 0.96rem; line-height: 1.55; margin: 0 0 22px; }
.pwlock__list { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 12px; }
.pwlock__list li { display: flex; align-items: flex-start; gap: 11px; color: #ece8fb; font-size: 0.94rem; }
.pwlock__list svg { width: 18px; height: 18px; stroke: #00e0ff; flex-shrink: 0; margin-top: 2px; }
.pwlock__ctas { display: flex; gap: 10px; flex-wrap: wrap; }
.pwlock__cta { background: #fff; color: #2a1178; font-weight: 800; font-size: 1.02rem; padding: 15px 28px; border-radius: 13px; border: none; text-decoration: none; display: inline-flex; align-items: center; gap: 10px; box-shadow: 0 14px 34px -10px rgba(0,0,0,0.4); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.pwlock__cta:hover { transform: translateY(-2px); box-shadow: 0 20px 44px -10px rgba(0,0,0,0.5); }
.pwlock__cta svg { width: 18px; height: 18px; stroke: #2a1178; }
.pwlock__alt { background: transparent; color: #cbbef7; border: 1px solid rgba(255,255,255,0.24); font-weight: 700; font-size: 0.94rem; padding: 15px 22px; border-radius: 13px; text-decoration: none; display: inline-flex; align-items: center; }
.pwlock__alt:hover { border-color: rgba(255,255,255,0.5); color: #fff; }
.pwlock__guar { display: flex; align-items: flex-start; gap: 8px; margin-top: 15px; color: #8a8a99; font-size: 0.82rem; line-height: 1.5; }
.pwlock__guar svg { width: 14px; height: 14px; stroke: #8a8a99; flex-shrink: 0; margin-top: 2px; }

/* modal */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(20,12,50,0.55); backdrop-filter: blur(4px); align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.modal-backdrop.is-open { display: flex; }
.modal-card { background: #fff; border-radius: 22px; padding: 28px; max-width: 420px; width: 100%; box-shadow: var(--shadow-lg); position: relative; }
.modal-close { position: absolute; top: 14px; right: 14px; background: transparent; border: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 6px; }
.modal-close:hover { color: var(--ink); }
.modal-card h3 { margin: 0 0 8px; font-size: 1.1rem; font-weight: 800; }
.modal-card p { margin: 0 0 16px; }
.muted { color: var(--muted); font-weight: 300; }
.spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid var(--violet-100); border-top-color: var(--violet-500); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: middle; margin-right: 8px; }
.reset { display: inline-block; margin-top: 22px; color: var(--muted); font-size: 0.84rem; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1000px) {
  .app { grid-template-columns: 1fr; }
  .nav { flex-direction: row; align-items: center; padding: 14px 18px; gap: 14px; }
  .nav__logo { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
  .nav__steps { flex-direction: row; flex: 1; gap: 6px; overflow-x: auto; }
  .nstep span:not(.nstep__ic) { display: none; }
  .nav__card { display: none; }
  .dash { grid-template-columns: 1fr; }
  .dash__side { order: -1; }
}
@media (max-width: 820px) {
  .charts { grid-template-columns: 1fr; }
  .pwlock__grid { grid-template-columns: 1fr; }
  .pwlock__teaser { min-height: 220px; }
  .pwlock__body { padding: 32px 26px; }
}
@media (max-width: 720px) {
  .work__title span { display: none; }
  .dash-cols { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .chart-flex { flex-direction: column; }
  .chart-flex .radar-chart { flex: none; max-width: 220px; }
  .steps__label { display: none; }
  .scorebars { grid-template-columns: 1fr !important; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.1s !important; } }

/* ===================== IMPRESIÓN (el informe descargable) ===================== */
@media print {
  .no-print, .bg, .nav, .dash__side, .overlay { display: none !important; }
  body { background: #fff; }
  .app { display: block; margin: 0; max-width: none; background: #fff; box-shadow: none; backdrop-filter: none; border-radius: 0; }
  .work { padding: 0; }
  .work__head { display: none; }
  .card, .panel, .p2, .kpi, .dim, .pcard { box-shadow: none !important; backdrop-filter: none !important; background: #fff !important; break-inside: avoid; }
  .dims, .cards-grid, .charts, .kpis { break-inside: avoid; }
}
