/* ============================================================
   GROW LEVEL — Diagnóstico de crecimiento (/diagnostico)
   Usa solo tokens de variables.css.
   ============================================================ */

.diag-wrap { padding-top: calc(var(--gl-nav-h) + clamp(2rem, 5vw, 3.5rem)); padding-bottom: clamp(3rem, 7vw, 5rem); }
.diag { max-width: 640px; margin-inline: auto; padding: clamp(1.5rem, 4vw, 2.5rem); border: 1px solid var(--gl-border-strong); border-radius: 24px; background: var(--gl-surface-2); box-shadow: var(--gl-shadow-lg); position: relative; overflow: hidden; }
.diag::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 220px; background: var(--gl-grad-halo); pointer-events: none; }
.diag > * { position: relative; }
.diag h1:focus, .diag h2:focus { outline: none; }
.diag-anim > * { animation: diagIn .35s var(--gl-ease, ease) both; }
@keyframes diagIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- portada ---------- */
.diag-intro { text-align: center; }
.diag-intro h1 { font-size: clamp(1.9rem, 4.6vw, 2.8rem); line-height: var(--gl-lh-snug); margin: var(--gl-sp-4) 0; }
.diag-intro p { color: var(--gl-text-soft); font-size: var(--gl-fs-lg); margin-bottom: 1.75rem; }
.diag-trust { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.25rem; color: var(--gl-text-muted); font-size: var(--gl-fs-sm); }
.diag-trust li { display: inline-flex; align-items: center; gap: .4rem; }
.diag-trust svg { width: 16px; height: 16px; color: var(--gl-success); }

/* ---------- progreso ---------- */
.diag-top { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.diag-back { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--gl-border-strong); background: transparent; color: var(--gl-text-soft); display: grid; place-items: center; cursor: pointer; }
.diag-back:hover { color: var(--gl-text); border-color: var(--gl-border-accent); }
.diag-back svg { width: 18px; height: 18px; }
.diag-progress { flex: 1; height: 6px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.diag-progress span { display: block; height: 100%; background: var(--gl-grad-brand); border-radius: inherit; transition: width .4s ease; }
.diag-block { font-family: var(--gl-font-mono); font-size: var(--gl-fs-xs); letter-spacing: .12em; color: var(--gl-cyan); margin: 0 0 .75rem; text-transform: uppercase; }

/* ---------- preguntas ---------- */
.diag-q { font-size: clamp(1.35rem, 3.4vw, 1.75rem); line-height: var(--gl-lh-snug); margin: 0 0 .5rem; }
.diag-sub { color: var(--gl-text-muted); margin: 0 0 1rem; font-size: var(--gl-fs-sm); }
.diag-opts { display: grid; gap: .65rem; margin-top: 1.25rem; }
.diag-opt { text-align: left; padding: 1rem 1.15rem; border-radius: 14px; border: 1px solid var(--gl-border-strong); background: var(--gl-surface); color: var(--gl-text); cursor: pointer; display: grid; gap: .2rem; transition: border-color .2s, background .2s, transform .1s; font: inherit; }
.diag-opt:hover { border-color: var(--gl-border-accent); background: var(--gl-surface-3); }
.diag-opt:active { transform: scale(.99); }
.diag-opt.is-on { border-color: var(--gl-cyan); background: rgba(34,211,238,.08); box-shadow: 0 0 0 1px var(--gl-cyan) inset; }
.diag-opt-t { font-weight: 600; }
.diag-opt-s { color: var(--gl-text-muted); font-size: var(--gl-fs-sm); }
.diag-scale { display: grid; grid-template-columns: repeat(10, 1fr); gap: .4rem; margin-top: 1.5rem; }
.diag-scale-btn { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--gl-border-strong); background: var(--gl-surface); color: var(--gl-text); font: 600 var(--gl-fs-base) var(--gl-font-sans); cursor: pointer; }
.diag-scale-btn:hover { border-color: var(--gl-border-accent); }
.diag-scale-btn.is-on { background: var(--gl-grad-brand); color: #05060a; border-color: transparent; }
.diag-scale-labels { display: flex; justify-content: space-between; margin-top: .6rem; color: var(--gl-text-muted); font-size: var(--gl-fs-xs); }

/* ---------- verdad incómoda ---------- */
.diag-insight h2 { font-size: clamp(1.4rem, 3.6vw, 1.9rem); line-height: var(--gl-lh-snug); margin: 0 0 .75rem; }
.diag-insight-body { color: var(--gl-text-soft); margin-bottom: 1.25rem; }
.diag-bars { display: grid; gap: .9rem; padding: 1.1rem; border-radius: 14px; border: 1px solid var(--gl-border); background: var(--gl-black-2); margin-bottom: .75rem; }
.diag-bar-head { display: flex; justify-content: space-between; gap: 1rem; font-size: var(--gl-fs-sm); margin-bottom: .35rem; }
.diag-bar-head small { color: var(--gl-text-muted); text-align: right; }
.diag-bar-track { height: 8px; border-radius: 99px; background: rgba(255,255,255,.06); overflow: hidden; }
.diag-bar-track span { display: block; height: 100%; width: var(--w); min-width: 4px; background: var(--gl-grad-brand); border-radius: inherit; animation: diagGrow .9s ease both .15s; transform-origin: left; }
@keyframes diagGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.diag-compare { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: .75rem; }
.diag-compare-col { padding: 1rem; border-radius: 14px; border: 1px solid var(--gl-border); background: var(--gl-black-2); }
.diag-compare-col.is-good { border-color: var(--gl-border-accent); }
.diag-compare-col small { display: block; color: var(--gl-text-muted); font-size: var(--gl-fs-xs); margin-bottom: .6rem; text-transform: uppercase; letter-spacing: .08em; }
.diag-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.diag-chips span { font-size: var(--gl-fs-xs); padding: .3rem .55rem; border-radius: 8px; border: 1px dashed var(--gl-border-strong); color: var(--gl-text-soft); }
.diag-chips.is-joined span { border: 1px solid var(--gl-cyan); color: var(--gl-text); background: rgba(34,211,238,.08); }
.diag-source { color: var(--gl-text-faint); font-size: var(--gl-fs-xs); margin: 0 0 1.25rem; }

/* ---------- cargando ---------- */
.diag-loading { text-align: center; padding: 1.5rem 0; }
.diag-spinner { width: 46px; height: 46px; margin: 0 auto 1.5rem; border-radius: 50%; border: 3px solid rgba(255,255,255,.08); border-top-color: var(--gl-cyan); animation: diagSpin .9s linear infinite; }
@keyframes diagSpin { to { transform: rotate(360deg); } }
.diag-loading ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; text-align: left; max-width: 380px; margin-inline: auto; }
.diag-loading li { color: var(--gl-text-faint); font-size: var(--gl-fs-sm); transition: color .3s; }
.diag-loading li.is-on { color: var(--gl-text); }
.diag-loading li.is-done { color: var(--gl-success); }

