/* =========================================
   CONTACT FORM SPECIFIC STYLES
   Works alongside unified-styles.css
   ========================================= */

/* Contact Form Container - Unique styling */
.contact-form-container {
    max-width: 650px;
    margin: 0 auto;
    padding: 2.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(21, 4, 56, 0.1);
    border-top: 3px solid #1A46F1;
}

/* Form labels use unified styles, but add required/optional indicators */
.required {
    color: #dc2626;
    font-weight: 700;
}

.optional {
    color: #64748b;
    font-weight: 400;
    font-size: 0.85rem;
}

/* Textarea specific height */
.form-group textarea {
    min-height: 160px;
    resize: vertical;
}

/* CAPTCHA Styling - Uses brand colors */
.captcha-container {
    background: linear-gradient(135deg, #f5f5f0 0%, #ffffff 100%);
    padding: 1.75rem;
    border-radius: 8px;
    margin-bottom: 1.75rem;
    border: 2px solid #cbd5e1;
    box-shadow: inset 0 2px 4px rgba(21, 4, 56, 0.05);
}

.captcha-question {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #150438;
    font-size: 1.05rem;
}

.captcha-input-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.captcha-input {
    flex: 0 0 auto;
    width: 120px;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
    background: white;
    transition: all 0.3s ease;
}

.captcha-input:focus {
    outline: none;
    border-color: #1A46F1;
    box-shadow: 0 0 0 3px rgba(26, 70, 241, 0.1);
}

.captcha-refresh {
    background: none;
    border: none;
    color: #1A46F1;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.captcha-refresh:hover {
    background: rgba(26, 70, 241, 0.1);
    color: #150438;
}

.captcha-refresh:active {
    transform: scale(0.95);
}

.captcha-error {
    margin-top: 0.75rem;
    color: #dc2626;
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
}

.captcha-error.show {
    display: block;
    animation: shake 0.5s;
}

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

/* Form Messages - Leverages unified-styles color scheme */
.form-message {
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    display: none;
    animation: slideDown 0.3s ease;
}

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

.form-message.show {
    display: block;
}

.form-message.success {
    background: #d1fae5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.form-message.error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Submit Button - Extends unified-styles button with loading state */
.submit-btn {
    width: 100%;
    /* Inherits styles from unified-styles.css button class */
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.submit-btn:hover::before {
    left: 100%;
}

.btn-loader {
    display: inline-block;
}

.btn-loader::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

/* Responsive Design - Contact Form Specific */
@media (max-width: 768px) {
    .contact-form-container {
        padding: 1.5rem;
        margin: 0 1rem;
    }

    .captcha-container {
        padding: 1.25rem;
    }

    .captcha-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .captcha-input {
        width: 100%;
    }

    .captcha-refresh {
        width: 100%;
        text-align: center;
    }
}

/* Accessibility - Respects user motion preferences */
@media (prefers-reduced-motion: reduce) {
    .form-message {
        animation: none;
    }

    .btn-loader::after {
        animation: none;
    }
    
    .submit-btn::before {
        transition: none;
    }
}