.dpm-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
    font-family: inherit;
}

.dpm-popup.dpm-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.dpm-overlay {
    position: absolute;
    inset: 0;
    background: var(--dpm-overlay, rgba(17,24,39,.55));
}

.dpm-box {
    position: relative;
    z-index: 2;
    background: var(--dpm-bg, #fff);
    color: var(--dpm-text, #111827);
    border-radius: var(--dpm-radius, 18px);
    box-shadow: 0 30px 90px rgba(15,23,42,.32);
    padding: 30px;
    max-height: calc(100vh - 40px);
    overflow: auto;
    transform: translateY(14px) scale(.98);
    transition: transform .28s ease, opacity .28s ease;
}

.dpm-visible .dpm-box {
    transform: translateY(0) scale(1);
}

.dpm-close {
    position: absolute;
    right: 14px;
    top: 10px;
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--dpm-close, #111827);
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    padding: 6px;
    z-index: 4;
}

.dpm-close:hover,
.dpm-close:focus {
    opacity: .7;
    outline: none;
}

.dpm-image-wrap {
    margin: 0 0 18px;
}

.dpm-image {
    display: block;
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-radius: calc(var(--dpm-radius, 18px) - 6px);
}

.dpm-title {
    color: inherit;
    font-size: clamp(24px, 3vw, 36px);
    line-height: 1.08;
    margin: 0 0 12px;
    font-weight: 800;
}

.dpm-message {
    color: inherit;
    opacity: .9;
    font-size: 16px;
    line-height: 1.55;
    margin: 0 0 18px;
}

.dpm-message p {
    margin: 0 0 12px;
}

.dpm-message p:last-child {
    margin-bottom: 0;
}

.dpm-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 24px;
    border-radius: 999px;
    background: var(--dpm-button-bg, #dc2626);
    color: var(--dpm-button-text, #fff) !important;
    font-weight: 800;
    text-decoration: none !important;
    box-shadow: 0 12px 24px rgba(0,0,0,.14);
    transition: transform .18s ease, filter .18s ease;
}

.dpm-button:hover,
.dpm-button:focus {
    transform: translateY(-1px);
    filter: brightness(.96);
}

.dpm-position-center {
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dpm-position-bottom_right {
    align-items: flex-end;
    justify-content: flex-end;
    padding: 22px;
}

.dpm-position-top_bar,
.dpm-position-bottom_bar {
    align-items: flex-start;
    justify-content: center;
}

.dpm-position-bottom_bar {
    align-items: flex-end;
}

.dpm-position-top_bar .dpm-overlay,
.dpm-position-bottom_bar .dpm-overlay,
.dpm-position-bottom_right .dpm-overlay {
    background: transparent;
}

.dpm-position-top_bar .dpm-box,
.dpm-position-bottom_bar .dpm-box {
    width: 100%;
    max-width: none;
    border-radius: 0;
    padding: 18px 64px 18px 26px;
    text-align: center;
    max-height: 45vh;
}

.dpm-position-top_bar .dpm-title,
.dpm-position-bottom_bar .dpm-title {
    font-size: 22px;
    margin-bottom: 6px;
}

.dpm-position-top_bar .dpm-message,
.dpm-position-bottom_bar .dpm-message {
    margin-bottom: 10px;
}

.dpm-size-small .dpm-box { width: min(100%, 390px); }
.dpm-size-medium .dpm-box { width: min(100%, 520px); }
.dpm-size-large .dpm-box { width: min(100%, 720px); }

.dpm-position-top_bar.dpm-size-small .dpm-box,
.dpm-position-top_bar.dpm-size-medium .dpm-box,
.dpm-position-top_bar.dpm-size-large .dpm-box,
.dpm-position-bottom_bar.dpm-size-small .dpm-box,
.dpm-position-bottom_bar.dpm-size-medium .dpm-box,
.dpm-position-bottom_bar.dpm-size-large .dpm-box {
    width: 100%;
}

.dpm-template-classic .dpm-box {
    text-align: center;
}

.dpm-template-promo .dpm-box,
.dpm-template-whatsapp .dpm-box {
    overflow: hidden;
}

.dpm-template-promo .dpm-box:before,
.dpm-template-whatsapp .dpm-box:before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 8px;
    background: var(--dpm-button-bg, #dc2626);
}

.dpm-template-minimal .dpm-box {
    box-shadow: 0 18px 45px rgba(15,23,42,.18);
    border: 1px solid rgba(17,24,39,.08);
    text-align: left;
}

.dpm-template-minimal .dpm-button {
    box-shadow: none;
}

.dpm-template-whatsapp .dpm-button:before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    margin-right: 8px;
}

.dpm-animation-fade .dpm-box {
    transform: none;
    opacity: 0;
}

.dpm-animation-fade.dpm-visible .dpm-box {
    opacity: 1;
}

.dpm-animation-slide .dpm-box {
    transform: translateY(36px);
}

.dpm-animation-slide.dpm-visible .dpm-box {
    transform: translateY(0);
}

.dpm-animation-zoom .dpm-box {
    transform: scale(.92);
}

.dpm-animation-zoom.dpm-visible .dpm-box {
    transform: scale(1);
}

body.dpm-no-scroll {
    overflow: hidden;
}

@media (max-width: 700px) {
    .dpm-position-center,
    .dpm-position-bottom_right {
        align-items: flex-end;
        padding: 12px;
    }

    .dpm-position-bottom_right .dpm-box,
    .dpm-position-center .dpm-box {
        width: 100%;
        max-height: calc(100vh - 24px);
        padding: 24px 20px;
    }

    .dpm-title {
        font-size: 24px;
    }

    .dpm-message {
        font-size: 15px;
    }

    .dpm-image {
        max-height: 180px;
    }

    .dpm-position-top_bar .dpm-box,
    .dpm-position-bottom_bar .dpm-box {
        padding: 16px 48px 16px 16px;
    }
}

/* v3.0 lead capture and new templates */
.dpm-template-lead .dpm-box,
.dpm-template-announcement .dpm-box {
    overflow: hidden;
}

.dpm-template-lead .dpm-box:before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 8px;
    background: linear-gradient(90deg, var(--dpm-button-bg, #dc2626), rgba(220,38,38,.35));
}

.dpm-template-announcement .dpm-box {
    border: 1px solid rgba(17,24,39,.08);
}

.dpm-template-announcement .dpm-title:before {
    content: '•';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--dpm-button-bg, #dc2626);
    color: var(--dpm-button-text, #fff);
    margin-right: 8px;
    font-size: 18px;
    line-height: 1;
    vertical-align: middle;
}

.dpm-lead-form {
    display: grid;
    gap: 10px;
    margin-top: 16px;
    text-align: left;
}

.dpm-lead-form label {
    display: block;
    font-size: 13px;
    font-weight: 700;
}

.dpm-lead-form label > span {
    display: block;
    margin-bottom: 5px;
}

.dpm-lead-form input[type="text"],
.dpm-lead-form input[type="email"],
.dpm-lead-form input[type="tel"] {
    width: 100%;
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(17,24,39,.18);
    padding: 0 12px;
    box-sizing: border-box;
    background: #fff;
    color: #111827;
}

.dpm-lead-consent {
    display: flex !important;
    align-items: flex-start;
    gap: 8px;
    font-weight: 500 !important;
    font-size: 12px !important;
    line-height: 1.35;
    opacity: .82;
}

.dpm-lead-consent input {
    margin-top: 2px;
}

.dpm-lead-form .dpm-button {
    border: 0;
    cursor: pointer;
    width: 100%;
}

.dpm-lead-form .dpm-button.is-loading {
    opacity: .72;
    cursor: wait;
}

.dpm-lead-status {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    min-height: 18px;
}

.dpm-lead-status.is-success {
    color: #166534;
}

.dpm-lead-status.is-error {
    color: #b91c1c;
}

.dpm-hp {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.dpm-position-top_bar .dpm-lead-form,
.dpm-position-bottom_bar .dpm-lead-form {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
}

.dpm-position-top_bar .dpm-lead-consent,
.dpm-position-bottom_bar .dpm-lead-consent,
.dpm-position-top_bar .dpm-lead-status,
.dpm-position-bottom_bar .dpm-lead-status {
    grid-column: 1 / -1;
}

@media (max-width: 700px) {
    .dpm-position-top_bar .dpm-lead-form,
    .dpm-position-bottom_bar .dpm-lead-form {
        grid-template-columns: 1fr;
    }
}
