/* ╔════════════════════════════════════════════════════════════════╗
   ║  CCTV Panel — Login                                             ║
   ║  Tema "command center": fondo oscuro con cam-wall animado,      ║
   ║  scanlines, glows, partículas y tarjeta glass-morphism.         ║
   ╚════════════════════════════════════════════════════════════════╝ */

* { box-sizing: border-box; }

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #FFFFFF;
    font-family: Helvetica, Arial, sans-serif;
    color: #1a2840;
}

/* ── Fondo animado ───────────────────────────────────────────────── */

.bg-stage {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

/* Capa 1 — base blanco con halo azul muy sutil */
.bg-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(32, 100, 145, 0.06), transparent 55%),
        radial-gradient(ellipse at 80% 100%, rgba(32, 100, 145, 0.05), transparent 60%),
        #FFFFFF;
}

/* Capa 2 — rejilla HUD azul */
.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(32, 100, 145, 0.14) 1px, transparent 1px),
        linear-gradient(90deg, rgba(32, 100, 145, 0.14) 1px, transparent 1px);
    background-size: 44px 44px;
    animation: gridMove 60s linear infinite;
    opacity: 1;
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 85%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 85%);
}

@keyframes gridMove {
    0%   { background-position: 0 0, 0 0; }
    100% { background-position: 44px 44px, 44px 44px; }
}

/* Capa 3 — viñeta blanca para suavizar bordes */
.bg-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(255,255,255,0.85) 100%);
    pointer-events: none;
}

/* Globo wireframe (alusión a "contacto sin fronteras") */
.bg-globe {
    position: absolute;
    width: 600px;
    height: 600px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 1;
    animation: globeSpin 80s linear infinite;
    pointer-events: none;
    filter:
        drop-shadow(0 0 14px rgba(32, 100, 145, 0.35))
        drop-shadow(0 0 40px rgba(32, 100, 145, 0.20));
}

@keyframes globeSpin {
    0%   { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ── Sección y tarjeta de login ──────────────────────────────────── */

.login-section {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login {
    position: relative;
    width: 360px;
    padding: 38px 36px 28px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid rgba(32, 100, 145, 0.14);
    border-radius: 16px;
    box-shadow:
        0 24px 48px rgba(32, 100, 145, 0.16),
        0 8px 18px rgba(32, 100, 145, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    animation: cardIn 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardIn {
    0%   { opacity: 0; transform: translateY(22px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0)   scale(1); }
}

#alerta {
    position: relative;
    z-index: 50;
}

#loginTitulo_app {
    text-align: center;
    margin-bottom: 6px;
}

#imgLogoLogin_app {
    width: 256px !important;
    height: auto !important;
    max-height: 167px;
    object-fit: contain;
}

.login-form { width: 100%; }

.login_fieldlist {
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.login_field {
    margin: 0 0 14px;
    position: relative;
}

.login_input_text {
    width: 100%;
    height: 44px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 9px;
    color: #1a1a1a;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.login_input_text::placeholder {
    color: rgba(0, 0, 0, 0.40);
}

.login_input_text:hover {
    border-color: rgba(0, 0, 0, 0.20);
}

.login_input_text:focus {
    border-color: rgba(32, 100, 145, 0.7);
    box-shadow: 0 0 0 4px rgba(32, 100, 145, 0.14);
    background: #FFFFFF;
}

.login_action { margin-top: 22px; }

.login_boton {
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: 9px;
    background: #206491;
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.30),
        0 2px 6px rgba(0, 0, 0, 0.20);
    transition: transform 0.12s ease, box-shadow 0.18s ease, filter 0.18s ease;
    position: relative;
    overflow: hidden;
    font-family: Helvetica, Arial, sans-serif;
}

/* Shimmer al hover */
.login_boton::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.25) 50%,
        transparent);
    transform: translateX(-100%);
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.login_boton:hover::after { transform: translateX(100%); }

.login_boton:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
    box-shadow:
        0 14px 28px rgba(0, 0, 0, 0.35),
        0 3px 8px rgba(0, 0, 0, 0.22);
}

.login_boton:active {
    transform: translateY(0);
    filter: brightness(0.95);
}

/* Pie de la tarjeta — estado del sistema */
.login-foot {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    letter-spacing: 0.4px;
    color: rgba(0, 0, 0, 0.45);
    text-transform: uppercase;
}

.dot-live {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2ecc71;
    box-shadow: 0 0 8px #2ecc71;
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.45; transform: scale(0.85); }
}

/* Validación del E11 (la notificación se monta fuera, sólo aseguramos z-index) */
.k-widget.k-tooltip-validation,
.k-tooltip-validation {
    z-index: 1000 !important;
}

/* ── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .login {
        width: calc(100% - 32px);
        max-width: 360px;
        padding: 28px 24px 22px;
        border-radius: 14px;
    }
    #imgLogoLogin_app { width: 256px !important; max-height: 167px; }
    .bg-globe { width: 360px; height: 360px; opacity: 0.25; }
}

/* Reduce motion: respeta preferencia del sistema */
@media (prefers-reduced-motion: reduce) {
    .bg-grid, .bg-globe, .dot-live, .login {
        animation: none !important;
    }
    .login_boton::after { transition: none; }
}
