/* ==============================================================================
   TIGROUP SpA - ESTILOS GLOBALES UNIFICADOS (global.css)
   Ciberseguridad que protege tu negocio
   Consolidación limpia y fidedigna de estilos corporativos institucionales
   ============================================================================== */

/* --- RESET Y BASE DEL SISTEMA --- */
* {
    box-sizing: border-box;
}

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background-color: #eef2f7; 
    margin: 0; 
    padding: 16px 14px; 
    box-sizing: border-box; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    min-height: 100vh; 
    color: #1e293b;
}

/* --- LOGOTIPO Y CONTENEDORES CORPORATIVOS --- */
.logo-contenedor { 
    margin-bottom: 12px; 
    text-align: center; 
    width: 100%; 
}

.logo-empresa { 
    max-width: 145px; 
    height: auto; 
    display: block;
}

/* --- PÁGINA 1: FORMULARIO DE CONTACTO / REGISTRO --- */
.contenedor { 
    background: white; 
    padding: 25px 35px; 
    border-radius: 12px; 
    box-shadow: 0 8px 16px rgba(0,0,0,0.08); 
    width: 100%; 
    max-width: 600px; 
    box-sizing: border-box; 
}

h2 { 
    border-bottom: 2px solid #0056b3; 
    padding-bottom: 6px; 
    color: #333; 
    font-size: 21px; 
    margin-top: 0; 
    margin-bottom: 15px; 
}

.grilla-campos { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 4px 15px; 
    width: 100%; 
    text-align: left; 
    margin-bottom: 10px; 
}

@media (min-width: 600px) { 
    .grilla-campos { 
        grid-template-columns: 1fr 1fr; 
    } 
}

.campo-grupo { 
    display: flex; 
    flex-direction: column; 
    position: relative; 
}

label { 
    font-size: 13px; 
    font-weight: bold; 
    color: #555; 
    margin-top: 6px; 
}

input[type="text"], input[type="email"], input[type="number"], select { 
    width: 100%; 
    padding: 9px; 
    margin: 4px 0; 
    box-sizing: border-box; 
    border: 1px solid #cbd5e1; 
    border-radius: 6px; 
    font-size: 13.5px; 
    background-color: white; 
    color: #1e293b; 
    outline: none; 
    transition: border-color 0.2s, box-shadow 0.2s; 
}

input:focus, select:focus, textarea:focus { 
    border-color: #0056b3; 
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.15); 
}

.telefono-contenedor-flex { 
    display: flex; 
    align-items: center; 
    margin: 4px 0; 
    border: 1px solid #cbd5e1; 
    border-radius: 6px; 
    background-color: white; 
    overflow: hidden; 
}

.telefono-contenedor-flex.focus-activo { 
    border-color: #0056b3; 
    box-shadow: 0 0 0 2px rgba(0, 86, 179, 0.2); 
}

.telefono-contenedor-flex.campo-invalido { 
    border: 2px solid #dc3545; 
    background-color: #fff8f8; 
}

.telefono-prefijo { 
    background: #e9ecef; 
    border-right: 1px solid #cbd5e1; 
    color: #495057; 
    padding: 9px 12px; 
    font-size: 14px; 
    font-weight: bold; 
    user-select: none; 
}

.telefono-input-neto { 
    border: none !important; 
    outline: none !important; 
    width: 100%; 
    padding: 9px; 
    font-size: 14px; 
    background: transparent; 
    margin: 0 !important; 
}

input.correo-invalido { 
    border: 2px solid #dc3545; 
    background-color: #fff8f8; 
}

.alerta-validacion { 
    color: #dc3545; 
    font-size: 11px; 
    font-weight: bold; 
    margin-top: 2px; 
    margin-bottom: 2px; 
    display: none; 
}

.zona-consentimientos { 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    margin: 15px 0; 
    text-align: left; 
}

.checkbox-linea { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    font-size: 13px; 
    color: #444; 
}

