/**
 * Login Specific CSS
 * Path: assets/css/login.css
 */

/* Login Container Styles */
.login-container {
    background: linear-gradient(135deg, rgba(244, 199, 83, 0.1) 0%, rgba(255, 255, 255, 1) 50%, rgba(208, 208, 208, 0.2) 100%);
}

/* Form Animations */
.animate-on-load {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-load.animate-slide-up {
    opacity: 1;
    transform: translateY(0);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.animate-slide-up {
    animation: slideUp 0.6s ease forwards;
}

.animate-slideDown {
    animation: slideDown 0.4s ease forwards;
}

.animate-shake {
    animation: shake 0.6s ease forwards;
}

/* Enhanced Input Focus States */
.input-focus {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-focus:focus-within {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Custom Input Field Styles */
.input-field {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    color: #000000;
    border: 1px solid rgba(208, 208, 208, 0.5);
}

.input-field:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: #f4c753 !important;
    box-shadow: 0 0 0 3px rgba(244, 199, 83, 0.1) !important;
    outline: none !important;
}

.input-field::placeholder {
    color: rgba(208, 208, 208, 0.8);
}

/* Dark mode input adjustments */
.dark .input-field {
    background: rgba(31, 41, 55, 0.9);
    color: #ffffff;
    border-color: rgba(75, 85, 99, 0.5);
}

.dark .input-field:focus {
    background: rgba(31, 41, 55, 0.95);
    border-color: #f4c753 !important;
    box-shadow: 0 0 0 3px rgba(244, 199, 83, 0.2) !important;
}

/* Input Icons */
.input-icon {
    pointer-events: none;
    z-index: 10;
    transition: color 0.2s ease;
}

.input-focus:focus-within .input-icon i {
    color: #f4c753;
}

/* Password Toggle Button */
.password-toggle {
    transition: all 0.2s ease;
    z-index: 20;
}

.password-toggle:hover {
    color: #f4c753;
    transform: scale(1.1);
}

/* Login Button Enhanced Styles */
.login-button {
    background: linear-gradient(135deg, #f4c753 0%, #e6b347 100%);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

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

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

.login-button:hover {
    background: linear-gradient(135deg, #e6b347 0%, #d9a441 100%);
    transform: translateY(-1px);
    box-shadow: 0 10px 25px -5px rgba(244, 199, 83, 0.4);
}

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

/* Loading State */
.login-button.loading {
    pointer-events: none;
    opacity: 0.8;
}

.loading-icon {
    animation: spin 1s linear infinite;
}

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

/* Error Message Styles */
.error-message {
    animation: slideInDown 0.3s ease-out;
    border-left: 4px solid #ef4444;
}

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

/* Field Validation Styles */
.field-error {
    animation: slideInDown 0.3s ease-out;
    background: transparent !important;
}

.field-success {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Form Shake Animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
    20%, 40%, 60%, 80% { transform: translateX(3px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Checkbox Styling */
input[type="checkbox"] {
    accent-color: #f4c753;
    transition: all 0.2s ease;
}

input[type="checkbox"]:focus {
    box-shadow: 0 0 0 2px rgba(244, 199, 83, 0.3);
    outline: none;
}

/* Link Hover Effects */
.login-link {
    position: relative;
    transition: color 0.2s ease;
}

.login-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #f4c753;
    transition: width 0.3s ease;
}

.login-link:hover::after {
    width: 100%;
}

/* Branding Animation */
.branding-pattern {
    animation-play-state: running;
}

.branding-pattern.paused {
    animation-play-state: paused;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .input-field {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .login-container {
        padding: 1rem;
    }
    
    .input-focus:focus-within {
        transform: none; /* Reduce animations on mobile */
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .input-field {
        border-width: 2px;
    }
    
    .input-field:focus {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .animate-on-load,
    .input-focus,
    .login-button,
    .branding-pattern * {
        animation: none !important;
        transition: none !important;
    }
}

/* Print styles */
@media print {
    .branding-pattern,
    .login-button,
    .password-toggle {
        display: none !important;
    }
}

/* Focus trap for accessibility */
.login-form:focus-within {
    outline: 2px solid #f4c753;
    outline-offset: 4px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}