/* Fondo profesional del login. No modifica .login-box ni el formulario. */

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background: #050b2b;
    background-image:
        radial-gradient(at 20% 15%, rgba(67, 96, 255, 0.45) 0px, transparent 45%),
        radial-gradient(at 85% 85%, rgba(138, 43, 226, 0.40) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(0, 180, 255, 0.18) 0px, transparent 55%),
        linear-gradient(135deg, #050b2b 0%, #0b1560 45%, #1b0b4a 100%);
    background-size: 100% 100%;
    overflow: hidden;
    position: relative;
    min-height: 100vh;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

/* Capa de grilla sutil */
body::before {
    content: '';
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
    pointer-events: none;
    z-index: 0;
}

/* Viñeta oscura en los bordes */
body::after {
    content: '';
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Contenedor de orbes decorativos */
.bg-decor {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.bg-decor .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.55;
    animation: float 18s ease-in-out infinite;
    will-change: transform;
}

.bg-decor .orb-1 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, #4360ff, transparent 70%);
    top: -120px;
    left: -100px;
    animation-delay: 0s;
}

.bg-decor .orb-2 {
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, #8a2be2, transparent 70%);
    bottom: -140px;
    right: -120px;
    animation-delay: -6s;
}

.bg-decor .orb-3 {
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, #00c8ff, transparent 70%);
    top: 55%;
    left: 8%;
    animation-delay: -12s;
    opacity: 0.35;
}

.bg-decor .orb-4 {
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, #ff4a88, transparent 70%);
    top: 10%;
    right: 12%;
    animation-delay: -9s;
    opacity: 0.28;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(40px, -30px) scale(1.08); }
    66%      { transform: translate(-30px, 25px) scale(0.95); }
}

/* Marca discreta arriba-izquierda */
.bg-brand {
    position: fixed;
    top: 24px;
    left: 28px;
    z-index: 2;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.bg-brand .dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 10px;
    background: #4fc3ff;
    border-radius: 50%;
    box-shadow: 0 0 14px #4fc3ff, 0 0 28px rgba(79, 195, 255, 0.6);
    animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(1.25); }
}

/* Copyright discreto abajo */
.bg-footer {
    position: fixed;
    bottom: 18px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.45);
    font-size: 12px;
    letter-spacing: 1px;
    z-index: 2;
    pointer-events: none;
}

/* Garantiza que el login-box quede por encima de las capas decorativas */
.login-box,
.register-box {
    z-index: 10;
}

