/* =========================================================================
   MAPEUM S.A.S. — IDENTIDAD VISUAL PREMIUM "SAAS GIS"
   Tipografía: Inter (Cuerpo) y Space Grotesk (Títulos)
   Diseño: Glassmorphism, UI Oscura Tecnológica, Dashboard Geovisor
   ========================================================================= */

:root {
    /* Paleta de Colores Solicitada */
    --bg-dark: #071018;
    --bg-surface: #0E1A24;
    --bg-surface-light: #173446;
    --teal-primary: #12A6A0;
    --cyan-glow: #3FE0D0;
    --blue-accent: #56C8FF;
    --text-white: #F5FCFF;
    
    /* Textos secundarios */
    --text-muted: #8FA6B8;
    --border-color: rgba(63, 224, 208, 0.15);
    
    /* Gradientes y Sombras */
    --gradiente-marca: linear-gradient(135deg, var(--teal-primary) 0%, var(--blue-accent) 100%);
    --shadow-glow: 0 0 20px rgba(63, 224, 208, 0.2);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.5);

    /* Tipografía */
    --fuente-display: 'Space Grotesk', sans-serif;
    --fuente-cuerpo: 'Inter', sans-serif;
}

/* =========================================================================
   RESET & BASE
   ========================================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: var(--fuente-cuerpo);
    background-color: var(--bg-dark);
    color: var(--text-muted);
}

body {
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    /* Fondo con partículas/curvas sutiles */
    background-image: radial-gradient(circle at 15% 50%, rgba(18, 166, 160, 0.08), transparent 25%),
                      radial-gradient(circle at 85% 30%, rgba(86, 200, 255, 0.08), transparent 25%);
}

.contenedor {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 24px;
}

h1, h2, h3 {
    font-family: var(--fuente-display);
    color: var(--text-white);
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 10px;
}

.subtitulo {
    text-align: center;
    color: var(--cyan-glow);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 50px;
    font-weight: 500;
}

/* =========================================================================
   NAVBAR PREMIUM (Glassmorphism)
   ========================================================================= */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(7, 16, 24, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: background 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-white);
    font-family: var(--fuente-display);
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-logo-img {
    height: 35px;
    width: auto;
}

.logo span {
    color: var(--cyan-glow);
    font-size: 0.8rem;
    margin-left: 5px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-menu a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: var(--cyan-glow);
}

