/* ABD Captcha Styles */
/* Enhanced styles for number-based captcha */
.abd-captcha-options.number-options .option-text {
    font-weight: 600;
    font-size: 16px;
    color: #007cba;
}

.abd-captcha-options.name-options .option-text {
    font-weight: 500;
    font-size: 14px;
}
.abd-captcha-container {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.abd-captcha-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
}

.abd-captcha-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.abd-captcha-icon {
    font-size: 18px;
}

[type=button].abd-captcha-refresh {
    padding: 6px 8px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border-color: green;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.abd-captcha-refresh:hover {
    background: #218838;
    transform: rotate(180deg);
}

.abd-captcha-question {
    margin-bottom: 15px;
}

.question-text {
    font-size: 15px;
    font-weight: 500;
    color: #343a40;
    margin: 0;
    line-height: 1.5;
}

.abd-captcha-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.captcha-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.captcha-option:hover {
    border-color: #28a745;
    background: #f8fff9;
}

.captcha-option input[type="radio"] {
    margin: 0;
    accent-color: #28a745;
}

.captcha-option input[type="radio"]:checked + .option-text {
    font-weight: 600;
    color: #28a745;
}

.option-text {
    font-size: 14px;
    color: #495057;
    flex: 1;
}

.abd-captcha-footer {
    text-align: center;
}

.captcha-help {
    color: #6c757d;
    font-size: 12px;
    font-style: italic;
}

/* Loading state */
.abd-captcha-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

.abd-captcha-container.loading .abd-captcha-refresh {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Error and success message styles */
.abd-captcha-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    border: 1px solid #f5c6cb;
    font-size: 14px;
}

.abd-captcha-success-message {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    border: 1px solid #c3e6cb;
    font-size: 14px;
}

/* Captcha container states */
.abd-captcha-container.error {
    border-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da, #ffffff);
}

.abd-captcha-container.success {
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda, #ffffff);
}

.abd-captcha-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Selected option state */
.captcha-option.selected {
    border-color: #28a745;
    background: #f8fff9;
}

.captcha-option.selected .option-text {
    font-weight: 600;
    color: #28a745;
}

/* UsersWP Integration - Better positioning */
.uwp-captcha-wrapper,
.uwp-captcha-before-form,
.uwp-captcha-before-login,
.uwp-captcha-field {
    margin: 15px 0 20px 0;
    clear: both;
}

.uwp-captcha-field .uwp-form-field,
.uwp-captcha-wrapper .uwp-form-field {
    width: 100%;
}

.uwp-captcha-field label {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: block;
}

/* Make sure captcha appears before submit button */
.uwp-registration-form .uwp-captcha-wrapper,
.uwp-registration-form .uwp-captcha-field {
    order: 999; /* High order but not higher than submit button */
}

.uwp-registration-form .uwp-submit-wrap {
    order: 1000; /* Ensure submit is last */
}









/* Theme variations */
.abd-captcha-container.theme-algeria {
    border-color: #008000;
    background: linear-gradient(135deg, #f0f8f0, #ffffff);
}

.abd-captcha-container.theme-algeria .abd-captcha-title {
    color: #008000;
}

.abd-captcha-container.theme-algeria .abd-captcha-refresh {
    background: #008000;
}

.abd-captcha-container.theme-algeria .captcha-option:hover {
    border-color: #008000;
    background: #f0f8f0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .abd-captcha-container {
        padding: 15px;
        margin: 15px 0;
    }
    
    .abd-captcha-options {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .captcha-option {
        padding: 12px;
    }
    
    .question-text {
        font-size: 14px;
    }
}

/* Integration with ABD forms */
.abd-form .abd-captcha-container {
    margin-top: 25px;
    margin-bottom: 25px;
}

.abd-form-actions .abd-captcha-container {
    margin-bottom: 20px;
}

/* Accessibility improvements */
.captcha-option:focus-within {
    outline: 2px solid #28a745;
    outline-offset: 2px;
}

.abd-captcha-container input[type="radio"]:focus {
    outline: none;
}

/* Animation for new questions */
.abd-captcha-question.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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