/* =====================================================================
   Innova Empresarial V2 — Hoja de estilos principal (app.css)
   ---------------------------------------------------------------------
   Stack: CSS3 puro (sin Tailwind, sin frameworks).
   Enfoque: mobile-first, accesible, profesional, rápido.
   Marca V2: INNOVA (negro) + ING (rojo) = INNOVAING
   Paleta: negro / blanco / rojo
   ===================================================================== */

/* ---------- 1. Variables de marca y tema V2 ---------- */
:root {
  /* Marca V2 — Negro/Blanco/Rojo */
  --brand: #dc2626;          /* INNOVA — rojo principal V2 */
  --brand-dark: #b91c1c;     /* rojo profundo */
  --brand-darker: #991b1b;
  --brand-soft: #fef2f2;     /* rojo muy claro (fondos) */
  --brand-tint: #fee2e2;     /* rojo claro (bordes/chips) */

  /* ING — Negro profesional V2 */
  --ink: #0a0a0a;            /* texto principal / ING — negro */
  --ink-soft: #404040;       /* texto secundario */
  --muted: #737373;          /* texto apagado */

  /* Neutros */
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --bg-elev: #ffffff;
  --border: #e5e5e5;
  --border-strong: #d4d4d4;
  --ring: rgba(220, 38, 38, 0.4);

  /* Acentos por perfil (mantener para compatibilidad V1) */
  --amber: #f59e0b;
  --emerald: #10b981;
  --teal: #14b8a6;
  --rose: #f43f5e;

  /* Geometría */
  --radius-sm: 0.5rem;
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;

  /* Sombras */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.10), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.12);

  /* Tipografía */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  /* Layout */
  --container: 920px;
  --header-h: 4rem;
}

/* ---------- 2. Reset moderno ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden; /* sin scroll horizontal */
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- 3. Layout del shell ---------- */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
.app-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1rem;
}
@media (min-width: 640px) { .container { padding-inline: 1.5rem; } }

/* ---------- 4. Encabezado ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-header__meta {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.site-header__version {
  display: none;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--brand-dark);
  background: var(--brand-soft);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}
@media (min-width: 640px) { .site-header__version { display: inline-flex; } }
.site-header__country { display: none; font-size: 0.75rem; color: var(--muted); }
@media (min-width: 768px) { .site-header__country { display: inline; } }

/* ---------- 5. Marca INNOVAING ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  border-radius: var(--radius-sm);
}
.brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.625rem;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.brand__mark svg { width: 1.25rem; height: 1.25rem; }
.brand__wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.brand__line {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.0625rem;
  white-space: nowrap;
}
.brand__innova { color: var(--brand); }
.brand__ing { color: var(--ink); }
.brand__sub {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand-dark);
  margin-top: 0.2rem;
}

/* ---------- 6. Badge superior ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-darker);
  background: var(--brand-soft);
  border: 1px solid var(--brand-tint);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}
.badge__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
}

/* ---------- 7. Pantallas (toggle sin flash) ---------- */
.screen { display: none; }
html[data-stage="landing"] #screen-landing,
html:not([data-stage]) #screen-landing,
html[data-stage="onboarding-intro"] #screen-onboarding-intro,
html[data-stage="onboarding-preparing"] #screen-onboarding-preparing,
html[data-stage="questions"] #screen-questions,
html[data-stage="result"] #screen-result,
html[data-stage="action-check"] #screen-action-check,
html[data-stage="history"] #screen-history,
html[data-stage="business"] #screen-business,
html[data-stage="admin"] #screen-admin {
  display: block;
}

/* ---------- 8. Hero ---------- */
.hero {
  text-align: center;
  padding-block: 2rem 0;
}
@media (min-width: 768px) { .hero { padding-block: 3rem 0; } }
.hero__title {
  font-size: clamp(1.75rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
  max-width: 18ch;
  margin: 1.25rem auto 0;
}
.hero__title-accent {
  color: var(--brand);
}
.hero__subtitle {
  margin-top: 0.875rem;
  font-size: clamp(0.95rem, 2.5vw, 1.125rem);
  color: var(--ink-soft);
  max-width: 40ch;
  margin-inline: auto;
}
.hero__hint {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
}

/* ---------- 9. Sección pregunta + perfiles ---------- */
.section-title {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin: 2.25rem 0 1.125rem;
}
.section-title__line {
  display: none;
  flex: 1;
  height: 1px;
  background: linear-gradient(to var(--dir, right), transparent, var(--border));
}
@media (min-width: 640px) { .section-title__line { display: block; } }
.section-title__text {
  font-size: clamp(1.05rem, 3vw, 1.25rem);
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}

.profiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 640px) { .profiles { grid-template-columns: 1fr 1fr; gap: 1rem; } }