/* =========================================================================
   HERO (Diseño protagonista con Logo)
   ========================================================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding-top: 80px;
}

/* Red geodésica sutil de fondo */
.hero-bg-elements {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(63, 224, 208, 0.05) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(63, 224, 208, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    z-index: -1;
    mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
}

.hero-logo img {
    width: 140px;
    margin-bottom: 30px;
    filter: drop-shadow(0 0 20px rgba(63, 224, 208, 0.5));
    animation: float 6s ease-in-out infinite;
}

.hero-texto h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero-texto h1 span {
    background: var(--gradiente-marca);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-texto p {
    font-size: 1.2rem;
    margin-bottom: 40px;
}

.hero-botones {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn-principal, .btn-secundario {
    padding: 14px 30px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-principal {
    background: var(--gradiente-marca);
    color: var(--bg-dark);
    box-shadow: var(--shadow-glow);
}

.btn-principal:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(63, 224, 208, 0.5);
}

.btn-secundario {
    border: 1px solid var(--cyan-glow);
    color: var(--cyan-glow);
    background: rgba(63, 224, 208, 0.05);
}

.btn-secundario:hover {
    background: rgba(63, 224, 208, 0.15);
}

/* =========================================================================
   TARJETAS SAAS (Servicios)
   ========================================================================= */
.grilla-servicios {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.tarjeta-servicio {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 30px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-card);
}

.tarjeta-servicio:hover {
    transform: translateY(-10px);
    border-color: var(--cyan-glow);
    box-shadow: var(--shadow-glow);
}

.icono-servicio {
    font-size: 2rem;
    margin-bottom: 20px;
}

.tarjeta-servicio h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

/* Filtros */
.filtros-servicios {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}
.btn-filtro {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-filtro.activo, .btn-filtro:hover {
    background: var(--bg-surface-light);
    color: var(--cyan-glow);
    border-color: var(--cyan-glow);
}

/* =========================================================================
   GEOVISOR DASHBOARD (Consultorio)
   ========================================================================= */
.seccion-consultorio {
    background: var(--bg-surface);
}

.analisis-problema {
    max-width: 800px;
    margin: 0 auto 50px;
    text-align: center;
    font-size: 1.05rem;
    line-height: 1.6;
}
.analisis-problema strong {
    color: var(--text-white);
}

/* Estructura Dashboard: Mapa Amplio, Panel Lateral */
.grilla-consultorio {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 25px;
    height: 75vh;
    min-height: 650px;
    align-items: stretch;
}

.contenedor-mapa {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-glow);
}

#mapa-catastral {
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
}

.map-overlay-ui {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 400; /* Sobre el mapa Leaflet */
    background: rgba(7, 16, 24, 0.8);
    backdrop-filter: blur(8px);
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
}
.ayuda-mapa { font-size: 0.85rem; color: var(--text-white); }

/* Panel lateral (Formulario) */
.panel-lateral {
    background: rgba(14, 26, 36, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.titulo-form-mapa {
    font-size: 1.3rem;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.form-mapa, .form-contacto {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.grupo-input input,
.grupo-input textarea {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-white);
    font-family: var(--fuente-cuerpo);
    transition: all 0.3s ease;
}

.grupo-input input:focus,
.grupo-input textarea:focus {
    outline: none;
    border-color: var(--cyan-glow);
    box-shadow: 0 0 10px rgba(63, 224, 208, 0.2);
}

.inputs-coordenadas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.inputs-coordenadas input {
    background: rgba(0,0,0,0.4);
    border-style: dashed;
    color: var(--blue-accent);
}

/* Consentimiento de tratamiento de datos (Ley 1581) */
.grupo-consentimiento {
    margin: 5px 0;
}
.consentimiento-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-muted);
    cursor: pointer;
}
.consentimiento-label input[type="checkbox"] {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    min-width: 16px;
    accent-color: var(--teal-primary);
    cursor: pointer;
}
.consentimiento-label a {
    color: var(--cyan-glow);
    text-decoration: underline;
}
.consentimiento-label a:hover {
    color: var(--blue-accent);
}

.btn-glow {
    padding: 15px;
    background: var(--gradiente-marca);
    color: var(--bg-dark);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* =========================================================================
   CONTACTO Y FOOTER
   ========================================================================= */
.seccion-contacto {
    background: var(--bg-dark);
}

.contenedor-contacto {
    max-width: 600px;
    margin: 0 auto;
}

.canales-directos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.canal {
    background: var(--bg-surface);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
}
.canal span { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 5px;}
.canal a { color: var(--text-white); font-weight: 600; text-decoration: none; }

.footer {
    background: #04090D;
    padding: 40px 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}
.footer-logo { margin-bottom: 20px; }
.footer-coordenadas {
    font-family: 'Space Grotesk', monospace;
    font-size: 0.75rem;
    color: var(--bg-surface-light);
    margin-top: 10px;
    letter-spacing: 2px;
}

/* =========================================================================
   ANIMACIONES (CSS Puro)
   ========================================================================= */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
}
.delay-1 { animation-delay: 0.2s; opacity: 0; }

/* Para revelar en scroll (Tu JS lo puede activar o simplemente dejarlo estático) */
.reveal-on-scroll {
    animation: fadeInUp 1s ease forwards;
}

/* =========================================================================
   RESPONSIVE DESKTOP FIRST
   ========================================================================= */
@media (max-width: 992px) {
    .grilla-consultorio {
        grid-template-columns: 1fr; /* Apila el mapa y el formulario */
        height: auto;
    }
    .contenedor-mapa {
        height: 400px; /* Alto fijo para móvil/tablet */
    }
}

@media (max-width: 768px) {
    .nav-menu { display: none; } /* Ocultar menú en móvil para simplificar */
    h2 { font-size: 2rem; }
    .hero-texto h1 { font-size: 2.2rem; }
    .hero-botones { flex-direction: column; }
}

/* =========================================================================
   MODAL: POLÍTICA DE TRATAMIENTO DE DATOS
   Ventana emergente que se abre desde el enlace del checkbox de
   consentimiento en ambos formularios. Muestra politica-tratamiento-datos.html
   dentro de un iframe (una sola fuente de verdad para el texto legal).
   ========================================================================= */
.modal-politica-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000; /* por encima de la navbar (1000) y del map-overlay-ui (400) */
    background: rgba(4, 9, 14, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal-politica-overlay.activo {
    display: flex;
    opacity: 1;
}

.modal-politica-caja {
    width: 100%;
    max-width: 820px;
    height: 85vh;
    max-height: 800px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(18px) scale(0.98);
    opacity: 0;
    transition: transform 0.28s ease, opacity 0.28s ease;
}

.modal-politica-overlay.activo .modal-politica-caja {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-politica-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 26px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.modal-politica-header h2 {
    font-size: 1.05rem;
    margin: 0;
}

.modal-politica-cerrar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(63, 224, 208, 0.1);
    color: var(--text-white);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.modal-politica-cerrar:hover {
    background: rgba(63, 224, 208, 0.22);
    transform: rotate(90deg);
}

.modal-politica-cuerpo {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: var(--bg-dark);
}

.modal-politica-cuerpo iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.modal-politica-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 26px;
    background: var(--bg-dark);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.mp-btn-imprimir,
.mp-btn-cerrar {
    font-family: var(--fuente-cuerpo);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.mp-btn-imprimir {
    background: rgba(63, 224, 208, 0.1);
    color: var(--cyan-glow);
    border: 1px solid rgba(63, 224, 208, 0.3);
}

.mp-btn-cerrar {
    background: var(--gradiente-marca);
    color: var(--bg-dark);
}

.mp-btn-imprimir:hover,
.mp-btn-cerrar:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .modal-politica-overlay { padding: 0; }
    .modal-politica-caja { max-width: 100%; height: 100vh; max-height: none; border-radius: 0; }
}