/* ==========================================================================
   VARIABLES DE DISEÑO SOBRIO Y CONFIGURACIÓN BASE
   ========================================================================== */
html {
    scroll-behavior: smooth;
}
:root {
    --primary-color: #1e3a8a; /* Azul institucional */
    --secondary-color: #0d9488; /* Verde azulado de control */
    --text-color: #334155; /* Gris oscuro suave para lectura */
    --bg-light: #f8fafc; /* Fondo gris claro limpio */
    --success-color: #10b981; /* Verde esmeralda para estados normales */
    --border-color: #e2e8f0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: #ffffff;
}

/* CONTENEDORES ELÁSTICOS */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-narrow {
    max-width: 800px;
}

.text-center { text-align: center; }
.bg-light { background-color: var(--bg-light); }

/* ==========================================================================
   CABECERA INTEGRADA Y DEPURADA (GEOALERTA)
   ========================================================================== */
header, .main-header {
    background-color: #f4f6f7 !important; /* Gris claro sutil que unifica con Análisis */
    border-bottom: 3px solid #16a085 !important; /* Línea verde turquesa inferior */
    padding: 1rem 0 !important;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Caja contenedora para el logotipo y las letras */
.logo-geoalerta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    color: var(--primary-color);
}

/* Ajuste proporcional de la imagen redonda */
.brand-image {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.main-nav a {
    color: #2c3e50 !important; /* Gris oscuro ultra legible */
    text-decoration: none;
    margin-left: 20px;
    font-size: 0.95rem;
    font-weight: 600;
}

.main-nav a.active, .main-nav a:hover {
    color: #16a085 !important; /* Verde turquesa corporativo */
    border-bottom: 2px solid #16a085;
    padding-bottom: 4px;
}
/* 2. Oscurece el rojo de la magnitud sísmica (cambia el #e74c3c por este granate) */
.indicador-tarjeta strong, [style*="color:#e74c3c"] {
    color: #b81d18 !important; 
}

/* 3. Oscurece el azul del enlace de Creative Commons del footer */
.main-footer a[href*="creativecommons"] {
    color: #1a56db !important; /* Un azul marino con contraste excelente */
    text-decoration: underline !important;
}

/* ==========================================================================
   ESTILO BASE DEL BOTÓN COLABORAR 
   ========================================================================== */
.btn-nav {
    background: #16a085 !important;
    color: #ffffff !important; /* Texto blanco nativo al cargar */
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
}

/* REGLA DEFINITIVA: Mantiene las letras blancas al pasar el ratón */
.main-nav a.btn-nav:hover, 
.btn-nav:hover {
    color: #ffffff !important;        /* Fuerza el texto a seguir siendo blanco puro */
    background-color: #117a65 !important; /* Oscurece un poco el fondo verde como feedback */
    text-decoration: none !important;
}


/* ==========================================================================
   SECCIÓN HÉROE PRINCIPAL
   ========================================================================== */
.hero-section {
    padding: 80px 0;
    background: radial-gradient(circle at top right, #eff6ff 0%, #ffffff 100%);
}

h1 {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.15rem;
    color: #64748b;
    margin-bottom: 30px;
}

/* PÍLDORA DE ESTADO */
.status-pill {
    display: inline-flex;
    align-items: center;
    background: #ecfdf5;
    color: #065f46;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.status-dot {
    width: 10px;
    height: 10px;
    background-color: var(--success-color);
    border-radius: 50%;
    margin-right: 8px;
}
/* ==========================================================================
   SECCIONES GENERALES Y MANIFIESTO
   ========================================================================== */
.content-section {
    padding: 60px 0;
}

.section-title {
    font-size: 1.75rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 40px;
}

.section-subtitle {
    color: #64748b;
    margin-top: -30px;
    margin-bottom: 40px;
}

.manifiesto-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.pilares-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.pilar h3 {
    color: var(--secondary-color);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.pilar p {
    font-size: 0.9rem;
    color: #64748b;
}

/* ==========================================================================
   TARJETAS DE ACCIÓN TRICOLUMNA
   ========================================================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.action-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 30px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 15px;
}

.action-card h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
}

.action-card p {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 20px;
    flex-grow: 1;
}

.btn-card {
    display: inline-block;
    text-align: center;
    padding: 10px;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-card:hover {
    background: #f1f5f9;
}

.btn-primary {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #ffffff;
}

.btn-primary:hover {
    background: #0b7a70;
    color: #ffffff;
}

/* ==========================================================================
   ESTILOS DEL AULA KÁRSTICA
   ========================================================================== */
.aula-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-top: 20px;
}

.aula-bloque {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.aula-bloque.reverse {
    background-color: var(--bg-light);
}

.aula-texto h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.3rem;
}

.aula-texto p {
    color: var(--text-color);
    font-size: 1rem;
    text-align: justify;
}

/* ==========================================================================
   ESTILOS DEL FORMULARIO DE CAPTACIÓN
   ========================================================================== */
.form-container {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-width: 700px;
    margin: 50px auto 0 auto;
    padding: 35px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.form-header {
    text-align: center;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.form-header h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.form-header p {
    color: #64748b;
    font-size: 0.95rem;
}

.form-group-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 6px;
}

.form-group input, .form-group select {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95rem;
    color: var(--text-color);
    background-color: var(--bg-light);
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
    background-color: #ffffff;
}

.form-group-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 25px;
}

.form-group-checkbox input {
    margin-top: 4px;
}

.form-group-checkbox label {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.4;
}

.btn-submit {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-submit:hover {
    background-color: #1d4ed8;
}

/* ==========================================================================
   ACTUALIZACIÓN PANEL DOBLE API (DATOS EN VIVO)
   ========================================================================== */
.panel-monitoreo {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 15px;
}

.indicador-tarjeta {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.info-dinamica {
    margin-top: 15px;
    font-size: 0.95rem;
    color: var(--text-color);
}

.sync-banner {
    text-align: center;
    margin-top: 10px;
}

/* ==========================================================================
   ESTILOS DEL SISMÓGRAFO EXPERIMENTAL
   ========================================================================== */
.ejes-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.eje-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    padding: 10px 5px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.9rem; 
    font-weight: bold;
    text-align: center;
}

.vibracion-barra-bg {
    background: #e2e8f0;
    border-radius: 10px;
    height: 15px;
    width: 100%;
    overflow: hidden;
    margin-top: 25px;
}

.vibracion-barra-fg {
    background: var(--secondary-color);
    height: 100%;
    width: 0%;
    transition: width 0.1s ease;
}

.log-container {
    background: #1e293b;
    color: #38bdf8;
    padding: 15px;
    border-radius: 6px;
    text-align: left;
    font-family: monospace;
    font-size: 0.85rem;
    max-height: 150px;
    overflow-y: auto;
}

.log-container h4 { color: #f8fafc; margin-bottom: 8px; }
.log-container ul { list-style: none; padding-left: 0; }
.log-container li { margin-bottom: 4px; border-bottom: 1px solid #334155; padding-bottom: 20px; }

/* Colores del semáforo de alertas con contraste accesible */
.alert-verde {
    background-color: #e6f4ea; /* Verde pastel muy suave */
    color: #137333;            /* Verde bosque oscuro y legible para el texto */
    font-weight: 600;
}

.alert-naranja { 
    background-color: #ffe6cc; /* Naranja pastel */
    color: #a03c00;            /* Teja/marrón oscuro */
    font-weight: 600;
}

.alert-rojo { 
    background-color: #fde8e8; /* Rosa/rojo pastel */
    color: #821010;            /* Granate profundo */
    font-weight: 600;
}

.recursos-tecnicos {
    background: #f8f9fa;
    border-left: 4px solid #0d6efd;
    padding: 20px;
    margin-top: 30px;
    border-radius: 4px;
}

.lista-descargas {
    list-style: none;
    padding-left: 0;
}

.lista-descargas li {
    margin-bottom: 12px;
}

.lista-descargas a {
 color: #212529;
 text-decoration: none;
 display: inline-block;
}
.lista-descargas a:hover {
 color: #0d6efd;
 text-decoration: underline;
}
/* NUEVAS REGLAS DE CONTRASTE ACCESIBLE PARA CRÉDITOS DE TERCEROS */
.data-credits a[href*="seismicportal"] {
 color: #1a56db !important; /* Azul marino de alta visibilidad */
 font-weight: 600;
}
.data-credits a[href*="open-meteo"] {
 color: #1b5e20 !important; /* Verde bosque denso que pasa el filtro WCAG */
 font-weight: 600;
}

.lista-descargas a:hover {
    color: #0d6efd;
    text-decoration: underline;
}

/* ==========================================================================
   PIE DE PÁGINA Y TRANSPARENCIA LEGAL
   ========================================================================== */
.main-footer {
    background: var(--primary-color);
    color: #94a3b8;
    padding: 30px 0;
    font-size: 0.85rem;
}
.main-footer a {
 display: inline-block;
 padding: 0.8rem 1rem !important; /* Genera la zona de pulsación de 48px exigida por Google */
 margin: 0.4rem 0.2rem !important; /* Separa los enlaces físicamente en horizontal */
 color: #ffffff !important;        /* Forzamos texto blanco para un contraste perfecto */
 transition: color 0.2s ease;
}
.main-footer a:hover {
 color: #0d9488 !important;        /* Color secundario corporativo al pasar el ratón */
}

.legal-notice {
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
}

.legal-text {
    font-size: 0.75rem;
    color: #64748b;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.5;
    text-align: justify;
}

/* ==========================================================================
   ESPACIADO TÁCTIL EXCLUSIVO PARA PANTALLAS MÓVILES
   ========================================================================== */
@media (max-width: 768px) {
 .main-nav a {
 padding: 1rem 1.2rem !important; /* Amplía la zona de pulsación del dedo */
 margin: 0.4rem 0.2rem !important; /* Separa físicamente un enlace de otro */
 display: inline-block !important;
 }
}

@media (max-width: 480px) {
 /* Forzamos a que las tres cajas se apilen una debajo de otra */
 .ejes-container { 
 grid-template-columns: 1fr !important; 
 gap: 10px !important; 
 }
 /* Rediseñamos la tarjeta para que el texto y el número se organicen en horizontal */
 .eje-card {
 font-size: 0.9rem !important;
 padding: 12px 15px !important;
 display: flex !important;
 justify-content: space-between !important;
 align-items: center !important;
 text-align: left !important;
 }
}

@media (max-width: 600px) {
    .form-group-row {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 15px;
    }
    .form-container { padding: 20px; }
}

@media (max-width: 480px) {
    /* Forzamos a que las tres cajas se apilen una debajo de otra */
    .ejes-container { 
        grid-template-columns: 1fr !important; 
        gap: 10px !important; 
    }
   /* ==========================================================================
      Espaciado táctil exclusivo para pantallas móviles
   /* ==========================================================================
@media (max-width: 768px) {
    .main-nav a {
        padding: 1rem 1.2rem !important; /* Amplía la zona de pulsación del dedo */
        margin: 0.4rem 0.2rem !important;  /* Separa físicamente un enlace de otro */
        display: inline-block !important;
    }
}
      /* Amplía el área de pulsación de los enlaces del pie de página */
.main-footer a {
    display: inline-block;
    padding: 0.8rem 1rem !important; /* Genera un escudo de 48px exigido por Google */
    margin: 0.4rem 0.2rem !important; /* Separa los enlaces físicamente */
}

/* Separa el botón de Espacio Vecinal de otros elementos */
.btn-card.btn-primary {
    padding: 12px 24px !important;
    margin-top: 15px !important;
    display: inline-block;
}
   
    /* Rediseñamos la tarjeta para que el texto y el número se organicen en horizontal */
    .eje-card {
        font-size: 0.9rem !important;
        padding: 12px 15px !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        text-align: left !important;
    }
}
