/* --- Styles for the outer container (Remains the same) --- */
section.contact-information .contact-form-container {
    -webkit-box-flex: 1;
    -moz-box-flex: 1;
    box-flex: 1;
    -webkit-flex: 1;
    -moz-flex: 1;
    -ms-flex: 1;
    flex: 1;
    /* NOTE: Update the image path to use get_template_directory_uri() in WP if needed */
    background-image: url(../img/contact/contact-bg.jpg); 
    background-size: cover;
    background-position: center;
    height: 600px;
    padding: 60px;
}

/* --- Styles for the White Form Box (Targeting the Fluent Form Wrapper) --- */
section.contact-information .contact-form-container .fluent-form-wrapper .fluentform {
    max-width: 600px;
    width: 100%;
    background: white;
    padding: 40px;
    box-shadow: 0px 0px 10px 1px rgba(0, 0, 0, 0.2);
    /* Fluent Form's structure might require margin auto for centering */
    margin: 0 auto;
}

/* --- Heading styles (already handled by the PHP template structure, but including text style for safety) --- */
section.contact-information .contact-form-container .main-heading {
    color: #4b4b4d;
    text-align: left;
    margin-bottom: 30px;
}

/* --- Error/Message Styling (Targeting Fluent Form error classes) --- */
section.contact-information .contact-form-container .fluent-form-wrapper .error,
section.contact-information .contact-form-container .fluent-form-wrapper .text-danger,
section.contact-information .contact-form-container .fluent-form-wrapper .ff-el-validation-error {
    font-size: 12px;
    color: #f5746e !important; 
}

/* --- Common Group/Field Wrapper Styles (Recreating the side-by-side flex layout) --- */
section.contact-information .contact-form-container .fluent-form-wrapper .ff-el-group {
    /* Recreating the old .group flex properties */
    display: -webkit-box;
    display: -moz-box;
    display: box;
    display: -webkit-flex;
    display: -moz-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -moz-box-align: center;
    box-align: center;
    -webkit-align-items: center;
    -moz-align-items: center;
    -ms-align-items: center;
    -o-align-items: center;
    align-items: center;
    -ms-flex-align: center;
    /* Increase specificity and set margin/padding */
    margin-bottom: 20px !important; 
    padding: 0 !important; 
}

/* --- Label Styles (Recreating the fixed width and colon suffix) --- */
section.contact-information .contact-form-container .fluent-form-wrapper .ff-el-input--label {
    /* Container for the label */
    width: 100px !important; /* Force fixed width */
    padding-right: 15px; /* Space for the colon */
    position: relative; /* CRITICAL for positioning the ::after colon */
    text-align: right; /* Align label text right */
}
section.contact-information .contact-form-container .fluent-form-wrapper .ff-el-input--label label {
    font-weight: 200;
    color: #58585a;
    text-transform: capitalize;
    /* Ensure label content fits and doesn't wrap */
    width: auto !important; 
    display: inline-block !important; 
}

/* --- Colon Suffix (CRITICAL FIX) --- */
section.contact-information .contact-form-container .fluent-form-wrapper .ff-el-input--label label::after {
    content: ":";
    position: absolute;
    top: 50%; /* Center vertically */
    transform: translateY(-50%);
    right: 5px; /* Position relative to the parent ff-el-input--label */
    font-weight: 200; 
}

/* --- Input and Textarea Container (Takes up remaining flex space) --- */
section.contact-information .contact-form-container .fluent-form-wrapper .ff-el-input--content {
    -webkit-box-flex: 1;
    -moz-box-flex: 1;
    box-flex: 1;
    -webkit-flex: 1;
    -moz-flex: 1;
    -ms-flex: 1;
    flex: 1;
    width: 100% !important; /* Ensure content container fills its flex space */
}

/* --- Input and Textarea Field Styles (Applying border and padding) --- */
section.contact-information .contact-form-container .fluent-form-wrapper .ff-el-group input[type="text"],
section.contact-information .contact-form-container .fluent-form-wrapper .ff-el-group input[type="email"],
section.contact-information .contact-form-container .fluent-form-wrapper .ff-el-group input[type="subject"], 
section.contact-information .contact-form-container .fluent-form-wrapper .ff-el-group textarea,
section.contact-information .contact-form-container .fluent-form-wrapper .ff-el-group .ff-el-form-control { /* Generic Fluent Form field class */
    margin: 10px 0 !important;
    outline: none !important;
    border: 1px solid #b0b0b1 !important;
    width: 100% !important; /* Must be 100% of the ff-el-input--content wrapper */
    box-sizing: border-box !important;
    background-color: white !important; /* Ensure background is white */
    border-radius: 0 !important; /* Remove any default rounded corners */
}

