.fd-exit-popup[hidden] {
    display: none !important;
}

.fd-exit-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    padding: 24px;
    color: #102847;
    font-family: inherit;
}

.fd-exit-popup *,
.fd-exit-popup *::before,
.fd-exit-popup *::after {
    box-sizing: border-box;
}

.fd-exit-popup__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(16, 40, 71, 0.58);
    cursor: default;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.fd-exit-popup__dialog {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 42px;
    border: 1px solid #c7c3bd;
    border-radius: 20px;
    outline: none;
    background: linear-gradient(145deg, #f7f6f4 0%, #e5e3df 58%, #d5d2ce 100%);
    box-shadow: 0 26px 80px rgba(9, 24, 43, 0.28);
    animation: fd-exit-popup-in 220ms ease-out both;
}

.fd-exit-popup__close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0 0 3px;
    border: 1px solid #c9c5bf;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.72);
    color: #102847;
    font: 400 32px/1 Arial, sans-serif;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.fd-exit-popup__close:hover,
.fd-exit-popup__close:focus-visible {
    border-color: #102847;
    background: #ffffff;
    color: #102847;
    transform: rotate(5deg);
}

.fd-exit-popup__copy {
    padding-right: 38px;
}

.fd-exit-popup__eyebrow {
    margin: 0 0 10px;
    color: #53657a;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.fd-exit-popup__copy h2 {
    margin: 0 0 12px;
    color: #102847;
    font-size: clamp(27px, 3.2vw, 38px);
    font-weight: 800;
    line-height: 1.12;
    text-transform: none;
}

.fd-exit-popup__copy > p:last-child {
    max-width: 580px;
    margin: 0;
    color: #344a63;
    font-size: 18px;
    line-height: 1.45;
}

.fd-exit-popup__form {
    margin-top: 26px;
}

.fd-exit-popup .wpcf7,
.fd-exit-popup .wpcf7-form {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #102847 !important;
}

.fd-exit-popup .callback-title,
.fd-exit-popup .callback-desc {
    display: none !important;
}

.fd-exit-popup .callback-fields {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px !important;
    width: 100% !important;
    margin: 0 !important;
}

.fd-exit-popup .callback-fields > p,
.fd-exit-popup .callback-fields > br {
    display: none !important;
}

.fd-exit-popup .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
    margin: 0 !important;
}

.fd-exit-popup .callback-fields > .wpcf7-form-control-wrap:last-of-type {
    grid-column: 1 / -1;
}

.fd-exit-popup input[type="text"],
.fd-exit-popup input[type="tel"] {
    width: 100% !important;
    min-height: 50px;
    margin: 0 !important;
    padding: 12px 15px !important;
    border: 1px solid #c5c1bb !important;
    border-radius: 11px !important;
    outline: none;
    background: rgba(255, 255, 255, 0.94) !important;
    color: #102847 !important;
    font: inherit !important;
    font-size: 16px !important;
    box-shadow: none !important;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.fd-exit-popup input[type="text"]::placeholder,
.fd-exit-popup input[type="tel"]::placeholder {
    color: #778596 !important;
    opacity: 1;
}

.fd-exit-popup input[type="text"]:focus,
.fd-exit-popup input[type="tel"]:focus {
    border-color: #53657a !important;
    box-shadow: 0 0 0 3px rgba(83, 101, 122, 0.16) !important;
}

.fd-exit-popup .privacy-policy {
    grid-column: 1 / -1;
    color: #344a63 !important;
    font-size: 13px;
    line-height: 1.4;
}

.fd-exit-popup .privacy-policy label,
.fd-exit-popup .privacy-policy .wpcf7-list-item {
    margin: 0 !important;
}

.fd-exit-popup .privacy-policy input[type="checkbox"] {
    accent-color: #102847;
}

.fd-exit-popup .privacy-policy a {
    color: #102847 !important;
    text-decoration: underline;
}

.fd-exit-popup input[type="submit"],
.fd-exit-popup .wpcf7-submit {
    min-width: 230px;
    min-height: 50px;
    margin: 18px 0 0 !important;
    padding: 13px 22px !important;
    border: 0 !important;
    border-radius: 11px !important;
    background: #dc0014 !important;
    color: #ffffff !important;
    font: inherit !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: none !important;
    transition: background-color 160ms ease, transform 160ms ease;
}

.fd-exit-popup input[type="submit"]:hover,
.fd-exit-popup input[type="submit"]:focus-visible,
.fd-exit-popup .wpcf7-submit:hover,
.fd-exit-popup .wpcf7-submit:focus-visible {
    background: #b90011 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

.fd-exit-popup .wpcf7-not-valid-tip {
    margin-top: 5px;
    color: #b90011 !important;
    font-size: 12px;
}

.fd-exit-popup .wpcf7-response-output {
    margin: 16px 0 0 !important;
    padding: 10px 12px !important;
    border-radius: 9px;
    color: #102847 !important;
    font-size: 14px;
}

body.fd-exit-popup-open {
    overflow: hidden;
}

@keyframes fd-exit-popup-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 640px) {
    .fd-exit-popup {
        padding: 12px;
    }

    .fd-exit-popup__dialog {
        max-height: calc(100vh - 24px);
        padding: 31px 20px 24px;
        border-radius: 16px;
    }

    .fd-exit-popup__close {
        top: 10px;
        right: 10px;
        width: 38px;
        height: 38px;
        font-size: 29px;
    }

    .fd-exit-popup__copy {
        padding-right: 28px;
    }

    .fd-exit-popup__copy h2 {
        font-size: 25px;
    }

    .fd-exit-popup__copy > p:last-child {
        font-size: 16px;
    }

    .fd-exit-popup__form {
        margin-top: 20px;
    }

    .fd-exit-popup .callback-fields {
        grid-template-columns: 1fr;
        gap: 11px !important;
    }

    .fd-exit-popup .privacy-policy {
        grid-column: auto;
    }

    .fd-exit-popup .callback-fields > .wpcf7-form-control-wrap:last-of-type {
        grid-column: auto;
    }

    .fd-exit-popup input[type="submit"],
    .fd-exit-popup .wpcf7-submit {
        width: 100% !important;
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fd-exit-popup__dialog {
        animation: none;
    }

    .fd-exit-popup__close,
    .fd-exit-popup input[type="submit"],
    .fd-exit-popup .wpcf7-submit {
        transition: none;
    }
}
