* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --primary-gradient-hover: linear-gradient(135deg, #5568d3 0%, #6a3d8f 50%, #e083eb 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 50%, #4facfe 100%);
    --rainbow-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 20%, #f093fb 40%, #f5576c 60%, #4facfe 80%, #43e97b 100%);
    --background-gradient: linear-gradient(135deg, 
        #0a0e27 0%, 
        #1a1a2e 15%, 
        #2d1b3d 30%, 
        #1a0d33 45%,
        #2d1b3d 60%,
        #1a1a2e 75%, 
        #0a0e27 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(102, 126, 234, 0.5);
    --shadow-lg: 0 12px 40px rgba(102, 126, 234, 0.6);
    --shadow-xl: 0 20px 60px rgba(102, 126, 234, 0.7);
    --shadow-neon: 0 0 30px rgba(102, 126, 234, 0.8), 
                    0 0 60px rgba(118, 75, 162, 0.6),
                    0 0 90px rgba(240, 147, 251, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #c8d0e7;
    --border-radius: 20px;
    --border-radius-lg: 28px;
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --glow-blue: 0 0 20px rgba(102, 126, 234, 1), 
                 0 0 40px rgba(102, 126, 234, 0.6),
                 0 0 60px rgba(102, 126, 234, 0.4);
    --glow-purple: 0 0 20px rgba(118, 75, 162, 1), 
                   0 0 40px rgba(118, 75, 162, 0.6),
                   0 0 60px rgba(118, 75, 162, 0.4);
    --glow-pink: 0 0 20px rgba(240, 147, 251, 1),
                 0 0 40px rgba(240, 147, 251, 0.6);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: var(--background-gradient);
    background-attachment: fixed;
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    background-image: 
        url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="2" fill="rgba(102,126,234,0.3)"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>'),
        var(--background-gradient);
    background-blend-mode: overlay;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    25% { background-position: 100% 50%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
    100% { background-position: 0% 50%; }
}

/* Advanced animated particle background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(3px 3px at 20% 30%, rgba(102, 126, 234, 0.6), transparent),
        radial-gradient(3px 3px at 60% 70%, rgba(118, 75, 162, 0.6), transparent),
        radial-gradient(2px 2px at 40% 50%, rgba(240, 147, 251, 0.5), transparent),
        radial-gradient(2px 2px at 80% 10%, rgba(102, 126, 234, 0.4), transparent),
        radial-gradient(3px 3px at 10% 80%, rgba(245, 87, 108, 0.5), transparent),
        radial-gradient(2px 2px at 90% 60%, rgba(79, 172, 254, 0.4), transparent),
        radial-gradient(2px 2px at 50% 90%, rgba(67, 233, 123, 0.4), transparent),
        radial-gradient(1px 1px at 30% 20%, rgba(255, 255, 255, 0.4), transparent);
    background-size: 300% 300%;
    animation: particleFloat 25s ease infinite;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.25) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.25) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(240, 147, 251, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 60% 40%, rgba(245, 87, 108, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 90% 20%, rgba(79, 172, 254, 0.2) 0%, transparent 50%);
    animation: glowPulse 10s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes particleFloat {
    0% { transform: translate(0, 0) rotate(0deg); background-position: 0% 0%; }
    25% { transform: translate(40px, -40px) rotate(90deg); background-position: 25% 25%; }
    50% { transform: translate(-30px, 30px) rotate(180deg); background-position: 50% 50%; }
    75% { transform: translate(30px, 20px) rotate(270deg); background-position: 75% 75%; }
    100% { transform: translate(0, 0) rotate(360deg); background-position: 100% 100%; }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.6; transform: scale(1) rotate(0deg); }
    33% { opacity: 0.9; transform: scale(1.15) rotate(120deg); }
    66% { opacity: 0.7; transform: scale(1.05) rotate(240deg); }
}

.container {
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 1;
}

.auth-box, .dashboard-box {
    background: var(--glass-bg);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 3px solid transparent;
    border-radius: var(--border-radius-lg);
    padding: 52px;
    box-shadow: 
        var(--shadow-xl), 
        0 0 0 1px rgba(255, 255, 255, 0.15) inset,
        0 0 80px rgba(102, 126, 234, 0.4),
        0 0 120px rgba(118, 75, 162, 0.3),
        inset 0 0 60px rgba(102, 126, 234, 0.1);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    background-image: 
        url('data:image/svg+xml;utf8,<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"><defs><radialGradient id="grad1"><stop offset="0%" stop-color="rgba(102,126,234,0.1)"/><stop offset="100%" stop-color="transparent"/></radialGradient></defs><circle cx="100" cy="100" r="80" fill="url(%23grad1)"/></svg>'),
        var(--glass-bg);
    background-size: 400px 400px, cover;
    background-position: center, center;
    background-repeat: repeat, no-repeat;
}

.auth-box::before, .dashboard-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--border-radius-lg);
    padding: 3px;
    background: var(--rainbow-gradient);
    background-size: 300% 300%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: borderRotate 8s linear infinite;
    z-index: -1;
}

.auth-box::after, .dashboard-box::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent 25%, 
        rgba(102, 126, 234, 0.15) 30%, 
        rgba(118, 75, 162, 0.15) 35%,
        rgba(240, 147, 251, 0.15) 40%,
        transparent 45%,
        transparent 55%,
        rgba(102, 126, 234, 0.15) 60%,
        rgba(118, 75, 162, 0.15) 65%,
        rgba(240, 147, 251, 0.15) 70%,
        transparent 75%);
    animation: shine 4s infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes borderRotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


h2 {
    color: #ffffff;
    margin-bottom: 32px;
    text-align: center;
    font-size: 36px;
    font-weight: 900;
    letter-spacing: -1px;
    background: var(--rainbow-gradient);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 4s ease infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8))
            drop-shadow(0 0 20px rgba(102, 126, 234, 0.6))
            drop-shadow(0 0 40px rgba(118, 75, 162, 0.4));
    position: relative;
    text-transform: uppercase;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
}

h2::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 4px;
    background: var(--rainbow-gradient);
    background-size: 300% 100%;
    border-radius: 2px;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.8);
    animation: gradientText 4s ease infinite, pulseLine 2s ease-in-out infinite;
}

@keyframes gradientText {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulseLine {
    0%, 100% { opacity: 0.7; transform: translateX(-50%) scaleX(1); }
    50% { opacity: 1; transform: translateX(-50%) scaleX(1.3); }
}

h3 {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 10px;
    color: #000000;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.3px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid rgba(102, 126, 234, 0.5);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    background: rgba(255, 255, 255, 1);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #000000;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(102, 126, 234, 0.2);
    font-weight: 500;
}

input::placeholder,
textarea::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
textarea:hover,
select:hover {
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.2);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 1);
    box-shadow: 
        0 0 0 4px rgba(102, 126, 234, 0.1),
        0 0 20px rgba(102, 126, 234, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.btn {
    width: 100%;
    padding: 16px 28px;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 14px;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                height 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: -1;
}

.btn::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #667eea);
    background-size: 300% 300%;
    border-radius: 12px;
    opacity: 0;
    z-index: -2;
    animation: borderRotate 3s linear infinite;
    transition: opacity 0.3s;
}

@keyframes borderRotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.btn:hover::before {
    width: 400px;
    height: 400px;
}

.btn:hover::after {
    opacity: 1;
}

.btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-neon), 0 8px 24px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(-2px) scale(0.98);
}

.btn-primary {
    background: var(--rainbow-gradient);
    background-size: 300% 300%;
    color: #ffffff;
    box-shadow: 
        0 6px 20px rgba(102, 126, 234, 0.5),
        0 0 30px rgba(118, 75, 162, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: buttonGlow 3s ease infinite;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6), 0 0 8px rgba(0, 0, 0, 0.3);
    font-weight: 700;
    letter-spacing: 0.5px;
}

@keyframes buttonGlow {
    0%, 100% { 
        background-position: 0% 50%;
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5),
                    0 0 30px rgba(118, 75, 162, 0.4),
                    inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% { 
        background-position: 100% 50%;
        box-shadow: 0 6px 30px rgba(102, 126, 234, 0.8),
                    0 0 50px rgba(118, 75, 162, 0.6),
                    0 0 70px rgba(240, 147, 251, 0.4),
                    inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
}

.btn-primary:hover {
    animation: none;
    background: var(--rainbow-gradient);
    background-size: 300% 300%;
    background-position: 50% 50%;
    box-shadow: 
        0 0 40px rgba(102, 126, 234, 1),
        0 0 80px rgba(118, 75, 162, 0.8),
        0 0 120px rgba(240, 147, 251, 0.6),
        0 12px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.6);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6), 0 0 8px rgba(0, 0, 0, 0.3);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7), 0 0 10px rgba(0, 0, 0, 0.4);
}

.auth-link {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
}

.auth-link a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #667eea;
    transition: width 0.3s ease;
}

.auth-link a:hover::after {
    width: 100%;
}

.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    animation: slideIn 0.4s ease-out;
    border-left: 4px solid;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-error {
    background: linear-gradient(135deg, rgba(255, 235, 238, 0.9) 0%, rgba(255, 245, 245, 0.9) 100%);
    color: #c62828;
    border-left-color: #e53935;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: linear-gradient(135deg, rgba(232, 245, 233, 0.9) 0%, rgba(241, 248, 233, 0.9) 100%);
    color: #2e7d32;
    border-left-color: #43a047;
    box-shadow: var(--shadow-sm);
}

.user-info {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    padding: 28px;
    border-radius: 16px;
    margin-bottom: 24px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 4px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.user-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s;
}

.user-info:hover::before {
    left: 100%;
}

.user-info:hover {
    box-shadow: 
        var(--glow-blue),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 8px 32px rgba(0, 0, 0, 0.4);
    transform: translateY(-4px) scale(1.01);
    border-color: rgba(102, 126, 234, 0.5);
}

.user-info p {
    margin-bottom: 12px;
    color: #ffffff;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6), 0 0 8px rgba(0, 0, 0, 0.4);
    font-weight: 500;
}

.user-info p:last-child {
    margin-bottom: 0;
}

.user-info strong {
    color: #a8b5ff;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.8), 0 2px 4px rgba(0, 0, 0, 0.6);
    filter: drop-shadow(0 0 8px rgba(102, 126, 234, 0.6));
}

.dashboard-actions {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dashboard-actions .btn {
    margin-bottom: 0;
}

@media (max-width: 480px) {
    .auth-box, .dashboard-box {
        padding: 32px 24px;
        border-radius: var(--border-radius);
    }
    
    h2 {
        font-size: 28px;
    }
    
    body {
        padding: 16px;
    }
}

