/* =========================================
   1. VARIABLES Y CONFIGURACIÓN (COLORES EFECTOBOLA)
   ========================================= */
:root {
    /* --- COLORES DE MARCA --- */
    --brand-blue: #104a6c;       /* Azul Profesional (Efecto) */
    --brand-green: #3fb34f;      /* Verde Crecimiento (Bola) */
    
    /* Variaciones para interacciones (Hover) */
    --brand-blue-hover: #0c3852;
    --brand-green-hover: #359642;

    /* --- TEMA CLARO (Por defecto) --- */
    --primary-bg: #f4f7f9;       /* Fondo muy suave azulado */
    --card-bg: #ffffff;
    --text-main: #104a6c;        /* El texto principal es el Azul Profesional */
    --text-body: #374151;        /* Gris oscuro para párrafos largos */
    --text-muted: #64748b;       /* Texto secundario */
    --border: #e2e8f0;
    
    /* Mapeo de colores funcionales a la marca */
    --accent: var(--brand-green);  /* Acentos en verde */
    --primary-btn: var(--brand-blue); /* Botones en azul */
    
    /* UI Elements */
    --radius: 16px;
    --shadow-sm: 0 2px 4px rgba(16, 74, 108, 0.05);
    --shadow-md: 0 10px 30px -5px rgba(16, 74, 108, 0.1);
    
    /* Inputs */
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --input-focus: var(--brand-green);
    
    /* Tipografía */
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}



/* --- TEMA OSCURO --- */
body.dark-mode {
    --primary-bg: #0b1d2a;       /* Azul noche muy profundo */
    --card-bg: #152a3a;          /* Azul acero oscuro */
    --text-main: #f1f5f9;        /* Blanco para contraste */
    --text-body: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #2a4055;
    
    /* En modo oscuro, ajustamos los colores para que brillen */
    --brand-blue: #60a5fa;       
    --brand-green: #4ade80;
    
    /* Re-asignamos variables */
    --accent: var(--brand-green);
    --primary-btn: #3b82f6; /* Azul un poco más brillante para botones oscuros */

    --shadow-md: 0 10px 40px -10px rgba(0,0,0,0.6);
    --input-bg: #0f1f2e;
    --input-border: #334e68;
}

/* =========================================
   2. ESTILOS BASE
   ========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-family);
    background-color: var(--primary-bg);
    color: var(--text-body);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

.wrapper { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* =========================================
   3. HEADER & LOGO
   ========================================= */
.navbar {
    display: flex; justify-content: center; padding: 20px 0;
}
.nav-container {
    width: 90%; max-width: 1000px; display: flex; justify-content: space-between; align-items: center;
}

