.acw-newsletter-popup {
    --acw-popup-blue: #315df4;
    --acw-popup-blue-dark: #2447c8;
    --acw-popup-text: #172033;
    --acw-popup-muted: #6f7d91;
    --acw-popup-border: #dfe6f1;
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: grid;
    place-items: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s ease, visibility .22s ease;
}

.acw-newsletter-popup[hidden] {
    display: none !important;
}

.acw-newsletter-popup.is-visible {
    opacity: 1;
    visibility: visible;
}

/* Strong specificity is intentional: several themes apply global button colors. */
.acw-newsletter-popup button.acw-newsletter-popup__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: rgba(10, 18, 32, .72) !important;
    background-image: none !important;
    box-shadow: none !important;
    backdrop-filter: blur(8px) saturate(.72);
    -webkit-backdrop-filter: blur(8px) saturate(.72);
    cursor: default;
}

.acw-newsletter-popup__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 500px);
    padding: 32px;
    overflow: hidden;
    border: 1px solid rgba(223, 230, 241, .96);
    border-radius: 22px;
    background:
        radial-gradient(circle at 88% -6%, rgba(49, 93, 244, .11), transparent 35%),
        linear-gradient(180deg, #ffffff 0%, #fdfdff 100%);
    color: var(--acw-popup-text);
    box-shadow: 0 32px 90px rgba(6, 18, 42, .32);
    outline: 0;
    transform: translateY(16px) scale(.985);
    transition: transform .22s ease;
}

.acw-newsletter-popup.is-visible .acw-newsletter-popup__dialog {
    transform: translateY(0) scale(1);
}

.acw-newsletter-popup button.acw-newsletter-popup__close {
    position: absolute;
    inset-block-start: 15px;
    inset-inline-end: 15px;
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #d9e1ed !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,.96) !important;
    background-image: none !important;
    color: #748096 !important;
    box-shadow: 0 4px 12px rgba(20,38,70,.05) !important;
    font: inherit;
    cursor: pointer;
    transition: border-color .18s ease, color .18s ease, background .18s ease, transform .18s ease;
}

.acw-newsletter-popup__close span {
    display: block;
    margin-top: -2px;
    font-size: 25px;
    line-height: 1;
}

.acw-newsletter-popup button.acw-newsletter-popup__close:hover,
.acw-newsletter-popup button.acw-newsletter-popup__close:focus-visible {
    border-color: #bac8ef !important;
    background: #f7f9ff !important;
    color: var(--acw-popup-blue) !important;
    transform: rotate(3deg);
    outline: none;
}

