:root {
    --primary-color: #FF000D;
    --secondary-color: #121212;
    --light-gray: #f8f9fa;
    --medium-gray: #6c757d;
    --dark-gray: #495057;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2c2c2c 50%, #1a1a1a 100%);
}

/* Background and Overlay */
.login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 0, 13, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 0, 13, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(255, 0, 13, 0.08) 0%, transparent 50%),
        linear-gradient(135deg, var(--secondary-color) 0%, #2c2c2c 50%, #1a1a1a 100%);
    z-index: -2;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
}

/* Particles Background */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
}

#particles::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 0, 13, 0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255, 0, 13, 0.1), transparent),
        radial-gradient(2px 2px at 160px 30px, rgba(255, 255, 255, 0.1), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: particleFloat 20s linear infinite;
}

@keyframes particleFloat {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-200px, -100px); }
}

/* Login Container */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Login Card */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    animation: cardSlideUp 0.8s ease-out;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #ff3345, var(--primary-color));
    background-size: 200% 100%;
    animation: gradientShift 3s ease-in-out infinite;
}

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

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

/* Logo and Header */
.login-header {
    margin-bottom: 2rem;
}

.logo-container {
    position: relative;
    display: inline-block;
}

.logo-icon {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--primary-color), #ff3345);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: logoGlow 2s ease-in-out infinite alternate;
}

@keyframes logoGlow {
    from {
        filter: drop-shadow(0 0 10px rgba(255, 0, 13, 0.3));
    }
    to {
        filter: drop-shadow(0 0 20px rgba(255, 0, 13, 0.6));
    }
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--medium-gray);
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0;
}

/* Form Styles */
.form-label {
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-control {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background-color: rgba(248, 249, 250, 0.5);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(255, 0, 13, 0.15);
    background-color: white;
}

.form-control.is-invalid {
    border-color: var(--danger-color);
}

.form-control.is-valid {
    border-color: var(--success-color);
}

/* Password Input Container */
.password-input-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--medium-gray);
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--primary-color);
}

/* Remember Me Checkbox */
.form-check-input {
    border-radius: 4px;
    border: 2px solid #dee2e6;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    font-size: 0.9rem;
    color: var(--dark-gray);
}

/* Login Button */
.login-btn {
    background: linear-gradient(135deg, var(--primary-color), #ff3345);
    border: none;
    border-radius: 10px;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-btn::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;
}

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

.login-btn:hover {
    background: linear-gradient(135deg, #e6000c, #ff2a3c);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 0, 13, 0.3);
}

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

/* Forgot Password Link */
.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.forgot-password:hover {
    color: #e6000c;
    text-decoration: underline;
}

/* Security Notice */
.security-notice {
    padding: 1rem;
    background: rgba(40, 167, 69, 0.2);
    border-radius: 8px;
    border-left: 4px solid var(--success-color);
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.security-notice .text-muted {
    color: #155724 !important;
    font-weight: 600;
    font-size: 0.95rem;
}

.security-notice i {
    color: var(--success-color);
    font-size: 1.2rem;
}

/* Footer */
.login-footer {
    margin-top: 2rem;
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: white;
    text-decoration: underline;
}

/* Alert Styles */
.alert {
    border-radius: 10px;
    border: none;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

.alert-info {
    background-color: rgba(13, 202, 240, 0.1);
    color: #055160;
    border-left: 3px solid #0dcaf0;
}

/* Modal Styles */
.modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.modal-title {
    color: var(--secondary-color);
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

/* Success Modal */
.success-icon i {
    font-size: 3rem;
}

/* Responsive Design */
@media (max-width: 576px) {
    .login-container {
        padding: 1rem;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
        margin: 1rem 0;
    }
    
    .logo-icon {
        font-size: 3rem;
    }
    
    .brand-name {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .login-card {
        margin: 1rem;
    }
}

/* Loading Animation */
.btn-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Form Validation */
.invalid-feedback {
    display: block;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

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

/* High contrast mode */
@media (prefers-contrast: high) {
    .login-card {
        background: white;
        border: 2px solid var(--secondary-color);
    }
    
    .form-control {
        border-width: 2px;
    }
}

/* Dark mode preference */
@media (prefers-color-scheme: dark) {
    .login-card {
        background: rgba(33, 37, 41, 0.95);
        color: white;
    }
    
    .brand-name,
    .form-label {
        color: white;
    }
    
    .login-subtitle {
        color: #adb5bd;
    }
    
    .form-control {
        background-color: rgba(52, 58, 64, 0.5);
        border-color: #495057;
        color: white;
    }
    
    .form-control:focus {
        background-color: #495057;
    }
}