/* LOGO */
.logo { 
    font-weight: 900; 
    font-size: 1.6rem; 
    letter-spacing: -0.5px; 
    color: #104a6c; /* Azul marca forzado en modo claro */
}
body.dark-mode .logo { color: #ffffff; }

.text-accent { color: var(--brand-green); }

.settings-btn {
    background: transparent; border: none; cursor: pointer; color: var(--text-main);
    padding: 8px; border-radius: 50%; transition: background 0.2s;
}
.settings-btn:hover { background: rgba(0,0,0, 0.05); }

/* HERO */
.hero { text-align: center; padding: 40px 20px 60px; }

.hero h1 { 
    font-size: 2.8rem; 
    font-weight: 800; 
    letter-spacing: -1.5px; 
    margin-bottom: 15px; 
    line-height: 1.1;
    color: var(--text-main);
}

.gradient-text {
    /* Degradado EFECTOBOLA: Azul -> Verde */
    background: linear-gradient(135deg, #104a6c 0%, #3fb34f 100%);
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent;
}
body.dark-mode .gradient-text {
    background: linear-gradient(135deg, #60a5fa 0%, #4ade80 100%);
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent;
}

.hero-subtitle { color: var(--text-muted); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

/* =========================================
   4. TABS & GRID
   ========================================= */
.tabs-container { display: flex; justify-content: center; margin-bottom: 30px; }

.tabs {
    background: var(--card-bg); padding: 5px; border-radius: 50px;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
    display: flex; gap: 5px;
}

.tab-btn {
    padding: 10px 24px; border: none; border-radius: 40px;
    background: transparent; color: var(--text-muted);
    font-weight: 600; cursor: pointer; transition: all 0.2s; font-size: 0.95rem;
}

.tab-btn.active {
    background: var(--brand-blue); /* Activo = Azul */
    color: white;
    box-shadow: 0 4px 12px rgba(16, 74, 108, 0.3);
}

.main-grid {
    display: grid; grid-template-columns: 380px 1fr; gap: 30px; align-items: start;
}

.card {
    background: var(--card-bg); border-radius: var(--radius);
    padding: 30px; box-shadow: var(--shadow-md); border: 1px solid var(--border);
    transition: background 0.3s, border-color 0.3s;
}

.card-header h2 { 
    font-size: 1.3rem; margin-bottom: 25px; font-weight: 700; 
    color: var(--text-main); border-bottom: 2px solid var(--primary-bg); padding-bottom: 10px;
}

/* =========================================
   5. INPUTS
   ========================================= */
.input-group { margin-bottom: 20px; }
.input-group label {
    display: block; font-size: 0.9rem; font-weight: 700;
    margin-bottom: 8px; color: var(--text-main);
}

.input-wrapper { position: relative; }
.currency-symbol {
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-weight: 600;
}
.input-wrapper input { padding-left: 35px; }

input {
    width: 100%; padding: 12px 15px;
    background: var(--input-bg); border: 2px solid var(--input-border);
    border-radius: 12px; font-size: 1rem; color: var(--text-main);
    font-family: var(--font-family); transition: all 0.2s; font-weight: 500;
}

input:focus {
    outline: none; 
    border-color: var(--brand-green); /* Foco = Verde */
    box-shadow: 0 0 0 4px rgba(63, 179, 79, 0.1);
}

.row-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

/* CHECKBOX */
.checkbox-wrapper { margin: 20px 0; }
.checkbox-group {
    display: flex; align-items: center; cursor: pointer; position: relative;
    padding-left: 30px; user-select: none; font-size: 0.9rem; font-weight: 500; color: var(--text-muted);
}
.checkbox-group input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.checkmark {
    position: absolute; top: 0; left: 0; height: 20px; width: 20px;
    background-color: var(--input-bg); border: 2px solid var(--input-border);
    border-radius: 6px; transition: all 0.2s;
}
.checkbox-group input:checked ~ .checkmark { 
    background-color: var(--brand-green); 
    border-color: var(--brand-green); 
}
.checkmark:after {
    content: ""; position: absolute; display: none;
    left: 6px; top: 2px; width: 5px; height: 10px;
    border: solid white; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.checkbox-group input:checked ~ .checkmark:after { display: block; }

/* =========================================
   6. BOTONES
   ========================================= */
.button-group { display: grid; gap: 12px; margin-top: 25px; }

.action-btn {
    padding: 16px; border-radius: 12px; font-weight: 700; font-size: 1rem;
    cursor: pointer; transition: transform 0.1s, opacity 0.2s; border: none;
    display: flex; justify-content: center; align-items: center; gap: 8px;
}
.action-btn:active { transform: scale(0.98); }

.action-btn.primary {
    background: var(--primary-btn); /* Azul */
    color: white;
    box-shadow: 0 4px 15px rgba(16, 74, 108, 0.3);
}
.action-btn.primary:hover { background: var(--brand-blue-hover); }

.action-btn.secondary {
    background: transparent; border: 2px solid var(--border); color: var(--text-main);
}
.action-btn.secondary:hover { background: var(--primary-bg); border-color: var(--text-muted); }

/* =========================================
   7. RESULTADOS (GRADIENTE)
   ========================================= */
.result-card { display: flex; flex-direction: column; justify-content: space-between; min-height: 500px; }

.result-box {
    text-align: center; padding: 35px;
    /* GRADIENTE: Azul -> Verde */
    background: linear-gradient(135deg, #104a6c 0%, #1a5c85 50%, #3fb34f 100%);
    border-radius: var(--radius); 
    margin-bottom: 20px;
    color: white;
    box-shadow: 0 10px 20px rgba(63, 179, 79, 0.2);
}

.result-box span { 
    font-size: 0.85rem; font-weight: 600; color: rgba(255,255,255,0.8); 
    text-transform: uppercase; letter-spacing: 1px;
}
.result-box h3 {
    margin: 10px 0; color: #ffffff; font-size: 2.8rem; 
    letter-spacing: -1.5px; text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.small-text { font-size: 0.85rem; color: rgba(255,255,255,0.7); margin-top: 5px; font-weight: 400; }
.chart-container { flex-grow: 1; min-height: 300px; width: 100%; margin-top: 20px; }

/* =========================================
   8. SEO & PROMO
   ========================================= */
.promo-section { margin-top: 60px; }
.promo-section h3 { margin-bottom: 20px; font-size: 1.5rem; color: var(--text-main); }
.promo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }

.promo-card {
    background: var(--card-bg); padding: 25px; border-radius: var(--radius);
    border: 1px solid var(--border); transition: transform 0.2s;
}
.promo-card:hover { transform: translateY(-3px); border-color: var(--brand-green); }

.promo-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.promo-header h4 { font-size: 1.1rem; font-weight: 700; color: var(--text-main); }

.tag {
    background: #e6fffa; padding: 4px 8px; border-radius: 6px;
    font-size: 0.75rem; font-weight: 700; color: var(--brand-green); 
    border: 1px solid rgba(63, 179, 79, 0.2);
}
body.dark-mode .tag { background: rgba(63, 179, 79, 0.1); }

.btn-link {
    display: inline-block; color: var(--brand-green); font-weight: 700;
    text-decoration: none; font-size: 0.95rem;
}
.btn-link:hover { text-decoration: underline; color: var(--brand-green-hover); }

/* --- SEO CONTENT (Corregido y Unificado) --- */
.seo-container {
    margin-top: 60px; margin-bottom: 60px;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 25px;
}

.seo-card {
    background: var(--card-bg); padding: 25px; border-radius: var(--radius);
    border: 1px solid var(--border); 
    border-left: 5px solid var(--brand-green); /* Acento verde lateral */
    display: flex; flex-direction: column; gap: 15px; height: 100%;
}

.seo-card h2 { color: var(--text-main); font-size: 1.25rem; font-weight: 700; margin: 0; }
.seo-card p, .seo-card li { font-size: 0.95rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 10px; }

.icon-box {
    font-size: 1.5rem;
    background: var(--primary-bg);
    width: 45px; height: 45px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px; color: var(--text-main);
    border: 1px solid var(--border);
}

.seo-list { list-style: none; padding: 0; margin: 10px 0; }
.seo-list li { position: relative; padding-left: 20px; }
.seo-list li::before {
    content: "•"; color: var(--brand-green); 
    font-weight: bold; position: absolute; left: 0;
}
.text-highlight {
    color: var(--brand-blue); font-weight: 600;
    background: rgba(16, 74, 108, 0.1); padding: 2px 6px; border-radius: 4px;
}

/* =========================================
   9. FOOTER & MODAL
   ========================================= */
footer { margin-top: 80px; padding: 40px 0; border-top: 1px solid var(--border); }
.footer-content {
    width: 90%; max-width: 1000px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
}
.footer-brand { font-weight: 700; color: var(--text-main); }
.footer-nav a {
    color: var(--text-muted); text-decoration: none; margin-left: 20px; font-size: 0.9rem; transition: color 0.2s;
}
.footer-nav a:hover { color: var(--brand-blue); }
.footer-disclaimer {
    text-align: center; margin-top: 30px; font-size: 0.8rem; color: var(--text-muted); opacity: 0.7;
}

/* Modal Ajustes */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(16, 74, 108, 0.4); backdrop-filter: blur(5px);
    z-index: 1000; display: flex; justify-content: center; align-items: center;
}
.modal-content {
    background: var(--card-bg); width: 90%; max-width: 400px;
    padding: 25px; border-radius: 20px; box-shadow: var(--shadow-md);
    border: 1px solid var(--border); color: var(--text-main);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.close-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }
.setting-row { display: flex; justify-content: space-between; align-items: center; }

/* Switch Toggle */
.switch { position: relative; display: inline-block; width: 50px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--input-border); transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--brand-green); }
input:checked + .slider:before { transform: translateX(24px); }

/* =========================================
   10. LEGAL PAGES STYLES
   ========================================= */
.legal-body { background-color: var(--primary-bg); color: var(--text-body); }
.legal-wrapper { max-width: 800px; margin: 60px auto; padding: 0 20px; }
.back-nav { margin-bottom: 30px; }
.back-link {
    text-decoration: none; color: var(--text-muted); font-weight: 600;
    display: inline-flex; align-items: center; gap: 8px; font-size: 0.95rem;
}
.back-link:hover { color: var(--brand-blue); }

.legal-card {
    background: var(--card-bg); padding: 50px; border-radius: var(--radius);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}

.legal-title { font-size: 2rem; font-weight: 800; margin-bottom: 10px; color: var(--text-main); letter-spacing: -1px; }
.legal-subtitle { color: var(--text-muted); margin-bottom: 40px; border-bottom: 1px solid var(--border); padding-bottom: 20px; }

.legal-content h2 { color: var(--text-main); margin-top: 40px; font-size: 1.4rem; font-weight: 700; }
.legal-content p, .legal-content li { color: var(--text-body); margin-bottom: 15px; }
.legal-content ul { padding-left: 20px; margin-bottom: 20px; }
.legal-content strong { color: var(--text-main); font-weight: 600; }
.brand-highlight { color: var(--brand-blue); font-weight: 700; }

.cookie-table { width: 100%; border-collapse: collapse; margin-top: 25px; font-size: 0.9rem; }
.cookie-table th { text-align: left; padding: 15px; border-bottom: 2px solid var(--border); color: var(--text-main); background: var(--primary-bg); font-weight: 600; }
.cookie-table td { padding: 15px; border-bottom: 1px solid var(--border); color: var(--text-body); vertical-align: top; }

/* Responsive */
@media (max-width: 850px) {
    .main-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2.2rem; }
    .footer-content { flex-direction: column; gap: 20px; }
    .legal-card { padding: 25px; }
    .promo-grid, .seo-container { grid-template-columns: 1fr; }
}
.hidden { display: none !important; }

/* =========================================
   ESTILOS DEL LEAD MAGNET (EMAIL GATE)
   ========================================= */

/* Ajuste específico para el contenido del modal de leads */
.lead-content {
    max-width: 450px; /* Un poco más ancho que el de ajustes */
    text-align: left;
}

.lead-body p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

.lead-body strong {
    color: var(--brand-blue);
}
body.dark-mode .lead-body strong {
    color: var(--brand-green);
}

/* Ajustes del formulario dentro del modal */
#lead-form .input-group {
    margin-bottom: 15px;
}

#lead-form label {
    font-size: 0.85rem;
    color: var(--text-main);
    margin-bottom: 5px;
}

#lead-form input {
    background: var(--input-bg);
    border: 2px solid var(--border);
}

#lead-form input:focus {
    border-color: var(--brand-green);
}

/* Disclaimer pequeño */
.disclaimer-mini {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.8;
    text-align: center;
}

/* =========================================
   SEGURIDAD: COOKIE BANNER
   ========================================= */
.cookie-banner {
    position: fixed; bottom: 20px; right: 20px; left: 20px;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
    border: 1px solid var(--border);
    z-index: 9999;
    max-width: 400px;
    margin-left: auto; /* Para alinearlo a la derecha en PC */
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.cookie-content p {
    font-size: 0.9rem; margin-bottom: 15px; color: var(--text-muted);
}

.cookie-actions {
    display: flex; align-items: center; gap: 15px;
}

.action-btn.small {
    padding: 8px 16px; font-size: 0.85rem;
}

.cookie-link {
    font-size: 0.85rem; color: var(--text-muted); text-decoration: underline;
}

/* En móvil, que ocupe todo el ancho */
@media (max-width: 480px) {
    .cookie-banner { right: 0; left: 0; bottom: 0; border-radius: 12px 12px 0 0; max-width: 100%; }
}