/* KRONAI · auditoría de IA — extiende index.css (tokens, .btn, .beam) */

.audit { padding: clamp(56px, 8vw, 96px) 0; }
.audit [hidden] { display: none !important; }
.audit-wrap { max-width: 1024px; }

/* ─── cabecera, aviso y progreso ─── */
.audit-banner {
  display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 10px 14px;
  border-radius: 12px; background: #eaf3fd; border: 1px solid #cfe2f8; font-size: 13px; color: var(--ink-2);
}
.audit-banner b { color: var(--ink); }
.audit-banner .gfx-ico { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent); }
.audit-eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--accent); }
.audit-eyebrow .gfx-ico { width: 16px; height: 16px; }
.audit-title { margin-bottom: 22px; font-size: clamp(28px, 5.4vw, 44px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.08; text-wrap: balance; }
.audit-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.audit-bars span { position: relative; height: 5px; border-radius: 999px; background: var(--line-light); overflow: hidden; }
.audit-bars span::after { content: ""; position: absolute; inset: 0; width: 0; border-radius: inherit; background: var(--accent); transition: width .4s var(--ease-out); }
.audit-bars span.done::after { width: 100%; }
.audit-bars span.cur::after { width: 45%; }
.audit-progress { margin: 10px 0 20px; font-size: 13px; color: var(--ink-3); }
.audit-noscript { margin-bottom: 20px; font-size: 17px; color: var(--ink-2); }
.audit-noscript a { color: var(--accent); text-decoration: underline; }

/* ─── tarjeta ─── */
.audit-card {
  padding: 24px 16px 20px; border-radius: var(--radius); background: var(--paper-2);
}
.audit-card fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
.audit-card legend {
  display: block; width: 100%; margin-bottom: 20px; padding: 0;
  font-size: clamp(26px, 5vw, 34px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1;
}
.audit-card legend:focus { outline: none; }
.audit-card.shake { animation: audit-shake .4s var(--ease-out); }
@keyframes audit-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.audit-help { margin-bottom: 20px; font-size: 15px; color: var(--ink-2); }
.audit-sub { margin: 28px 0 12px; font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }

/* ─── campos ─── */
.audit label { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.audit-field { margin-bottom: 18px; }
.audit input[type="text"], .audit input[type="email"], .audit input[type="number"], .audit select {
  display: block; width: 100%; min-height: 44px; margin-top: 6px; padding: 10px 14px;
  border: 1px solid var(--line-light); border-radius: 12px; background: var(--paper);
  font: inherit; font-size: 16px; font-weight: 400; color: var(--ink);
}
.audit input:focus-visible, .audit select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.audit [aria-invalid="true"] { border-color: #d93025; box-shadow: 0 0 0 3px rgba(217,48,37,.15); }

/* ─── roles ─── */
.audit-roles { display: grid; gap: 10px; grid-template-columns: 1fr; }
.audit-role { padding: 0; border-radius: 16px; background: var(--paper); border: 1.5px solid var(--line-light); transition: border-color .2s ease, box-shadow .2s ease; }
.audit-role:hover { border-color: #b4cfee; }
.audit-role.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,113,227,.12); }
.audit label.audit-check { position: relative; display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 8px 16px; cursor: pointer; font-size: 15px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--ink) !important; }
.audit label.audit-check input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.audit-role-ico { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px; background: #eaf3fd; color: var(--accent); }
.audit-role-ico .gfx-ico { width: 20px; height: 20px; }
.audit-role-name { flex: 1; min-width: 0; }
.audit-tick { position: relative; width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; border: 2px solid #c3c3c8; box-sizing: border-box; transition: background-color .2s ease, border-color .2s ease; }
.audit-tick::after { content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(0); transition: transform .2s var(--ease-out); }
.audit-role.on .audit-tick { background: var(--accent); border-color: var(--accent); }
.audit-role.on .audit-tick::after { transform: rotate(45deg) scale(1); }
.audit-check input:focus-visible ~ .audit-tick { outline: 2px solid var(--accent); outline-offset: 3px; }
.audit-role-fields { display: none; gap: 16px; padding: 4px 16px 18px; grid-template-columns: 1fr; border-top: 1px solid var(--line-light); margin-top: 2px; padding-top: 16px; }
.audit-role.on { grid-column: 1 / -1; }
.audit-role.on .audit-role-fields { display: grid; }
.audit-range { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.audit-range input[type="range"] { flex: 1; min-width: 0; margin: 0; accent-color: var(--accent); }
.audit-range output { min-width: 4ch; font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 600; color: var(--ink); text-align: right; }
.audit-ticks { display: flex; justify-content: space-between; margin-top: 4px; padding-right: calc(4ch + 14px); font-size: 11px; font-weight: 500; color: var(--ink-3); }

/* ─── sistemas ─── */
.audit-systems { display: flex; flex-wrap: wrap; gap: 8px; }
.audit label.audit-chip { position: relative; margin: 0; cursor: pointer; }
.audit-chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.audit-chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--line-light);
  font-size: 15px; font-weight: 500; color: var(--ink);
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.audit-chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.audit-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ─── preguntas ─── */
.audit-q { margin-bottom: 28px; }
.audit-q-text { margin-bottom: 12px; font-size: 18px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }
.audit label.audit-opt { position: relative; display: block; margin: 0 0 8px; cursor: pointer; }
.audit-opt span {
  display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 10px 16px; border-radius: 14px;
  background: var(--paper); border: 1.5px solid var(--line-light);
  font-size: 15px; font-weight: 600; line-height: 1.35; letter-spacing: .01em; color: var(--ink);
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.audit-letter { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0; border-radius: 8px; background: #eaf3fd; color: var(--accent); font-style: normal; font-size: 13px; font-weight: 700; transition: background-color .2s ease, color .2s ease; }
.audit-opt:hover span { border-color: #b4cfee; }
.audit-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.audit-opt input:checked + span { border-color: var(--accent); background: var(--accent); color: #fff; }
.audit-opt input:checked + span .audit-letter { background: rgba(255,255,255,.22); color: #fff; }
.audit-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ─── métricas gratis ─── */
.audit-metrics { display: grid; gap: 10px; margin-bottom: 14px; grid-template-columns: 1fr; }
.audit-metric { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line-light); }
.audit-metric-ico { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: #eaf3fd; color: var(--accent); }
.audit-metric-ico .gfx-ico { width: 20px; height: 20px; }
.audit-metric-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.audit-metric b { font-size: clamp(28px, 7vw, 34px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.audit-metric small { font-size: 12px; line-height: 1.4; color: var(--ink-3); }
.audit-tag { margin-top: auto; padding: 3px 10px; border-radius: 999px; font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.audit-tag.known { background: #e3f4e8; color: #1e7a3a; }
.audit-tag.est { background: #fdeede; color: #b05a00; }

/* ─── bloque bloqueado: relleno hecho solo con CSS, sin contenido real ─── */
#audit-locked { position: relative; }
.audit-ghost { display: grid; gap: 12px; padding: 24px; border-radius: var(--radius-sm); background: var(--paper); filter: blur(7px); opacity: .7; user-select: none; pointer-events: none; }
.ghost-score { display: block; width: 96px; height: 56px; border-radius: 14px; background: var(--ink-3); }
.ghost-line { display: block; height: 14px; border-radius: 7px; background: var(--line-light); }
.ghost-line.short { width: 60%; }
.audit-unlock {
  margin-top: -150px; position: relative; padding: 24px 20px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.92); border: 1px solid var(--line-light);
  box-shadow: 0 12px 40px rgba(0,0,0,.08);
}
.audit-unlock h2 { margin-bottom: 18px; font-size: clamp(22px, 4.6vw, 28px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
.audit-includes-label { margin-bottom: 8px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.audit-includes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.audit-includes li { padding: 6px 12px; border-radius: 999px; background: #eaf3fd; color: var(--ink); font-size: 13px; font-weight: 600; }
#audit-lead { display: grid; gap: 14px; }
#audit-lead .btn { width: 100%; margin-top: 4px; }
.audit-privacy { font-size: 13px; line-height: 1.4; color: var(--ink-3); }

/* anti-bots: fuera de pantalla, no display:none */
.hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ─── resultado desbloqueado ─── */
#audit-unlocked:focus { outline: none; }
.audit-stage-label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.audit-score { display: flex; align-items: baseline; gap: 8px; }
.audit-score b { font-size: clamp(64px, 18vw, 104px); font-weight: 700; letter-spacing: -0.05em; line-height: 1; }
.audit-score span { font-size: 22px; font-weight: 600; color: var(--ink-3); }
.audit-stage { margin: 6px 0 28px; font-size: clamp(24px, 5vw, 30px); font-weight: 700; letter-spacing: -0.03em; color: var(--accent); }
.audit-h3 { margin-bottom: 14px; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
#audit-quickwins { display: grid; gap: 10px; counter-reset: qw; margin-bottom: 28px; }
#audit-quickwins li { counter-increment: qw; position: relative; padding: 18px 20px 18px 56px; border-radius: var(--radius-sm); background: var(--paper); }
#audit-quickwins li::before {
  content: counter(qw); position: absolute; left: 18px; top: 18px; width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; font-size: 14px; font-weight: 700;
}
#audit-quickwins b { display: block; margin-bottom: 4px; font-size: 17px; letter-spacing: -0.015em; }
#audit-quickwins p { font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.audit-hours { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 999px; background: #eef5fe; color: var(--accent); font-size: 13px; font-weight: 600; }

/* ─── estado + navegación ─── */
.audit-status { min-height: 22px; margin-top: 14px; font-size: 15px; color: #1e8e3e; }
.audit-status.error { color: #d93025; }
.audit-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; }
.audit-nav .btn { flex: 1; }
.audit-nav .btn-light { border: 1px solid var(--line-light); }
.audit-notice { margin-top: 18px; font-size: 13px; text-align: center; color: var(--ink-3); }

@media (min-width: 640px) {
  .audit-card { padding: 40px 44px 32px; }
  .audit-role-fields { grid-template-columns: 1fr 2fr; align-items: end; }
  .audit-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .audit-opts .audit-opt { margin: 0; }
  .audit-opts .audit-opt span { height: 100%; }
  .audit-metrics { grid-template-columns: repeat(3, 1fr); }
  .audit-roles { grid-template-columns: 1fr 1fr; }
  .audit-q { margin-bottom: 22px; }
  .audit-nav .btn { flex: 0 0 auto; min-width: 150px; }
  .audit-nav { justify-content: flex-end; }
  .audit-nav [data-action="back"] { margin-right: auto; }
}


.audit-updated { margin-top: 18px; font-size: 13px; color: #86868b; }

/* ─── gráficos ─── */
.audit-hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.audit-hero-art { justify-self: center; width: 100%; max-width: 380px; }
.audit-hero-art svg { display: block; width: 100%; height: auto; }
.ha-card { fill: rgba(255,255,255,.05); stroke: rgba(255,255,255,.14); }
.ha-track { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 14; }
.ha-arc { fill: none; stroke: url(#ha-g); stroke-width: 14; stroke-linecap: round; animation: ha-draw 1.4s var(--ease-out) both; }
.ha-num { fill: #fff; font: 700 40px var(--font); letter-spacing: -0.04em; }
.ha-cap { fill: #a1a1a6; font: 600 12px var(--font); }
.ha-bars rect { fill: url(#ha-g); transform-box: fill-box; transform-origin: bottom; animation: ha-grow .9s var(--ease-out) both; }
.ha-bars rect:nth-child(2) { animation-delay: .1s; } .ha-bars rect:nth-child(3) { animation-delay: .2s; } .ha-bars rect:nth-child(4) { animation-delay: .3s; }
.ha-row { fill: rgba(255,255,255,.1); }
.ha-fill { fill: url(#ha-g); transform-box: fill-box; transform-origin: left; animation: ha-wide 1.1s var(--ease-out) .3s both; }
.ha-fill-2 { animation-delay: .5s; }
@keyframes ha-draw { from { stroke-dasharray: 0 100; } }
@keyframes ha-grow { from { transform: scaleY(0); } }
@keyframes ha-wide { from { transform: scaleX(0); } }

.gfx-badge {
  display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin-bottom: 20px;
  border-radius: 16px; background: #eef5fe; color: var(--accent);
}
.gfx-badge-dark { background: rgba(79,195,247,.12); color: var(--cyan); margin-bottom: 24px; }
.gfx-badge .gfx-ico { width: 28px; height: 28px; }
.svc .tile .svc-num { margin-bottom: 24px; }
.svc-steps .step-num { margin-bottom: 28px; }

.audit-share { margin: 0 0 28px; padding: 18px 20px; border-radius: var(--radius-sm); background: var(--paper); }
.audit-share-text { margin-bottom: 12px; font-size: 15px; color: var(--ink-2); }
.audit-share-text b { color: var(--ink); font-size: 18px; }
.audit-share-track { height: 12px; border-radius: 999px; background: var(--line-light); overflow: hidden; }
.audit-share-fill { display: block; --w: 0%; width: var(--w); height: 100%; border-radius: 999px; background: var(--grad-light); transition: width .6s var(--ease-out); }

.audit-score-wrap { position: relative; width: 120px; height: 120px; margin: 8px 0 14px; }
.audit-ring { position: absolute; inset: 0; }
.ring-track { fill: none; stroke: var(--line-light); stroke-width: 10; }
.ring-arc { --v: 0; fill: none; stroke: var(--accent); stroke-width: 10; stroke-linecap: round; stroke-dasharray: var(--v) 100; transition: stroke-dasharray .9s var(--ease-out); }
.audit-score-wrap .audit-score { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; margin: 0; }
.audit-score-wrap .audit-score b { font-size: 38px; letter-spacing: -0.04em; }
.audit-score-wrap .audit-score span { font-size: 12px; margin-top: -2px; }

@media (min-width: 960px) {
  .audit-roles { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 860px) {
  .audit-hero-grid { grid-template-columns: 1fr; }
  .audit-hero-art { max-width: 300px; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  .audit-bars span::after, .audit-chip span, .audit-opt span, .audit-tick::after { transition: none; }
  .audit-card.shake { animation: none; }
  .ha-arc, .ha-bars rect, .ha-fill { animation: none; }
  .audit-share-fill, .ring-arc { transition: none; }
}