/* Tarjeta = botón completo (toda clickeable) */
.profile-card {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  width: 100%;
  text-align: left;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.125rem;
  min-height: 5.5rem;
  box-shadow: var(--shadow-xs);
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease, background 0.18s ease;
}
@media (min-width: 640px) { .profile-card { min-height: 6.25rem; padding: 1.125rem 1.25rem; } }
.profile-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.profile-card:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.profile-card[data-accent="amber"]:hover { border-color: rgba(245, 158, 11, 0.6); }
.profile-card[data-accent="emerald"]:hover { border-color: rgba(16, 185, 129, 0.6); }
.profile-card[data-accent="teal"]:hover { border-color: rgba(20, 184, 166, 0.6); }
.profile-card[data-accent="rose"]:hover { border-color: rgba(244, 63, 94, 0.55); }

.profile-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius);
  background: var(--bg-soft);
  font-size: 1.5rem;
  flex-shrink: 0;
  transition: background 0.18s ease;
}
.profile-card:hover .profile-card__icon { background: #fff; }
@media (min-width: 640px) { .profile-card__icon { width: 3rem; height: 3rem; font-size: 1.75rem; } }
.profile-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.profile-card__label {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}
@media (min-width: 640px) { .profile-card__label { font-size: 1rem; } }
.profile-card__desc {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted);
}
@media (min-width: 640px) { .profile-card__desc { font-size: 0.875rem; } }
.profile-card__arrow {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--muted);
  transition: transform 0.18s ease, color 0.18s ease;
}
.profile-card:hover .profile-card__arrow {
  transform: translateX(3px);
  color: var(--brand);
}

.privacy-note {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}
.privacy-note__icon { width: 0.875rem; height: 0.875rem; color: var(--brand); flex-shrink: 0; }

/* ---------- 10. Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  min-height: 3rem;
  transition: background 0.16s ease, border-color 0.16s ease,
    color 0.16s ease, box-shadow 0.16s ease, transform 0.08s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 1.125rem; height: 1.125rem; }

/* Acción principal: verde sólido */
.btn--primary {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--brand-dark); }
.btn--primary:active { background: var(--brand-darker); }

/* Acción secundaria: blanco con borde */
.btn--secondary {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--border-strong);
}
.btn--secondary:hover { background: var(--bg-soft); border-color: var(--ink-soft); }

/* Acción terciaria: texto/enlace */
.btn--tertiary {
  background: transparent;
  color: var(--ink-soft);
  padding-inline: 0.75rem;
}
.btn--tertiary:hover { color: var(--brand); }

.btn--block { width: 100%; }
.btn--lg { min-height: 3.25rem; font-size: 1rem; padding-inline: 1.75rem; }

.btn-row {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-top: 2rem;
}
@media (min-width: 640px) {
  .btn-row { flex-direction: row; justify-content: center; align-items: center; }
  .btn-row .btn--block { width: auto; }
}

/* ---------- 11. Onboarding ---------- */
.onboarding {
  max-width: 560px;
  margin-inline: auto;
  padding-block: 2rem 3rem;
}
@media (min-width: 768px) { .onboarding { padding-block: 3rem 3rem; } }

.onboarding__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: var(--radius-xl);
  background: var(--brand-soft);
  font-size: 2rem;
  margin-inline: auto;
}
.onboarding__icon--check {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-radius: 999px;
}
.onboarding__icon--check svg { width: 2rem; height: 2rem; }

.onboarding__title {
  text-align: center;
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
  margin-top: 1.25rem;
}
.onboarding__text {
  text-align: center;
  font-size: 0.9375rem;
  color: var(--ink-soft);
  margin-top: 0.75rem;
  max-width: 42ch;
  margin-inline: auto;
}

/* Tarjeta de recap del perfil */
.recap {
  margin-top: 2rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.125rem 1.25rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
}
.recap--active { border-width: 2px; }
.recap[data-accent="amber"].recap--active { border-color: var(--amber); background: #fffbeb; }
.recap[data-accent="emerald"].recap--active { border-color: var(--emerald); background: #ecfdf5; }
.recap[data-accent="teal"].recap--active { border-color: var(--teal); background: #f0fdfa; }
.recap[data-accent="rose"].recap--active { border-color: var(--rose); background: #fff1f2; }
.recap__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  font-size: 1.25rem;
  flex-shrink: 0;
}
.recap__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.recap__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  margin-top: 0.2rem;
}
.recap__promise {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  line-height: 1.45;
  margin-top: 0.35rem;
}

/* ---------- 12. Progreso ---------- */
.progress {
  margin-bottom: 2rem;
}
.progress__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  font-size: 0.75rem;
}
.progress__label { font-weight: 600; color: var(--ink); }
.progress__value { color: var(--muted); font-variant-numeric: tabular-nums; }
.progress__track {
  height: 0.375rem;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-dark) 100%);
  border-radius: 999px;
  transition: width 0.4s ease;
  width: 0%;
}

