/*******************************************************************************
 * N° 1 Función. - Estilos generales del contenedor del formulario.
 ******************************************************************************/
.form-container {
    max-width: 800px;
    margin: 2em auto;
    padding: 1em;
    background: #f9f9f9;
    border: 1px solid #ccc;
    border-radius: 5px;
    user-select: none;
}

.karin-warning {
    background-color: #fffde7;
    border: 1px solid #fbc02d;
    color: #5d4037;
    padding: 1em;
    margin-bottom: 1.5em;
    border-radius: 5px;
    text-align: center;
}

/*******************************************************************************
 * N° 2 Función. - Estilos para las secciones del formulario.
 ******************************************************************************/
.form-section {
    border-bottom: 1px solid #eee;
    padding-bottom: 1em;
    margin-bottom: 1em;
}

/*******************************************************************************
 * N° 3 Función. - Estilos para los grupos de preguntas.
 ******************************************************************************/
.form-group {
    margin-bottom: 1em;
}

/*******************************************************************************
 * N° 4 Función. - Estilos para los títulos del formulario.
 ******************************************************************************/
.form-container h3 {
    text-align: center;
    color: #333;
    margin-bottom: 1em;
}

/*******************************************************************************
 * N° 5 Función. - Estilos para las etiquetas de los formularios.
 ******************************************************************************/
.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.5em;
}

/*******************************************************************************
 * N° 6 Función. - Estilos para los inputs de texto y select.
 ******************************************************************************/
.form-group input[type="text"],
.form-group input[type="email"],
.form-group select,
.form-group input[type="date"],
.form-group textarea {
    width: 100%;
    padding: 0.5em;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-sizing: border-box;
}

/*******************************************************************************
 * N° 7 Función. - Estilos para los botones de radio.
 ******************************************************************************/
.radio-group label {
    display: block;
    font-weight: normal;
    margin-bottom: 0.5em;
}

/*******************************************************************************
 * N° 8 Función. - Estilos para el botón de envío del formulario.
 ******************************************************************************/
#submit-button, .next-step-btn, .prev-step-btn {
    background-color: #0073aa;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    flex-grow: 1;
    text-align: center;
    width: 100%;
}
#submit-button:hover, .next-step-btn:hover, .prev-step-btn:hover {
    background-color: #005177;
}

.prev-step-btn {
    background-color: #6c757d;
}
.prev-step-btn:hover {
    background-color: #5a6268;
}

.step-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1em;
    margin-top: 1.5em;
}

#submit-button {
    background-color: #28a745;
}
#submit-button:hover {
    background-color: #218838;
}

.text-mobile {
    display: none;
}


/*******************************************************************************
 * N° 9 Función. - Estilos para los resultados del informe.
 ******************************************************************************/
#results {
    border-top: 2px solid #0073aa;
    padding-top: 1em;
    margin-top: 2em;
}

#results.results-are-visible {
    display: block !important;
}


/*******************************************************************************
 * N° 10 Función. - Estilos para el texto de carga.
 ******************************************************************************/
#loading {
    text-align: center;
    font-weight: bold;
    color: #0073aa;
}

/*******************************************************************************
 * N° 11 Función. - Estilos para el sistema de semáforos.
 ******************************************************************************/
.semaforo {
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 3px;
    margin-top: 5px;
    display: inline-block;
}
.verde { background-color: #e6f4e6; color: #388e3c; }
.amarillo { background-color: #fffde7; color: #fbc02d; }
.rojo { background-color: #fbe9e7; color: #d32f2f; }

/*******************************************************************************
 * N° 12 Función. - Estilos para el gráfico de pastel flotante.
 ******************************************************************************/
#floating-pie-chart {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 15px;
    text-align: center;
    z-index: 1000;
    width: 280px;
    transition: opacity 0.5s ease-in-out;
    height: fit-content;
}

.drag-handle {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    cursor: move;
    z-index: 10;
}
.drag-handle img {
    width: 100%;
    height: auto;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}
.drag-handle:hover img {
    opacity: 1;
}

#floating-pie-chart h4 { 
    margin: 0 0 10px; 
    font-size: 1.5em;
    padding: 5px 0;
    text-align: center;
}

#floating-pie-chart.is-dragging {
    z-index: 99999;
    opacity: 0.8;
    cursor: grabbing;
}

#karinPieChart { width: 150px; height: 150px; margin: 0 auto; }
.porcentajes-fuera { display: flex; flex-direction: column; align-items: flex-start; margin-top: 15px; line-height: 1.8; }
.pie-text-item { font-weight: bold; font-size: 1.2em; display: flex; justify-content: space-between; width: 100%; }
.porcentajes-fuera .cumplimiento-text { color: #388e3c; }
.porcentajes-fuera .riesgo-text { color: #d32f2f; }
.total-multa { font-size: 1.3em; font-weight: bold; color: #d32f2d; margin-top: 15px; }

/*******************************************************************************
 * N° 13 Función. - Estilos para las preguntas paso a paso.
 ******************************************************************************/
.question-step { display: none; }
.sub-pregunta { border-left: 2px solid #ddd; padding-left: 1em; margin-top: 1em; }
.sub-respuesta { margin-top: 1em; }

/*******************************************************************************
 * N° 14 Función. - Estilos responsivos.
 ******************************************************************************/
@media screen and (max-width: 768px) {
    .text-desktop {
        display: none;
    }
    .text-mobile {
        display: inline;
    }

    #floating-pie-chart {
        width: 220px;
        padding: 15px;
        bottom: 10px;
        right: 10px;
        box-sizing: border-box;
    }
    #floating-pie-chart h4 {
        font-size: 1.1em;
        margin-bottom: 10px;
    }
    #karinPieChart {
        width: 120px !important;
        height: 120px !important;
        margin: 0 auto;
    }
    .pie-text-item { font-size: 0.9em; }
    .porcentajes-fuera { margin-top: 15px; }
    .total-multa { font-size: 1em; }
}

/*******************************************************************************
 * N° 15 Función. - Clases de ayuda para JavaScript.
 ******************************************************************************/
body.is-dragging-chart {
    user-select: none;
    -webkit-user-select: none;
    overflow: hidden !important;
}