/* Done Digital Lead Machine — Popups
 * Distinct namespace (.ddlm-lpop-*) to avoid collision with the form-level
 * popup shell (.ddlm-popup-*) used by render_popup_overlay_html().
 */

.ddlm-lpop {
    position: fixed;
    inset: 0;
    z-index: 2147483645;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    visibility: hidden;
    pointer-events: none;
    /* Keep the container out of the tab/click path until visible, but delay hiding
       visibility until the fade-out finishes so transitions still play on close. */
    transition: visibility 0s linear 0.45s;
}

.ddlm-lpop.ddlm-lpop-visible {
    visibility: visible;
    pointer-events: auto;
    transition: visibility 0s linear 0s;
}

.ddlm-lpop-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.56);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.ddlm-lpop.ddlm-lpop-visible .ddlm-lpop-overlay {
    opacity: 1;
}

.ddlm-lpop-dialog {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
    padding: 32px 28px 28px;
    max-width: min(520px, 94vw);
    width: 100%;
    max-height: calc(100vh - 32px);
    overflow: auto;
    transform: translateY(12px) scale(0.985);
    opacity: 0;
    /* Slight delay so the overlay lands just ahead of the dialog for a softer reveal. */
    transition:
        transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1) 0.08s,
        opacity 0.4s ease 0.08s;
}

.ddlm-lpop.ddlm-lpop-visible .ddlm-lpop-dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Respect users who prefer reduced motion: fade only, no movement or delay. */
@media (prefers-reduced-motion: reduce) {
    .ddlm-lpop-overlay,
    .ddlm-lpop-dialog {
        transition: opacity 0.2s ease;
    }
    .ddlm-lpop-dialog {
        transform: none;
    }
}

.ddlm-lpop-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #475569;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    border-radius: 999px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.ddlm-lpop-close:hover {
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

.ddlm-lpop-heading {
    margin: 0 0 10px 0;
    font-size: 22px;
    line-height: 1.25;
    /* font-family intentionally inherited so the site's heading font applies. */
}

.ddlm-lpop-description {
    margin: 0 0 20px 0;
    color: #475569;
    line-height: 1.5;
    /* font-family inherited: site's body font. */
}

.ddlm-lpop-action {
    display: flex;
    justify-content: flex-start;
}

.ddlm-lpop-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ddlm-lpop-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* The form's own heading/subheading visibility is controlled server-side via the
   form's show_heading/show_subheading settings, so no defensive display:none here.
   We only neutralize the form's card styling so it sits flush inside the popup. */
.ddlm-lpop .ddlm-custom-form {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* Prevent scroll-through while the popup is open. */
body.ddlm-lpop-no-scroll {
    overflow: hidden;
}

@media (max-width: 480px) {
    .ddlm-lpop-dialog {
        padding: 26px 18px 20px;
        border-radius: 12px;
    }

    .ddlm-lpop-heading {
        font-size: 20px;
    }
}
