.gravity-form-popup {
    display: none;
    position: fixed;
    inset: 0;
    /* Site overlays (mobile menu, language switcher) already use z-index
       up to 99999999, so this must clear all of them. */
    z-index: 999999999;
    background: rgba(17, 24, 32, 0.5);
    justify-content: center;
    align-items: center;
    padding: 24px;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.gravity-form-popup.is-open {
    display: flex;
}

.gravity-form-popup .modal-content {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
    padding: 40px 48px;
}

/* Popups authored in the Divi builder: the section is the panel, so it keeps
   its builder styling (width, radius, padding) and only gets what a modal
   needs on top. */
.gravity-form-popup > .gravity-form-popup__panel {
    position: relative;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.gravity-form-popup .close-popup {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 999px;
    /* Divi rows are `position: relative` and come later in the DOM, so inside
       a builder-authored popup they would paint over the close button. */
    z-index: 10;
}

.gravity-form-popup .close-popup:hover {
    background: #f3f1ec;
}

/* The X is drawn rather than typed: the page font has no U+2715 glyph, so a
   text "x" renders blank. */
.gravity-form-popup .close-popup::before,
.gravity-form-popup .close-popup::after {
    content: '';
    position: absolute;
    /* Centred with offsets rather than translate(), so the only transform
       each bar needs is its rotation: 32px box, 15x2 bar. */
    top: 15px;
    left: 8px;
    width: 15px;
    height: 2px;
    background: #1c2128;
    border-radius: 2px;
}

.gravity-form-popup .close-popup::before {
    transform: rotate(45deg);
}

.gravity-form-popup .close-popup::after {
    transform: rotate(-45deg);
}

/* Builder-authored popups sit the close button on their own header, which on
   the volunteer popup is dark (#1c2128 - the same colour as the icon), so the
   icon and its hover state flip to light there. */
.gravity-form-popup__panel > .close-popup::before,
.gravity-form-popup__panel > .close-popup::after {
    background: #ffffff;
}

.gravity-form-popup__panel > .close-popup:hover {
    background: rgba(255, 255, 255, 0.16);
}

.gravity-form-popup .form-header {
    margin-bottom: 28px;
}

.gravity-form-popup .form-subtitle {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    font-weight: 700;
    margin: 0 0 8px;
}

.gravity-form-popup .form-title {
    font-size: 24px;
    font-weight: 800;
    color: #1c2128;
    margin: 0;
    line-height: 1.25;
}

.gravity-form-popup .form-body input[type="hidden"] {
    display: none;
}

body.cco-modal-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .gravity-form-popup .modal-content {
        max-height: 100vh;
        border-radius: 12px;
        padding: 32px 24px;
    }

    .gravity-form-popup > .gravity-form-popup__panel {
        max-height: 100vh;
    }
}
