/**
 * Authentication Styles - Flat Design
 * assets/css/auth.css
 */

/* Auth Page Layout */
.auth-page {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, 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;
}

/* Header controls - Top right corner */
.auth-header-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 15px;
    z-index: 1000;
}

.language-switcher {
    display: flex;
    gap: 5px;
}

.language-option {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.language-option:hover,
.language-option.active {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Main login container */
.login-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 100%;
    max-width: 400px;
    position: relative;
    animation: slideUp 0.6s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    background: linear-gradient(135deg, #4FC3F7 0%, #29B6F6 100%);
    color: white;
    padding: 40px 30px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.login-logo {
    font-size: 32px;
    font-weight: 300;
    margin-bottom: 10px;
    position: relative;
    z-index: 2;
}

.login-subtitle {
    font-size: 16px;
    opacity: 0.9;
    font-weight: 300;
    position: relative;
    z-index: 2;
}

/* Form styles */
.login-form {
    padding: 40px 30px;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-input {
    width: 100%;
    padding: 15px 20px;
    padding-right: 50px; /* Space for icon */
    border: 2px solid #E1E5E9;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #F8F9FA;
    outline: none;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: #4FC3F7;
    background: white;
    box-shadow: 0 0 0 4px rgba(79, 195, 247, 0.1);
    transform: translateY(-2px);
}

.form-input.error {
    border-color: #EF4444;
    background: #FEF2F2;
}

.form-input.error:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-input::placeholder {
    color: #9CA3AF;
    font-weight: 300;
}

/* Input icons */
.input-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    z-index: 2;
}

.form-input:focus + .input-icon {
    color: #4FC3F7;
}

.password-toggle:hover {
    color: #4FC3F7;
    transform: translateY(-50%) scale(1.1);
}

/* Error messages */
.error-message {
    color: #EF4444;
    font-size: 14px;
    margin-top: 5px;
    margin-left: 5px;
    animation: slideIn 0.3s ease;
}

/* Remember me checkbox */
.remember-group {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #E1E5E9;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    cursor: pointer;
    background: #F8F9FA;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-custom:hover {
    border-color: #4FC3F7;
    transform: scale(1.05);
}

.checkbox-custom.checked {
    background: #4FC3F7;
    border-color: #4FC3F7;
}

.checkbox-custom.checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.checkbox-label {
    font-size: 14px;
    color: #6B7280;
    cursor: pointer;
    user-select: none;
    flex: 1;
}

/* Login button */
.login-btn {
    width: 100%;
    background: linear-gradient(135deg, #4FC3F7 0%, #29B6F6 100%);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79, 195, 247, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.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;
}

.login-btn:hover::before {
    left: 100%;
}

.btn-loading {
    display: none;
    align-items: center;
    gap: 8px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer links */
.login-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #E1E5E9;
}

.footer-link {
    color: #4FC3F7;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-link:hover {
    color: #29B6F6;
    transform: translateY(-1px);
}

.footer-links {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    gap: 10px;
}

/* Flash messages */
.flash-message {
    margin: 0 30px 20px;
    padding: 15px;
    border-radius: 12px;
    font-size: 14px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid;
}

.flash-error {
    background: #FEE2E2;
    color: #DC2626;
    border-left-color: #DC2626;
}

.flash-success {
    background: #D1FAE5;
    color: #059669;
    border-left-color: #059669;
}

.flash-info {
    background: #DBEAFE;
    color: #1D4ED8;
    border-left-color: #1D4ED8;
}

.flash-warning {
    background: #FEF3C7;
    color: #D97706;
    border-left-color: #D97706;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form submission state */
.submitting {
    pointer-events: none;
    opacity: 0.8;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .auth-page {
        padding: 15px;
    }

    .login-container {
        max-width: 100%;
        border-radius: 15px;
    }

    .login-header {
        padding: 30px 20px 20px;
    }

    .login-form {
        padding: 30px 20px;
    }

    .auth-header-controls {
        top: 15px;
        right: 15px;
        gap: 10px;
    }

    .language-option,
    .theme-toggle {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 35px;
    }

    .footer-links {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .form-input {
        padding: 12px 15px;
        padding-right: 45px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Dark theme support */
.theme-dark.auth-page {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.theme-dark .login-container {
    background: #1f2937;
    color: #f9fafb;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.theme-dark .form-input {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

.theme-dark .form-input:focus {
    background: #4b5563;
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.1);
}

.theme-dark .form-input.error {
    background: #7f1d1d;
    border-color: #dc2626;
}

.theme-dark .form-input::placeholder {
    color: #9ca3af;
}

.theme-dark .checkbox-custom {
    background: #374151;
    border-color: #4b5563;
}

.theme-dark .checkbox-custom.checked {
    background: #60a5fa;
    border-color: #60a5fa;
}

.theme-dark .checkbox-label {
    color: #d1d5db;
}

.theme-dark .footer-link {
    color: #60a5fa;
}

.theme-dark .footer-link:hover {
    color: #93c5fd;
}

.theme-dark .login-footer {
    border-top-color: #4b5563;
}

.theme-dark .flash-error {
    background: #7f1d1d;
    color: #fca5a5;
}

.theme-dark .flash-success {
    background: #064e3b;
    color: #6ee7b7;
}

.theme-dark .flash-info {
    background: #1e3a8a;
    color: #93c5fd;
}

.theme-dark .flash-warning {
    background: #92400e;
    color: #fcd34d;
}

.theme-dark .input-icon {
    color: #9ca3af;
}

.theme-dark .form-input:focus + .input-icon {
    color: #60a5fa;
}