/* RESET BÁSICO Y ESTILOS GLOBALES NOSCE™ */
:root {
    --color-d: #FF6600; 
    --color-i: #FFFF99; 
    --color-s: #87CEEB; 
    --color-c: #90EE90; 
    --color-primary: #0f172a; 
    --color-secondary: #00796b;
    --color-background: #f4f4f9;
    --color-text: #333;
}

body {
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* BARRA SUPERIOR DE NAVEGACIÓN NOSCE™ */
.test-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #0f172a;
    padding: 12px 24px;
    color: #f8fafc;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.test-navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-title {
    color: #38bdf8;
    font-weight: 700;
    font-size: 1.1rem;
}

.brand-sub {
    color: #94a3b8;
    font-size: 0.85rem;
}

.btn-return-hub {
    display: inline-flex;
    align-items: center;
    background-color: #0284c7;
    color: #ffffff !important;
    border: 1px solid #38bdf8;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.btn-return-hub:hover {
    background-color: #0369a1;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

/* ENCABEZADO CORREGIDO CON MÁXIMO CONTRASTE */
header {
    background-color: #0f172a !important;
    color: #ffffff !important;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1, header .main-disc-title {
    color: #ffffff !important;
    font-size: 2rem;
    font-weight: 900;
    margin: 0;
    padding: 0;
    border: none !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

main {
    max-width: 1200px; 
    margin: 20px auto;
    padding: 0 15px;
}

.card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    border-top: 5px solid var(--color-secondary);
}

h1, h2, h3, h4 {
    color: #0f172a;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
    margin-top: 0;
}

.felicitacion {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--color-d);
}

.nota {
    font-style: italic;
    color: #666;
}

.instrucciones li {
    margin-bottom: 10px;
}

/* COMPACTACIÓN DE GRUPOS */
#discForm {
    display: flex;
    flex-wrap: wrap; 
    gap: 15px; 
    justify-content: space-between;
    padding: 10px;
}

.grupo-conducta {
    flex: 0 0 calc(25% - 12px); 
    min-width: 220px; 
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box; 
    background-color: #fcfcfc;
}

.grupo-conducta h3 {
    border-bottom: none;
    margin-bottom: 8px;
    color: #0284c7;
    font-size: 1.1em;
}

.opciones {
    display: flex;
    flex-direction: column;
    gap: 5px; 
}

.conducta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 6px;
    border-radius: 4px;
}

.conducta label {
    flex-grow: 1;
    font-size: 0.9em;
}

.radio-buttons {
    display: flex;
    gap: 5px; 
    font-weight: bold;
    align-items: center;
}

.label-i, .label-r {
    color: transparent; 
    width: 15px; 
    text-align: right;
    font-size: 0.8em;
}

input[type="radio"] {
    cursor: pointer;
    transform: scale(1.1);
}

.selected-i {
    background-color: #d4edda; 
    border: 1.5px solid #28a745;
}
.selected-r {
    background-color: #f8d7da; 
    border: 1.5px solid #dc3545;
}

#calcular-btn {
    flex-basis: 100%; 
    margin-top: 20px;
    padding: 15px;
    font-size: 1.2em;
    font-weight: bold;
    background-color: var(--color-d); 
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}
#calcular-btn:hover {
    background-color: #e65c00;
}

/* ESTILOS DE RESULTADOS Y TABLAS */
.hidden {
    display: none;
}

.tabla-puntajes table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    margin-top: 15px;
}

.tabla-puntajes th, .tabla-puntajes td {
    border: 1px solid #ddd;
    padding: 10px;
}

.tabla-puntajes th {
    background-color: #0f172a;
    color: white;
}

.perfil-titulo {
    font-size: 1.4em;
    text-align: center;
    margin: 20px 0;
    padding: 10px;
    background-color: #e0f2f1;
    border-radius: 6px;
}

#perfil-predominante {
    font-weight: bold;
}

.claves-interaccion {
    list-style: none;
    padding: 0;
}
.claves-interaccion li {
    margin-bottom: 5px;
    display: flex; 
}
.clave-label {
    font-weight: bold;
    display: inline-block;
    min-width: 130px; 
    margin-right: 5px;
}