.checkbox-linea input[type="checkbox"] { 
    margin: 0; 
    width: 16px; 
    height: 16px; 
    cursor: pointer; 
    flex-shrink: 0; 
}

.texto-legal-bloque { 
    font-size: 11px; 
    color: #666; 
    margin-top: 1px; 
    padding-left: 28px; 
    line-height: 1.4; 
}

.enlace-legal { 
    color: #0056b3; 
    text-decoration: underline; 
    font-weight: bold; 
}

.enlace-legal:hover { 
    color: #004494; 
}

button { 
    width: 100%; 
    padding: 11px; 
    background-color: #b3b3b3; 
    color: white; 
    border: none; 
    border-radius: 6px; 
    cursor: pointer; 
    font-weight: bold; 
    font-size: 15px; 
    transition: background 0.2s; 
    margin-top: 5px; 
}

button.habilitado-real { 
    background-color: #0056b3; 
}

button.habilitado-real:hover { 
    background-color: #004494; 
}

button:disabled { 
    cursor: not-allowed; 
}

.msg-error { 
    color: #dc3545; 
    background-color: #fef2f2; 
    border: 1px solid #fecaca; 
    padding: 10px 14px; 
    border-radius: 8px; 
    font-size: 13px; 
    font-weight: bold; 
    margin: 8px 0 14px 0; 
    text-align: center; 
    width: 100%; 
    box-sizing: border-box; 
}

/* --- PÁGINA 2: CONTENEDOR Y GRILLA DE CUESTIONARIO --- */
.contenedor-cuestionario { 
    background: white; 
    padding: 20px 28px 16px 28px; 
    border-radius: 14px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.07); 
    width: 100%; 
    max-width: 1100px; 
    min-height: 520px;
    box-sizing: border-box; 
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

@media (min-width: 850px) {
    .contenedor-cuestionario {
        height: 535px; /* Altura constante para navegación fluida entre pasos */
    }
}

.cabecera-cuestionario {
    display: grid;
    grid-template-columns: 140px 1fr 140px;
    align-items: center;
    border-bottom: 2px solid #0056b3;
    padding-bottom: 10px;
    margin-bottom: 16px;
    width: 100%;
    box-sizing: border-box;
}

.cabecera-slot-izq {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.cabecera-slot-der {
    width: 100%;
}

.titulo-cuestionario-centrado {
    font-size: 19px;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
    margin: 0;
    padding: 0;
    white-space: nowrap;
}

@media (max-width: 680px) {
    .cabecera-cuestionario {
        display: flex;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    .titulo-cuestionario-centrado {
        white-space: normal;
        font-size: 17px;
    }
}

#formulario-cuestionario-astro {
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
    min-height: 0;
}

#contenedor-preguntas-paso {
    flex: 1;
    display: flex;
    min-height: 0;
}

.grilla-pilares-paso { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 16px; 
    width: 100%; 
    height: 100%;
    align-items: stretch;
}

@media (min-width: 850px) { 
    .grilla-pilares-paso.doble { grid-template-columns: 1fr 1fr; } 
    .grilla-pilares-paso.individual { grid-template-columns: 1fr; } 
}

.pilar-seccion { 
    background: #f8fafc; 
    border: 1px solid #e2e8f0; 
    padding: 14px 18px; 
    border-radius: 10px; 
    display: flex; 
    flex-direction: column; 
    box-sizing: border-box; 
    height: 100%;
    width: 100%;
}

.grilla-preguntas-cumplimiento {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 850px) {
    .grilla-preguntas-cumplimiento {
        grid-template-columns: 1fr 1fr;
    }
}

.pilar-cabecera { 
    display: flex; 
    align-items: center; 
    justify-content: flex-start; 
    border-bottom: 1px solid #e2e8f0; 
    padding-bottom: 8px; 
    margin-bottom: 12px; 
}

.pilar-titulo { 
    font-size: 13.5px; 
    font-weight: bold; 
    color: #0f172a; 
    margin: 0; 
    text-transform: uppercase; 
    border-left: 3px solid #0056b3; 
    padding-left: 8px; 
}

