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

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --danger-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Animated background particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 118, 117, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(67, 233, 123, 0.3) 0%, transparent 50%);
    animation: backgroundFlow 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes backgroundFlow {
    0%, 100% { 
        transform: translateX(0) translateY(0) rotate(0deg);
        opacity: 0.3;
    }
    33% { 
        transform: translateX(30px) translateY(-30px) rotate(1deg);
        opacity: 0.5;
    }
    66% { 
        transform: translateX(-20px) translateY(20px) rotate(-1deg);
        opacity: 0.4;
    }
}

/* === BEGRÜSSUNGSSCREEN === */
.welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.5s ease-out;
}

.welcome-screen.fade-out {
    opacity: 0;
    transform: scale(0.95);
}

.welcome-content {
    text-align: center;
    color: var(--text-primary);
    animation: welcomeSlideIn 1s ease-out;
}

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

.welcome-logo {
    margin-bottom: 2rem;
}

.logo-animation {
    position: relative;
}

.welcome-title {
    font-size: 4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from {
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
        transform: scale(1);
    }
    to {
        text-shadow: 0 0 30px rgba(255, 255, 255, 0.6), 0 0 60px rgba(102, 126, 234, 0.4);
        transform: scale(1.02);
    }
}

.logo-underline {
    width: 120px;
    height: 4px;
    background: var(--success-gradient);
    margin: 0 auto;
    border-radius: 2px;
    animation: underlineExpand 1.5s ease-out 0.5s both;
}

@keyframes underlineExpand {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 120px;
        opacity: 1;
    }
}

.welcome-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    animation: fadeInUp 1s ease-out 1s both;
}

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

.welcome-loader {
    animation: fadeInUp 1s ease-out 1.5s both;
}

.loader-dots {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.loader-dots span {
    width: 12px;
    height: 12px;
    background: var(--text-primary);
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite both;
}

.loader-dots span:nth-child(1) { animation-delay: -0.32s; }
.loader-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* === LOGIN-BEREICH === */
.login-container {
    width: 100%;
    max-width: 420px;
    transition: all 0.6s ease-out;
}

.login-container.fade-in {
    opacity: 1 !important;
    animation: loginSlideIn 0.8s ease-out;
}

@keyframes loginSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    padding: 3rem;
    text-align: center;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0px;
    background: var(--primary-gradient);
}

.logo-section {
    margin-bottom: 2.5rem;
}

.logo-section h1 {
    font-size: 2.8rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.logo-section p {
    color: #718096;
    font-size: 1rem;
    font-weight: 500;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafafa;
    position: relative;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 
        0 0 0 4px rgba(102, 126, 234, 0.1),
        0 4px 12px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 2rem;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.checkbox-group label {
    margin: 0;
    font-weight: 500;
    color: #6b7280;
    font-size: 0.9rem;
    cursor: pointer;
}

.login-btn {
    width: 100%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 24px rgba(102, 126, 234, 0.3),
        0 6px 12px rgba(102, 126, 234, 0.2);
}

.login-btn:active:not(:disabled) {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
    transform: none;
}

.login-btn.loading {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
}

.login-btn.success {
    background: var(--success-gradient);
}

.btn-loader {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.btn-loader span {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: btnDotPulse 1.4s ease-in-out infinite both;
}

.btn-loader span:nth-child(1) { animation-delay: -0.32s; }
.btn-loader span:nth-child(2) { animation-delay: -0.16s; }

@keyframes btnDotPulse {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.error-message {
    background: linear-gradient(135deg, #fef2f2 0%, #fdf2f8 100%);
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.error-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--danger-gradient);
}

.error-message.shake {
    animation: shake 0.6s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 480px) {
    body {
        padding: 1rem;
    }
    
    .welcome-title {
        font-size: 3rem;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
    }
    
    .logo-section h1 {
        font-size: 2.2rem;
    }
}

/* === DARK MODE SUPPORT === */
@media (prefers-color-scheme: dark) {
    .login-card {
        background: rgba(31, 41, 55, 0.95);
        color: #f9fafb;
        border: 1px solid rgba(75, 85, 99, 0.3);
    }
    
    .logo-section h1 {
        color: #f9fafb;
    }
    
    .logo-section p {
        color: #9ca3af;
    }
    
    label {
        color: #d1d5db;
    }
    
    input[type="text"],
    input[type="password"] {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    input[type="text"]:focus,
    input[type="password"]:focus {
        background: #374151;
        border-color: #667eea;
    }
    
    .checkbox-group label {
        color: #9ca3af;
    }
    
    .error-message {
        background: linear-gradient(135deg, #7f1d1d 0%, #7c2d12 100%);
        color: #fca5a5;
        border-color: #991b1b;
    }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .welcome-screen {
        transition: opacity 0.3s ease;
    }
}