/* ============================================================
   Alcanza Mejora Continua — diagnostico.css  v3.0
   ============================================================ */

:root {
    --lime:       #B1C903;
    --lime-dark:  #8FA002;
    --lime-light: #d4e84a;
    --black:      #0a0a0a;
    --white:      #ffffff;
    --gray-50:    #fafafa;
    --gray-100:   #f4f4f4;
    --gray-200:   #e8e8e8;
    --gray-300:   #d0d0d0;
    --gray-400:   #aaa;
    --gray-500:   #888;
    --gray-700:   #333;
    --red:        #DC2626;
    --orange:     #EA580C;
    --yellow:     #CA8A04;
    --green:      #16A34A;

    /* Niveles para badges en intro */
    --level-solid-bg:    rgba(22,163,74,0.15);
    --level-solid-text:  #16A34A;
    --level-solid-bd:    rgba(22,163,74,0.35);
    --level-critical-bg: rgba(220,38,38,0.12);
    --level-critical-text:#DC2626;
    --level-critical-bd: rgba(220,38,38,0.3);
    --level-dev-bg:      rgba(202,138,4,0.12);
    --level-dev-text:    #B45309;
    --level-dev-bd:      rgba(202,138,4,0.3);
    --level-vuln-bg:     rgba(234,88,12,0.12);
    --level-vuln-text:   #C2410C;
    --level-vuln-bd:     rgba(234,88,12,0.3);

    --font-head: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
    --radius:      1rem;
    --radius-sm:   0.6rem;
    --radius-full: 9999px;
    --shadow:      0 8px 32px rgba(0,0,0,0.08);
    --transition:  0.28s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--gray-100); color: var(--gray-700); overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; border: none; }
input, select, textarea { font: inherit; }
h1,h2,h3,h4 { font-family: var(--font-head); }
::selection { background: var(--lime); color: var(--black); }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }

