.cf7-modal-trigger {
    cursor: pointer;
}

.cf7-modal-overlay {
    /*
     * "absolute" statt "fixed": Safari (iOS) hat einen bekannten Bug, bei dem
     * "position: fixed"-Elemente während der Tastatur-Einblendanimation nicht
     * zuverlässig neu compositiert werden (der Hintergrund scheint dann kurz
     * durch). Da der body während eines offenen Modals bereits selbst per
     * "position: fixed" gesperrt ist (siehe cf7-modal.js), dient er als
     * Containing Block – das Overlay wird per JS exakt darauf ausgerichtet
     * (siehe syncOverlaysToVisualViewport()).
     */
    position: absolute;
    inset: 0;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

.cf7-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
    overflow: auto;
    overscroll-behavior: none;
}

.cf7-modal-box {
    position: relative;
    background: #fff;
    margin: 10px;
    padding: 2rem;
    border-radius: 8px;
    max-width: 380px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
}

.cf7-modal-title {
    margin-top: 0;
}

.cf7-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: #333;
}

.cf7-modal-close:hover {
    color: #000;
}

/*
 * Verhindert Scrollen im Hintergrund, solange ein Modal offen ist.
 * "overflow: hidden" allein reicht auf iOS Safari nicht aus (Rubber-Band-
 * Scrolling bleibt dort trotzdem möglich) – deshalb zusätzlich body per
 * "position: fixed" fixieren; die Scrollposition wird per JS über "top"
 * kompensiert und beim Schließen wiederhergestellt (siehe cf7-modal.js).
 */
html.cf7-modal-lock,
body.cf7-modal-lock {
    overflow: hidden;
}

body.cf7-modal-lock {
    position: fixed;
    width: 100%;
}

@media (min-width: 782px) {
    .cf7-modal-box {
        max-width: 560px;
    }
}

@media (min-width: 960px) {
    .cf7-modal-box {
        max-width: 650px;
        max-height: 95vh;
    }

    .cf7-modal-close {
        top: 0.5rem;
        right: 0.75rem;
    }
}

@media (min-width: 1200px) {
    .cf7-modal-box {
        max-width: 800px;
    }
}