/* #hiremodal5 — layout fixes only (keep original form design).
   - Center the modal in the viewport
   - Stop the tall empty white gap under the form
   - Keep the close button inside the card on tablet/phone
*/

#hiremodal5 {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1050 !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    padding: 24px 16px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
}

/* custom.js sets display:flex — keep flex + centering */
#hiremodal5[style*="display: flex"],
#hiremodal5[style*="display:flex"],
#hiremodal5[style*="display: block"],
#hiremodal5[style*="display:block"],
#hiremodal5.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#hiremodal5[style*="display: none"],
#hiremodal5[style*="display:none"] {
    display: none !important;
}

#hiremodal5 .modal-dialog,
#hiremodal5 .modal-dialog-centered {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    display: block !important;
    width: 100% !important;
    max-width: min(1100px, calc(100vw - 48px)) !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 48px) !important;
    margin: auto !important;
    padding: 0 !important;
    transform: none !important;
    -webkit-transform: none !important;
}

#hiremodal5 .modal-content {
    height: auto !important;
    max-height: calc(100dvh - 32px) !important;
    overflow: hidden !important;
}

#hiremodal5 .modal-body {
    height: auto !important;
    max-height: calc(100dvh - 32px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* Kill the space-between stretch that creates the big white gap */
#hiremodal5 .testimonials-content-des {
    height: auto !important;
    min-height: 0 !important;
    align-items: stretch !important;
}

#hiremodal5 .testimonials-review-box {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    gap: 16px !important;
    height: auto !important;
    min-height: 0 !important;
}

#hiremodal5 .inquiry-form-modern,
#hiremodal5 .footer-form.contact-form,
#hiremodal5 .clutch-review-box {
    flex: 0 0 auto !important;
}

#hiremodal5 .client-review-message {
    min-height: 0 !important;
}

/* Close button stays on the card (legacy rules pull it outside) */
#hiremodal5 .modal-header {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    z-index: 6;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

#hiremodal5 .modal-header .close {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    left: auto !important;
}

/* ---------- iPad / tablet ---------- */
@media (max-width: 1024px) {
    #hiremodal5 {
        padding: 12px !important;
    }

    #hiremodal5 .modal-dialog {
        max-width: calc(100vw - 24px) !important;
        max-height: calc(100dvh - 24px) !important;
        margin: 0 auto !important;
    }

    #hiremodal5 .modal-content,
    #hiremodal5 .modal-body {
        max-height: calc(100dvh - 24px) !important;
    }

    #hiremodal5 .testimonials-content-des {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        height: auto !important;
    }

    /* Side panel + clutch cause the tall empty stretch on iPad */
    #hiremodal5 .testimonial-client-info {
        display: none !important;
    }

    #hiremodal5 .clutch-review-box {
        display: none !important;
    }

    #hiremodal5 .testimonials-review-box {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        padding: 24px 20px 20px !important;
        gap: 12px !important;
        justify-content: flex-start !important;
    }

    #hiremodal5 .modal-header .close {
        top: 10px !important;
        right: 10px !important;
    }
}

@media (max-width: 767px) {
    #hiremodal5 {
        padding: 8px !important;
    }

    #hiremodal5 .modal-dialog,
    #hiremodal5 .modal-content,
    #hiremodal5 .modal-body {
        max-height: calc(100dvh - 16px) !important;
    }

    #hiremodal5 .testimonials-review-box {
        padding: 20px 14px 16px !important;
    }
}