/* ── HEADER ──────────────────────────────────────────────── */
.header {
    background: var(--white); border-bottom: 1px solid var(--gray-200);
    padding: 1rem 2rem;
    display: flex; align-items: center; justify-content: center;
    position: sticky; top: 0; z-index: 50;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.header__logo { display: flex; align-items: center; gap: 0.6rem; }
.header__logo img { height: 40px; width: auto; }

/* ── LAYOUT ──────────────────────────────────────────────── */
.page { max-width: 860px; margin: 0 auto; padding: 2.5rem 1.5rem 5rem; }

/* ── INTRO CARD ──────────────────────────────────────────── */
.intro-card {
    background: var(--black); border-radius: var(--radius);
    padding: 3rem 2.5rem; margin-bottom: 2rem;
    position: relative; overflow: hidden;
}
.intro-card.hidden { display: none; }
.intro-card::before {
    content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 5px;
    background: var(--lime);
}
.intro-card::after {
    content: 'DIAGNÓSTICO';
    position: absolute; right: -30px; top: 50%; transform: translateY(-50%) rotate(90deg);
    font-family: var(--font-head); font-weight: 900; font-size: 3.5rem;
    color: rgba(255,255,255,0.04); white-space: nowrap; pointer-events: none;
}
.intro-badge {
    display: inline-block; background: rgba(177,201,3,0.15); color: var(--lime);
    font-family: var(--font-head); font-size: 0.68rem; font-weight: 700;
    letter-spacing: 0.15em; text-transform: uppercase;
    padding: 0.35em 1em; border-radius: var(--radius-full);
    border: 1px solid rgba(177,201,3,0.25); margin-bottom: 1rem;
}
.intro-card h1 { font-size: clamp(1.6rem,4vw,2.4rem); font-weight: 900; color: var(--lime); line-height: 1.1; margin-bottom: 0.5rem; }
.intro-card h1 span { color: var(--lime); }
.intro-card .intro-subtitle { font-family: var(--font-head); font-size: 1rem; font-weight: 600; color: rgba(255,255,255,0.75); margin-bottom: 1rem; }
.intro-card p { font-size: 0.95rem; color: rgba(255,255,255,0.6); line-height: 1.75; margin-bottom: 1rem; }
.intro-card .intro-section-title { font-family: var(--font-head); font-size: 0.85rem; font-weight: 700; color: var(--lime); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 1.25rem; margin-bottom: 0.5rem; }

/* ── LISTA DE ÁREAS CON BADGES ───────────────────────────── */
.intro-areas-list { list-style: none; padding: 0; margin-bottom: 1.25rem; display: flex; flex-direction: column; gap: 0.6rem; }
.intro-areas-list li { font-size: 0.9rem; color: rgba(255,255,255,0.75); display: flex; align-items: center; gap: 0.65rem; line-height: 1.4; }
.area-level { display: inline-flex; align-items: center; font-family: var(--font-head); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.22em 0.7em; border-radius: var(--radius-full); white-space: nowrap; flex-shrink: 0; border: 1px solid transparent; }
.area-level--solid    { background: var(--level-solid-bg);    color: var(--level-solid-text);    border-color: var(--level-solid-bd);    }
.area-level--critical { background: var(--level-critical-bg); color: var(--level-critical-text); border-color: var(--level-critical-bd); }
.area-level--dev      { background: var(--level-dev-bg);      color: var(--level-dev-text);      border-color: var(--level-dev-bd);      }
.area-level--vuln     { background: var(--level-vuln-bg);     color: var(--level-vuln-text);     border-color: var(--level-vuln-bd);     }

/* ── OBJETIVO ────────────────────────────────────────────── */
.intro-objetivo { background: rgba(177,201,3,0.08); border: 1px solid rgba(177,201,3,0.2); border-radius: var(--radius-sm); padding: 1rem 1.25rem; margin-top: 1rem; }
.intro-objetivo p { font-size: 0.88rem; color: rgba(255,255,255,0.65); margin-bottom: 0; line-height: 1.65; }
.intro-objetivo strong { color: var(--lime); }

/* ── INTRO ITEMS ─────────────────────────────────────────── */
.intro-items { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin-top: 1.5rem; }
.intro-item { background: rgba(255,255,255,0.05); border-radius: var(--radius-sm); padding: 1rem; border: 1px solid rgba(255,255,255,0.08); transition: border-color var(--transition); }
.intro-item:last-child { border-color: rgba(177,201,3,0.2); background: rgba(177,201,3,0.05); }
.intro-item svg { width: 22px; height: 22px; color: var(--lime); margin-bottom: 0.5rem; }
.intro-item strong { font-family: var(--font-head); font-size: 0.82rem; font-weight: 700; color: var(--white); display: block; margin-bottom: 0.2rem; }
.intro-item span { font-size: 0.78rem; color: rgba(255,255,255,0.45); line-height: 1.4; }

/* ── PRIVACY CONSENT ─────────────────────────────────────── */
.privacy-consent { margin-top: 1.75rem; background: rgba(255,255,255,0.06); border: 1px solid rgba(177,201,3,0.25); border-radius: var(--radius-sm); padding: 1.1rem 1.25rem; }
.consent-label { display: flex; align-items: flex-start; gap: 0.75rem; cursor: pointer; }
.consent-label input[type="checkbox"] { display: none; }
.consent-box { flex-shrink: 0; width: 20px; height: 20px; border-radius: 4px; border: 2px solid rgba(177,201,3,0.5); background: transparent; display: flex; align-items: center; justify-content: center; transition: background 0.2s, border-color 0.2s; margin-top: 1px; position: relative; }
.consent-label:has(input:checked) .consent-box { background: var(--lime); border-color: var(--lime); }
.consent-label:has(input:checked) .consent-box::after { content: ''; position: absolute; width: 5px; height: 9px; border-right: 2px solid var(--black); border-bottom: 2px solid var(--black); transform: rotate(45deg) translate(-1px,-1px); }
.consent-text { font-size: 0.82rem; color: rgba(255,255,255,0.6); line-height: 1.6; }
.consent-text a { color: var(--lime); font-weight: 600; border-bottom: 1px solid rgba(177,201,3,0.35); padding-bottom: 1px; transition: color 0.2s; }
.consent-text a:hover { color: var(--lime-light); }
.consent-hint { font-size: 0.75rem; color: rgba(255,100,100,0.7); margin-top: 0.5rem; margin-left: 2.1rem; display: none; }
.consent-hint.visible { display: block; }

/* ── PROGRESO ────────────────────────────────────────────── */
.progress-wrap { margin-bottom: 2rem; }
.progress-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.progress-label { font-family: var(--font-head); font-size: 0.8rem; font-weight: 600; color: var(--gray-700); }
.progress-pct   { font-family: var(--font-head); font-size: 0.8rem; font-weight: 700; color: var(--lime-dark); }
.progress-bar-bg { background: var(--gray-200); border-radius: var(--radius-full); height: 8px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--lime-dark), var(--lime)); border-radius: var(--radius-full); transition: width 0.5s ease; width: 0%; }
.steps-row { display: flex; gap: 0.4rem; margin-top: 0.75rem; }
.step-dot { flex: 1; height: 4px; border-radius: var(--radius-full); background: var(--gray-200); transition: background var(--transition); }
.step-dot.done   { background: var(--lime); }
.step-dot.active { background: var(--lime-dark); }

