/* style.css */

/* ------------------- */
/* --- VARIABLES --- */
/* ------------------- */

:root {
    /* Paleta de Colores */
    --color-primary-dark: #0c4a6e;  /* Azul Oscuro (para fondos, cabeceras) */
    --color-primary-base: #0369a1;  /* Azul Principal */
    --color-accent-cyan: #06b6d4;   /* Cian Acento (para botones principales, highlights) */
    --color-accent-purple: #7c3aed; /* Púrpura Acento */
    --color-accent-teal: #14b8a6;   /* Teal Acento */
    --color-success: #22c55e;       /* Verde Éxito */
    --color-text-primary: #1f2937;  /* Gris muy oscuro (para texto principal) */
    --color-text-secondary: #4b5563;/* Gris oscuro (para texto secundario) */
    --color-text-light: #ffffff;    /* Blanco */
    --color-bg-light: #f8fafc;      /* Fondo claro (casi blanco) */
    --color-bg-white: #ffffff;      /* Blanco puro */
    --color-border: #e5e7eb;        /* Borde sutil */

    /* Tipografía */
    --font-family-main: 'Poppins', sans-serif;

    /* UI Elements */
    --border-radius-soft: 0.5rem;  /* 8px */
    --border-radius-medium: 0.75rem; /* 12px */
    --border-radius-hard: 9999px; /* full */
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-strong: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition-fast: all 0.2s ease-in-out;
    --transition-medium: all 0.3s ease-in-out;
}

/* ------------------- */
/* --- ESTILOS BASE --- */
/* ------------------- */

body {
    font-family: var(--font-family-main);
    background-color: var(--color-bg-light);
    color: var(--color-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ------------------- */
/* --- ANIMACIONES --- */
/* ------------------- */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-fade-in {
    animation: fadeIn 0.6s ease-in-out forwards;
}

@keyframes blob {
    0% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0px, 0px) scale(1); }
}

.animate-blob {
    animation: blob 7s infinite cubic-bezier(0.6, 0.01, 0.3, 0.9);
}
.animation-delay-2000 { animation-delay: 2s; }
.animation-delay-4000 { animation-delay: 4s; }


/* ------------------- */
/* --- COMPONENTES --- */
/* ------------------- */

/* --- Botones --- */
.btn {
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-hard);
    transition: var(--transition-medium);
    box-shadow: var(--shadow-soft);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}
.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-soft);
}

.btn-primary {
    background-color: var(--color-accent-cyan);
    color: var(--color-text-light);
}
.btn-primary:hover {
    background-color: #0891b2; /* Darker cyan */
}

.btn-secondary {
    background-color: var(--color-accent-purple);
    color: var(--color-text-light);
}
.btn-secondary:hover {
    background-color: #6d28d9; /* Darker purple */
}

.btn-tertiary {
    background-color: var(--color-accent-teal);
    color: var(--color-text-light);
}
.btn-tertiary:hover {
    background-color: #0d9488; /* Darker teal */
}

.btn-neutral {
    background-color: var(--color-text-secondary);
    color: var(--color-text-light);
}
.btn-neutral:hover {
    background-color: #374151; /* Darker gray */
}

/* --- Tarjetas --- */
.card {
    background-color: var(--color-bg-white);
    border-radius: var(--border-radius-medium);
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--color-border);
    padding: 2rem;
    transition: var(--transition-medium);
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-strong);
}

/* --- Formularios y Cuestionario --- */
#quiz-container, #savings-calculator-section .bg-white {
    background-color: var(--color-bg-white);
    border-radius: var(--border-radius-medium);
    box-shadow: var(--shadow-strong);
    padding: 2rem;
}

#question-container {
    /* El padding se elimina para dar paso a un centrado más robusto */
}

#question-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary-dark);
    margin-bottom: 2rem;
    text-align: center;
}

#options-container {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centra los botones horizontalmente */
    gap: 0.75rem; /* Espacio entre botones */
}

#options-container .bg-gray-200 {
    background-color: var(--color-bg-light);
    color: var(--color-text-secondary);
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius-soft);
    padding: 1rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    width: 100%; /* Ocupa el 100% del nuevo max-width */
    max-width: 500px; /* Ancho máximo para los botones en escritorio */
}
#options-container .bg-gray-200:hover {
    border-color: var(--color-accent-cyan);
    color: var(--color-accent-cyan);
    background-color: #f0f9ff; /* Light cyan background */
}

/* --- ESTILO UNIFICADO PARA OPCIÓN SELECCIONADA (LA CORRECCIÓN PRINCIPAL) --- */
#options-container .selected-option {
    background-color: var(--color-accent-cyan) !important;
    color: var(--color-text-light) !important;
    border-color: var(--color-accent-cyan) !important;
    font-weight: 500; /* Changed to 500 to match non-selected state */
    box-shadow: var(--shadow-soft);
    transform: scale(1.02);
}

