/* ============================================================
   1. IMPORTACIONES Y VARIABLES
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
    --primary: #009c78;
    --accent: #ffdc00;
    --error: #88201e;
    --dark: #2c3e50;
    --light: #f4f7f6;
    --white: #ffffff;
    --info-bg: #e8f5f2; /* Color de fondo suave para la recomendación */
}

/* ============================================================
   2. ESTILOS BASE
   ============================================================ */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--light);
    color: var(--dark);
    margin: 0;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
}

.main-container {
    max-width: 1100px;
    margin: 0 auto;
}

.header-logo {
    text-align: center;
    margin-bottom: 20px;
}

.header-logo img {
    max-height: 80px;
    transition: max-height 0.3s ease;
}

h1 { 
    text-align: center; 
    color: var(--primary); 
    margin-bottom: 30px; 
    font-weight: 700;
}

/* ============================================================
   3. GRID Y TARJETAS (LAYOUT)
   ============================================================ */
.simulator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.card {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border: 1px solid transparent;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 156, 120, 0.15);
    border-color: rgba(0, 156, 120, 0.2);
}

h2 { 
    color: var(--dark); 
    border-bottom: 2px solid var(--accent); 
    padding-bottom: 10px; 
    margin-top: 0;
    font-weight: 500;
}

/* Contenedor de la barra (fondo gris) */
.progress-container {
    width: 100%;
    height: 8px;
    background-color: #eee;
    border-radius: 10px;
    margin-top: 8px;
    overflow: hidden; /* Para que la barra no se salga de los bordes redondeados */
}

/* La barra que se mueve */
.progress-bar {
    height: 100%;
    width: 0%; /* Empieza en 0 */
    background-color: var(--error); /* Empieza en rojo */
    transition: width 0.4s ease, background-color 0.4s ease;
}
/* ============================================================
   4. FORMULARIOS E INPUTS
   ============================================================ */
.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: 500; }

input[type="number"], 
input[type="text"], 
select {
    width: 100%; 
    padding: 12px; 
    border: 2px solid #eee; 
    border-radius: 8px;
    font-size: 16px; 
    font-family: 'Roboto', sans-serif;
    box-sizing: border-box; 
    transition: all 0.3s ease;
}

input:focus, select:focus { 
    border-color: var(--primary); 
    background-color: #fafffe;
    outline: none; 
}

/* Botones de Radio (Plazos) */
.radio-group { display: flex; gap: 10px; }
.radio-group input { display: none; }
.radio-group label {
    flex: 1; 
    padding: 12px; 
    background: #eee; 
    text-align: center;
    border-radius: 8px; 
    cursor: pointer; 
    transition: 0.3s;
    font-weight: 500;
}

.radio-group label:hover { background-color: #e2e2e2; }

.radio-group input:checked + label {
    background-color: var(--primary); 
    color: white;
    box-shadow: 0 4px 12px rgba(0, 156, 120, 0.3);
}

.validation-message { font-size: 0.85em; color: var(--error); margin-top: 5px; font-weight: 500; }
.validation-message.valid { color: var(--primary); }

.hidden { display: none; }

/* ============================================================
   5. RESULTADOS Y ROI
   ============================================================ */
.result-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #eee; }

.payment-box {
    background: var(--primary); 
    color: white; 
    padding: 25px;
    border-radius: 12px; 
    text-align: center; 
    margin: 20px 0;
}

.payment-box strong { display: block; font-size: 2.2em; margin: 10px 0; font-weight: 700; }

.roi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 15px; }
.roi-item { 
    background: #f9f9f9; 
    padding: 15px; 
    border-radius: 8px; 
    text-align: center; 
    border: 1px solid #eee; 
}

.roi-item strong { display: block; color: var(--primary); font-size: 1.3em; margin-top: 5px; font-weight: 700; }

.disclaimer-text {
    font-size: 0.75rem;
    color: #7f8c8d;
    line-height: 1.3;
    margin-top: 15px;
    font-style: italic;
    text-align: justify;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

/* ============================================================
   6. BOTONES DE ACCIÓN
   ============================================================ */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-action, .btn-secondary {
    padding: 16px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Botón Amarillo (Solicitar) */
.btn-action {
    background: var(--accent);
    color: var(--dark);
    flex: 2;
}

.btn-action:hover { 
    background: #f0cf00; 
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 220, 0, 0.4);
}

/* Botón Gris (Limpiar) */
.btn-secondary {
    background: #e0e0e0;
    color: var(--dark);
    flex: 1;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

/* ============================================================
   8. RECOMENDACIÓN DE COMBO (NUEVO)
   ============================================================ */
.recommendation-box {
    margin-top: 12px;
    background-color: var(--info-bg);
    border-left: 4px solid var(--primary);
    color: var(--dark);
    padding: 12px 15px;
    border-radius: 0 8px 8px 0;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.4s ease-out;
}

.recommendation-box .icon {
    font-size: 1.2em;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   7. AJUSTES RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
    .simulator-grid { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 600px) {
    body { padding: 10px; }
    h1 { font-size: 1.6rem; }
    .card { padding: 20px; }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn-action, .btn-secondary {
        width: 100%;
        padding: 18px;
    }

    .radio-group { flex-direction: column; }
    .roi-grid { grid-template-columns: 1fr; }
}