/* Appointment Form Styling
   Add these styles to your assets/css/main.css or create a separate stylesheet
   These styles enhance the appointment form with better error handling and reCAPTCHA styling
*/

/* Ajax Response Messages */
.ajax-response {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.ajax-response.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ajax-response.success::before {
    content: "✓ ";
    font-weight: bold;
    margin-right: 8px;
}

.ajax-response.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.ajax-response.error::before {
    content: "✗ ";
    font-weight: bold;
    margin-right: 8px;
}

/* Field-specific Error Styles */
.rs-contact-input-box.has-error .rs-contact-input input,
.rs-contact-input-box.has-error .rs-contact-input select,
.rs-contact-input-box.has-error .rs-contact-input textarea {
    border-color: #e74c3c !important;
    background-color: #fff5f5 !important;
}

.rs-contact-input-box.has-error .rs-contact-input i {
    color: #e74c3c !important;
}

.field-error {
    color: #e74c3c;
    font-size: 12px;
    display: block;
    margin-top: 5px;
    animation: slideDown 0.3s ease;
}

/* reCAPTCHA Widget Styling */
.g-recaptcha {
    margin: 15px 0;
    padding: 10px;
    border-radius: 4px;
    background-color: #f9f9f9;
}

/* Ensure reCAPTCHA fits properly in responsive layouts */
@media (max-width: 768px) {
    .g-recaptcha {
        margin: 10px 0;
        transform: scale(0.9);
        transform-origin: left;
        margin-bottom: -20px;
        padding-bottom: 20px;
    }
}

/* Submit Button States */
button[type="submit"]:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

button[type="submit"]:disabled::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Success State */
.rs-contact-form.form-success input,
.rs-contact-form.form-success select,
.rs-contact-form.form-success textarea {
    background-color: #f0f8f4;
    border-color: #27ae60 !important;
}

/* Loading State for Form Submit */
.rs-contact-form.form-loading {
    opacity: 0.8;
    pointer-events: none;
}

/* Input Focus Styles */
.rs-contact-input input:focus,
.rs-contact-input select:focus,
.rs-contact-input textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(171, 5, 45, 0.2);
}

/* Error State Focus */
.rs-contact-input-box.has-error input:focus,
.rs-contact-input-box.has-error select:focus,
.rs-contact-input-box.has-error textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2);
}

/* Responsive Message Styling */
@media (max-width: 576px) {
    .ajax-response {
        padding: 12px 15px;
        font-size: 14px;
        margin-bottom: 15px;
    }

    .field-error {
        font-size: 11px;
        margin-top: 3px;
    }

    .rs-contact-form .row {
        margin: 0;
    }

    .rs-contact-form .col-md-6 {
        margin-bottom: 15px;
    }
}

/* Additional Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .ajax-response,
    .field-error,
    button[type="submit"]:disabled::after {
        animation: none;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .ajax-response {
        border-color: rgba(255, 255, 255, 0.2);
    }

    .ajax-response.success {
        background-color: rgba(39, 174, 96, 0.2);
        color: #a8e6c1;
        border-color: #27ae60;
    }

    .ajax-response.error {
        background-color: rgba(231, 76, 60, 0.2);
        color: #ff8a80;
        border-color: #e74c3c;
    }

    .g-recaptcha {
        background-color: #2c2c2c;
    }
}

/* Print Styles */
@media print {
    .ajax-response,
    .field-error,
    .g-recaptcha {
        display: none;
    }
}