/* ---------- resultado ---------- */
.diag-result { text-align: center; }
.diag-score { display: flex; align-items: baseline; justify-content: center; gap: .25rem; }
.diag-score-n { font: 700 clamp(3.6rem, 12vw, 5rem)/1 var(--gl-font-display); background: var(--gl-grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.diag-score-of { color: var(--gl-text-muted); font-size: var(--gl-fs-xl); }
.diag-score-label { color: var(--gl-text-muted); margin: .25rem 0 1.25rem; }
.diag-cats { display: grid; gap: .8rem; text-align: left; margin: 0 0 1.25rem; }
.diag-cat-head { display: flex; justify-content: space-between; font-size: var(--gl-fs-sm); margin-bottom: .35rem; }
.diag-locked { text-align: left; border: 1px solid var(--gl-border); border-radius: 14px; padding: .4rem 1rem 1rem; background: var(--gl-black-2); margin-bottom: 1.5rem; }
.diag-locked-row { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--gl-border); font-size: var(--gl-fs-sm); }
.diag-locked-row em { font-style: normal; filter: blur(6px); user-select: none; color: var(--gl-cyan); }
.diag-locked-badge { display: flex; align-items: center; gap: .5rem; justify-content: center; margin-top: .85rem; color: var(--gl-text-muted); font-size: var(--gl-fs-xs); }
.diag-locked-badge svg { width: 14px; height: 14px; }
.diag-form { text-align: left; display: grid; gap: .85rem; }
.diag-form h2 { font-size: var(--gl-fs-xl); margin: 0; }
.diag-form > p { color: var(--gl-text-muted); margin: -.5rem 0 0; font-size: var(--gl-fs-sm); }
.diag-form label { display: grid; gap: .35rem; font-size: var(--gl-fs-sm); color: var(--gl-text-soft); }
/* 16px mínimo: con menos, Safari de iPhone hace zoom al tocar el campo y la página parece desbordarse. */
.diag-form input, .diag-form select { font: inherit; font-size: 16px; color: var(--gl-text); background: var(--gl-surface); border: 1px solid var(--gl-border-strong); border-radius: 12px; padding: .85rem 1rem; min-width: 0; }
.diag-form input:focus, .diag-form select:focus { outline: none; border-color: var(--gl-cyan); box-shadow: 0 0 0 3px rgba(34,211,238,.15); }
.diag-phone { display: grid; grid-template-columns: auto 1fr; gap: .5rem; }
.diag-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.diag-error { color: #fca5a5; font-size: var(--gl-fs-sm); margin: 0; }
.diag-legal { color: var(--gl-text-faint); font-size: var(--gl-fs-xs); margin: 0; text-align: center; }
.diag-legal a { color: var(--gl-text-muted); text-decoration: underline; }
.diag-level { font: 600 var(--gl-fs-xl) var(--gl-font-display); margin: .5rem 0 .25rem; }
.diag-level-d { color: var(--gl-text-soft); margin: 0 0 1.25rem; }
.diag-weak { text-align: left; padding: 1rem; border-radius: 14px; border: 1px solid rgba(251,191,36,.35); background: rgba(251,191,36,.06); margin-bottom: 1.25rem; }
.diag-weak small { display: block; color: var(--gl-warning); font-size: var(--gl-fs-xs); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .25rem; }
.diag-plan { text-align: left; list-style: none; counter-reset: p; padding: 0; margin: 0 0 1.75rem; display: grid; gap: .75rem; }
.diag-plan li { counter-increment: p; position: relative; padding: 1rem 1rem 1rem 3.25rem; border-radius: 14px; border: 1px solid var(--gl-border); background: var(--gl-surface); display: grid; gap: .25rem; }
.diag-plan li::before { content: counter(p); position: absolute; left: 1rem; top: 1rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--gl-grad-brand); color: #05060a; font-weight: 700; font-size: var(--gl-fs-sm); }
.diag-plan span { color: var(--gl-text-soft); font-size: var(--gl-fs-sm); }
.diag-route { text-align: left; border-top: 1px solid var(--gl-border); padding-top: 1.5rem; display: grid; gap: .9rem; }
.diag-route h2 { font-size: clamp(1.35rem, 3.4vw, 1.75rem); margin: 0; }
.diag-route p { color: var(--gl-text-soft); margin: 0; }
.diag-video video { width: 100%; border-radius: 14px; background: #000; aspect-ratio: 16 / 9; display: block; }
.diag-cal { border-radius: 14px; overflow: hidden; background: transparent; border: 0; box-shadow: none; }
.diag-note { color: var(--gl-text-muted) !important; font-size: var(--gl-fs-sm); }

@media (max-width: 520px) {
  .diag { border-radius: 18px; }
  .diag-scale { grid-template-columns: repeat(5, 1fr); }
  .diag-compare { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .diag-anim > *, .diag-bar-track span { animation: none; }
  .diag-spinner { animation-duration: 3s; }
}
.diag-eyebrow { justify-content: center; }
.diag-eyebrow::before { display: none; }
.diag-restart { background: none; border: 0; color: var(--gl-text-muted); font: inherit; font-size: var(--gl-fs-sm); text-decoration: underline; cursor: pointer; justify-self: center; margin-top: .5rem; }
.diag-restart:hover { color: var(--gl-text); }

/* ---------- correcciones QA 2026-11-06 ---------- */
.diag [hidden] { display: none !important; }                         /* .btn{display:flex} anulaba [hidden] */
.diag-opt, .diag-scale-btn, .diag-back, .diag .btn { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.diag-form > .diag-error { color: #fca5a5; margin: 0; }              /* .diag-form > p lo dejaba gris */
.diag-form input[aria-invalid="true"] { border-color: #f87171; box-shadow: 0 0 0 3px rgba(248,113,113,.15); }
.diag-phone { grid-template-columns: 7.25rem 1fr; }
.diag-phone select { padding-inline: .6rem; }
@media (max-width: 520px) {
  .diag-wrap .gl-container { padding-inline: 10px; }
  .diag { padding: 1.25rem; }
  /* El calendario ocupa todo el ancho de la tarjeta (antes se cortaba el sábado y la flecha). */
  .diag-cal { margin-inline: -1.25rem; width: auto; border-radius: 0; }
  .diag-bar-head { flex-direction: column; gap: .1rem; }
  .diag-bar-head small { text-align: left; font-size: var(--gl-fs-xs); }
}
