/* Popup Overlay */
#exitPopupOverlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

#exitPopupOverlay[hidden] {
    display: none !important;
}

#exitPopupOverlay [hidden] {
    display: none !important;
}

/* Dark-Mode für Overlay & Popup */
body.theme-deep #exitPopupOverlay {
    background: rgba(15,23,42,0.85);
}

    .exit-popup {
        background: radial-gradient(circle at top left, #f8fafc 0, #ffffff 45%, #eef2ff 100%);
        color: #0f172a;
        padding: 1.7rem 1.85rem;
        border-radius: 22px;
        max-width: 600px;
        width: min(600px, calc(100vw - 32px));
        max-height: calc(100vh - 32px);
        overflow-y: auto;
        position: relative;
        box-shadow: 0 22px 70px rgba(15,23,42,0.35);
        animation: popupFadeIn .25s ease-out;
        font-family: inherit;
    }

    body.theme-deep .exit-popup {
        background: radial-gradient(circle at top left, #020617 0, #020617 40%, #020617 70%);
        color: #e5e7eb;
        box-shadow: 0 22px 70px rgba(0,0,0,0.85);
    }

    @keyframes popupFadeIn {
        from { opacity: 0; transform: translateY(8px) scale(.96); }
        to { opacity: 1; transform: translateY(0) scale(1); }
    }

    .exit-popup-close {
        position: absolute;
        top: 1rem;
        right: 1.1rem;
        background: rgba(15,23,42,0.04);
        border-radius: 999px;
        width: 32px;
        height: 32px;
        border: none;
        font-size: 1.4rem;
        cursor: pointer;
        line-height: 1;
        color: inherit;
        opacity: .8;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .exit-popup-close:hover {
        opacity: 1;
        background: rgba(15,23,42,0.06);
    }

    body.theme-deep .exit-popup-close {
        background: rgba(148,163,184,0.05);
    }
    body.theme-deep .exit-popup-close:hover {
        background: rgba(148,163,184,0.15);
    }

    .exit-popup-inner {
        display: grid;
        grid-template-columns: 108px minmax(0, 1fr);
        align-items: flex-start;
        gap: 1.2rem;
    }

    .exit-popup-media {
        width: 108px;
    }

    .exit-popup-media-frame {
        position: relative;
        border-radius: 20px;
        padding: 3px;
        background: linear-gradient(135deg, #22c55e, #2563eb, #a855f7);
    }

    body.theme-deep .exit-popup-media-frame {
        background: linear-gradient(135deg, #22c55e, #38bdf8, #a855f7);
    }

    .exit-popup-media-frame img {
        display: block;
        width: 102px;
        height: 102px;
        border-radius: 16px;
        object-fit: cover;
    }

    .exit-popup-body {
        display: flex;
        flex-direction: column;
        gap: .65rem;
        min-width: 0;
    }

    .exit-popup-content {
        display: flex;
        flex-direction: column;
        gap: .65rem;
    }

    .exit-popup-header {
        margin-bottom: 0;
        background: transparent;
    }

    .exit-popup-tag {
        display: inline-flex;
        align-items: center;
        gap: .35rem;
        padding: .15rem .7rem;
        border-radius: 999px;
        font-size: .72rem;
        letter-spacing: .04em;
        text-transform: uppercase;
        font-weight: 600;
        background: rgba(37,99,235,0.04);
        color: var(--accent);
    }

    .exit-popup-tag::before {
        content: "";
        width: 6px;
        height: 6px;
        border-radius: 999px;
        background: #22c55e;
    }

    body.theme-deep .exit-popup-tag {
        background: rgba(56, 248, 120, 0.12);
        color: white;
    }
    body.theme-deep .exit-popup-tag::before {
        background: #22c55e;
    }

    .exit-popup-header h3 {
        margin: .35rem 0 .2rem;
        font-size: 1.22rem;
        font-weight: 700;
        line-height: 1.28;
    }

    .exit-popup-header p {
        margin: 0;
        font-size: .93rem;
        line-height: 1.48;
        color: #111827;
    }

    body.theme-deep .exit-popup-header p {
        color: #e5e7eb;
    }

    .exit-popup-list {
        margin: 0;
        padding-left: 0;
        list-style: none;
        font-size: .9rem;
        display: grid;
        gap: .18rem;
    }

    .exit-popup-list li {
        position: relative;
        padding-left: 1.4rem;
        line-height: 1.5;
        color: #1f2933;
    }

    .exit-popup-list li::before {
        content: "";
        position: absolute;
        left: 0;
        top: .45rem;
        width: 8px;
        height: 8px;
        border-radius: 999px;
        background: #22c55e;
        box-shadow: 0 0 0 3px rgba(34,197,94,0.22);
    }

    body.theme-deep .exit-popup-list li {
        color: #e5e7eb;
    }
    body.theme-deep .exit-popup-list li::before {
        background: #22c55e;
        box-shadow: 0 0 0 3px rgba(34,197,94,0.35);
    }

    .exit-popup-actions {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: .6rem 1rem;
        margin-top: .3rem;
    }

    .exit-popup-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background-image: linear-gradient(135deg, var(--accent), var(--accent-dark));
        color: #fff;
        padding: .78rem 1.6rem;
        border-radius: 999px;
        text-decoration: none;
        font-weight: 600;
        font-size: .95rem;
        border: none;
        white-space: nowrap;
        box-shadow: 0 10px 25px rgba(37, 235, 96, 0.35);
        transform: translateY(0);
        transition: transform .12s ease-out, box-shadow .12s ease-out, background-image .12s ease-out;
    }

    .exit-popup-btn:hover {
        background-image: linear-gradient(135deg, var(--accent), var(--accent-dark));
        box-shadow: 0 12px 28px rgba(37, 235, 96, 0.45);
        transform: translateY(-1px);
    }

    body.theme-deep .exit-popup-btn {
        background-image: linear-gradient(135deg, var(--accent), var(--accent-dark));
        color: white;
        box-shadow: 0 10px 28px rgba(37, 235, 96, 0.55);
    }
    body.theme-deep .exit-popup-btn:hover {
        background-image: linear-gradient(135deg, var(--accent), var(--accent-dark));
        box-shadow: 0 12px 32px rgba(37, 235, 96, 0.75);
    }

    .exit-popup-secondary {
        background: transparent;
        border: none;
        padding: .3rem 0;
        font-size: .86rem;
        color: #64748b;
        cursor: pointer;
        text-decoration: underline;
        text-underline-offset: 3px;
    }

    .exit-popup-secondary:hover {
        color: #0f172a;
    }

    body.theme-deep .exit-popup-secondary {
        color: #9ca3af;
    }

    body.theme-deep .exit-popup-secondary:hover {
        color: #e5e7eb;
    }

    .exit-popup-footer {
        margin-top: .15rem;
        padding: .45rem 0 0;
        padding-bottom: 0px !important;
    }

    .exit-popup-microcopy {
        margin: 0;
        font-size: .78rem;
        line-height: 1.5;
        color: #94a3b8;
    }

    body.theme-deep .exit-popup-microcopy {
        color: #6b7280;
    }

    @media (max-width: 640px) {
        .exit-popup {
            width: calc(100vw - 20px);
            max-height: calc(100vh - 20px);
            padding: 1.25rem 1.25rem 1.35rem;
        }

        .exit-popup-inner {
            grid-template-columns: 1fr;
            align-items: stretch;
            gap: 1rem;
        }

        .exit-popup-media {
            width: auto;
            max-width: 118px;
        }

        .exit-popup-media-frame img {
            width: 100%;
            height: auto;
            max-height: none;
            aspect-ratio: 1 / 1;
        }

        .exit-popup-actions {
            flex-direction: column;
            align-items: stretch;
        }

        .exit-popup-btn {
            width: 100%;
        }
    }
