/* Global consultation and thank-you modals */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1055;
    display: none;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
}

.modal.show {
    display: block;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    pointer-events: none;
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 3.5rem);
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background: #fff;
    border: 0;
    outline: 0;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.62);
}

.modal-backdrop.fade {
    opacity: 0;
}

.modal-backdrop.show {
    opacity: 1;
}

.fade {
    transition: opacity 0.16s ease;
}

.fade:not(.show) {
    opacity: 0;
}

.modal-open {
    overflow: hidden;
}

#bookConsultationModal .modal-dialog,
#thankYouModal .modal-dialog {
    max-width: 520px;
    padding: 0 16px;
}

#bookConsultationModal .modal-content,
#thankYouModal .modal-content {
    border-radius: 28px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.24);
    padding: 30px;
}

#bookConsultationModal .modal-header,
#thankYouModal .modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 0 0 20px;
    border: 0;
}

#bookConsultationModal .modal-title,
#thankYouModal .modal-title {
    color: #0f172a;
    font-size: clamp(26px, 4vw, 34px);
    font-weight: 800;
    line-height: 1.16;
    margin: 0;
}

#bookConsultationModal .modal-body,
#thankYouModal .modal-body {
    padding: 0;
}

#bookConsultationModal .btn-close,
#thankYouModal .btn-close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
}

#bookConsultationModal .btn-close::before,
#bookConsultationModal .btn-close::after,
#thankYouModal .btn-close::before,
#thankYouModal .btn-close::after {
    content: "";
    position: absolute;
    left: 12px;
    top: 18px;
    width: 14px;
    height: 2px;
    background: currentColor;
}

#bookConsultationModal .btn-close::before,
#thankYouModal .btn-close::before {
    transform: rotate(45deg);
}

#bookConsultationModal .btn-close::after,
#thankYouModal .btn-close::after {
    transform: rotate(-45deg);
}

.ca-global-modal-field {
    margin-bottom: 16px;
}

#bookConsultationModal .form-label {
    display: block;
    color: #1e293b;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
}

#bookConsultationModal .form-control {
    width: 100%;
    min-height: 56px;
    padding: 14px 16px;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    background: #f8fafc;
    color: #0f172a;
    font: inherit;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

#bookConsultationModal textarea.form-control {
    min-height: 122px;
    resize: vertical;
}

#bookConsultationModal .form-control:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    outline: none;
}

.ca-global-modal-optional {
    color: #64748b;
    font-weight: 500;
}

#enquirySubmitBtn,
#thankYouModal .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 56px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff7a1a, #ff5c35);
    color: #fff;
    font-weight: 800;
    letter-spacing: 0;
    cursor: pointer;
    box-shadow: 0 16px 34px rgba(255, 92, 53, 0.28);
}

#enquirySubmitBtn:disabled {
    cursor: wait;
    opacity: 0.76;
}

.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 0.15em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: ca-modal-spin 0.75s linear infinite;
}

@keyframes ca-modal-spin {
    to {
        transform: rotate(360deg);
    }
}

.ca-global-modal-response {
    min-height: 22px;
    margin-top: 14px;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.ca-global-modal-response.is-error {
    color: #b91c1c;
}

.ca-global-modal-response.is-success {
    color: #047857;
}

#thankYouModal .modal-header {
    justify-content: flex-end;
    padding-bottom: 4px;
}

#thankYouModal .modal-body {
    text-align: center;
}

#thankYouModal .thank-you-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 82px;
    height: 82px;
    margin: 4px auto 20px;
    border-radius: 50%;
    background: #dcfce7;
    color: #16a34a;
    font-size: 34px;
}

#thankYouModal p {
    color: #475569;
    font-size: 16px;
    line-height: 1.7;
    margin: 14px 0 0;
}

#thankYouModal .modal-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 24px 0 0;
    border: 0;
}

#thankYouModal .btn {
    min-height: 50px;
    border-radius: 999px;
    font-weight: 800;
    text-decoration: none;
}

#thankYouModal .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef5ff;
    color: #0759a5;
}

@media (max-width: 576px) {
    #bookConsultationModal .modal-dialog,
    #thankYouModal .modal-dialog {
        max-width: none;
        width: calc(100% - 24px);
        margin: 12px auto;
        padding: 0;
    }

    .modal-dialog-centered {
        min-height: calc(100% - 24px);
    }

    #bookConsultationModal .modal-content,
    #thankYouModal .modal-content {
        max-height: calc(100vh - 24px);
        overflow-y: auto;
        border-radius: 22px;
        padding: 22px;
    }

    #bookConsultationModal .form-control {
        min-height: 52px;
    }

    #thankYouModal .modal-footer {
        grid-template-columns: 1fr;
    }
}
