/* Enhanced spam protection styles */

/* Honeypot field - multiple techniques to hide from users but not bots */
input[name="website"] {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    z-index: -1 !important;
    line-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
}

/* Additional protection for parent container */
div[aria-hidden="true"] {
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    height: 1px !important;
    overflow: hidden !important;
    position: absolute !important;
    white-space: nowrap !important;
    width: 1px !important;
}

/* Enhanced captcha styles */
#captchaQuestion {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

/* Refresh button animation */
#refreshCaptcha {
    transition: transform 0.5s ease, background-color 0.3s ease;
}

#refreshCaptcha:hover {
    background-color: #4d001f !important;
}

#refreshCaptcha:active {
    transform: scale(0.95);
}

/* Success state for captcha input */
#captcha.valid {
    border-color: #28a745 !important;
    background-color: #f0fff4 !important;
}

/* Error state for captcha input */
#captcha.invalid {
    border-color: #dc3545 !important;
    background-color: #fff5f5 !important;
}

/* Disable text selection on submit button when disabled */
input[type="submit"]:disabled {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Additional security through CSS */
.cc-m-form::before {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Rate limit warning styles */
.rate-limit-warning {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: none;
}

.rate-limit-warning.show {
    display: block;
    animation: slideDown 0.3s ease;
}

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

/* Loading state for form submission */
.form-loading {
    position: relative;
    pointer-events: none;
}

.form-loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    #refreshCaptcha,
    .rate-limit-warning {
        animation: none;
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    #captchaQuestion {
        border: 2px solid currentColor;
    }
    
    #captcha.valid {
        outline: 3px solid #28a745;
    }
    
    #captcha.invalid {
        outline: 3px solid #dc3545;
    }
}