/* ====== ENHANCED FORM FEEDBACK STYLES ====== */
/* Separate CSS-Datei: enhanced-form.css */

/* Real-time field validation styles */
.field-success {
    border: 2px solid #48bb78 !important;
    background: rgba(72, 187, 120, 0.05) !important;
    box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.1) !important;
}

.field-error {
    border: 2px solid #f56565 !important;
    background: rgba(245, 101, 101, 0.05) !important;
    box-shadow: 0 0 0 3px rgba(245, 101, 101, 0.1) !important;
    animation: shakeField 0.5s ease-in-out;
}

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

/* Field feedback messages */
.field-feedback {
    font-size: 13px;
    margin-top: 5px;
    padding: 5px 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    role: alert;
    aria-live: polite;
}

.feedback-success {
    background: rgba(72, 187, 120, 0.1);
    color: #38a169;
    border: 1px solid rgba(72, 187, 120, 0.2);
}

.feedback-error {
    background: rgba(245, 101, 101, 0.1);
    color: #e53e3e;
    border: 1px solid rgba(245, 101, 101, 0.2);
    role: alert;
    aria-live: assertive;
}

/* Progress message */
.progress-message {
    background: linear-gradient(90deg, #3182ce, #4299e1);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.progress-message::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Enhanced button loading state */
.submit-btn.loading {
    background: linear-gradient(45deg, #666, #777) !important;
    cursor: not-allowed;
    transform: none !important;
    position: relative;
    overflow: hidden;
}

.submit-btn.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: loading-shimmer 2s infinite;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Enhanced success message - Override existing */
.success-message {
    background: linear-gradient(135deg, #48bb78, #38a169) !important;
    color: white !important;
    padding: 20px !important;
    border-radius: 12px !important;
    margin-bottom: 15px !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(72, 187, 120, 0.3) !important;
    animation: successPulse 0.6s ease-out !important;
}

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

/* Enhanced error message - Override existing */
.error-message {
    background: linear-gradient(135deg, #f56565, #e53e3e) !important;
    color: white !important;
    padding: 20px !important;
    border-radius: 12px !important;
    margin-bottom: 15px !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(245, 101, 101, 0.3) !important;
    animation: errorShake 0.6s ease-out !important;
    line-height: 1.4 !important;
}

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

/* Enhanced timer display - Override existing */
.timer-display {
    background: linear-gradient(135deg, #ed8936, #dd6b20) !important;
    color: white !important;
    padding: 15px !important;
    border-radius: 12px !important;
    margin-bottom: 15px !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(237, 137, 54, 0.3) !important;
    text-align: center !important;
    font-weight: bold !important;
    animation: timerPulse 2s infinite !important;
}

@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Enhanced math captcha - Override existing */
.math-captcha {
    background: rgba(255,255,255,0.15) !important;
    padding: 20px !important;
    border-radius: 12px !important;
    border: 2px solid rgba(255,255,255,0.2) !important;
    margin-bottom: 1rem !important;
    backdrop-filter: blur(10px) !important;
    transition: all 0.3s ease !important;
}

.math-captcha:hover {
    border-color: rgba(232, 184, 109, 0.5) !important;
    background: rgba(255,255,255,0.2) !important;
}

.math-captcha label {
    color: #e8b86d !important;
    font-weight: bold !important;
    font-size: 16px !important;
    margin-bottom: 10px !important;
    display: block !important;
}

#mathQuestion {
    background: rgba(232, 184, 109, 0.2);
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 18px;
    color: #e8b86d;
    border: 1px solid rgba(232, 184, 109, 0.3);
    display: inline-block;
    margin: 0 5px;
}

#mathAnswer {
    margin-top: 10px;
    transition: all 0.3s ease;
}

#mathAnswer:focus {
    outline: none;
    border-color: #e8b86d !important;
    box-shadow: 0 0 0 3px rgba(232, 184, 109, 0.2) !important;
}

/* Enhanced rate limit info - Override existing */
.rate-limit-info {
    background: linear-gradient(135deg, rgba(232, 184, 109, 0.1), rgba(218, 165, 71, 0.1)) !important;
    color: #e8b86d !important;
    padding: 15px !important;
    border-radius: 12px !important;
    margin-bottom: 15px !important;
    font-size: 14px !important;
    border: 2px solid rgba(232, 184, 109, 0.2) !important;
    backdrop-filter: blur(5px) !important;
    position: relative !important;
    overflow: hidden !important;
}

.rate-limit-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(232, 184, 109, 0.1), transparent);
    animation: info-shimmer 3s infinite;
}

@keyframes info-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Form field enhancements */
.form-group input:focus,
.form-group textarea:focus {
    outline: none !important;
    border: 2px solid #e8b86d !important;
    box-shadow: 0 0 0 3px rgba(232, 184, 109, 0.2) !important;
    transform: translateY(-1px) !important;
}

/* Disabled state enhancements - Override existing */
.submit-btn:disabled {
    background: linear-gradient(45deg, #666, #777) !important;
    cursor: not-allowed !important;
    transform: none !important;
    opacity: 0.7 !important;
    box-shadow: none !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .field-success {
        border-color: #000 !important;
        background: #e6ffe6 !important;
    }
    
    .field-error {
        border-color: #000 !important;
        background: #ffe6e6 !important;
    }
    
    .feedback-success {
        background: #e6ffe6;
        color: #000;
        border-color: #000;
    }
    
    .feedback-error {
        background: #ffe6e6;
        color: #000;
        border-color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .field-feedback,
    .success-message,
    .error-message,
    .progress-message,
    .submit-btn.loading::before {
        animation: none !important;
    }
    
    .field-error {
        animation: none !important;
    }
    
    .timer-display {
        animation: none !important;
    }
}

/* Mobile responsiveness for enhanced feedback elements */
@media (max-width: 768px) {
    .field-feedback {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .math-captcha {
        padding: 15px !important;
    }
    
    #mathQuestion {
        font-size: 16px;
        padding: 6px 10px;
    }
    
    .success-message,
    .error-message,
    .progress-message,
    .timer-display {
        padding: 15px !important;
        font-size: 14px !important;
    }
    
    .rate-limit-info {
        padding: 12px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 480px) {
    .field-feedback {
        font-size: 11px;
        margin-top: 3px;
    }
    
    .math-captcha {
        padding: 12px !important;
    }
    
    .math-captcha label {
        font-size: 14px !important;
    }
    
    #mathQuestion {
        font-size: 14px;
        padding: 5px 8px;
    }
    
    .success-message,
    .error-message,
    .progress-message,
    .timer-display {
        padding: 12px !important;
        font-size: 13px !important;
        border-radius: 8px !important;
    }
    
    .rate-limit-info {
        padding: 10px !important;
        font-size: 12px !important;
    }
}