/* ==========================================================================
   1. VARIABLES Y CONFIGURACIÓN BASE
   ========================================================================== */
:root {
    --bg-principal: #f8f9fa;       /* Gris muy claro, descansa la vista */
    --bg-tarjetas: #ffffff;        /* Blanco puro para destacar el contenido */
    --texto-principal: #1a1a1a;   /* Casi negro para máxima legibilidad */
    --texto-mutado: #5a626a;      /* Gris oscuro para fechas o datos secundarios */
    --borde: #e2e8f0;              /* Gris suave para separar secciones */
    --rojo-alerta: #dc2626;        /* Para votos afirmativos o títulos fuertes */
    --azul-neutro: #2563eb;        /* Para enlaces y botones secundarios */
    --exito: #16a34a;              /* Para votos negativos o aprobaciones */
    --fuente: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-principal);
    color: var(--texto-principal);
    font-family: var(--fuente);
    line-height: 1.6;
    padding: 0 1rem;
}

/* Container para centrar el sitio en pantallas grandes */
.container, main {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* ==========================================================================
   2. ENCABEZADO Y NAVEGACIÓN
   ========================================================================== */
header {
    max-width: 800px;
    margin: 0 auto;
    padding: 2.5rem 0 1.5rem 0;
    border-bottom: 2px solid var(--texto-principal); /* Estilo prensa seria */
    text-align: center;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-weight: 600;
    font-size: 0.95rem;
}

nav a {
    color: var(--texto-mutado);
    text-decoration: none;
    transition: color 0.2s ease;
    padding: 0.25rem 0.5rem;
}

nav a:hover {
    color: var(--texto-principal);
    border-bottom: 2px solid var(--texto-principal);
}

/* ==========================================================================
   3. SECCIÓN DE VOTACIÓN (TARJETA DINÁMICA)
   ========================================================================== */
#consulta-del-dia {
    background: var(--bg-tarjetas);
    border: 1px solid var(--borde);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

#consulta-del-dia h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--texto-principal);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Pequeño indicador rojo de "Vivo/Actual" */
#consulta-del-dia h2::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--rojo-alerta);
    border-radius: 50%;
}

#pregunta-texto {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: var(--texto-principal);
}

/* Botones de votación */
#opciones-voto {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

button {
    font-family: var(--fuente);
    font-size: 1rem;
    font-weight: 600;
    padding: 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.1s ease, background-color 0.2s ease;
    border: 1px solid var(--borde);
}

/* Botón SÍ (Enfoque crítico) */
#opciones-voto button:first-child {
    background-color: #fef2f2;
    color: var(--rojo-alerta);
    border-color: #fca5a5;
}

#opciones-voto button:first-child:hover {
    background-color: var(--rojo-alerta);
    color: #ffffff;
}

/* Botón NO */
#opciones-voto button:last-child {
    background-color: #f0fdf4;
    color: var(--exito);
    border-color: #86efac;
}

#opciones-voto button:last-child:hover {
    background-color: var(--exito);
    color: #ffffff;
}

button:active {
    transform: scale(0.98);
}

/* Resultados de la votación */
#resultados {
    background-color: var(--bg-principal);
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid var(--texto-principal);
}

#resultados h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

#resultados p {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
}

/* ==========================================================================
   4. SECCIÓN DE CASOS Y MULTIMEDIA (Para las páginas de las instituciones)
   ========================================================================== */
.caso {
    background: var(--bg-tarjetas);
    border: 1px solid var(--borde);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.caso h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--texto-principal);
    line-height: 1.3;
}

.caso p {
    color: var(--texto-mutado);
    margin-bottom: 1.5rem;
}

/* Ajustes para reproductores nativos */
audio, video {
    display: block;
    width: 100%;
    margin-top: 1rem;
    border-radius: 6px;
    background-color: #000; /* Evita destellos blancos en videos antes de cargar */
}

audio {
    background-color: transparent; /* El audio nativo no requiere fondo negro */
}

/* Enlaces a documentos PDF o pruebas descargables */
.documento-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--azul-neutro);
    text-decoration: none;
    font-weight: 500;
    margin-top: 1rem;
}

.documento-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   5. RESPONSIVE DESIGN (Celulares)
   ========================================================================== */
@media (max-width: 600px) {
    header h1 {
        font-size: 1.7rem;
    }
    
    #opciones-voto {
        grid-template-columns: 1fr; /* Apilar botones en pantallas pequeñas */
    }
    
    #consulta-del-dia, .caso {
        padding: 1.25rem;
    }
}

/* ==========================================================================
   6. NUEVOS ESTILOS: BARRA DE ALERTA Y FORMULARIOS
   ========================================================================== */

/* Contenedor de la barra superior */
.alerta-denuncia-container {
    background-color: var(--texto-principal); /* Fondo negro para llamar la atención */
    color: var(--bg-principal);
    width: 100vw;
    margin-left: calc(-50vw + 50%); /* Rompe el contenedor de 800px para ir de lado a lado */
    padding: 0.75rem 1rem;
}

.alerta-denuncia {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.alerta-denuncia p {
    font-size: 0.95rem;
}

/* Botón llamativo en la esquina */
.btn-denuncia {
    background-color: var(--rojo-alerta);
    color: #ffffff;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.btn-denuncia:hover {
    background-color: #b91c1c;
}

/* Estructuración de los campos del formulario */
.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--texto-principal);
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    font-family: var(--fuente);
    font-size: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--borde);
    border-radius: 4px;
    background-color: var(--bg-principal);
    color: var(--texto-principal);
    outline: none;
    width: 100%;
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--texto-principal);
}

