/* =============================================
   Login Page - Metaverse Wireframe Theme
   ============================================= */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --- Background --- */
.login-background {
    position: fixed;
    inset: 0;
    background: linear-gradient(145deg, #060d1f 0%, #0a1a3a 35%, #0d1f3c 50%, #081428 75%, #030a15 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- SVG Grid --- */
.bg-grid {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.grid-line {
    stroke: #00d4ff;
    stroke-width: 0.5;
    opacity: 0.12;
}

.grid-line--h1 { animation: pulse-glow 6s ease-in-out 0s infinite; }
.grid-line--h2 { animation: pulse-glow 6s ease-in-out 0.4s infinite; }
.grid-line--h3 { animation: pulse-glow 6s ease-in-out 0.8s infinite; }
.grid-line--h4 { animation: pulse-glow 6s ease-in-out 1.2s infinite; }
.grid-line--h5 { animation: pulse-glow 6s ease-in-out 1.6s infinite; }
.grid-line--h6 { animation: pulse-glow 6s ease-in-out 2.0s infinite; }
.grid-line--h7 { animation: pulse-glow 6s ease-in-out 2.4s infinite; }
.grid-line--h8 { animation: pulse-glow 6s ease-in-out 2.8s infinite; }

.grid-line--v1 { animation: pulse-glow 7s ease-in-out 0.5s infinite; }
.grid-line--v2 { animation: pulse-glow 7s ease-in-out 1.0s infinite; }
.grid-line--v3 { animation: pulse-glow 7s ease-in-out 1.5s infinite; }
.grid-line--v4 { animation: pulse-glow 7s ease-in-out 0s infinite; opacity: 0.2; }
.grid-line--v5 { animation: pulse-glow 7s ease-in-out 1.5s infinite; }
.grid-line--v6 { animation: pulse-glow 7s ease-in-out 1.0s infinite; }
.grid-line--v7 { animation: pulse-glow 7s ease-in-out 0.5s infinite; }

/* --- Hexagons --- */
.hex polygon {
    fill: none;
    stroke: #00d4ff;
    stroke-width: 0.8;
    opacity: 0.15;
}

.hex--1 { animation: drift 8s ease-in-out infinite alternate; }
.hex--2 { animation: drift 10s ease-in-out 2s infinite alternate; }
.hex--3 { animation: drift 7s ease-in-out 1s infinite alternate; }

/* --- Nodes --- */
.node {
    fill: #00d4ff;
    opacity: 0.3;
}

.node--1 { animation: pulse-node 4s ease-in-out 0s infinite; }
.node--2 { animation: pulse-node 4s ease-in-out 0.5s infinite; }
.node--3 { animation: pulse-node 5s ease-in-out 1s infinite; }
.node--4 { animation: pulse-node 5s ease-in-out 1.5s infinite; }
.node--5 { animation: pulse-node 3s ease-in-out 0s infinite; }
.node--6 { animation: pulse-node 6s ease-in-out 2s infinite; }
.node--7 { animation: pulse-node 6s ease-in-out 3s infinite; }
.node--8 { animation: pulse-node 4.5s ease-in-out 0.8s infinite; }
.node--9 { animation: pulse-node 4.5s ease-in-out 1.3s infinite; }

/* --- Connections --- */
.connection {
    stroke: #00d4ff;
    stroke-width: 0.4;
    opacity: 0.08;
}

.connection--1 { animation: pulse-glow 5s ease-in-out 0s infinite; }
.connection--2 { animation: pulse-glow 5s ease-in-out 0.8s infinite; }
.connection--3 { animation: pulse-glow 5s ease-in-out 1.6s infinite; }
.connection--4 { animation: pulse-glow 5s ease-in-out 2.4s infinite; }
.connection--5 { animation: pulse-glow 6s ease-in-out 1s infinite; }
.connection--6 { animation: pulse-glow 6s ease-in-out 2s infinite; }

/* --- Floating particles --- */
.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #00d4ff;
    border-radius: 50%;
    opacity: 0;
    animation: float-up 12s linear infinite;
}

.particle--1 { left: 15%; animation-delay: 0s; }
.particle--2 { left: 35%; animation-delay: 2s; }
.particle--3 { left: 55%; animation-delay: 4s; }
.particle--4 { left: 75%; animation-delay: 6s; }
.particle--5 { left: 25%; animation-delay: 8s; }
.particle--6 { left: 65%; animation-delay: 10s; }

/* --- Login container --- */
.login-container {
    position: relative;
    z-index: 10;
    text-align: center;
    transform: translateY(-8%);
}

.login-logo {
    margin-bottom: 4rem;
}

.logo-img {
    width: 88px;
    height: 88px;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 24px rgba(0, 212, 255, 0.4));
}

.login-title {
    color: #ffffff;
    font-size: 2.2rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-shadow: 0 0 40px rgba(0, 212, 255, 0.25);
}

/* --- Microsoft sign-in button (official branding) --- */
.login-actions {
    margin-top: 1rem;
}

.ms-signin-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px 0 12px;
    height: 41px;
    background: #ffffff;
    border: 1px solid #8c8c8c;
    color: #5e5e5e;
    font-family: 'Segoe UI', sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: box-shadow 0.2s ease;
}

.ms-signin-btn:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.ms-signin-btn:active {
    background: #f0f0f0;
}

.ms-signin-btn svg {
    flex-shrink: 0;
}

/* --- Animations --- */
@keyframes pulse-glow {
    0%, 100% { opacity: 0.08; }
    50% { opacity: 0.25; }
}

@keyframes pulse-node {
    0%, 100% { opacity: 0.2; r: inherit; }
    50% { opacity: 0.7; }
}

@keyframes drift {
    0% { transform: translateY(0) translateX(0); }
    100% { transform: translateY(-15px) translateX(8px); }
}

@keyframes float-up {
    0% {
        transform: translateY(100vh);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-10vh);
        opacity: 0;
    }
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .login-title {
        font-size: 1.5rem;
        letter-spacing: 0.08em;
    }

    .logo-img {
        width: 64px;
        height: 64px;
    }

    .login-logo {
        margin-bottom: 3rem;
    }
}
