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

:root {
    --deep-space: #0a0a0f;
    --cosmic-purple: #2d1b69;
    --nebula-blue: #1e3a8a;
    --quantum-violet: #7c3aed;
    --cyber-blue: #3b82f6;
    --neon-purple: #8b5cf6;
    --plasma-pink: #ec4899;
    --crystal-white: #ffffff;
    --quantum-gray: #64748b;
    --void-black: #000000;
    --glass-surface: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--deep-space) 0%, var(--cosmic-purple) 25%, var(--nebula-blue) 50%, var(--quantum-violet) 75%, var(--deep-space) 100%);
    background-attachment: fixed;
    background-size: 200% 200%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    animation: cosmicShift 20s ease-in-out infinite;
    padding: 2rem 0;
}

@keyframes cosmicShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Futuristic animated background layers */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(139, 92, 246, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(45, 27, 105, 0.5) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(59, 130, 246, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 60% 60%, rgba(124, 58, 237, 0.35) 0%, transparent 50%);
    animation: nebulaPulse 15s ease-in-out infinite;
    z-index: -2;
    pointer-events: none;
}

@keyframes nebulaPulse {
    0%, 100% { opacity: 0.8; transform: scale(1) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.1) rotate(180deg); }
}

/* Dynamic starfield container */
.starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    animation: starAppear 2s ease-in-out forwards, starTwinkle 3s ease-in-out infinite 2s;
}

.star.bright {
    width: 3px;
    height: 3px;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

.star.dim {
    width: 1px;
    height: 1px;
    opacity: 0.6;
}

@keyframes starAppear {
    0% { 
        opacity: 0; 
        transform: scale(0); 
    }
    100% { 
        opacity: 1; 
        transform: scale(1); 
    }
}

@keyframes starTwinkle {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1); 
    }
    50% { 
        opacity: 0.3; 
        transform: scale(0.8); 
    }
}

@keyframes starDisappear {
    0% { 
        opacity: 1; 
        transform: scale(1); 
    }
    100% { 
        opacity: 0; 
        transform: scale(0); 
    }
}

/* Floating energy orbs */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
    animation: energyFloat 25s infinite ease-in-out;
    z-index: 1;
    pointer-events: none;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.4), transparent);
    top: -200px;
    left: -200px;
    animation-duration: 30s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.3), transparent);
    bottom: -250px;
    right: -250px;
    animation-duration: 35s;
    animation-delay: -15s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.5), transparent);
    top: 50%;
    left: 50%;
    animation-duration: 40s;
    animation-delay: -8s;
}

@keyframes energyFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    25% {
        transform: translate(150px, -80px) scale(1.2) rotate(90deg);
    }
    50% {
        transform: translate(-100px, 120px) scale(0.8) rotate(180deg);
    }
    75% {
        transform: translate(-150px, -50px) scale(1.1) rotate(270deg);
    }
}

/* Quantum login container - FULLY RESPONSIVE */
.login-container {
    position: relative;
    z-index: 100;
    width: clamp(320px, 85vw, 800px);
    max-width: 95vw;
    padding: clamp(1rem, 2vw, 2rem);
    animation: containerAppear 1s ease-out;
    margin: auto;
}

/* Form row responsive layout */
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: 0;
}

.form-row .form-group {
    margin-bottom: clamp(1rem, 2vw, 1.5rem);
}

.form-row .form-group:last-child {
    margin-bottom: clamp(1rem, 2vw, 1.5rem);
}

/* Two-column layout on larger screens */
@media (min-width: 768px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: clamp(1rem, 2vw, 2rem);
        margin-bottom: clamp(1rem, 2vw, 1.5rem);
    }
    
    .form-row .form-group {
        margin-bottom: 0 !important;
    }
    
    .form-row .form-group:last-child {
        margin-bottom: 0 !important;
    }
}