.acw-newsletter-popup__mark {
    display: inline-grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin-bottom: 17px;
    border-radius: 16px;
    background: linear-gradient(135deg, #eef3ff, #f8faff);
    color: var(--acw-popup-blue);
    box-shadow: inset 0 0 0 1px rgba(49,93,244,.10);
}

.acw-newsletter-popup__eyebrow {
    display: block;
    margin-bottom: 7px;
    color: var(--acw-popup-blue);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.acw-newsletter-popup__dialog h2 {
    margin: 0 0 9px;
    padding: 0;
    color: var(--acw-popup-text);
    font-size: clamp(23px, 4vw, 29px);
    line-height: 1.35;
    letter-spacing: -.02em;
}

.acw-newsletter-popup__description {
    margin: 0 0 22px;
    color: var(--acw-popup-muted);
    font-size: 14px;
    line-height: 1.9;
}

.acw-newsletter-popup__fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.acw-newsletter-popup .acw-newsletter-popup__fields input[type="email"] {
    width: 100%;
    min-width: 0;
    height: 52px;
    margin: 0 !important;
    border: 1px solid #cbd6e5 !important;
    border-radius: 13px !important;
    background-color: #fff !important;
    background-repeat: no-repeat !important;
    background-size: 18px 18px !important;
    color: var(--acw-popup-text) !important;
    caret-color: var(--acw-popup-blue);
    font: inherit;
    outline: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03) !important;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.acw-newsletter-popup[dir="rtl"] .acw-newsletter-popup__fields input[type="email"] {
    direction: rtl;
    text-align: right;
    unicode-bidi: plaintext;
    padding: 0 44px 0 14px !important;
    background-position: right 15px center !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236f7d91' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5.5' width='17' height='13' rx='2'/%3E%3Cpath d='m4.5 7 7.5 6 7.5-6'/%3E%3C/svg%3E") !important;
}

.acw-newsletter-popup[dir="ltr"] .acw-newsletter-popup__fields input[type="email"] {
    direction: ltr;
    text-align: left;
    padding: 0 14px 0 44px !important;
    background-position: left 15px center !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236f7d91' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5.5' width='17' height='13' rx='2'/%3E%3Cpath d='m4.5 7 7.5 6 7.5-6'/%3E%3C/svg%3E") !important;
}

.acw-newsletter-popup .acw-newsletter-popup__fields input[type="email"]::placeholder { color: #98a4b6; opacity: 1; }
.acw-newsletter-popup .acw-newsletter-popup__fields input[type="email"]:hover { border-color: #aebddd !important; }
.acw-newsletter-popup .acw-newsletter-popup__fields input[type="email"]:focus {
    border-color: var(--acw-popup-blue) !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 3px rgba(49, 93, 244, .12), 0 8px 18px rgba(49, 93, 244, .06) !important;
}
.acw-newsletter-popup .acw-newsletter-popup__fields input[type="email"].is-invalid {
    border-color: #d94a4a !important;
    background-color: #fffafa !important;
    box-shadow: 0 0 0 3px rgba(217, 74, 74, .10) !important;
}
.acw-newsletter-popup .acw-newsletter-popup__fields input[type="email"]:disabled { background-color: #f7f9fc !important; color: #7a8799 !important; }

.acw-newsletter-popup .acw-newsletter-popup__fields button[type="submit"] {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 150px;
    min-height: 52px;
    margin: 0 !important;
    padding: 0 18px !important;
    border: 1px solid var(--acw-popup-blue) !important;
    border-radius: 13px !important;
    background: linear-gradient(135deg, var(--acw-popup-blue), #416ff8) !important;
    background-image: linear-gradient(135deg, var(--acw-popup-blue), #416ff8) !important;
    color: #fff !important;
    font: inherit;
    font-weight: 700;
    text-shadow: none !important;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(49,93,244,.20) !important;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.acw-newsletter-popup .acw-newsletter-popup__fields button[type="submit"]::before {
    content: '';
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5.5' width='17' height='13' rx='2'/%3E%3Cpath d='m4.5 7 7.5 6 7.5-6'/%3E%3C/svg%3E");
}
.acw-newsletter-popup .acw-newsletter-popup__fields button[type="submit"]:hover,
.acw-newsletter-popup .acw-newsletter-popup__fields button[type="submit"]:focus-visible {
    border-color: var(--acw-popup-blue-dark) !important;
    background: var(--acw-popup-blue-dark) !important;
    background-image: none !important;
    color: #fff !important;
    box-shadow: 0 12px 28px rgba(49,93,244,.26) !important;
    transform: translateY(-1px);
    outline: none;
}
.acw-newsletter-popup .acw-newsletter-popup__fields button[type="submit"]:disabled { cursor: wait; opacity: .75; transform: none; }
.acw-newsletter-popup__spinner {
    display: none; width: 16px; height: 16px; margin-inline-start: 2px;
    border: 2px solid rgba(255,255,255,.38); border-top-color: #fff; border-radius: 50%; animation: acw-popup-spin .7s linear infinite;
}
.acw-newsletter-popup__fields button.is-loading .acw-newsletter-popup__spinner { display: inline-block; }
.acw-newsletter-popup__status { min-height: 22px; margin-top: 10px; font-size: 12px; line-height: 1.6; }
.acw-newsletter-popup__status.is-success,
.acw-newsletter-popup__status.is-error {
    display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 7px 10px; border-radius: 10px; font-weight: 600;
}
.acw-newsletter-popup__status.is-success { background: #eefbf4; color: #16794a; }
.acw-newsletter-popup__status.is-success::before {
    content: '✓'; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #d9f5e5; color: #16794a; font-weight: 800;
}
.acw-newsletter-popup__status.is-error { background: #fff3f3; color: #b73737; }
.acw-newsletter-popup__status.is-error::before {
    content: '!'; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #ffe2e2; color: #b73737; font-weight: 800;
}

.acw-newsletter-popup__privacy {
    margin: 5px 0 0;
    color: #8a96a9;
    font-size: 11px;
    line-height: 1.7;
}

.acw-newsletter-popup__honeypot {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
}

html.acw-newsletter-popup-open,
html.acw-newsletter-popup-open body {
    overflow: hidden;
}

@keyframes acw-popup-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
    .acw-newsletter-popup {
        align-items: end;
        padding: 10px;
    }

    .acw-newsletter-popup__dialog {
        width: 100%;
        padding: 27px 19px 21px;
        border-radius: 21px;
        transform: translateY(28px);
    }

    .acw-newsletter-popup button.acw-newsletter-popup__close {
        inset-block-start: 11px;
        inset-inline-end: 11px;
    }

    .acw-newsletter-popup__mark {
        width: 48px;
        height: 48px;
        margin-bottom: 14px;
    }

    .acw-newsletter-popup__fields {
        grid-template-columns: 1fr;
    }

    .acw-newsletter-popup .acw-newsletter-popup__fields button[type="submit"] {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .acw-newsletter-popup,
    .acw-newsletter-popup__dialog,
    .acw-newsletter-popup__close,
    .acw-newsletter-popup__fields button[type="submit"] {
        transition: none !important;
    }

    .acw-newsletter-popup__spinner {
        animation-duration: 1.2s;
    }
}