/* Caja de carga de archivos */
.file-zone {
    background-color: var(--bg-principal);
    padding: 1.5rem;
    border: 2px dashed var(--borde);
    border-radius: 6px;
}

.file-help {
    font-size: 0.8rem;
    color: var(--texto-mutado);
    margin-bottom: 0.5rem;
}

/* Botón de envío masivo */
.btn-enviar-formulario {
    width: 100%;
    background-color: var(--texto-principal) !important;
    color: var(--bg-principal) !important;
    border: none;
    padding: 1.2rem !important;
    font-size: 1.1rem !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-enviar-formulario:hover {
    background-color: var(--rojo-alerta) !important;
    color: #ffffff !important;
}

/* Ajuste responsive para celulares */
@media (max-width: 600px) {
    .alerta-denuncia {
        flex-direction: column;
        text-align: center;
    }
    .btn-denuncia {
        width: 100%;
        text-align: center;
    }
}
/* ==========================================================================
   7. DISEÑO DE LA BARRA DE VOTACIÓN BICOLOR
   ========================================================================== */
.barra-voto-contenedor {
    display: flex;
    width: 100%;
    height: 24px;
    background-color: var(--borde);
    border-radius: 12px;
    overflow: hidden; /* Corta los bordes rectos de los segmentos internos */
    margin: 1.5rem 0 0.75rem 0;
    border: 1px solid var(--borde);
}

/* Segmento SÍ (Rojo Alerta) */
.segmento-si {
    background-color: var(--rojo-alerta);
    height: 100%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Segmento NO (Verde Éxito) */
.segmento-no {
    background-color: var(--exito);
    height: 100%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Leyendas e información numérica */
.leyenda-resultados {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.txt-si {
    color: var(--rojo-alerta);
}

.txt-no {
    color: var(--exito);
}

.alerta-ya-voto {
    font-size: 0.85rem;
    color: var(--texto-mutado);
    text-align: center;
    font-style: italic;
    border-top: 1px dashed var(--borde);
    padding-top: 0.75rem;
}

/* ==========================================================================
   8. SECCIÓN DE PETICIONES CIUDADANAS
   ========================================================================== */
#peticiones-ciudadanas {
    margin-top: 4rem;
    border-top: 1px solid var(--borde);
    padding-top: 2rem;
}

.descripcion-seccion {
    color: var(--texto-mutado);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.tarjeta-peticion {
    background: var(--bg-tarjetas);
    border: 1px solid var(--borde);
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.tarjeta-peticion h3 {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.detalle-peticion {
    font-size: 0.95rem;
    color: var(--texto-mutado);
    margin-bottom: 1.25rem;
}

/* Distribución de botones de peticiones */
.opciones-peticion {
    display: flex;
    gap: 1rem;
}

.opciones-peticion button {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    flex: 1;
}

/* Botón Respaldar (Estilo sobrio, azul neutro o gris oscuro) */
.btn-peticion-si {
    background-color: var(--bg-principal);
    color: var(--azul-neutro);
    border-color: var(--azul-neutro);
}
.btn-peticion-si:hover {
    background-color: var(--azul-neutro);
    color: #ffffff;
}

/* Botón Rechazar */
.btn-peticion-no {
    background-color: var(--bg-principal);
    color: var(--texto-mutado);
}
.btn-peticion-no:hover {
    background-color: var(--texto-mutado);
    color: #ffffff;
}

/* Reducimos el margen de las barras dentro de las peticiones para que se vea compacto */
.resultados-peticion .barra-voto-contenedor {
    margin: 0.5rem 0 0.5rem 0;
    height: 16px; /* Más delgada que la principal */
}
/* ==========================================================================
   9. PIE DE PÁGINA Y DONACIONES BTC
   ========================================================================== */
footer {
    margin-top: 5rem;
    border-top: 2px solid var(--texto-principal);
    padding: 3rem 0;
    text-align: center;
    background-color: var(--bg-tarjetas);
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.footer-contenido {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.contenedor-donacion {
    margin-top: 1.5rem;
    background-color: var(--bg-principal);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px dashed var(--borde);
}

.txt-donacion {
    font-size: 0.9rem;
    color: var(--texto-mutado);
    margin-bottom: 1rem;
}

/* Botón oficial estilo cripto */
.btn-donar-btc {
    background-color: #f7931a; /* El color naranja oficial de Bitcoin */
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-donar-btc:hover {
    background-color: #e17e0a;
}

.icono-btc {
    font-size: 1.2rem;
}

/* Caja de datos desplegada */
.caja-cripto {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: var(--bg-tarjetas);
    border: 1px solid var(--borde);
    border-radius: 6px;
    animation: fadeIn 0.3s ease;
}

.alerta-anonimato {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--exito);
    margin-bottom: 1rem;
}

.qr-placeholder img {
    max-width: 150px;
    margin: 0 auto 1.5rem auto;
    display: block;
    border: 4px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Bloque para copiar la billetera */
.direccion-bloque {
    display: flex;
    gap: 0.5rem;
    max-width: 500px;
    margin: 0 auto;
}

.direccion-bloque input {
    flex: 1;
    font-family: monospace; /* Fuente de código para evitar confusiones de caracteres */
    font-size: 0.85rem;
    padding: 0.6rem;
    border: 1px solid var(--borde);
    border-radius: 4px;
    background-color: var(--bg-principal);
    text-align: center;
}

.direccion-bloque button {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    background-color: var(--bg-principal);
    color: var(--texto-principal);
    white-space: nowrap;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .direccion-bloque {
        flex-direction: column;
    }
}