/* ---------- 13. Chips para cambiar de perfil ---------- */
.chips-title {
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  box-shadow: var(--shadow-xs);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  max-width: 14rem;
}
.chip:hover { transform: translateY(-1px); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.chip__emoji { font-size: 0.875rem; }
.chip__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chips-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.chips-note svg { width: 0.875rem; height: 0.875rem; }

/* ---------- 14. Pie de página (sticky al fondo) ---------- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}
.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding-block: 0.875rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}
@media (min-width: 640px) {
  .site-footer__inner { flex-direction: row; text-align: left; }
}
.site-footer__brand { font-weight: 600; color: var(--ink-soft); }
.site-footer__country { display: inline-flex; align-items: center; gap: 0.35rem; }

/* ---------- 15. Utilidades ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.text-center { text-align: center; }
.mt-2 { margin-top: 0.5rem; }
.mt-8 { margin-top: 2rem; }

/* ---------- 16. Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 17. Pantalla de preguntas ---------- */
.onboarding--questions { max-width: 640px; }

.question { margin-top: 1.5rem; }
.question__hint-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  background: var(--brand-soft);
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}
.question__prompt {
  font-size: clamp(1.25rem, 4vw, 1.625rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.question__hint {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  min-height: 3rem;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.08s ease;
  cursor: pointer;
}
.option:hover {
  border-color: var(--border-strong);
  background: var(--bg-soft);
}
.option:active { transform: translateY(1px); }
.option--selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px var(--brand);
}
.option__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  border: 2px solid var(--border-strong);
  color: transparent;
  flex-shrink: 0;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}
.option__check svg { width: 0.875rem; height: 0.875rem; }
.option--selected .option__check {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.option__label {
  flex: 1;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}

.question__open { margin-top: 1.25rem; }
.question__open-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}
.question__open-input {
  width: 100%;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.75rem 0.875rem;
  min-height: 3rem;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.question__open-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--ring);
}
.question__open-input::placeholder { color: var(--muted); }

.question__ab {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .question__ab { grid-template-columns: 1fr 1fr; }
}
.question__ab-field { display: flex; flex-direction: column; }
.question__ab-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.btn-row--questions {
  display: flex;
  gap: 0.625rem;
  align-items: center;
  margin-top: 2rem;
}
.btn-row--questions .btn--secondary { flex: 0 0 auto; min-width: 5rem; }
.btn-row--questions .btn--primary { flex: 1; }
.btn-row--questions .btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn--view-result { background: var(--brand); }
.btn--view-result:hover { background: var(--brand-dark); }

/* ---------- 18. Pantalla de resultado ---------- */
.onboarding--result { max-width: 720px; }

.result { display: flex; flex-direction: column; gap: 0.875rem; margin-top: 1.5rem; }

/* A. Encabezado del resultado */
.result__hero {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.result__emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-lg);
  background: var(--brand-soft);
  font-size: 1.5rem;
  flex-shrink: 0;
}
.result__hero-text { min-width: 0; }
.result__headline {
  font-size: clamp(1.375rem, 4.5vw, 1.875rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
  margin: 0;
}
.result__profile {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* D. Tu siguiente paso — máximo peso visual, aparece primero */
.result__card--step {
  border-color: var(--brand);
  background: linear-gradient(180deg, var(--brand-soft) 0%, #ffffff 100%);
  box-shadow: var(--shadow-md);
  padding: 1.25rem 1.375rem;
  position: relative;
}
.result__card--step::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--brand);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.result__card--step .result__card-title {
  color: var(--brand-dark);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
}
.result__card--step .result__card-body {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.55;
}

/* B/C. Cards normales (entendimos / importante) */
.result__card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.125rem 1.25rem;
  box-shadow: var(--shadow-xs);
}
.result__card-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.result__card-body {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink);
}

/* Listas dentro de cards */
.result__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.result__list-item {
  position: relative;
  padding-left: 1.25rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.result__list-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 999px;
  background: var(--brand);
}

