/* ============================================================
   1. FIJACIÓN DE ESTRUCTURA Y RESET
   ============================================================ */
/* Forzamos scrollbar para que el ancho de la ventana no cambie al calcular */
html { 
    overflow-y: scroll; 
}

* { 
    box-sizing: border-box; 
}

body {
    user-select: none;
    -webkit-user-select: none;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: transparent;
    color: #333;
    margin: 0;
    padding: 10px;
    display: flex;
    justify-content: center;
}

/* ============================================================
   2. CONTENEDOR Y COLUMNAS (BLOQUEO ESCRITORIO)
   ============================================================ */
.container {
    width: 100%;
    max-width: 1300px;
    background-color: #fff;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch; /* Ambas columnas miden lo mismo de alto */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.left-column {
    flex: 0 0 50%;
    width: 50%;
    max-width: 50%;
    padding: 20px;
    background-color: #ffffff;
}

.right-column {
    flex: 0 0 50%;
    width: 50%;
    max-width: 50%;
    padding: 20px;
    background-color: #f9f9f9; /* Fondo gris resultados */
    border-left: 1px solid #eee;
}

/* ============================================================
   3. TÍTULOS Y SECCIONES
   ============================================================ */
h2 {
    color: #34433c;
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 3px solid #34433c;
    padding-bottom: 12px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
}

h3.seccion-titulo {
    background-color: #f0f4f2;
    color: #34433c;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 15px;
    border-radius: 6px;
    margin: 15px 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-left: 4px solid #34433c;
}

h4 {
    font-size: 13px;
}

/* ============================================================
   4. FORMULARIO: INPUTS Y SELECTS
   ============================================================ */
#nominaForm label {
    font-weight: 700;
    color: #34433c;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: block;
}

#nominaForm input[type="number"],
#nominaForm input[type="text"],
#nominaForm select {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

#nominaForm input:focus,
#nominaForm select:focus {
    border-color: #34433c;
    box-shadow: 0 0 0 3px rgba(52, 67, 60, 0.1);
    background-color: #fcfdfc;
}

.input-group-row {
    display: flex;
    gap: 20px;
    width: 100%;
}

.input-half {
    flex: 1;
}

/* ============================================================
   5. CHECKBOXES PERSONALIZADOS
   ============================================================ */
/* Estilo para el icono "?" */
.tooltip-icon {
    background-color: #34433c;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: inline-block;
    text-align: center;
    line-height: 18px;
    font-size: 14px;
    cursor: pointer;
    margin-left: 8px;
    font-weight: bold;
}

/* Estilo para el recuadro de texto de ayuda */
.help-text {
    display: none; /* Se oculta por defecto */
    background-color: #f9f9f9;
    border-left: 4px solid #34433c;
    padding: 10px;
    margin-top: 5px;
    margin-bottom: 10px;
    font-size: 0.85em;
    color: #555;
    border-radius: 4px;
}

.radio-inline-group {
    padding: 10px 15px;
}

.radio-item input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #34433c; /* Color corporativo para el check */
}


form input[type="checkbox"] {
    display: none;
}

form label.checkbox-label {
    display: flex !important;
    align-items: center;
    position: relative;
    padding-left: 35px;
    cursor: pointer;
    text-transform: none !important;
    font-weight: 600 !important;
    margin-bottom: 18px !important;
    color: #444 !important;
}

form label.checkbox-label:before {
    content: "";
    position: absolute;
    left: 0;
    width: 22px;
    height: 22px;
    border: 2px solid #34433c;
    border-radius: 6px;
    background: white;
}

form input[type="checkbox"]:checked + label.checkbox-label:before {
    background-color: #34433c;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: center;
}

/* ============================================================
   6. RESULTADOS Y TABLAS (ALINEACIÓN DEL EURO)
   ============================================================ */
#resultados table {
    width: 100% !important;
    table-layout: fixed; /* Evita que la tabla empuje la columna */
    border-collapse: collapse;
}

#resultados td {
    padding: 10px 0;
    font-size: 14px;
    color: #444;
    vertical-align: middle;
}

.importe {
    text-align: right !important;
    padding-left: 15px;
    font-weight: 700;
    color: #34433c;
    white-space: nowrap;
}

hr {
    border: 0;
    border-top: 1px solid #e1e1e1;
    margin: 15px 0;
}

.small-text {
    font-size: 11px;
    font-weight: 400;
    color: #888;
    font-style: italic;
    text-transform: none;
}

/* ============================================================
   7. RESPONSIVE (MÓVILES)
   ============================================================ */
@media (max-width: 900px) {
    .container {
        flex-direction: column;
    }
    
    .left-column, 
    .right-column {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        border-left: none;
    }

    .right-column {
        border-top: 1px solid #eee;
    }

    .input-group-row {
        flex-direction: column;
        gap: 0;
    }
}