/* ==========================================================
   SECURE-IZT - Ultra-Modern Vector-Driven Design System
   Linear / Claude Artifact / Apple Pro Aesthetics (Zero Emojis)
   ========================================================== */

:root {
    /* Deep Background Matrix */
    --bg-base: #07090e;
    --bg-surface-1: #0d111a;
    --bg-surface-2: #131826;
    --bg-glass: rgba(13, 17, 26, 0.78);
    --bg-card: rgba(17, 23, 36, 0.72);

    /* Precision Borders */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.22);
    --border-glow-blue: rgba(0, 112, 243, 0.45);
    --border-glow-cyan: rgba(0, 223, 216, 0.45);

    /* Typography & Monospace */
    --text-primary: #f8f9fa;
    --text-secondary: #9aa3b2;
    --text-muted: #5e687a;

    /* High-Voltage Accent Accents */
    --accent-blue: #0070f3;
    --accent-blue-hover: #0060df;
    --accent-cyan: #00dfd8;
    --accent-purple: #8a2be2;
    --accent-pink: #f81ce5;
    --accent-red: #ff3b30;
    --accent-green: #30d158;
    --accent-amber: #ff9f0a;

    /* Gradients */
    --gradient-brand: linear-gradient(135deg, #00dfd8 0%, #0070f3 50%, #8a2be2 100%);
    --gradient-hero-text: linear-gradient(180deg, #ffffff 15%, #94a3b8 100%);
    --gradient-card: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
    --gradient-danger: linear-gradient(135deg, #ff3b30 0%, #a80700 100%);

    /* Radii */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 30px;
    --radius-pill: 9999px;

    /* Volumetric Glows */
    --glow-blue: 0 0 50px -10px rgba(0, 112, 243, 0.4);
    --glow-purple: 0 0 60px -15px rgba(138, 43, 226, 0.45);
    --glow-cyan: 0 0 45px -10px rgba(0, 223, 216, 0.35);
    --shadow-soft: 0 4px 30px -4px rgba(0, 0, 0, 0.6);
    --shadow-hover: 0 20px 50px -10px rgba(0, 0, 0, 0.85);

    /* Fonts & Motion Timing */
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Plus Jakarta Sans", system-ui, sans-serif;
    --font-mono: "SF Mono", "Fira Code", "Consolas", monospace;
    --ease-linear: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Ambient Cyber Texture */
.cyber-bg {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(circle at 50% -10%, rgba(0, 112, 243, 0.18) 0%, transparent 55%),
        radial-gradient(circle at 100% 40%, rgba(138, 43, 226, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 0% 80%, rgba(0, 223, 216, 0.08) 0%, transparent 45%),
        linear-gradient(to right, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 100% 100%, 54px 54px, 54px 54px;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 750;
    letter-spacing: -0.035em;
    color: var(--text-primary);
}

.text-gradient {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-hero {
    background: var(--gradient-hero-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Vector Icon Base Utilities */
.icon-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.icon-svg svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--accent-cyan);
    transition: all 0.3s ease;
}

.icon-box-blue { background: rgba(0, 112, 243, 0.12); color: var(--accent-blue); border-color: rgba(0, 112, 243, 0.3); }
.icon-box-purple { background: rgba(138, 43, 226, 0.12); color: #c084fc; border-color: rgba(138, 43, 226, 0.3); }
.icon-box-green { background: rgba(48, 209, 88, 0.12); color: var(--accent-green); border-color: rgba(48, 209, 88, 0.3); }
.icon-box-red { background: rgba(255, 59, 48, 0.12); color: var(--accent-red); border-color: rgba(255, 59, 48, 0.3); }

/* Spotlight Card Engine */
.spotlight-card {
    position: relative;
    border-radius: var(--radius-xl);
    background: var(--bg-surface-1);
    border: 1px solid var(--border-subtle);
    padding: 1px;
    overflow: hidden;
    transition: transform 0.35s var(--ease-linear), box-shadow 0.35s var(--ease-linear), border-color 0.3s ease;
}

.spotlight-card::before {
    content: '';
    position: absolute;
    top: var(--mouse-y, -1000px);
    left: var(--mouse-x, -1000px);
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(0, 223, 216, 0.24) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

.spotlight-card:hover::before {
    opacity: 1;
}

.spotlight-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-hover);
}

.spotlight-card-inner {
    background: var(--bg-card);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-radius: calc(var(--radius-xl) - 1px);
    padding: 34px;
    height: 100%;
    position: relative;
    z-index: 1;
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
}

.bento-col-4 { grid-column: span 4; }
.bento-col-6 { grid-column: span 6; }
.bento-col-8 { grid-column: span 8; }
.bento-col-12 { grid-column: span 12; }

@media (max-width: 960px) {
    .bento-col-4, .bento-col-6, .bento-col-8 {
        grid-column: span 12;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s var(--ease-linear);
    font-family: inherit;
}

.btn .icon-svg svg {
    width: 17px;
    height: 17px;
}

.btn-cyber {
    background: var(--gradient-brand);
    color: #ffffff;
    box-shadow: var(--glow-blue);
}

.btn-cyber:hover {
    transform: scale(1.03) translateY(-1px);
    box-shadow: var(--glow-purple);
}

.btn-primary {
    background: var(--accent-blue);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 112, 243, 0.35);
}

.btn-primary:hover {
    background: var(--accent-blue-hover);
    transform: scale(1.02);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(14px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.btn-danger { background: var(--accent-red); color: #fff; }
.btn-sm { padding: 8px 18px; font-size: 13px; }

/* Vector Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-pill);
    letter-spacing: 0.03em;
}

.badge-glow {
    background: rgba(0, 112, 243, 0.12);
    color: #58a6ff;
    border: 1px solid rgba(0, 112, 243, 0.35);
    box-shadow: 0 0 20px rgba(0, 112, 243, 0.2);
}

.badge-pro {
    background: rgba(138, 43, 226, 0.16);
    color: #df9aff;
    border: 1px solid rgba(138, 43, 226, 0.4);
}

.badge-free {
    background: rgba(255, 255, 255, 0.06);
    color: #9aa3b2;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.badge-danger {
    background: rgba(255, 59, 48, 0.15);
    color: #ff6961;
    border: 1px solid rgba(255, 59, 48, 0.3);
}

.badge-success {
    background: rgba(48, 209, 88, 0.15);
    color: #4cd964;
    border: 1px solid rgba(48, 209, 88, 0.3);
}

/* Radar Pulse Beacon */
.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan);
    animation: pulseBeacon 2s infinite;
}

@keyframes pulseBeacon {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 223, 216, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(0, 223, 216, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 223, 216, 0); }
}

/* iPhone Virtual Mockup Frame */
.phone-mockup {
    width: 310px;
    height: 560px;
    background: #000;
    border-radius: 46px;
    border: 3.5px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 45px rgba(0, 112, 243, 0.25);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    margin: 0 auto;
}

.phone-island {
    width: 92px;
    height: 25px;
    background: #000;
    border-radius: 20px;
    margin: 0 auto 16px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
}

.phone-cam-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #111;
    transition: all 0.3s ease;
}

.phone-cam-indicator.active {
    background: #00dfd8;
    box-shadow: 0 0 10px #00dfd8;
}

/* Keypad Simulator Buttons */
.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.keypad-btn {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 auto;
    transition: all 0.15s ease;
    user-select: none;
}

.keypad-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.25);
}

.keypad-btn:active {
    transform: scale(0.92);
    background: rgba(0, 112, 243, 0.4);
}

/* Pin Dots */
.pin-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 16px 0;
}

.pin-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    transition: all 0.2s ease;
}

.pin-dot.filled {
    background: #ffffff;
    border-color: #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* Tactical Leaflet Map Dark Styling (100% Free OpenStreetMap Filter) */
#security-map .leaflet-tile {
    filter: brightness(0.65) invert(1) contrast(2.4) hue-rotate(200deg) saturate(0.35);
}

#security-map .leaflet-container {
    background: #06080d;
}