/* E. Información adicional — separada visualmente */
.result__extra {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.result__extra-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
/* Las listas dentro de extra tienen fondo más sutil */
.result__extra .result__card {
  background: var(--bg-soft);
  box-shadow: none;
}

/* Caminos explorables */
.result__paths {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.result__paths-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.result__path {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.125rem;
  box-shadow: var(--shadow-xs);
}
.result__path-head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.5rem;
}
.result__path-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.result__path-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.result__path-porque {
  font-size: 0.875rem;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0 0 0.625rem;
}
.result__path-step {
  font-size: 0.8125rem;
  color: var(--ink);
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 0.625rem 0.75rem;
}
.result__path-step-label {
  font-weight: 700;
  color: var(--brand-dark);
  margin-right: 0.25rem;
}

/* Nota breve de punto de partida */
.result__disclaimer {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
  margin-top: 0.5rem;
  padding: 0 0.5rem;
}

/* =====================================================================
   12b. Premium Result Dashboard — datos reales del motor
   ---------------------------------------------------------------------
   No inventa scores ni dimensiones. Usa understood/important/step/
   needToCheck/faltaInfo/paths/areas/context del engine.js congelado.
   ===================================================================== */

/* Hero premium con badge */
.result__hero--premium {
  background: linear-gradient(135deg, var(--ink) 0%, #1a1a1a 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-md);
}
.result__hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}
.result__hero-emoji { font-size: 1rem; line-height: 1; }
.result__hero-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #fecaca;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.result__hero--premium .result__headline {
  color: #fff;
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 800;
  margin: 0 0 0.25rem;
}
.result__hero--premium .result__profile {
  color: #a3a3a3;
  font-size: 0.9375rem;
  margin: 0;
}

/* Tu siguiente paso — destacado */
.result__step-premium {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}
.result__step-premium-icon {
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
}
.result__step-premium-icon svg { width: 1.25rem; height: 1.25rem; color: #fff; }
.result__step-premium-body { flex: 1; min-width: 0; }
.result__step-premium-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.25rem;
}
.result__step-premium-text {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  margin: 0;
  color: #fff;
}

/* Grid de señales (fortalezas/riesgos/incertidumbres) */
.result__signals {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 768px) {
  .result__signals { grid-template-columns: repeat(3, 1fr); }
}
.result__signal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.125rem;
  border-left: 4px solid var(--muted);
}
.result__signal--favor { border-left-color: var(--brand); }
.result__signal--risk { border-left-color: var(--amber); }
.result__signal--uncertain { border-left-color: var(--muted); }
.result__signal-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.result__signal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex: 0 0 auto;
}
.result__signal--favor .result__signal-icon { background: var(--brand); }
.result__signal--risk .result__signal-icon { background: var(--amber); }
.result__signal--uncertain .result__signal-icon { background: var(--muted); }
.result__signal-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.result__signal-body {
  font-size: 0.875rem;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0;
}
.result__signal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.result__signal-list li {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  line-height: 1.4;
  padding-left: 0.875rem;
  position: relative;
}
.result__signal-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--muted);
  font-weight: 700;
}

/* Tarjeta "lo que entendimos" */
.result__card--understood {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.125rem 1.25rem;
  margin-bottom: 1.25rem;
}

/* Áreas (business) — grid 2x2 */
.result__areas { margin-bottom: 1.25rem; }
.result__areas-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.625rem;
}
.result__areas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
}
.result__area {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.result__area--pain { border-top: 3px solid var(--brand); }
.result__area--goal { border-top: 3px solid var(--emerald); }
.result__area--gap { border-top: 3px solid var(--amber); }
.result__area--top { border-top: 3px solid var(--ink); }
.result__area-label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.result__area-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

/* Contexto (decision) */
.result__context { margin-bottom: 1.25rem; }
.result__context-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.625rem;
}
.result__context-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}
@media (min-width: 560px) {
  .result__context-grid { grid-template-columns: 1fr 1fr; }
}
.result__context-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.result__context-item--ab { border-left: 3px solid var(--brand); }
.result__context-label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.result__context-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}

/* Caminos (explorer) — grid de tarjetas */
.result__paths-premium { margin-bottom: 1.25rem; }
.result__paths-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .result__paths-grid { grid-template-columns: 1fr 1fr; }
}
.result__path-premium {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.result__path-premium:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}
.result__path-premium-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  flex: 0 0 auto;
}
.result__path-premium-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.result__path-premium-porque {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  line-height: 1.45;
  margin: 0;
}
.result__path-premium-step {
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.75rem;
  margin-top: auto;
}
.result__path-premium-step-label {
  display: block;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-dark);
  margin-bottom: 0.125rem;
}
.result__path-premium-step p {
  font-size: 0.8125rem;
  color: var(--ink);
  margin: 0;
  line-height: 1.4;
}

