/* استایل‌های مربوط به فرم همکاری AJAX */

.ajax-messages {
    min-height: 60px;
}

.ajax-messages .alert {
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
    border: 1px solid transparent;
    animation: fadeIn 0.3s ease-in;
}

.ajax-messages .alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.ajax-messages .alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.ajax-messages .alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.ajax-messages .alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* استایل دکمه در حال ارسال */
button.submitting {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

button.submitting::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* استایل خطاهای فیلد */
.is-invalid {
    border-color: #dc3545 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}

/* استایل کپچا */
.captcha-wrapper {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    margin-bottom: 20px;
}

.captcha-img img {
    border-radius: 4px;
    border: 1px solid #ced4da;
    margin-bottom: 10px;
    max-width: 100%;
    height: auto;
}

.captcha-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-field input {
    flex: 1;
    max-width: 200px;
}

.captcha-refresh-btn {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.captcha-refresh-btn:hover {
    background: #5a6268;
}

/* اسپینر بوت‌استرپ */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

/* هایلایت فرم هنگام اسکرول */
.form-highlight {
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.5);
    transition: box-shadow 0.3s ease;
}

/* رسپانسیو */
@media (max-width: 768px) {
    .captcha-field {
        flex-direction: column;
        align-items: stretch;
    }
    
    .captcha-field input {
        max-width: 100%;
        margin-bottom: 10px;
    }
    
    .captcha-refresh-btn {
        align-self: flex-start;
    }
}