/* ── SECCIONES ───────────────────────────────────────────── */
.form-section { display: none; }
.form-section.active { display: block; animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }

.section-card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--gray-200); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 1.25rem; }
.section-card-header { background: var(--black); padding: 1.25rem 1.75rem; display: flex; align-items: center; gap: 1rem; }
.section-card-header .num { width: 34px; height: 34px; border-radius: 50%; background: var(--lime); display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 900; font-size: 0.9rem; color: var(--black); flex-shrink: 0; }
.section-card-header h2 { font-size: 1.05rem; font-weight: 700; color: var(--white); }
.section-card-header p  { font-size: 0.8rem; color: rgba(255,255,255,0.5); margin-top: 0.1rem; }
.section-card-body { padding: 1.75rem; }

/* ── CAMPOS DATOS ────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-family: var(--font-head); font-size: 0.78rem; font-weight: 600; color: var(--gray-700); }
.form-group label span { color: var(--red); margin-left: 2px; }
.form-group input, .form-group select { padding: 0.75rem 1rem; border-radius: var(--radius-sm); border: 1.5px solid var(--gray-200); background: var(--gray-50); font-size: 0.9rem; color: var(--black); transition: var(--transition); outline: none; }
.form-group input:focus, .form-group select:focus { border-color: var(--lime); background: var(--white); box-shadow: 0 0 0 3px rgba(177,201,3,0.12); }
.form-group input.error, .form-group select.error { border-color: var(--red); box-shadow: 0 0 0 3px rgba(220,38,38,0.1); }
.form-group .error-msg { font-size: 0.75rem; color: var(--red); display: none; }
.form-group.has-error .error-msg { display: block; }

/* ── AREA HEADER ─────────────────────────────────────────── */
.area-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; padding-bottom: 0.75rem; border-bottom: 2px solid var(--gray-200); }
.area-title { font-family: var(--font-head); font-size: 0.95rem; font-weight: 700; color: var(--black); }
.area-progress-label { font-family: var(--font-head); font-size: 0.78rem; font-weight: 600; color: var(--gray-500); background: var(--gray-100); padding: 0.3em 0.8em; border-radius: var(--radius-full); }

/* ── PREGUNTAS ───────────────────────────────────────────── */
.question-block { margin-bottom: 1.75rem; }
.question-text { font-size: 0.9rem; color: var(--gray-700); line-height: 1.55; margin-bottom: 0.85rem; font-weight: 500; }
.question-num { font-family: var(--font-head); font-weight: 700; color: var(--lime-dark); }

/*
 * OPCIONES DE RESPUESTA — COLORES NEUTROS
 *
 * Cambio clave: las opciones ya no tienen colores semafóricos (verde/amarillo/naranja/rojo)
 * que inducirían al usuario a seleccionar la "mejor" opción visualmente.
 * Todas las opciones tienen el mismo estilo neutral hasta que se selecciona una.
 * Al seleccionar: se usa el color de marca (lime) de forma uniforme.
 */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}

.option-label { display: block; cursor: pointer; }
.option-label input[type="radio"] { display: none; }

.option-card {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--gray-50);
    transition: border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
    cursor: pointer;
    min-height: 52px;
}
.option-card:hover {
    border-color: var(--gray-400);
    background: var(--white);
}

/* Letra identificadora (A, B, C, D) — neutral, sin color semafórico */
.opt-letter {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-500);
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 0.8rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition), color var(--transition);
}

.opt-text {
    font-size: 0.82rem;
    line-height: 1.35;
    color: var(--gray-700);
    transition: color var(--transition);
}

/* Estado seleccionado: color de marca, uniforme para todas las opciones */
.option-label input:checked + .option-card {
    border-color: var(--lime);
    background: rgba(177,201,3,0.07);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(177,201,3,0.15);
}
.option-label input:checked + .option-card .opt-letter {
    background: var(--lime);
    color: var(--black);
}
.option-label input:checked + .option-card .opt-text {
    color: var(--black);
    font-weight: 600;
}

/* Pregunta sin responder — resaltado de error */
.question-block.unanswered .options-grid {
    outline: 2px solid var(--red);
    border-radius: var(--radius-sm);
    outline-offset: 3px;
}

/* Barra de progreso del área (indica preguntas respondidas, no puntaje) */
.area-progress { margin-top: 0.5rem; margin-bottom: 1.25rem; }
.area-progress-bar-bg { height: 5px; background: var(--gray-200); border-radius: var(--radius-full); }
.area-progress-bar { height: 100%; background: var(--lime); border-radius: var(--radius-full); transition: width 0.4s ease; }

