html.cs-contact-modal-open,
body.cs-contact-modal-open {
    overflow: hidden !important;
}

.cs-contact-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: grid;
    place-items: center;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, visibility .25s ease;
}

.cs-contact-modal--open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.cs-contact-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(1, 18, 37, .78);
    backdrop-filter: blur(7px);
    cursor: pointer;
}

.cs-contact-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(780px, 100%);
    max-height: calc(100dvh - 40px);
    padding: clamp(28px, 4vw, 48px);
    overflow: hidden;
    color: #012347;
    background: #fff;
    border: 1px solid rgba(1, 35, 71, .12);
    border-radius: 28px;
    box-shadow: 0 28px 90px rgba(1, 18, 37, .32);
    outline: 0;
    transform: translateY(18px) scale(.985);
    transition: transform .25s ease;
    overscroll-behavior: contain;
}

.cs-contact-modal--open .cs-contact-modal__dialog {
    transform: translateY(0) scale(1);
}

.cs-contact-modal__close {
    position: absolute;
    top: 18px;
    right: 18px;
    display: block !important;
    place-items: center;
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    padding: 0 !important;
    color: #012347 !important;
    background: rgba(1, 35, 71, .07) !important;
    border: 0 !important;
    border-radius: 50% !important;
    box-shadow: none !important;
    font: inherit;
    font-size: 0 !important;
    line-height: 0 !important;
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease, transform .2s ease;
}

.cs-contact-modal__close::before,
.cs-contact-modal__close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}

.cs-contact-modal__close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.cs-contact-modal__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.cs-contact-modal__close:hover,
.cs-contact-modal__close:focus-visible {
    color: #fff !important;
    background: #a31923 !important;
    transform: rotate(4deg);
}

.cs-contact-modal__close:focus-visible {
    outline: 3px solid rgba(163, 25, 35, .22);
    outline-offset: 3px;
}

.cs-contact-modal__header {
    padding-right: 50px;
    margin-bottom: 28px;
}

.cs-contact-modal__eyebrow {
    display: block;
    margin-bottom: 7px;
    color: #a31923;
    font-family: "Host Grotesk", system-ui, sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.cs-contact-modal__header h2 {
    margin: 0;
    color: #012347;
    font-family: "Gilroy", "Host Grotesk", system-ui, sans-serif;
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 700;
    line-height: 1.05;
}

.cs-contact-modal__content,
.cs-contact-modal__content .wpcf7 {
    width: 100%;
    max-width: none;
}

.cs-contact-modal__content {
    max-height: calc(100dvh - 220px);
    padding-right: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: rgba(1, 35, 71, .32) transparent;
    scrollbar-width: thin;
}

.cs-contact-modal__content::-webkit-scrollbar {
    width: 6px;
}

.cs-contact-modal__content::-webkit-scrollbar-track {
    background: transparent;
}

.cs-contact-modal__content::-webkit-scrollbar-thumb {
    background: rgba(1, 35, 71, .28);
    border-radius: 999px;
}

.cs-contact-modal__content::-webkit-scrollbar-thumb:hover {
    background: rgba(163, 25, 35, .55);
}

.cs-contact-modal--status .cs-contact-modal__dialog {
    overflow: hidden;
}

.cs-contact-modal--status .cs-contact-modal__content {
    max-height: none;
    padding-right: 0;
    overflow: hidden;
}

.cs-contact-modal--status .cs-contact-modal__header {
    margin-bottom: 18px;
}

.cs-contact-modal--status .wpcf7-form {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}

.cs-contact-modal--status .wpcf7-form > :not(.wpcf7-response-output) {
    display: none !important;
}

.cs-contact-modal--status .wpcf7-response-output {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 150px;
    margin: 0 !important;
    padding: 30px !important;
    color: #012347 !important;
    background: rgba(1, 35, 71, .045);
    border: 1px solid rgba(1, 35, 71, .14) !important;
    border-radius: 18px;
    font-size: clamp(18px, 2.2vw, 23px) !important;
    font-weight: 700 !important;
    line-height: 1.4;
    text-align: center;
    outline: 0;
}

.cs-contact-modal--success .wpcf7-response-output {
    border-color: rgba(33, 126, 82, .32) !important;
    background: rgba(33, 126, 82, .08);
}

.cs-contact-modal--error .wpcf7-response-output {
    border-color: rgba(163, 25, 35, .3) !important;
    background: rgba(163, 25, 35, .07);
}

@media (max-width: 767px) {
    .cs-contact-modal {
        padding: 10px;
    }

    .cs-contact-modal__dialog {
        max-height: calc(100dvh - 20px);
        padding: 28px 20px 24px;
        border-radius: 20px;
    }

    .cs-contact-modal__content {
        max-height: calc(100dvh - 175px);
        padding-right: 5px;
    }

    .cs-contact-modal__close {
        top: 12px;
        right: 12px;
    }

    .cs-contact-modal__header {
        padding-right: 42px;
        margin-bottom: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cs-contact-modal,
    .cs-contact-modal__dialog,
    .cs-contact-modal__close {
        transition: none;
    }
}
