/* ==========================================================================
   NEURA LOGIN PAGE - ANIMATED
   Based on neura_optimized_animation.html
   ========================================================================== */

/* ============================================
   BASE - Login page reset & body
   ============================================ */

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

body.login-page {
    background: #000;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
}

/* ============================================
   CANVAS - Particle background
   ============================================ */

#loginCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
    opacity: 0;
    animation: fadeInCanvas 1s ease-out forwards;
}

@keyframes fadeInCanvas {
    to { opacity: 1; }
}

/* ============================================
   MAIN CONTAINER - Centered layout
   ============================================ */

.login-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    max-width: 1200px;
    width: 90%;
}

/* ============================================
   NEURON VISUAL (pulsating core + orbital nodes)
   ============================================ */

.neuron-visual {
    position: relative;
    width: 250px;
    height: 250px;
    flex-shrink: 0;
    opacity: 0;
    animation: fadeInCore 0.8s ease-out forwards;
    animation-delay: 0.5s;
}

@keyframes fadeInCore {
    to { opacity: 1; }
}

/* Core center - pulsating gradient sphere */
.core-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    margin: -30px 0 0 -30px;
    background: radial-gradient(circle, #00d9ff 0%, #0099ff 60%, #6b5aff 100%);
    border-radius: 50%;
    box-shadow:
        0 0 40px rgba(0, 217, 255, 0.6),
        0 0 80px rgba(0, 153, 255, 0.3);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            0 0 40px rgba(0, 217, 255, 0.6),
            0 0 80px rgba(0, 153, 255, 0.3);
    }
    50% {
        transform: scale(1.1);
        box-shadow:
            0 0 50px rgba(0, 217, 255, 0.8),
            0 0 100px rgba(0, 153, 255, 0.5);
    }
}

/* Orbital nodes - rotating around core */
.orbit-node {
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -6px 0 0 -6px;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, #00d9ff, #0099ff);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.6);
    opacity: 0;
    animation: fadeInNode 0.4s ease-out forwards, orbit 8s linear infinite;
}

@keyframes fadeInNode {
    to { opacity: 1; }
}

@keyframes orbit {
    from { transform: rotate(0deg) translateX(80px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(80px) rotate(-360deg); }
}

/* Staggered node timing - fade + orbit */
.orbit-node:nth-child(2) {
    animation-delay: 0.8s, 0.8s;
    animation-duration: 0.4s, 10s;
}
.orbit-node:nth-child(3) {
    animation-delay: 1.0s, 1.0s;
    animation-duration: 0.4s, 12s;
}
.orbit-node:nth-child(4) {
    animation-delay: 1.2s, 1.2s;
    animation-duration: 0.4s, 9s;
}
.orbit-node:nth-child(5) {
    animation-delay: 1.4s, 1.4s;
    animation-duration: 0.4s, 11s;
}

/* ============================================
   TEXT - NEURA title + tagline
   ============================================ */

.login-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.text-container {
    text-align: center;
    opacity: 0;
    animation: slideInText 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 1.5s;
}

@keyframes slideInText {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.neura-text {
    font-size: clamp(60px, 10vw, 120px);
    font-weight: 800;
    letter-spacing: 0.15em;
    background: linear-gradient(135deg, #00d9ff 0%, #0099ff 50%, #6b5aff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(0, 217, 255, 0.4));
    margin: 0;
    line-height: 1;
}

.tagline {
    font-size: clamp(12px, 2vw, 16px);
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.3em;
    margin-top: 15px;
    font-weight: 500;
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
    animation-delay: 2.0s;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* ============================================
   LOGIN FORM - Glassmorphism card
   ============================================ */

.login-form-wrapper {
    opacity: 0;
    animation: slideInForm 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 2.0s;
}

@keyframes slideInForm {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-form {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 32px;
    min-width: 340px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(0, 184, 212, 0.1);
}

/* Form group */
.login-form .form-group {
    margin-bottom: 16px;
    width: 100%;
}

.login-form .form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

/* Input fields */
.login-form .form-group input {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.login-form .form-group input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    border-color: #00d9ff;
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

.login-form .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   LOGIN BUTTON
   ============================================ */

.login-button {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #00d9ff 0%, #0099ff 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.3);
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 217, 255, 0.4);
}

.login-button:active {
    transform: translateY(0);
}

/* Loading state - spinner replaces text */
.login-button.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.login-button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   ERROR MESSAGE
   ============================================ */

.error-message {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: #ff6b6b;
    font-size: 13px;
    text-align: center;
    display: none;
}

.error-message.show {
    display: block;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ============================================
   FOOTER
   ============================================ */

.login-footer {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
    animation-delay: 2.5s;
}

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

@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        gap: 40px;
        width: 95%;
    }

    .neuron-visual {
        width: 200px;
        height: 200px;
    }

    .core-center {
        width: 50px;
        height: 50px;
        margin: -25px 0 0 -25px;
    }

    .orbit-node {
        width: 10px;
        height: 10px;
    }

    .neura-text {
        font-size: 48px;
    }

    .tagline {
        font-size: 12px;
    }

    .login-form {
        min-width: 280px;
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .login-container {
        gap: 30px;
    }

    .neuron-visual {
        width: 160px;
        height: 160px;
    }

    .core-center {
        width: 40px;
        height: 40px;
        margin: -20px 0 0 -20px;
    }

    .login-form {
        min-width: auto;
        width: 100%;
        padding: 20px;
    }

    .login-button {
        padding: 12px 20px;
        font-size: 14px;
    }
}