.leaflet-popup-content-wrapper {
    background: rgba(255, 255, 255, 0.96) !important;
    border-radius: 14px !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6) !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.leaflet-popup-tip {
    background: rgba(255, 255, 255, 0.96) !important;
}

/* Staggered Scroll Reveal Animations (con fallback visible garantizado) */
.reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: opacity 0.65s var(--ease-linear), transform 0.65s var(--ease-linear);
}

html.js-ready .reveal-on-scroll:not(.is-visible) {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
}

.reveal-on-scroll.is-visible {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
}

/* Switch */
.switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    transition: .3s; border-radius: 34px;
}
.slider:before {
    position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px;
    background-color: white; transition: .3s cubic-bezier(0.34, 1.56, 0.64, 1); border-radius: 50%;
}
input:checked + .slider { background-color: var(--accent-blue); }
input:checked + .slider:before { transform: translateX(22px); }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.form-control {
    width: 100%;
    padding: 14px 18px;
    background: rgba(10, 13, 20, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
}
.form-control:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 112, 243, 0.25);
    background: rgba(10, 13, 20, 0.95);
}

/* Dashboard Layout */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 270px;
    background: var(--bg-surface-1);
    border-right: 1px solid var(--border-subtle);
    display: flex; flex-direction: column; padding: 24px 16px;
    position: sticky; top: 0; height: 100vh; z-index: 50;
}
.main-content { flex: 1; padding: 32px 40px; overflow-y: auto; background: var(--bg-base); }
.nav-link {
    display: flex; align-items: center; gap: 14px; padding: 12px 16px;
    color: var(--text-secondary); text-decoration: none; border-radius: var(--radius-md);
    font-size: 14px; font-weight: 500; transition: all 0.2s ease; margin-bottom: 4px;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); }