/* ── NAVEGACIÓN ──────────────────────────────────────────── */
.nav-row { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; gap: 1rem; }
.btn { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-head); font-size: 0.88rem; font-weight: 700; padding: 0.85rem 2rem; border-radius: var(--radius-full); transition: var(--transition); border: 2px solid transparent; cursor: pointer; }
.btn--primary { background: var(--lime); color: var(--black); }
.btn--primary:hover { background: var(--lime-dark); transform: translateY(-2px); box-shadow: 0 0 30px rgba(177,201,3,0.3); }
.btn--ghost { background: transparent; color: var(--gray-500); border-color: var(--gray-200); }
.btn--ghost:hover { border-color: var(--gray-700); color: var(--gray-700); }
.btn svg { width: 18px; height: 18px; }

/* ── PANTALLA PROCESANDO ─────────────────────────────────── */
.processing-screen { display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 70vh; padding: 3rem 1.5rem; }
.processing-screen.active { display: flex; }
.processing-orb { width: 100px; height: 100px; border-radius: 50%; background: var(--black); position: relative; margin-bottom: 2rem; display: flex; align-items: center; justify-content: center; }
.processing-orb::before { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--lime); border-right-color: var(--lime-dark); animation: spin 1.2s linear infinite; }
.processing-orb::after  { content: ''; position: absolute; inset: -12px; border-radius: 50%; border: 2px solid transparent; border-top-color: rgba(177,201,3,0.25); animation: spin 2s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.processing-orb svg { width: 42px; height: 42px; color: var(--lime); position: relative; z-index: 1; }
.processing-screen h2 { font-size: clamp(1.5rem,4vw,2.2rem); font-weight: 900; margin-bottom: 0.75rem; }
.processing-screen p  { font-size: 1rem; color: var(--gray-500); line-height: 1.7; max-width: 480px; margin-bottom: 2rem; }
.processing-areas { width: 100%; max-width: 460px; text-align: left; }
.processing-area-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--gray-200); opacity: 0.3; transition: opacity 0.4s; }
.processing-area-row.done { opacity: 1; }
.processing-area-row .pa-icon { width: 26px; height: 26px; border-radius: 50%; background: var(--gray-200); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background 0.4s; }
.processing-area-row.done .pa-icon { background: var(--lime); }
.processing-area-row .pa-icon svg { width: 13px; height: 13px; color: var(--black); }
.processing-area-row span   { font-family: var(--font-head); font-size: 0.82rem; font-weight: 600; }
.processing-area-row .pa-status { margin-left: auto; font-size: 0.75rem; color: var(--gray-500); }
.processing-area-row.done .pa-status { color: var(--green); font-weight: 600; }
.processing-footer { margin-top: 2.5rem; background: var(--gray-50); border-radius: var(--radius); padding: 1.25rem 1.75rem; max-width: 460px; width: 100%; border: 1px solid var(--gray-200); }
.processing-footer p { font-size: 0.88rem; color: var(--gray-500); line-height: 1.65; }
.processing-footer strong { color: var(--black); font-family: var(--font-head); }

/* ── PANTALLA ÉXITO ──────────────────────────────────────── */
.success-screen { display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 70vh; padding: 1rem 1.0rem; }
.success-screen.active { display: flex; }
.success-icon { width: 90px; height: 90px; border-radius: 50%; background: var(--lime); display: flex; align-items: center; justify-content: center; margin-bottom: 1.75rem; animation: popIn 0.5s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes popIn { from { transform:scale(0); opacity:0; } to { transform:scale(1); opacity:1; } }
.success-icon svg { width: 44px; height: 44px; color: var(--black); }
.success-screen h2 { font-size: clamp(1.6rem,4vw,2.3rem); font-weight: 900; margin-bottom: 0.75rem; }
.success-screen .email-highlight { display: inline-block; background: rgba(177,201,3,0.12); color: var(--lime-dark); font-family: var(--font-head); font-weight: 700; padding: 0.3em 0.9em; border-radius: var(--radius-full); margin: 0.5rem 0 1rem; }
.success-screen p { font-size: 0.95rem; color: var(--gray-500); line-height: 1.75; max-width: 460px; margin: 0.5rem auto; }

/* ── ACCESIBILIDAD / MOVIMIENTO ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 680px) {
    .intro-card { padding: 2rem 1.5rem; }
    .form-grid  { grid-template-columns: 1fr; }
    .intro-items { grid-template-columns: 1fr; }
    .options-grid { grid-template-columns: 1fr; }
    .nav-row { flex-direction: column-reverse; }
    .btn { width: 100%; justify-content: center; }
    .intro-areas-list li { flex-wrap: wrap; }
}
@media (max-width: 480px) {
    .area-level { font-size: 0.58rem; }
}