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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
    color: #334155;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    /* Performance optimizations */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeSpeed;
}

/* Animated Background */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

/* Simplified Background Animation - Performance Optimized */
.simple-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Static Gradient Overlay */
.gradient-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 60% 10%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
    animation: gradientShift 20s ease-in-out infinite;
}

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

/* Floating Circles - Reduced quantity */
.floating-circles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.floating-circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    animation: simpleFloat 15s ease-in-out infinite;
    will-change: transform, opacity;
}

@keyframes simpleFloat {
    0%, 100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.3;
    }
    25% {
        transform: translateY(-20px) translateX(10px) scale(1.1);
        opacity: 0.5;
    }
    50% {
        transform: translateY(0) translateX(20px) scale(0.9);
        opacity: 0.4;
    }
    75% {
        transform: translateY(15px) translateX(-5px) scale(1.05);
        opacity: 0.6;
    }
}

.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 15s infinite ease-in-out;
}

/* Main Login Wrapper */
.login-wrapper {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
}

/* Brand Header */
.brand-header {
    text-align: center;
    margin-bottom: 32px;
}

.brand-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    margin: 0 auto 16px;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
    /* Simplified animation */
    animation: simplePulse 3s infinite ease-in-out;
}

@keyframes simplePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.brand-title {
    font-size: 28px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #1e293b, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-subtitle {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

/* Login Form Container */
.login-form-container {
    position: relative;
}

.form-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 24px;
    text-align: center;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 20px;
}

.flash-message {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-message {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #dc2626;
    border: 1px solid #fecaca;
}

.success-message {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* Form Styles */
.login-form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.form-label i {
    color: #6366f1;
    font-size: 16px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    background: white;
    transition: all 0.3s ease;
    position: relative;
}

.form-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.form-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.password-toggle:hover {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
    color: white;
}

.btn-merchant {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-merchant:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.6);
    color: white;
}

.login-btn {
    margin-bottom: 8px;
}

/* Ripple Effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    pointer-events: none;
    animation: ripple-animation 0.6s ease-out;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Divider */
.divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(135deg, transparent, #e2e8f0, transparent);
}

.divider span {
    background: white;
    padding: 0 16px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

/* Register Link */
.register-link {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.register-link p {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

.link-primary {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.link-primary:hover {
    color: #2563eb;
    text-decoration: none;
}

/* Focus Animations */
.form-group.focused .form-label {
    color: #6366f1;
}

.form-group.focused .form-label i {
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-wrapper {
        padding: 16px;
    }
    
    .login-container {
        padding: 32px 24px;
        border-radius: 16px;
    }
    
    .brand-icon {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }
    
    .brand-title {
        font-size: 24px;
    }
    
    .form-title {
        font-size: 20px;
    }
    
    .floating-shapes .shape {
        opacity: 0.05;
    }
    
    .shape-1, .shape-2 {
        width: 60px;
        height: 60px;
    }
    
    .shape-3, .shape-4, .shape-5 {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 24px 20px;
    }
    
    .brand-header {
        margin-bottom: 24px;
    }
    
    .brand-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .brand-title {
        font-size: 20px;
    }
    
    .brand-subtitle {
        font-size: 13px;
    }
    
    .form-title {
        font-size: 18px;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 13px;
    }
}

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

.form-group {
    animation: fadeInUp 0.6s ease-out;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.btn { animation: fadeInUp 0.6s ease-out 0.3s both; }
.divider { animation: fadeInUp 0.6s ease-out 0.4s both; }
.register-link { animation: fadeInUp 0.6s ease-out 0.5s both; }