.pregunta-item { 
    display: flex; 
    flex-direction: column; 
    margin-bottom: 10px; 
    text-align: left; 
}

.pregunta-item:last-child { 
    margin-bottom: 0; 
}

.pregunta-cabecera-flex { 
    display: flex; 
    align-items: flex-start; 
    justify-content: space-between; 
    gap: 6px; 
    margin-bottom: 4px; 
}

.pregunta-texto { 
    font-size: 12.8px; 
    font-weight: 600; 
    color: #334155; 
    line-height: 1.35; 
}

.btn-glosario-ayuda { 
    background: #0056b3; 
    color: white; 
    width: 18px; 
    height: 18px; 
    border-radius: 50%; 
    display: inline-flex; 
    justify-content: center; 
    align-items: center; 
    font-size: 10.5px; 
    font-weight: bold; 
    cursor: pointer; 
    border: none; 
    transition: background 0.2s, transform 0.1s; 
    padding: 0; 
    flex-shrink: 0; 
}

.btn-glosario-ayuda:hover { 
    background: #004494; 
    transform: scale(1.1); 
}

textarea.control-respuesta {
    width: 100%;
    height: 52px;
    min-height: 52px;
    max-height: 52px;
    font-family: inherit;
    resize: none;
    line-height: 1.35;
    padding: 7px 10px;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 12px;
    background-color: white;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* --- BARRA DE NAVEGACIÓN INFERIOR DEL CUESTIONARIO --- */
.barra-nav-inferior { 
    margin-top: 14px; 
    padding-top: 12px; 
    border-top: 1px solid #e2e8f0; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    gap: 15px; 
}

.nav-slot-izq { min-width: 125px; }
.nav-slot-der { min-width: 125px; display: flex; justify-content: flex-end; }
.nav-slot-centro { font-size: 12.5px; color: #64748b; text-align: center; }
.nav-slot-centro strong { color: #334155; }

.btn-nav-accion { 
    font-size: 13px; 
    font-weight: bold; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: all 0.2s; 
    border: none; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    gap: 6px; 
    box-sizing: border-box;
}

.btn-nav-accion:active { transform: scale(0.98); }

.btn-atras { 
    background: #f1f5f9; 
    color: #475569; 
    padding: 8px 18px;
    height: 38px;
}
.btn-atras:hover { background: #e2e8f0; }

.btn-siguiente, .btn-enviar-final { 
    width: 125px; 
    height: 38px; 
    padding: 0;
}

.btn-siguiente { background: #0056b3; color: white; }
.btn-siguiente:hover { background: #004494; }
.btn-enviar-final { background: #28a745; color: white; }
.btn-enviar-final:hover { background: #218838; }
.btn-enviar-final:disabled { background: #94a3b8; cursor: not-allowed; }

/* --- MODAL DE GLOSARIO TÉCNICO --- */
.glosario-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(15, 23, 42, 0.6); 
    backdrop-filter: blur(2px);
    display: flex; 
    justify-content: center; 
    align-items: center; 
    z-index: 500; 
    opacity: 0; 
    pointer-events: none; 
    transition: opacity 0.2s ease; 
}

.glosario-overlay.abierto { opacity: 1; pointer-events: auto; }

.glosario-modal { 
    background: white; 
    padding: 25px 30px; 
    border-radius: 12px; 
    max-width: 460px; 
    width: 90%; 
    box-sizing: border-box; 
    text-align: left; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.2); 
}

.glosario-modal h4 { 
    margin-top: 0; 
    color: #0056b3; 
    font-size: 18px; 
    margin-bottom: 10px; 
    border-bottom: 1px solid #e2e8f0; 
    padding-bottom: 8px; 
}

.glosario-modal p { 
    margin: 0 0 20px 0; 
    color: #334155; 
    font-size: 14px; 
    line-height: 1.5; 
}

.btn-cerrar-glosario { 
    width: 100%; 
    padding: 10px; 
    background-color: #64748b; 
    color: white; 
    border: none; 
    border-radius: 6px; 
    font-weight: bold; 
    cursor: pointer; 
    font-size: 14px; 
    transition: background 0.2s; 
}

.btn-cerrar-glosario:hover { background-color: #475569; }

.estado-carga { 
    text-align: center; 
    padding: 40px; 
    color: #64748b; 
    font-size: 15px; 
}

/* --- CONTENEDOR ESTÉTICO DE CARGA CON SPINNER (GATILLO DE IA) --- */
.contenedor-carga-ia {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    text-align: center;
    background: #ffffff;
    border-radius: 12px;
    animation: fadeIn 0.3s ease;
}

.spinner-ia {
    width: 54px;
    height: 54px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #0056b3;
    border-right: 4px solid #22c55e;
    border-radius: 50%;
    animation: girarSpinner 1s linear infinite;
    margin-bottom: 24px;
}

@keyframes girarSpinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.texto-carga-principal {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
    line-height: 1.4;
    max-width: 600px;
}

.texto-carga-secundario {
    font-size: 13.5px;
    color: #64748b;
    max-width: 520px;
    line-height: 1.5;
}

/* --- PÁGINA 3: RUTA EXCLUSIVA DE ÉXITO Y AGRADECIMIENTO (exito.astro) --- */
.pantalla-exito-contenedor {
    width: 100%;
    max-width: 780px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.07);
    overflow: hidden;
    box-sizing: border-box;
    animation: fadeIn 0.4s ease-out;
}

.exito-cabecera-banner {
    background: linear-gradient(135deg, #0056b3 0%, #003366 100%);
    color: white;
    padding: 30px 24px;
    text-align: center;
}

.exito-icono-circulo {
    font-size: 40px;
    margin-bottom: 10px;
    display: inline-block;
}

.exito-titulo {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 6px 0;
    color: #ffffff;
}

.exito-subtitulo {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.4;
}

.exito-cuerpo {
    padding: 24px 30px;
}

.exito-info-correo {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    line-height: 1.45;
}

.exito-tarjeta-detalle {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 22px;
}

.exito-lista-pasos {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.exito-lista-pasos li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
    color: #334155;
    line-height: 1.45;
}

.exito-check-badge {
    background: #22c55e;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 11px;
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 1px;
}

.exito-acciones-pie {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    border-top: 1px solid #e2e8f0;
    padding-top: 18px;
}

.btn-nuevo-diagnostico {
    background: #10b981;
    color: white;
    text-decoration: none;
    padding: 10px 18px;
    font-size: 13.5px;
    font-weight: 700;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-nuevo-diagnostico:hover { 
    background: #059669; 
}

/* --- PÁGINA 4: ESTADO YA REGISTRADO (ya-registrado.astro) --- */
.contenedor-bloqueo { 
    background: white; 
    padding: 40px; 
    border-radius: 12px; 
    box-shadow: 0 8px 16px rgba(0,0,0,0.08); 
    width: 100%; 
    max-width: 500px; 
    text-align: center; 
    box-sizing: border-box; 
}

.icono-aviso { 
    width: 60px; 
    height: 60px; 
    background: #0056b3; 
    color: white; 
    border-radius: 50%; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    font-size: 28px; 
    margin: 0 auto 20px auto; 
    font-weight: bold; 
}

.contenedor-bloqueo h1 { 
    color: #333; 
    font-size: 22px; 
    margin-top: 0; 
    margin-bottom: 12px; 
}

.contenedor-bloqueo p { 
    color: #555; 
    font-size: 14.5px; 
    line-height: 1.6; 
    margin-bottom: 25px; 
    text-align: justify; 
}

.btn-entendido { 
    display: inline-block; 
    width: 100%; 
    padding: 12px; 
    background-color: #6c757d; 
    color: white; 
    text-decoration: none; 
    border-radius: 6px; 
    font-weight: bold; 
    font-size: 15px; 
    transition: background 0.2s; 
    box-sizing: border-box; 
}

.btn-entendido:hover { 
    background-color: #5a6268; 
}