/* Bloque de acciones (guardar + secundarias) */
.result__actions {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.result__save-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: center;
  margin: 0;
}

.result__saved-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 0.875rem;
  background: var(--brand-soft);
  border: 1px solid var(--brand-tint);
  border-radius: var(--radius);
  color: var(--brand-darker);
  font-size: 0.8125rem;
  line-height: 1.45;
}
.result__saved-note svg { color: var(--brand); flex-shrink: 0; margin-top: 0.1rem; }

.btn-row--secondary {
  margin-top: 0.25rem;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
}
.btn-row--secondary .btn--block { width: 100%; flex: none; }
@media (min-width: 480px) {
  .btn-row--secondary { flex-direction: row; }
  .btn-row--secondary .btn--block { width: auto; flex: 1; }
}

.result__empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
}

@media (max-width: 412px) {
  .result__card { padding: 1rem; }
  .result__card--step { padding: 1.0625rem 1.125rem; }
  .result__path { padding: 0.875rem 1rem; }
  .result__headline { font-size: 1.3125rem; }
}

/* ---------- 19. Pantalla de comprobación accionable ---------- */
.onboarding--action { max-width: 680px; }

.action-check { display: flex; flex-direction: column; gap: 0.875rem; margin-top: 1.5rem; }

.action-check__hero {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.action-check__eyebrow {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-dark);
  margin-bottom: 0.25rem;
}
.action-check__headline {
  font-size: clamp(1.375rem, 4.5vw, 1.875rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
  margin: 0;
}

.action-check__card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.125rem 1.25rem;
  box-shadow: var(--shadow-xs);
}
.action-check__card-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.action-check__card-body {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink);
}

/* Card de interpretación — 3 sub-bloques */
.action-check__card--interpret {
  background: var(--bg-soft);
  border-color: var(--border);
}
.action-check__interpret-grid {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
@media (min-width: 640px) {
  .action-check__interpret-grid { grid-template-columns: 1fr; }
}
.action-check__interpret-item {
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 0.75rem 0.875rem;
  border-left: 3px solid var(--border-strong);
}
.action-check__interpret-item--advance { border-left-color: var(--brand); }
.action-check__interpret-item--reconsider { border-left-color: var(--amber); }
.action-check__interpret-item--ambiguous { border-left-color: var(--muted); }
.action-check__interpret-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.action-check__interpret-item--advance .action-check__interpret-label { color: var(--brand-dark); }
.action-check__interpret-item--reconsider .action-check__interpret-label { color: #92400e; }
.action-check__interpret-text {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
}

/* Sección de evidencia */
.action-check__evidence-section {
  margin-top: 0.5rem;
}
.action-check__pending {
  text-align: center;
  padding: 1rem 0.5rem;
}
.action-check__pending-text {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin-bottom: 1rem;
  line-height: 1.5;
}
.action-check__evidence-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.action-check__evidence-label,
.action-check__interpret-select-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0;
}
.action-check__evidence-input {
  width: 100%;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.75rem 0.875rem;
  min-height: 4.5rem;
  resize: vertical;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.action-check__evidence-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--ring);
}
.action-check__evidence-input::placeholder { color: var(--muted); }
.action-check__interpret-select {
  width: 100%;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.625rem 0.75rem;
  min-height: 2.75rem;
}
.action-check__interpret-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--ring);
}

/* Conclusión */
.action-check__conclusion {
  margin-top: 0.25rem;
}
.action-check__conclusion-box {
  background: var(--brand-soft);
  border: 1px solid var(--brand-tint);
  border-radius: var(--radius);
  padding: 0.75rem 0.875rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--brand-darker);
}
.action-check__conclusion-label {
  font-weight: 700;
  color: var(--brand-dark);
}
.action-check__conclusion-text {
  font-weight: 500;
}

.action-check__empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
}

@media (max-width: 412px) {
  .action-check__card { padding: 1rem; }
  .action-check__interpret-item { padding: 0.625rem 0.75rem; }
  .action-check__headline { font-size: 1.3125rem; }
}

/* ---------- 20. Tu Radiografía (capa de comprensión) ---------- */
.result__radiografia-toggle {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}
.result__radiografia-toggle .btn { margin-bottom: 0.5rem; }

.radiografia {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-top: 0.5rem;
}
.radiografia__block {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  border-left: 3px solid var(--border-strong);
}
.radiografia__block--favor { border-left-color: var(--brand); }
.radiografia__block--atencion { border-left-color: var(--amber); }
.radiografia__block--conexiones { border-left-color: var(--teal); }
.radiografia__block--vacios { border-left-color: var(--muted); }

