/**
 * Two-Factor Authentication Login Styles
 * 
 * @package Engineers House WP ERP
 * @since 1.0.0
 */

/* Login Page 2FA Styles */
.login #afp-2fa-messages {
    margin: 20px 0;
}

.login #afp-2fa-messages .notice {
    margin: 0;
    padding: 12px;
    border-radius: 4px;
}

.login #afp-2fa-messages .notice-success {
    background: #d1e7dd;
    border-left: 4px solid #00a32a;
    color: #0f5132;
}

.login #afp-2fa-messages .notice-error {
    background: #f8d7da;
    border-left: 4px solid #d63638;
    color: #721c24;
}

/* 2FA Verification Form */
#afp-2fa-verify-form,
#afp-2fa-backup-form {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#afp-2fa-verify-form p,
#afp-2fa-backup-form p {
    margin: 15px 0;
}

#afp-2fa-verify-form label,
#afp-2fa-backup-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #1d2327;
}

#afp-2fa-code,
#afp-2fa-backup-code {
    width: 100%;
    padding: 15px;
    border: 2px solid #8c8f94;
    border-radius: 6px;
    font-size: 18px;
    text-align: center;
    letter-spacing: 3px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    transition: border-color 0.3s ease;
}

#afp-2fa-code:focus,
#afp-2fa-backup-code:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

#afp-2fa-backup-code {
    letter-spacing: 2px;
    font-size: 16px;
}

/* Submit Button */
.submit .button {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.submit .button:hover {
    background-color: #135e96;
}

/* Backup Code Link */
.afp-2fa-backup {
    text-align: center;
    margin: 20px 0;
}

.afp-2fa-backup a {
    color: #2271b1;
    text-decoration: none;
    font-size: 14px;
}

.afp-2fa-backup a:hover {
    color: #135e96;
    text-decoration: underline;
}

/* Form Transitions */
#afp-2fa-verify-form,
#afp-2fa-backup-form {
    transition: opacity 0.3s ease;
}

#afp-2fa-backup-form {
    opacity: 0;
    display: none;
}

#afp-2fa-backup-form.show {
    opacity: 1;
    display: block;
}

/* Loading State */
.afp-2fa-loading {
    opacity: 0.6;
    pointer-events: none;
}

.afp-2fa-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success Animation */
.afp-2fa-success {
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Error Animation */
.afp-2fa-error {
    animation: errorShake 0.6s ease-in-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Responsive Design */
@media (max-width: 480px) {
    #afp-2fa-code,
    #afp-2fa-backup-code {
        font-size: 16px;
        padding: 12px;
    }
    
    .submit .button {
        padding: 12px;
        font-size: 14px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    #afp-2fa-verify-form,
    #afp-2fa-backup-form {
        background: #1e1e1e;
        color: #ffffff;
    }
    
    #afp-2fa-code,
    #afp-2fa-backup-code {
        background: #2d2d2d;
        border-color: #555;
        color: #ffffff;
    }
    
    #afp-2fa-code:focus,
    #afp-2fa-backup-code:focus {
        border-color: #4a9eff;
    }
    
    #afp-2fa-verify-form label,
    #afp-2fa-backup-form label {
        color: #ffffff;
    }
}