/* --- Specific Input Padding --- */
section.contact-information .contact-form-container .fluent-form-wrapper .ff-el-group input[type="text"],
section.contact-information .contact-form-container .fluent-form-wrapper .ff-el-group input[type="email"] {
    padding: 4px 2px !important;
    height: auto !important; /* Prevent fixed height from Fluent Form */
}

/* --- Specific Textarea Padding and Resize --- */
section.contact-information .contact-form-container .fluent-form-wrapper .ff-el-group textarea {
    resize: none !important;
    min-height: 120px !important; /* Set a minimum height for the message field */
    padding: 4px 2px !important; /* Consistent padding */
}

/* --- Message Group Alignment (For the textarea field) --- */
section.contact-information .contact-form-container .fluent-form-wrapper .ff-el-group:has(textarea) {
    /* Recreating the old .group.message-group flex-start properties */
    -webkit-box-align: start !important;
    -moz-box-align: start !important;
    box-align: start !important;
    -webkit-align-items: flex-start !important;
    -moz-align-items: flex-start !important;
    -ms-align-items: flex-start !important;
    -o-align-items: flex-start !important;
    align-items: flex-start !important;
    -ms-flex-align: start !important;
}

/* --- Submit Button Group Alignment --- */
section.contact-information .contact-form-container .fluent-form-wrapper .ff-el-group.ff-el-submit {
    /* Recreating the old .cta-group properties */
    text-align: right !important;
    display: block !important; /* Overrides flex */
}

/* --- Submit Button Styles --- */
section.contact-information .contact-form-container .fluent-form-wrapper .ff-btn-submit {
    font-size: 12px;
    text-transform: uppercase;
    background: #a89287 !important;
    color: white !important;
    border: none !important;
    outline: none !important;
    padding: 8px 22px !important;
    cursor: pointer;
    /* Reset Fluent Form button defaults */
    border-radius: 0 !important; 
    line-height: normal !important;
    height: auto !important;
    font-weight: 400 !important;
}

/* --- Responsive Adjustments --- */

@media (max-width: 768px) {
    section.contact-information .contact-form-container {
        padding: 20px;
        height: initial;
    }
    
    section.contact-information .contact-form-container .fluent-form-wrapper .fluentform {
        max-width: 100%;
        margin: auto;
    }
}

@media (max-width: 480px) {
    /* Group Layout: Stacked (Label on top, Input below) */
    section.contact-information .contact-form-container .fluent-form-wrapper .ff-el-group {
        -webkit-box-orient: vertical !important;
        -moz-box-orient: vertical !important;
        box-orient: vertical !important;
        -webkit-box-direction: normal !important;
        -moz-box-direction: normal !important;
        box-direction: normal !important;
        -webkit-flex-direction: column !important;
        -moz-flex-direction: column !important;
        flex-direction: column !important;
        -ms-flex-direction: column !important;
        
        /* Reset alignment for stacking */
        -webkit-box-align: start !important;
        -moz-box-align: start !important;
        box-align: start !important;
        -webkit-align-items: flex-start !important;
        -moz-align-items: flex-start !important;
        -ms-align-items: flex-start !important;
        -o-align-items: flex-start !important;
        align-items: flex-start !important;
        -ms-flex-align: start !important;
    }

    /* Remove fixed width on label container when stacked */
    section.contact-information .contact-form-container .fluent-form-wrapper .ff-el-input--label {
        width: 100% !important;
        position: static !important; /* Remove relative positioning */
        text-align: left !important;
    }
    
    /* Hide the colon suffix when stacked */
    section.contact-information .contact-form-container .fluent-form-wrapper .ff-el-input--label label::after {
        content: none !important;
        display: none !important;
    }

    /* Ensure inputs/textareas take full width when stacked */
    section.contact-information .contact-form-container .fluent-form-wrapper .ff-el-group input,
    section.contact-information .contact-form-container .fluent-form-wrapper .ff-el-group textarea,
    section.contact-information .contact-form-container .fluent-form-wrapper .ff-el-input--content {
        width: 100% !important;
        -webkit-box-flex: 1 !important;
        -moz-box-flex: 1 !important;
        box-flex: 1 !important;
        -webkit-flex: 1 !important;
        -moz-flex: 1 !important;
        -ms-flex: 1 !important;
        flex: 1 !important;
    }

    /* Submit button alignment correction */
    section.contact-information .contact-form-container .fluent-form-wrapper .ff-el-group.ff-el-submit {
        text-align: left !important;
    }
}