.nav-link.active { background: rgba(0, 112, 243, 0.15); color: var(--accent-blue); font-weight: 600; }

/* Tables */
.table-container { overflow-x: auto; }
table.cyber-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.cyber-table th {
    text-align: left; padding: 14px 16px; color: var(--text-muted); font-weight: 600;
    border-bottom: 1px solid var(--border-subtle); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
}
table.cyber-table td { padding: 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); color: var(--text-primary); vertical-align: middle; }
table.cyber-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

.thumb-img {
    width: 54px; height: 54px; border-radius: var(--radius-sm);
    object-fit: cover; border: 1px solid var(--border-subtle); cursor: pointer; transition: transform 0.2s;
}
.thumb-img:hover { transform: scale(1.1); }

/* Toasts */
#toast-container { position: fixed; bottom: 28px; right: 28px; z-index: 9999; display: flex; flex-direction: column; gap: 12px; }
.toast {
    background: var(--bg-surface-1); color: var(--text-primary); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md); padding: 14px 20px; box-shadow: var(--shadow-hover);
    display: flex; align-items: center; gap: 12px; font-size: 14px;
}

/* Landing Header & Responsive Navigation */
.site-header {
    position: sticky;
    top: 16px;
    z-index: 1000;
    margin: 0 16px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.site-header-inner {
    background: var(--bg-glass);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: var(--shadow-soft);
    position: relative;
}
.site-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}
.site-nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}
.site-nav-link:hover {
    color: #fff;
}
.mobile-nav-btn {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.mobile-nav-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--border-hover);
}
.mobile-nav-tray {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: rgba(13, 17, 26, 0.96);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
    flex-direction: column;
    gap: 12px;
    z-index: 1001;
}
.mobile-nav-tray.active {
    display: flex;
    animation: mobileNavSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes mobileNavSlide {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.mobile-nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.mobile-nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent-cyan);
}

/* App Mobile Topbar */
.app-mobile-topbar {
    display: none;
    background: rgba(13, 17, 26, 0.94);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px 18px;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 900;
}

@media (max-width: 860px) {
    .site-header {
        margin: 0 12px;
        top: 10px;
    }
    .site-header-inner {
        padding: 0 16px;
        height: 56px;
    }
    .site-nav {
        display: none; /* Ocultar enlaces directos en móviles */
    }
    .mobile-nav-btn {
        display: inline-flex; /* Mostrar botón hamburguesa */
    }
    .desktop-only-action {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .site-header {
        margin: 0 8px;
        top: 8px;
    }
    .site-header-inner {
        padding: 0 12px;
        height: 52px;
    }
    .brand-text {
        font-size: 15px !important;
    }
    .brand-icon {
        width: 32px !important;
        height: 32px !important;
    }
    .site-actions {
        gap: 8px !important;
    }
    .site-actions .btn-sm {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
    .mobile-nav-btn {
        width: 34px !important;
        height: 34px !important;
    }
    .mobile-nav-tray {
        top: 60px;
        padding: 16px;
    }
}

@media (max-width: 900px) {
    .app-layout { flex-direction: column; }
    .app-mobile-topbar { display: flex; }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 20px 16px;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        background: rgba(13, 17, 26, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        display: none; /* Se oculta por defecto en móviles y se despliega con toggle */
        z-index: 850;
    }
    .sidebar.mobile-open {
        display: flex;
        animation: mobileNavSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
    .sidebar .sidebar-brand-container {
        display: none; /* Ya se visualiza en la barra superior móvil */
    }
    .main-content { padding: 20px 14px; }
}