.radiografia__block-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.radiografia__block--favor .radiografia__block-title { color: var(--brand-dark); }
.radiografia__block--atencion .radiografia__block-title { color: #92400e; }
.radiografia__block--conexiones .radiografia__block-title { color: #0f766e; }

.radiografia__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.radiografia__item {
  position: relative;
  padding-left: 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.radiografia__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 0.3125rem;
  height: 0.3125rem;
  border-radius: 999px;
  background: var(--border-strong);
}
.radiografia__block--favor .radiografia__item::before { background: var(--brand); }
.radiografia__block--atencion .radiografia__item::before { background: var(--amber); }
.radiografia__block--conexiones .radiografia__item::before { background: var(--teal); }
.radiografia__block--vacios .radiografia__item::before { background: var(--muted); }

@media (max-width: 412px) {
  .radiografia__block { padding: 0.75rem 0.875rem; }
  .radiografia__item { font-size: 0.75rem; }
}

/* ---------- 21. AI Insight (capa de profundización V2) ---------- */
.result__ai-toggle {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}
.result__ai-toggle .btn { margin-bottom: 0.5rem; }

.ai-insight {
  margin-top: 0.5rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.125rem 1.25rem;
  box-shadow: var(--shadow-sm);
}
.ai-insight__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.ai-insight__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}
.ai-insight__cached {
  font-size: 0.625rem;
  color: var(--muted);
}
.ai-insight__content {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--ink-soft);
}
.ai-insight__note {
  margin-top: 0.75rem;
  font-size: 0.6875rem;
  color: var(--muted);
  line-height: 1.4;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}
.ai-insight__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 0;
}
.ai-insight__spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: ai-spin 0.8s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-insight__loading p {
  font-size: 0.875rem;
  color: var(--muted);
}
.ai-insight__fallback {
  padding: 1rem 0;
  text-align: center;
}
.ai-insight__fallback p {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin-bottom: 0.25rem;
}
.ai-insight__fallback-detail {
  font-size: 0.75rem !important;
  color: var(--muted) !important;
}
.ai-insight__error {
  padding: 1rem 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}

@media (max-width: 412px) {
  .ai-insight { padding: 1rem; }
  .ai-insight__content { font-size: 0.8125rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-insight__spinner { animation: none; }
}

/* =====================================================================
   21. FASE 3 — Usuario, cuenta, historial y planes
   ---------------------------------------------------------------------
   Capa adicional sobre V1/V2. Misma paleta negro/blanco/rojo.
   El registro NO es barrera: el diagnóstico sigue funcionando sin cuenta.
   ===================================================================== */

/* Agrupar meta + barra de usuario a la derecha del header. */
.site-header__meta { margin-left: auto; }
.site-header__user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Botón pequeño (header) */
.btn--sm {
  min-height: 2.25rem;
  font-size: 0.8125rem;
  padding-inline: 0.75rem;
}

/* Chip de usuario autenticado */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.625rem 0.25rem 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  max-width: 14rem;
}
.user-chip:hover { border-color: var(--brand); background: var(--brand-soft); }
.user-chip__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  flex: 0 0 auto;
}
.user-chip__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  min-width: 0;
}
.user-chip__email {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-chip__plan {
  font-size: 0.625rem;
  color: var(--muted);
}
.user-logout {
  min-height: 2.25rem;
  font-size: 0.75rem;
  padding-inline: 0.625rem;
}
@media (max-width: 480px) {
  .user-chip__email { max-width: 7.5rem; }
  .site-header__version { display: none !important; }
}

/* ---------- Modal de autenticación ---------- */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.auth-modal[hidden] { display: none; }
.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.auth-modal__panel {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 26rem;
  padding: 1.75rem 1.5rem 1.5rem;
  max-height: 90vh;
  overflow-y: auto;
}
.auth-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.auth-modal__close:hover { background: var(--bg-soft); color: var(--ink); }
.auth-modal__title {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 0.25rem;
}
.auth-modal__subtitle {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.auth-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-soft);
  padding: 0.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
}
.auth-tabs__tab {
  flex: 1;
  min-height: 2.5rem;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.auth-tabs__tab--active {
  background: var(--bg);
  color: var(--brand-dark);
  box-shadow: var(--shadow-xs);
}
.auth-tabs__tab:hover:not(.auth-tabs__tab--active) { color: var(--ink); }

.auth-panel { display: flex; flex-direction: column; gap: 0.875rem; }
.auth-panel[hidden] { display: none; }

.auth-field { display: flex; flex-direction: column; gap: 0.375rem; }
.auth-field__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.auth-field__input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-field__input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--ring);
}
.auth-hint {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
}
.auth-error {
  font-size: 0.8125rem;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  margin: 0;
}
.auth-error[hidden] { display: none; }
.auth-modal__note {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}