/* Pequeño refuerzo visual al login-box sin cambiar su layout: sombra más profunda */
.login-box {
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* =========================================================
   CAPA TELECOM: torres, teléfonos, satélite, red de conexiones
   ========================================================= */

.bg-network {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.85;
}

/* Colores base del stroke */
.bg-network .wire,
.bg-network .node,
.bg-network .device,
.bg-network .signal,
.bg-network .packet {
    color: #4fc3ff;
}

/* --- Red de conexiones (líneas con flujo de datos) --- */
.bg-network .wire {
    fill: none;
    stroke: rgba(79, 195, 255, 0.28);
    stroke-width: 1.2;
    stroke-linecap: round;
}

.bg-network .wire-glow {
    fill: none;
    stroke: #4fc3ff;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-dasharray: 6 180;
    filter: drop-shadow(0 0 6px rgba(79, 195, 255, 0.8));
    animation: dataflow 4s linear infinite;
}
.bg-network .wire-glow.d2 { animation-duration: 5.5s; animation-delay: -1.2s; stroke: #7aa2ff; }
.bg-network .wire-glow.d3 { animation-duration: 6.5s; animation-delay: -3s;   stroke: #b388ff; }
.bg-network .wire-glow.d4 { animation-duration: 4.8s; animation-delay: -2.3s; stroke: #4fc3ff; }

@keyframes dataflow {
    to { stroke-dashoffset: -186; }
}

/* --- Nodos API / endpoints --- */
.bg-network .node {
    fill: #4fc3ff;
    filter: drop-shadow(0 0 6px rgba(79, 195, 255, 0.7));
    animation: nodePulse 2.6s ease-in-out infinite;
}
.bg-network .node.n2 { animation-delay: -0.6s; fill: #7aa2ff; }
.bg-network .node.n3 { animation-delay: -1.2s; fill: #b388ff; }
.bg-network .node.n4 { animation-delay: -1.8s; }
.bg-network .node.n5 { animation-delay: -2.2s; fill: #7aa2ff; }

@keyframes nodePulse {
    0%, 100% { opacity: 1;   transform-origin: center; }
    50%      { opacity: 0.55; }
}

/* --- Dispositivos (teléfonos, torres, satélite) --- */
.bg-network .device {
    fill: none;
    stroke: rgba(180, 220, 255, 0.75);
    stroke-width: 1.6;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.bg-network .device-fill {
    fill: rgba(10, 20, 60, 0.6);
    stroke: rgba(180, 220, 255, 0.75);
    stroke-width: 1.6;
    stroke-linejoin: round;
}

.bg-network .screen {
    fill: rgba(79, 195, 255, 0.18);
    stroke: none;
}

.bg-network .screen-accent {
    fill: #4fc3ff;
    opacity: 0.85;
}

/* --- Flotación suave de cada dispositivo --- */
.bg-network .phone-1 { animation: floatY 6s ease-in-out infinite; }
.bg-network .phone-2 { animation: floatY 7.5s ease-in-out infinite reverse; }
.bg-network .phone-3 { animation: floatY 8s ease-in-out infinite; animation-delay: -2s; }
.bg-network .tower   { animation: floatY 9s ease-in-out infinite; animation-delay: -1s; }

@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-14px); }
}

/* --- Satélite con órbita sutil --- */
.bg-network .satellite {
    transform-origin: 50% 50%;
    animation: satOrbit 22s linear infinite;
}
@keyframes satOrbit {
    0%   { transform: translate(0, 0) rotate(0deg); }
    50%  { transform: translate(18px, -10px) rotate(6deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

/* --- Ondas de señal: círculos que se expanden --- */
.bg-network .signal {
    fill: none;
    stroke: #4fc3ff;
    stroke-width: 1.4;
    transform-origin: 50% 50%;
    animation: signalWave 2.8s ease-out infinite;
    opacity: 0;
}
.bg-network .signal.w2 { animation-delay: 0.9s; }
.bg-network .signal.w3 { animation-delay: 1.8s; }

.bg-network .signal.pink  { stroke: #ff77c8; }
.bg-network .signal.violet{ stroke: #b388ff; }

@keyframes signalWave {
    0%   { transform: scale(0.3); opacity: 0.8; }
    80%  { opacity: 0.15; }
    100% { transform: scale(2.3); opacity: 0; }
}

/* --- Arcos wifi salientes de teléfonos (3 arcos apilados) --- */
.bg-network .wifi-arc {
    fill: none;
    stroke: #4fc3ff;
    stroke-width: 1.6;
    stroke-linecap: round;
    opacity: 0;
    animation: wifiPulse 2.4s ease-out infinite;
}
.bg-network .wifi-arc.a2 { animation-delay: 0.4s; }
.bg-network .wifi-arc.a3 { animation-delay: 0.8s; }

@keyframes wifiPulse {
    0%   { opacity: 0; }
    20%  { opacity: 0.9; }
    60%  { opacity: 0.35; }
    100% { opacity: 0; }
}

/* --- Paquete de datos viajando por la línea principal --- */
.bg-network .packet {
    fill: #9be7ff;
    filter: drop-shadow(0 0 6px #9be7ff);
}

/* =========================================================
   ACCESIBILIDAD / RESPONSIVE
   ========================================================= */

/* Accesibilidad: respeta preferencia de menos movimiento */
@media (prefers-reduced-motion: reduce) {
    .bg-decor .orb,
    .bg-brand .dot,
    .bg-network .wire-glow,
    .bg-network .node,
    .bg-network .phone-1,
    .bg-network .phone-2,
    .bg-network .phone-3,
    .bg-network .tower,
    .bg-network .satellite,
    .bg-network .signal,
    .bg-network .wifi-arc {
        animation: none;
    }
}

/* Mobile: simplificar para rendimiento */
@media (max-width: 700px) {
    .bg-decor .orb {
        filter: blur(60px);
    }
    .bg-decor .orb-3,
    .bg-decor .orb-4 {
        display: none;
    }
    .bg-network {
        opacity: 0.55;
    }
    .bg-brand {
        font-size: 13px;
        top: 16px;
        left: 18px;
    }
}
