/**
 * Contact Form 7 Custom Styles
 * Matches FinBI Design
 */

/* Contact Form Wrapper */
.contact-form-wrapper .wpcf7 {
    width: 100%;
}

/* Form Fields */
.contact-form-wrapper .wpcf7-form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid #dee2e6;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    margin-bottom: -18px;
}

.contact-form-wrapper .wpcf7-form-control:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Textarea Height */
.contact-form-wrapper .h-115px {
    height: 115px !important;
    min-height: 115px;
}

/* Text Truncate Fix */
.contact-form-wrapper .text-truncate {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
}

/* Submit Button */
.contact-form-wrapper .wpcf7-submit {
    padding: 0.75rem 2rem;
    font-size: 1.125rem;
    font-weight: 700;
    text-transform: uppercase;
    background-color: var(--bs-secondary, #6c757d);
    border: none;
    border-radius: 0.375rem;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.contact-form-wrapper .wpcf7-submit:hover {
    background-color: #5c636a;
}

/* Success/Error Messages */
.contact-form-wrapper .wpcf7-response-output {
    margin: 2rem 0 1rem;
    padding: 1rem;
    border-radius: 0.375rem;
    text-align: center;
}

.contact-form-wrapper .wpcf7-mail-sent-ok {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

.contact-form-wrapper .wpcf7-mail-sent-ng,
.contact-form-wrapper .wpcf7-validation-errors {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

/* Validation Errors */
.contact-form-wrapper .wpcf7-not-valid-tip {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.contact-form-wrapper .wpcf7-not-valid {
    border-color: #dc3545 !important;
}

/* Spinner (Loading) */
.contact-form-wrapper .wpcf7-spinner {
    margin: 0 0.5rem;
}

/* RTL Support */
[dir="rtl"] .contact-form-wrapper .wpcf7-form-control {
    text-align: right;
}

/* Responsive Adjustments */
@media (max-width: 575.98px) {
    .contact-form-wrapper .wpcf7-submit {
        width: 100%;
    }
}

/* Remove Default CF7 Styles that Conflict */
.contact-form-wrapper .wpcf7 form .wpcf7-response-output {
    margin: 2em 0 1em;
}

.contact-form-wrapper .wpcf7 form.invalid .wpcf7-response-output,
.contact-form-wrapper .wpcf7 form.unaccepted .wpcf7-response-output {
    border-color: #dc3545;
}

.contact-form-wrapper .wpcf7 form.sent .wpcf7-response-output {
    border-color: #46b450;
}

/* ============================================
   NEWSLETTER FORM STYLES (Footer)
   ============================================ */

/* Newsletter Wrapper - Add app-newsletter class to CF7 form */
.newsletter-form-wrapper .wpcf7 {
    width: 100%;
}

.newsletter-form-wrapper .wpcf7-form {
    margin: 0;
    padding: 0;
}

/* Add app-newsletter styling to the form */
.newsletter-form-wrapper .wpcf7-form {
    /* This applies the app-newsletter context */
}


/* Newsletter Spinner */
.newsletter-form-wrapper .wpcf7-spinner {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

/* Remove any CF7 default margins/spacing */
.newsletter-form-wrapper .wpcf7-form p {
    margin: 0 !important;
}

.newsletter-form-wrapper .wpcf7 br {
    display: none;
}

/* Fix for wpcf7-form-control-wrap to not interfere */
.newsletter-form-wrapper .wpcf7-form-control-wrap {
    display: contents; /* This removes the wrapper from layout */
}

/* Ensure submit button styling is preserved */
.newsletter-form-wrapper .wpcf7-submit {
    font-weight: 700 !important;
}

/* RTL Support */
[dir="rtl"] .newsletter-form-wrapper .wpcf7-spinner {
    left: auto;
    right: 50%;
    transform: translate(50%, -50%);
}

/* Newsletter Input Placeholder - White Color */
.newsletter-form-wrapper .wpcf7-form-control::placeholder,
.newsletter-form-wrapper input::placeholder,
.newsletter-form-wrapper textarea::placeholder,
.app-newsletter input::placeholder,
.app-newsletter textarea::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
    opacity: 1 !important;
}

/* For older browsers */
.newsletter-form-wrapper .wpcf7-form-control::-webkit-input-placeholder,
.app-newsletter input::-webkit-input-placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
    opacity: 1 !important;
}

.newsletter-form-wrapper .wpcf7-form-control::-moz-placeholder,
.app-newsletter input::-moz-placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
    opacity: 1 !important;
}

.newsletter-form-wrapper .wpcf7-form-control:-ms-input-placeholder,
.app-newsletter input:-ms-input-placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
    opacity: 1 !important;
}

.newsletter-form-wrapper .wpcf7-form-control:-moz-placeholder,
.app-newsletter input:-moz-placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
    opacity: 1 !important;
}


.contact-form-wrapper .wpcf7-not-valid-tip {
  margin-top: 1.25rem !important;
}