/* ---------- Aviso de migración ---------- */
.migration-prompt {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 90;
  width: calc(100% - 2rem);
  max-width: 32rem;
}
.migration-prompt[hidden] { display: none; }
.migration-prompt__body {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.migration-prompt__text {
  font-size: 0.875rem;
  margin: 0;
}
.migration-prompt .btn-row { margin: 0; }
.migration-prompt .btn--primary { background: var(--brand); border-color: var(--brand); }
.migration-prompt .btn--primary:hover { background: var(--brand-dark); }
.migration-prompt .btn--tertiary { color: #fff; }
.migration-prompt .btn--tertiary:hover { color: var(--brand); }

/* ---------- Pantalla Historial ---------- */
.onboarding--history { padding-block: 1.5rem 2rem; }
.history-head { text-align: center; margin-bottom: 1.5rem; }
.history-head__title {
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  font-weight: 800;
  color: var(--ink);
}
.history-head__subtitle {
  font-size: 0.9375rem;
  color: var(--muted);
  margin-top: 0.25rem;
}
.history-root { margin-bottom: 1.5rem; }

.history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.history-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  text-align: left;
  padding: 1rem 1.125rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}
.history-item:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.history-item:active { transform: translateY(1px); }
.history-item__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  font-size: 1.25rem;
  flex: 0 0 auto;
}
.history-item__body {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
  flex: 1;
}
.history-item__date {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--brand-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.history-item__summary {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-item__meta {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  color: var(--muted);
}
.history-item__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.625rem;
}
.history-item__badge--ai { background: var(--ink); color: #fff; }
.history-item__arrow { width: 1.25rem; height: 1.25rem; color: var(--muted); flex: 0 0 auto; }
.history-item:hover .history-item__arrow { color: var(--brand); }

.history-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}
.history-empty p { font-size: 0.9375rem; margin: 0; }
.history-empty__hint { font-size: 0.8125rem !important; margin-top: 0.5rem !important; }
.history-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-size: 0.875rem;
}

@media (prefers-reduced-motion: reduce) {
  .user-chip, .history-item, .auth-tabs__tab, .auth-field__input { transition: none; }
}

/* =====================================================================
   22. FASE 4 — Pagos: modal Premium, oferta, estado, overlay, resultado
   ---------------------------------------------------------------------
   Reutiliza .auth-modal (definido en Sección 21) para el modal premium.
   Misma paleta negro/blanco/rojo.
   ===================================================================== */

/* Modal Premium: hereda de .auth-modal/.auth-modal__panel (Sección 21). */
.premium-modal .auth-modal__title { color: var(--brand-dark); }

/* Cuerpo de oferta (usuario Free). */
.premium-offer { display: flex; flex-direction: column; gap: 0.875rem; }
.premium-offer__title {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}
.premium-offer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.premium-offer__list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
  line-height: 1.4;
}
.premium-offer__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  flex: 0 0 auto;
  margin-top: 0.0625rem;
}
.premium-offer__price {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0.25rem 0 0;
}
.premium-offer__price-note {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}
.premium-offer__note {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin: 0;
  line-height: 1.4;
}

/* Estado Premium (usuario ya Premium). */
.premium-status {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 1rem 0;
}
.premium-status__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.premium-status__text {
  font-size: 0.9375rem;
  color: var(--ink);
  margin: 0;
}
.premium-status__period {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0;
}

/* Spinner de carga dentro del modal premium. */
.premium-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 0;
  color: var(--muted);
  font-size: 0.875rem;
}

/* ---------- Overlay de procesamiento de pago ---------- */
.payment-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  padding: 1rem;
}
.payment-overlay[hidden] { display: none; }
.payment-overlay__box {
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.75rem 1.5rem;
  text-align: center;
  max-width: 22rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
}
.payment-overlay__text {
  font-size: 0.9375rem;
  color: var(--ink);
  margin: 0;
  line-height: 1.4;
}

/* ---------- Resultado de pago ---------- */
.payment-result-wrap {
  position: fixed;
  inset: 0;
  z-index: 115;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  padding: 1rem;
}
.payment-result-wrap[hidden] { display: none; }
.payment-result {
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.75rem 1.5rem;
  text-align: center;
  max-width: 24rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.payment-result__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 700;
}
.payment-result--success .payment-result__icon {
  background: var(--brand);
  color: #fff;
}
.payment-result--pending .payment-result__icon {
  background: var(--bg-soft);
  color: var(--ink-soft);
  border: 2px solid var(--border-strong);
}
.payment-result__title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}
.payment-result__text {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.5;
}
.payment-result .btn { margin-top: 0.5rem; }

