/* geo.css — estilos propios del módulo de circunscripciones */

/* ── Variables de diseño ─────────────────────────────────── */
:root {
    --primary-color:    #006341;
    --secondary-color:  #0a7d55;
    --accent-color:     #d6efe4;
    --background-color: #f6faf8;
    --card-background:  #ffffff;
    --border-color:     #d8e4de;
    --text-color:       #173126;
    --text-muted:       #5f7169;
    --success-color:    #198754;
    --warning-color:    #ffc107;
    --error-color:      #dc3545;
    --info-color:       #0d6efd;
    --border-radius:    10px;
    --box-shadow:       0 10px 24px rgba(0, 0, 0, 0.08);
}

/* ── Base ────────────────────────────────────────────────── */
body {
    min-height: 100vh;
    background: linear-gradient(180deg, #eef7f1 0%, #f8fbf9 100%);
    color: var(--text-color);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ── Login ───────────────────────────────────────────────── */
.geo-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.geo-login-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--box-shadow);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
}

.geo-login-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    font-weight: 700;
    font-size: .95rem;
    padding: .35rem .8rem;
    border-radius: 8px;
    letter-spacing: .05em;
    margin-bottom: 1.25rem;
}

.geo-login-card h2 {
    color: var(--primary-color);
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0 0 .25rem;
}

.geo-login-subtitulo {
    color: var(--text-muted);
    font-size: .88rem;
    margin-bottom: 1.75rem;
    line-height: 1.55;
}

.geo-login-subtitulo p { margin: 0; }

.geo-login-label {
    display: block;
    font-weight: 600;
    font-size: .88rem;
    color: var(--text-color);
    margin-bottom: .35rem;
}

.geo-login-input {
    width: 100%;
    padding: .55rem .9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: .95rem;
    color: var(--text-color);
    background: var(--background-color);
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
    margin-bottom: 1rem;
}

.geo-login-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 99, 65, .15);
    background: #fff;
}

.geo-login-btn {
    width: 100%;
    padding: .65rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: .25rem;
    transition: background .2s;
}

.geo-login-btn:hover { background: var(--secondary-color); }

/* ── Validador de Circunscripción ────────────────────────── */
.container-validador {
    width: 100%;
    max-width: 900px;
    margin: 30px auto;
    padding: 20px;
    background-color: var(--background-color);
}
.header-validador {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--box-shadow);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.header-validador h1 { color: white; margin: 0 0 .3rem; font-size: 1.5rem; }
.header-validador p  { margin: 0; opacity: .9; font-size: .9rem; }
.header-acciones     { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; }
.contador-consultas {
    font-size: .85rem;
    background: rgba(255,255,255,.15);
    border-radius: 6px;
    padding: .3rem .75rem;
    font-weight: 600;
    white-space: nowrap;
}
.contador-consultas.limite-alto    { background: rgba(255,200,0,.25); }
.contador-consultas.limite-critico { background: rgba(255,80,80,.3); }
.btn-logout {
    font-size: .85rem;
    font-weight: 600;
    color: #fff;
    background: rgba(180,0,0,.75);
    border: 2px solid rgba(255,255,255,.6);
    border-radius: 6px;
    padding: .4rem 1rem;
    text-decoration: none;
    transition: background .2s, border-color .2s;
    white-space: nowrap;
}
.btn-logout:hover { background: #c62828; border-color: white; color: white; }

.card-formulario {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
}
.card-formulario h5 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--accent-color);
}
.form-label { font-weight: 500; color: var(--text-color); margin-bottom: .25rem; font-size: .9rem; }
.form-label .requerido { color: var(--error-color); margin-left: 2px; }

.form-control-validador {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: .95rem;
    color: var(--text-color);
    background-color: var(--background-color);
    transition: border-color .2s ease, box-shadow .2s ease;
    box-sizing: border-box;
}
.form-control-validador:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0,99,65,.15);
}
.form-control-validador.uppercase-input { text-transform: uppercase; }

