/* Scope everything inside the module */
#africa_enquiry_form_page.qr_form_page,
#africa_enquiry_form_page.qr_form_page * {
    box-sizing: border-box !important;
}

/* Container padding */
#africa_enquiry_form_page.qr_form_page {
    padding: 20px !important;
}

/* Isolation */
#africa_enquiry_form_page .qr_form_page {
    isolation: isolate !important;
    contain: content !important;
}

/* Margin reset for contact form */
#africa_enquiry_form_page .et_pb_contact_form {
    margin: 0 !important;
}

/* Headings with full priority */
#africa_enquiry_form_page h2 {
    margin-bottom: 20px !important;
    font-family: 'Cinzel', Georgia, "Times New Roman", serif !important;
    text-transform: uppercase !important;
    font-size: clamp(22px, 3vw, 30px) !important;
    line-height: 1.2 !important;
    color: #975026 !important;
}

#africa_enquiry_form_page h3 {
    font-family: 'Cinzel', Georgia, "Times New Roman", serif !important;
    text-transform: uppercase !important;
    font-size: clamp(20px, 2.5vw, 26px) !important;
    padding-bottom: 5px !important;
    line-height: 1.2 !important;
    color: #1A1F28 !important;
}

#africa_enquiry_form_page h4 {
    font-family: 'Open Sans', Helvetica, Arial, Lucida, sans-serif !important;
    text-transform: uppercase !important;
    font-size: clamp(16px, 2vw, 18px) !important;
    padding-bottom: 5px !important;
    color: #EBB335 !important;
    line-height: 1.2 !important;
    display: block !important;
    width: 100% !important;
}

/* Subheader */
#africa_enquiry_form_page .form-subheader {
    font-family: 'Open Sans', Arial, sans-serif !important;
    font-size: clamp(14px, 2.5vw, 18px) !important;
    color: #1A1F28 !important;
    margin: -10px 0 30px !important;
    text-transform: none !important;
    font-weight: normal !important;
    line-height: 1.2 !important;
}

/* Flex containers */
#africa_enquiry_form_page .heading-container {
    display: block !important;
}

#africa_enquiry_form_page .input-container,
#africa_enquiry_form_page .third-container,
#africa_enquiry_form_page .et_pb_contact_field_container {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0 !important;
    width: 100% !important;
    padding-bottom: 15px !important;
}

/* Border wrapper */
#africa_enquiry_form_page .et_pb_with_border {
    padding: 20px 0 0 !important;
    border-radius: 3px !important;
    margin-bottom: 30px !important;
    background-color: transparent !important;
}

#africa_enquiry_form_page .et_pb_with_border .et_pb_contact_field_container:last-child {
    margin-bottom: 0 !important;
}

/* Half-width fields */
#africa_enquiry_form_page .et_pb_contact_field_half {
    flex: 1 1 calc(50% - 7.5px) !important;
    min-width: calc(50% - 7.5px) !important;
    max-width: calc(50% - 7.5px) !important;
}

/* Thirds */
#africa_enquiry_form_page .et_pb_contact_field_third:not(.children-ages-page) {
    flex: 1 1 calc(50% - 7.5px) !important;
    min-width: calc(50% - 7.5px) !important;
    max-width: calc(50% - 7.5px) !important;
}

#africa_enquiry_form_page .et_pb_contact_field_third.children-ages-page {
    flex: 0 0 100% !important;
    width: 100% !important;
}

/* Children ages grid */
#africa_enquiry_form_page .children-ages-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)) !important;
    gap: 0 !important;
}

/* Inputs */
#africa_enquiry_form_page .et_pb_contact_form_input,
#africa_enquiry_form_page input[type="text"],
#africa_enquiry_form_page input[type="email"],
#africa_enquiry_form_page input[type="tel"],
#africa_enquiry_form_page input[type="password"],
#africa_enquiry_form_page select,
#africa_enquiry_form_page textarea {
    width: 100% !important;
    padding: 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 3px !important;
    background-color: #fff !important;
    font-family: 'Open Sans', Arial, sans-serif !important;
    color: #1A1F28 !important;
}

/* Textareas */
#africa_enquiry_form_page textarea.et_pb_contact_form_input {
    min-height: 100px !important;
    resize: vertical !important;
}

/* Radio buttons */
#africa_enquiry_form_page .et_pb_contact_field_radio input[type="radio"] {
    width: 8px !important;
    height: 8px !important;
}

/* Radio labels */
#africa_enquiry_form_page .et_pb_contact_field_radio label,
#africa_enquiry_form_page .accommodation-radio label {
    font-family: 'Open Sans', Arial, sans-serif !important;
    color: #1A1F28 !important;
}

/* Datepicker */
#africa_enquiry_form_page .et_pb_datepicker {
    z-index: 99999 !important;
}

/* Buttons container */
#africa_enquiry_form_page .et_pb_contact_submit_container {
    text-align: center !important;
    margin-top: 30px !important;
}

/* Info icon */
#africa_enquiry_form_page .info-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #africa_enquiry_form_page .children-ages-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    #africa_enquiry_form_page .accommodation-radios {
        flex-direction: column !important;
    }
}