/* El botón "Mejorar a Premium" en el header es apuntado, no degrada el layout. */
.site-header__user .btn--sm[data-action="open-premium"] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.site-header__user .btn--sm[data-action="open-premium"]:hover {
  background: var(--brand);
  border-color: var(--brand);
}

@media (max-width: 480px) {
  .premium-offer__price { font-size: 1.5rem; }
  .payment-overlay__box, .payment-result { padding: 1.25rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .payment-overlay, .payment-result-wrap { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* =====================================================================
   23. FASE 5 — Business: dashboard, stats, clientes, white-label
   ---------------------------------------------------------------------
   Reutiliza .auth-modal (Sección 21) para los modales de invite/wl.
   Misma paleta. El botón "Business" del header usa el estilo primary.
   ===================================================================== */

.onboarding--business { padding-block: 1.5rem 2rem; }
.business-root { margin-bottom: 1.5rem; }

/* Acciones superiores del dashboard. */
.biz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

/* Tarjetas de estadísticas. */
.biz-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}
@media (min-width: 768px) {
  .biz-stats { grid-template-columns: repeat(4, 1fr); }
}
.biz-stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.biz-stat__value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--brand-dark);
  line-height: 1.1;
}
.biz-stat__label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

/* Secciones del dashboard. */
.biz-section { margin-bottom: 1.75rem; }
.biz-section__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.75rem;
}
.biz-empty {
  font-size: 0.875rem;
  color: var(--muted);
  padding: 1rem 0;
  margin: 0;
}

/* Ítem de lista estático (no clickeable, p. ej. invitaciones pendientes). */
.history-item--static { cursor: default; }
.history-item--static:hover { border-color: var(--border); box-shadow: none; }

/* Cabecera de detalle de cliente. */
.biz-client-head {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.biz-client-head__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--brand-soft);
  font-size: 1.5rem;
  flex: 0 0 auto;
}
.biz-client-head__email {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  word-break: break-all;
}
.biz-client-head__meta {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0.125rem 0 0;
}

/* Textarea de notas de seguimiento. */
.biz-notes-input {
  width: 100%;
  min-height: 6rem;
  resize: vertical;
  margin-bottom: 0.5rem;
}
.biz-notes-saved {
  font-size: 0.8125rem;
  color: var(--brand-dark);
  margin: 0.5rem 0 0;
}
.biz-notes-saved[hidden] { display: none; }

/* Botón PDF dentro de un item de diagnóstico de cliente. */
.history-item .btn--sm[data-biz-report] {
  flex: 0 0 auto;
  margin-left: auto;
}

/* Input de color en el modal white-label. */
.auth-field__input--color {
  height: 2.75rem;
  padding: 0.25rem;
  cursor: pointer;
}

@media (max-width: 480px) {
  .biz-stat__value { font-size: 1.375rem; }
  .biz-actions .btn { flex: 1 1 auto; }
}

/* =====================================================================
   24. FASE 6 — Admin screen + UX polish
   ---------------------------------------------------------------------
   Reutiliza .biz-stats / .biz-section / .history-list del panel Business.
   ===================================================================== */
.onboarding--admin { padding-block: 1.5rem 2rem; }
.admin-root { margin-bottom: 1.5rem; }

/* UX: focus visible más claro para accesibilidad (todo tipo de botones). */
.btn:focus-visible,
.user-chip:focus-visible,
.history-item:focus-visible,
.auth-tabs__tab:focus-visible,
.auth-field__input:focus-visible,
.chip:focus-visible,
.profile-card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* UX: estados disabled más claros. */
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* UX: respetar prefers-reduced-motion globalmente. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =====================================================================
   25. Premium UX polish — A/B context, focus, micro-mejoras
   ===================================================================== */

/* Hint explicativo para preguntas A/B (era ambiguo qué significaba A y B). */
.question__ab-hint {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

/* Mejor feedback visual en opciones de pregunta seleccionadas. */
.options [data-option-value][aria-pressed="true"],
.options [data-option-value].is-selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 2px var(--ring);
}

/* Scrollbar styling para listas largas (historial, business). */
.history-list,
.biz-notes-input {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.history-list::-webkit-scrollbar,
.biz-notes-input::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.history-list::-webkit-scrollbar-thumb,
.biz-notes-input::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}
.history-list::-webkit-scrollbar-track,
.biz-notes-input::-webkit-scrollbar-track {
  background: transparent;
}