/* MARCO DEL GRÁFICO RESPETANDO RELACIÓN EN PDF */
.grafico-wrapper-pdf {
    width: 100%;
    max-width: 650px;
    margin: 15px auto;
    height: 280px;
}

/* ESTILOS DEL GRÁFICO DE CUADRANTES */
#disc-cuadrantes {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 25px auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    border: 2px solid var(--color-text);
}

.diagrama-container {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
    display: contents; 
}

.cuadrante {
    padding: 12px;
    min-height: 180px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
}

.cuadrante .letra {
    font-size: 4em; 
    font-weight: 900;
    position: absolute;
    top: 50%;
    right: 50%;
    transform: translate(50%, -50%); 
    color: rgba(0, 0, 0, 0.12);
    z-index: 1;
}

.cuadrante .subtitulo {
    display: block;
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 5px;
    color: #111;
    position: relative;
    z-index: 2;
}

.cuadrante ul {
    position: relative;
    z-index: 2;
    padding-left: 15px;
    margin: 0;
    font-size: 0.82em;
    list-style-type: square;
}

.cuadrante.D { background-color: var(--color-d); grid-column: 1 / 2; grid-row: 1 / 2; }
.cuadrante.I { background-color: var(--color-i); grid-column: 2 / 3; grid-row: 1 / 2; }
.cuadrante.S { background-color: var(--color-s); grid-column: 1 / 2; grid-row: 2 / 3; }
.cuadrante.C { background-color: var(--color-c); grid-column: 2 / 3; grid-row: 2 / 3; }

.eje-y-label, .eje-x-label {
    position: absolute;
    font-weight: bold;
    color: #0f172a;
    font-size: 0.95em;
    z-index: 10;
}
.eje-x-label.izquierda { 
    top: 50%; 
    left: -75px; 
    transform: translateY(-50%) rotate(-90deg); 
    width: 150px;
    text-align: center;
}
.eje-x-label.derecha { 
    top: 50%; 
    right: -75px; 
    transform: translateY(-50%) rotate(90deg); 
    width: 150px;
    text-align: center;
}
.eje-y-label.superior { top: -25px; left: 50%; transform: translateX(-50%); }
.eje-y-label.inferior { bottom: -25px; left: 50%; transform: translateX(-50%); }

.boton-container-final {
    margin-top: 25px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 15px;
}
.btn-finalizar { background-color: #6c757d; color: white; border: none; padding: 12px 30px; font-weight: bold; border-radius: 50px; cursor: pointer; }
.btn-descargar-pdf { background-color: #dc3545; color: white; border: none; padding: 12px 30px; font-weight: bold; border-radius: 50px; cursor: pointer; }

footer {
    text-align: center;
    margin-top: 40px;
    padding: 15px 0;
    border-top: 1px solid #ddd;
    font-size: 0.9em;
    color: #888;
}

.pdf-reporte-contenedor {
    background-color: #ffffff;
    padding: 10px;
    box-sizing: border-box;
}

.reporte-titulo-pdf {
    font-size: 1.8em;
    font-weight: 900;
    color: #111;
    margin: 0 0 15px 0;
    border-bottom: 2px solid #111;
    padding-bottom: 3px;
}

.pdf-pagina-bloque {
    box-sizing: border-box;
    width: 100%;
}

.break-seccion-hoja {
    page-break-before: always !important;
    break-before: page !important;
    margin-top: 0 !important;
    padding-top: 15px !important;
}

.tabla-puntajes, .grafico-wrapper-pdf, #interpretacion-perfil, #disc-cuadrantes {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}

@media print {
    .test-navbar {
        display: none !important;
    }
}

@media (max-width: 1100px) { .grupo-conducta { flex: 0 0 calc(33.33% - 10px); } }
@media (max-width: 750px) { .grupo-conducta { flex: 0 0 calc(50% - 7.5px); } }
@media (max-width: 550px) { .grupo-conducta { flex-basis: 100%; } }