.btn-validar {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color .3s ease, transform .2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-validar:hover:not(:disabled) { background-color: var(--secondary-color); transform: scale(1.02); }
.btn-validar:disabled { background-color: #aaa; cursor: not-allowed; transform: none; }

.btn-limpiar {
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    transition: background-color .2s ease;
}
.btn-limpiar:hover { background-color: #f0f0f0; color: var(--text-color); }

.card-resultado {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
    display: none;
}
.card-resultado.visible { display: block; }
.card-resultado h5 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--accent-color);
}
.resultado-fila {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: .95rem;
}
.resultado-fila:last-child { border-bottom: none; }
.resultado-etiqueta {
    width: 220px;
    flex-shrink: 0;
    font-weight: 600;
    color: var(--text-muted);
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding-top: 1px;
}
.resultado-valor { flex: 1; color: var(--text-color); word-break: break-word; }

.badge-confianza {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .85rem;
    font-weight: 600;
    color: white;
}
.badge-confianza.alta    { background-color: var(--success-color); }
.badge-confianza.media   { background-color: var(--warning-color); color: #333; }
.badge-confianza.baja    { background-color: var(--error-color); }
.badge-confianza.pending { background-color: var(--text-muted); }

.badge-fuente {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: .8rem;
    font-weight: 600;
    margin-left: 8px;
}
.badge-fuente.google { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }

.subdelegacion-chip {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: .95rem;
}
.coordenadas-texto {
    font-family: monospace;
    background-color: #f4f4f4;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: .9rem;
    color: #333;
}

.btn-abrir-mapa {
    background-color: var(--info-color);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: .95rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color .2s ease, transform .2s ease;
}
.btn-abrir-mapa:hover:not(:disabled) { background-color: #0277a8; transform: scale(1.02); }
.btn-abrir-mapa:disabled { background-color: #aaa; cursor: not-allowed; }

.card-mapa {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    margin-top: 1.5rem;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: none;
}
.card-mapa.visible { display: block; }
.card-mapa-header {
    background-color: var(--primary-color);
    color: white;
    padding: .9rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: .95rem;
}
.btn-cerrar-mapa {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: .8;
    transition: opacity .2s;
}
.btn-cerrar-mapa:hover { opacity: 1; }
.btn-imprimir-mapa {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.6);
    color: white;
    font-size: .82rem;
    font-weight: 600;
    border-radius: 6px;
    padding: .3rem .85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background .2s;
}
.btn-imprimir-mapa:hover { background: rgba(255,255,255,.3); }
#mapa-leaflet { width: 100%; height: 480px; }

.alerta-suspendido {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-left: 4px solid #e65100;
    border-radius: 6px;
    padding: .9rem 1.2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #5d4037;
    display: none;
}
.alerta-suspendido.visible { display: block; }

/* ── Banner de error inline ─────────────────────────────── */
.banner-error {
    background: #fde8e8;
    border: 1px solid #f5c6cb;
    border-left: 4px solid var(--error-color);
    border-radius: 6px;
    padding: .9rem 1.2rem;
    margin-bottom: 1rem;
    color: #721c24;
    font-weight: 600;
    font-size: .92rem;
}

/* ── Modal de confirmación ──────────────────────────────── */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 9998;
    align-items: center;
    justify-content: center;
}
.modal-backdrop.visible { display: flex; }
.modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 2rem 2.2rem;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.modal-titulo    { margin: 0 0 .6rem; font-weight: 700; color: #1a2a4a; }
.modal-descripcion { margin: 0 0 1rem; color: #444; font-size: .92rem; }
.modal-preview {
    background: #f0f4ff;
    border-left: 4px solid #4361ee;
    border-radius: 6px;
    padding: .75rem 1rem;
    font-size: .93rem;
    color: #1a2a4a;
    margin-bottom: 1.4rem;
    word-break: break-word;
}
.modal-acciones { display: flex; gap: .75rem; justify-content: flex-end; }
.modal-btn { padding: .5rem 1.3rem; border-radius: 8px; font-size: .92rem; cursor: pointer; }
.modal-btn-aceptar  { border: none; background: #4361ee; color: #fff; font-weight: 600; }
.modal-btn-cancelar { border: 1px solid #ccc; background: #fff; color: #333; }

/* ── Responsive: tablet (~768 px) ───────────────────────── */
@media (max-width: 768px) {
    .resultado-etiqueta { width: 170px; }
    .header-validador   { flex-direction: column; gap: .75rem; }
    .header-acciones    { align-items: flex-start; }
}

/* ── Responsive: móvil (~576 px) ────────────────────────── */
@media (max-width: 576px) {
    .resultado-etiqueta { width: 140px; font-size: .78rem; }
    .card-formulario, .card-resultado { padding: 1.25rem; }
    .acciones-formulario { flex-direction: column; gap: 10px; }
    .acciones-formulario .btn-validar,
    .acciones-formulario .btn-limpiar { width: 100%; justify-content: center; }
    .header-validador { flex-direction: column; gap: .75rem; }
    .header-acciones  { align-items: flex-start; }
}