@keyframes containerAppear {
    0% { opacity: 0; transform: translateY(50px) scale(0.9); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Dark glass morphism login box */
.login-box {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(40px);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: clamp(16px, 3vw, 32px);
    padding: clamp(32px, 4vw, 56px) clamp(24px, 3vw, 48px);
    box-shadow: 
        0 32px 64px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 0 1px rgba(139, 92, 246, 0.15),
        inset 0 0 100px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(10, 10, 15, 0.4) 100%);
    z-index: -1;
}

/* Logo section */
.logo-container {
    text-align: center;
    margin-bottom: 56px;
}

.logo h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    background: linear-gradient(135deg, var(--neon-purple) 0%, var(--cyber-blue) 50%, var(--plasma-pink) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
    text-shadow: 0 0 30px rgba(139, 92, 246, 0.5);
    animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.logo-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: clamp(0.75rem, 1.5vw, 1.1rem);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 600;
    opacity: 1;
    text-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

/* Form styling */
.form-group {
    margin-bottom: 32px;
    position: relative;
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(0.75rem, 1.2vw, 0.95rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: clamp(8px, 1vw, 12px);
    opacity: 1;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.form-group input {
    width: 100%;
    padding: clamp(14px, 1.8vw, 18px) clamp(16px, 2vw, 20px);
    background: rgba(10, 10, 15, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: clamp(12px, 2vw, 16px);
    color: #ffffff;
    font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
    font-size: clamp(0.9rem, 1.3vw, 1.05rem);
    font-weight: 400;
    transition: all 0.3s ease;
    outline: none;
    backdrop-filter: blur(15px);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.4),
        0 1px 0 rgba(255, 255, 255, 0.05);
    min-height: clamp(48px, 5.5vw, 58px);
}

/* Override autofill styling */
.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus,
.form-group input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px rgba(10, 10, 15, 0.8) inset !important;
    -webkit-text-fill-color: #ffffff !important;
    background-color: rgba(10, 10, 15, 0.8) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.form-group input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px rgba(30, 20, 50, 0.9) inset !important;
    -webkit-text-fill-color: #a78bfa !important;
    background-color: rgba(30, 20, 50, 0.9) !important;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
    font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
}

.form-group input:hover,
.form-group select:hover {
    border-color: rgba(139, 92, 246, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.form-group input:focus,
.form-group select:focus {
    border-color: rgba(139, 92, 246, 0.8);
    background: rgba(30, 20, 50, 0.9);
    color: #a78bfa;
    box-shadow: 
        0 0 0 4px rgba(139, 92, 246, 0.15),
        0 0 30px rgba(139, 92, 246, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.form-group select option {
    background: #1a1a2e;
    color: white;
    padding: 10px;
}

/* Login button */
.btn-login {
    width: 100%;
    padding: clamp(14px, 1.8vw, 18px);
    background: linear-gradient(135deg, var(--quantum-violet) 0%, var(--cyber-blue) 50%, var(--neon-purple) 100%);
    border: none;
    border-radius: clamp(12px, 2vw, 16px);
    color: white;
    font-size: clamp(0.9rem, 1.3vw, 1.1rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: clamp(32px, 4vw, 40px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.3);
    min-height: clamp(52px, 6vw, 62px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 48px rgba(139, 92, 246, 0.4);
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:active {
    transform: translateY(-1px);
}

.btn-login:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(100, 116, 139, 0.3);
    box-shadow: none;
    transform: none;
}

.btn-login:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Loading spinner */
.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

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

.btn-login.loading .btn-text {
    display: none;
}

.btn-login.loading .loading-spinner {
    display: block;
}

.btn-login.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.4);
}

.btn-login.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #b91c1c 100%);
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.4);
}

.btn-login .status-message {
    display: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-login.success .status-message,
.btn-login.error .status-message {
    display: block;
}

.btn-login.success .btn-text,
.btn-login.error .btn-text {
    display: none;
}

/* Hidden message styling - now handled by button */
.message {
    display: none !important;
}

/* Forgot password link */
.forgot-password {
    display: block;
    text-align: center;
    margin-top: 32px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.3s ease;
    opacity: 1;
    text-shadow: 0 0 8px rgba(139, 92, 246, 0.3);
}

.forgot-password:hover {
    color: var(--neon-purple);
    opacity: 1;
    text-shadow: 0 0 15px rgba(139, 92, 246, 0.6);
    transform: translateY(-1px);
}

/* OAuth Buttons - fully responsive */
.oauth-btn {
    width: 100%;
    padding: clamp(12px, 1.8vw, 16px) clamp(16px, 2vw, 20px);
    border: 2px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.95);
    font-size: clamp(0.875rem, 1.3vw, 1rem);
    font-weight: 600;
    border-radius: clamp(10px, 2vw, 14px);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.5rem, 1vw, 0.75rem);
    font-family: 'Inter', sans-serif;
    min-height: clamp(48px, 5.5vw, 58px);
}

.oauth-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.2);
}

.oauth-btn svg {
    flex-shrink: 0;
}

/* Responsive design - Mobile first approach handled with clamp() */
/* Only essential media queries remain */

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}