body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f4f8;
    color: #2d3748;
    margin: 0;
    padding: 30px 15px;
    display: flex;
    justify-content: center;
}

.contenedor {
    display: flex;
    gap: 25px;
    max-width: 1200px;
    width: 100%;
}

.zona-input, .zona-resultado {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    flex: 1;
    box-sizing: border-box;
}

.zona-resultado {
    position: sticky;
    top: 30px;
    height: max-content;
    display: none;
    border-top: 5px solid #2b6cb0;
}

h2 {
    margin-top: 0;
    color: #1a365d;
    font-size: 1.6rem;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    background: #f8fafc;
}

legend {
    background: #2b6cb0;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
}

.grupo {
    margin-bottom: 15px;
}

.fila-inputs {
    display: flex;
    gap: 15px;
}

.fila-inputs .grupo {
    flex: 1;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: #4a5568;
}

select, input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    background-color: #fff;
    box-sizing: border-box;
    font-size: 0.95rem;
}

.grupo-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.grupo-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.grupo-check label {
    margin: 0;
    font-weight: 400;
}

.grupo-radio {
    margin-top: 10px;
}

.opciones-radio {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}

.opciones-radio label {
    font-weight: 400;
    display: inline;
}

button[type="submit"] {
    width: 100%;
    padding: 16px;
    background: #319795;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

button[type="submit"]:hover {
    background: #2c7a7b;
}

/* Formateo de las líneas de presupuesto */
.linea-presupuesto {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #e2e8f0;
    font-size: 0.95rem;
}

.linea-presupuesto span:last-child {
    font-weight: 600;
    color: #2d3748;
}

.totales {
    margin-top: 20px;
    text-align: right;
}

.totales p {
    margin: 6px 0;
    color: #718096;
}

.total {
    color: #dd6b20;
    font-size: 1.6rem;
    margin-top: 15px;
}

/* Modificaciones estructurales para diseño adaptativo */
@media (max-width: 900px) {
    .contenedor {
        flex-direction: column;
    }
    .zona-resultado {
        position: static;
    }
}

/* --- SISTEMA DE TOOLTIPS (BOTONES DE INFO) --- */

/* Contenedor para alinear el texto de la pregunta y su botón de info */
.label-ayuda {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.label-ayuda label {
    margin-bottom: 0; /* Quitamos el margen viejo para que se alinee con la (i) */
}

/* El circulito de la (i) */
.info-btn {
    background: #cbd5e0;
    color: #4a5568;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 11px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
}

.info-btn:hover {
    background: #2b6cb0;
    color: white;
}

/* El bocadillo con el texto oculto */
.info-btn::after {
    content: attr(data-tip); /* Lee el texto directamente desde el HTML */
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a202c;
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: normal;
    line-height: 1.3;
    white-space: normal;
    width: 220px; /* Ancho del cuadro explicativo */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Flechita del bocadillo */
.info-btn::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #1a202c transparent transparent transparent;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 999;
}

/* Mostrar bocadillo y flechita al pasar el ratón */
.info-btn:hover::after, .info-btn:hover::before {
    visibility: visible;
    opacity: 1;
}