/* --- Calculadora --- */
#savings-calculator-section input[type="number"] {
    font-size: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-soft);
    width: 100%;
    transition: var(--transition-fast);
}
#savings-calculator-section input[type="number"]:focus {
    outline: none;
    border-color: var(--color-accent-cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}
#savings-results {
    background-color: #f0f9ff; /* Light cyan background */
    border-radius: var(--border-radius-medium);
    padding: 1.5rem;
    margin-top: 2rem;
}
#savings-results table {
    width: 100%;
    border-collapse: collapse;
}
#savings-results th, #savings-results td {
    padding: 0.75rem;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
}
#savings-results th {
    font-weight: 600;
    color: var(--color-primary-dark);
}

/* --- Plan Financiero --- */
#plan-content {
    background-color: var(--color-bg-white);
    border-radius: var(--border-radius-medium);
    box-shadow: var(--shadow-strong);
    padding: 2.5rem;
}
.plan-step-card {
    background-color: #f0f9ff;
    border-left: 5px solid var(--color-accent-cyan);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius-soft);
    display: flex;
    align-items: flex-start;
}
.plan-step-icon {
    color: var(--color-accent-cyan);
    font-size: 1.5rem;
    margin-right: 1rem;
    flex-shrink: 0;
}
.plan-step-card p {
    margin: 0;
    line-height: 1.6;
    color: var(--color-text-primary);
}

/* --- Artículos y Contenido General --- */
article h1, article h2, article h3, article h4, article h5, article h6 {
    color: var(--color-text-primary);
    line-height: 1.3;
    margin-bottom: 1rem;
}
article h1 { font-size: 2.5rem; font-weight: 800; }
article h3 { font-size: 1.75rem; font-weight: 700; margin-top: 2rem; }
article p {
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}
article ul, article ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}
article li {
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}
article a {
    color: var(--color-accent-cyan);
    text-decoration: underline;
    font-weight: 600;
}
article strong {
    font-weight: 700;
    color: var(--color-text-primary);
}

/* --- Cabecera (Hero Section) --- */
#welcome-screen {
    background: linear-gradient(45deg, var(--color-primary-dark), var(--color-primary-base));
}
#welcome-screen h1 {
    text-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* --- Footer --- */
footer.bg-gray-800 {
    background-color: #1f2937; /* Manteniendo el gris oscuro para el footer */
}

/* --- FAQ --- */
.faq-item-question {
    cursor: pointer;
    padding: 1.25rem;
    transition: background-color 0.2s;
}
.faq-item-question:hover {
    background-color: #f9fafb;
}
.faq-item-answer {
    padding: 0 1.25rem 1.25rem 1.25rem;
    background-color: #f9fafb;
    border-top: 1px solid var(--color-border);
}

/* --- Botones de Navegación del Quiz (Re-estilizados) --- */
#prev-question-button, #next-question-button, #submit-quiz-button {
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-hard);
    transition: var(--transition-medium);
    box-shadow: var(--shadow-soft);
    border: none;
    cursor: pointer;
}
#prev-question-button {
    background-color: var(--color-text-secondary);
    color: var(--color-text-light);
}
#prev-question-button:hover {
    background-color: #374151;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}
#next-question-button, #submit-quiz-button {
    background-color: var(--color-accent-cyan);
    color: var(--color-text-light);
}
#next-question-button:hover, #submit-quiz-button:hover {
    background-color: #0891b2;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* --- Corrección de Estilos de Tailwind que puedan interferir --- */
/* Aseguramos que los botones del quiz usen los nuevos estilos */
#options-container > button {
    /* Removed all: unset; */
    box-sizing: border-box; /* Ensure consistent box model */
    background-color: var(--color-bg-light);
    color: var(--color-text-secondary);
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius-soft);
    padding: 1rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    display: block; /* Ensure it takes full width */
    width: 100%;
    margin-bottom: 0.5rem; /* Space between buttons */
    transition: none !important; /* Force no transitions */
    line-height: normal !important; /* Ensure consistent line height */
}

#options-container > button:hover {
    border-color: var(--color-accent-cyan);
    color: var(--color-accent-cyan);
    background-color: #f0f9ff;
}

/* Aplicamos la clase quiz-option-selected desde JS */
.quiz-option-selected {
    background-color: var(--color-accent-cyan) !important;
    color: var(--color-text-light) !important;
    border-color: var(--color-accent-cyan) !important;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3); /* Subtle inset shadow */
}