/* Login Page Specific Styles */

body {
    margin: 0;
    padding: 0;
    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;
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 300% 100%;
    animation: gradient 3s ease infinite;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
    position: relative;
}

.login-header .logo {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 40px;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    position: relative;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.login-header h1 {
    color: #2c3e50;
    font-size: 28px;
    margin: 0 0 8px 0;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.login-header .subtitle {
    color: #7f8c8d;
    font-size: 14px;
    margin: 0;
    font-weight: 400;
}

.login-tabs {
    display: flex;
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
    padding: 4px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.tab-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 8px;
}

.tab-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.tab-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.login-form {
    margin-top: 25px;
}

.login-form .form-group {
    margin-bottom: 22px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #bdc3c7;
    font-size: 16px;
    transition: color 0.3s;
}

.input-with-icon input {
    width: 100%;
    padding: 14px 20px 14px 50px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
    background: #fafafa;
}

.input-with-icon input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.input-with-icon input:focus + i,
.input-with-icon:focus-within i {
    color: #667eea;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 25px;
}

.remember-me label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #555;
    margin: 0;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.btn-login::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;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-login i {
    font-size: 14px;
    transition: transform 0.3s;
}

.btn-login:hover i {
    transform: translateX(3px);
}

.login-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #7f8c8d;
    font-size: 13px;
}

.login-footer p {
    margin: 0;
}

.login-footer strong {
    color: #667eea;
    font-weight: 600;
}

/* Alert box */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* Loading spinner inside button */
.btn-login .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 25px;
        border-radius: 15px;
    }
    
    .login-header .logo {
        width: 75px;
        height: 75px;
        font-size: 36px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    .tab-btn {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .input-with-icon input {
        padding: 12px 15px 12px 45px;
        font-size: 14px;
    }
    
    .btn-login {
        padding: 14px;
        font-size: 15px;
    }
}

/* Dark background pattern */
.login-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .login-header .logo {
        animation: none;
    }
    
    .btn-login::before {
        animation: none;
    }
    
    .alert {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .input-with-icon input {
        border-width: 3px;
    }
    
    .btn-login {
        border: 2px solid white;
    }
}

/* Focus styles */
.tab-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.input-with-icon input:focus {
    outline: none;
}

.btn-login:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Error state */
.input-with-icon.error input {
    border-color: #dc2626;
    background: #fef2f2;
}

.input-with-icon.success input {
    border-color: #16a34a;
    background: #f0fdf4;
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #bdc3c7;
    cursor: pointer;
    padding: 0;
    font-size: 16px;
}

.password-toggle:hover {
    color: #667eea;
}

/* Forgot password link */
.forgot-link {
    display: block;
    text-align: right;
    margin-top: 8px;
    font-size: 13px;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* Social login divider */
.divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: #7f8c8d;
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e8e8e8;
}

.divider span {
    padding: 0 15px;
}

/* Social buttons */
.social-login {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.social-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.social-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
}

.social-btn i {
    font-size: 18px;
}

/* Sign up link */
.signup-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #7f8c8d;
}

.signup-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.signup-link a:hover {
    text-decoration: underline;
}

/* Two-factor authentication */
.two-factor-section {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.two-factor-section.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.otp-input {
    width: 50px;
    height: 50px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    transition: all 0.3s;
}

.otp-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    outline: none;
}

/* Biometric login button */
.biometric-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.biometric-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(17, 153, 142, 0.4);
}

.biometric-btn i {
    font-size: 20px;
}

/* Session warning */
.session-warning {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: none;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.session-warning .btn {
    margin-left: 15px;
    padding: 6px 15px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.session-warning .btn-primary {
    background: #667eea;
    color: white;
}

.session-warning .btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Captcha */
.captcha-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.captcha-box {
    flex: 1;
    height: 50px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 8px;
    color: #2c3e50;
    user-select: none;
}

.captcha-refresh {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 20px;
    padding: 5px;
}

.captcha-refresh:hover {
    transform: rotate(180deg);
    transition: transform 0.3s;
}

/* Terms and conditions */
.terms-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #666;
}

.terms-check input {
    margin-top: 3px;
    accent-color: #667eea;
}

.terms-check a {
    color: #667eea;
    text-decoration: none;
}

.terms-check a:hover {
    text-decoration: underline;
}

/* Progress indicator */
.login-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

/* Tooltip */
.tooltip-custom {
    position: relative;
    display: inline-block;
}

.tooltip-custom::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    margin-bottom: 5px;
}

.tooltip-custom:hover::after {
    opacity: 1;
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .login-card {
        padding: 25px 20px;
        border-radius: 15px;
    }
    
    .social-login {
        flex-direction: column;
    }
    
    .otp-inputs {
        gap: 5px;
    }
    
    .otp-input {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

/* Landscape mode on mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .login-container {
        padding: 10px;
    }
    
    .login-card {
        padding: 20px;
    }
    
    .login-header .logo {
        width: 60px;
        height: 60px;
        font-size: 28px;
        margin-bottom: 10px;
    }
    
    .login-header h1 {
        font-size: 22px;
        margin-bottom: 5px;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    .login-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Animation delays for staggered effects */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* Glow effect on focus */
.glow-focus:focus {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

/* Shake animation for errors */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Success checkmark animation */
.success-checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #27ae60;
    display: block;
    margin: 20px auto;
    position: relative;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.success-checkmark::after {
    content: '';
    position: absolute;
    left: 28px;
    top: 16px;
    width: 15px;
    height: 30px;
    border: solid white;
    border-width: 0 4px 4px 0;
    transform: rotate(45deg);
    animation: drawCheck 0.3s ease 0.2s forwards;
    opacity: 0;
}

@keyframes drawCheck {
    to {
        opacity: 1;
    }
}