.contact-modal[hidden] {
    display: none;
}

.contact-modal {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.contact-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgb(15 23 42 / 72%);
    backdrop-filter: blur(3px);
}

.contact-modal__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 48rem);
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 1rem;
    background: #f8fafc;
    box-shadow: 0 24px 80px rgb(15 23 42 / 40%);
}

.contact-modal__header {
    position: sticky;
    z-index: 2;
    top: 0;
    display: flex;
    height: 3.5rem;
    align-items: center;
    justify-content: flex-end;
    padding: 0 0.75rem;
    background: rgb(248 250 252 / 96%);
}

.contact-modal__close {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    box-shadow: 0 2px 8px rgb(15 23 42 / 12%);
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
}

.contact-modal__content {
    padding: 1rem;
}

.contact-modal__content #contact-popup-form {
    width: 100%;
}

.contact-modal__content #contact-popup-form > div {
    padding: 1.25rem;
}

.contact-modal__content h2 {
    padding-right: 2rem;
}

.contact-modal__loading {
    margin: 0;
    padding: 3rem 1rem;
    color: #475569;
    text-align: center;
}

@media (max-width: 640px) {
    .contact-modal {
        padding: 0.5rem;
        align-items: start;
    }

    .contact-modal__panel {
        width: 100%;
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
        border-radius: 0.75rem;
    }

    .contact-modal__content {
        padding: 0.5rem;
    }

    .contact-modal__content #contact-popup-form > div {
        padding: 1rem;
    }
}

@media (max-height: 640px) {
    .contact-modal {
        padding-block: 0.5rem;
    }

    .contact-modal__panel {
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
    }
}
