/**
 * Exit Intent Popup — Luxury Judod Real Estate Design
 * Optimized for CRO, Flawless Alignment & Mobile Responsiveness
 */

.exit-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    direction: rtl;
}

.exit-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.exit-popup {
    background: #ffffff;
    border-radius: 28px;
    padding: 40px 32px 32px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    position: relative;
    transform: scale(0.92) translateY(24px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    box-shadow: 0 30px 70px -15px rgba(15, 39, 66, 0.25), 0 0 0 1px rgba(15, 39, 66, 0.08);
    box-sizing: border-box;
    overflow: hidden;
}

.exit-popup-overlay.active .exit-popup {
    transform: scale(1) translateY(0);
}

/* Luxury Top Accent Bar */
.exit-popup::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--brand-primary, #0F2742) 0%, var(--brand-accent, #C9A45C) 50%, var(--brand-primary, #0F2742) 100%);
    border-radius: 28px 28px 0 0;
}

/* Close Button */
.exit-popup__close {
    position: absolute;
    top: 18px;
    left: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    line-height: 1;
    padding: 0;
    z-index: 2;
}

.exit-popup__close:hover {
    background: var(--brand-primary, #0F2742);
    border-color: var(--brand-primary, #0F2742);
    color: #ffffff;
    transform: rotate(90deg);
}

/* Badge & Icon Area */
.exit-popup__badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.exit-popup__icon-wrap {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(15, 39, 66, 0.08) 0%, rgba(201, 164, 92, 0.15) 100%);
    border: 1px solid rgba(15, 39, 66, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px -6px rgba(15, 39, 66, 0.12);
}

.exit-popup__icon-emoji {
    font-size: 34px;
    line-height: 1;
    display: inline-block;
    animation: aqariWave 2s ease-in-out infinite alternate;
}

@keyframes aqariWave {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(15deg) scale(1.05); }
}

.exit-popup__tag {
    display: inline-block;
    padding: 4px 12px;
    background: #F9F5EC;
    border: 1px solid #E8CF96;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--brand-primary, #0F2742);
    letter-spacing: -0.2px;
}

/* Headings */
.exit-popup__title {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--brand-primary, #0F2742);
    margin: 6px 0 8px;
    line-height: 1.35;
}

.exit-popup__text {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0 0 22px;
    line-height: 1.6;
    padding: 0 10px;
}

/* Form & Inputs */
.exit-popup__form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.exit-popup__field {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.exit-popup__field-icon {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.95rem;
    pointer-events: none;
    transition: color 0.2s ease;
    z-index: 1;
}

.exit-popup__input {
    width: 100% !important;
    height: 50px !important;
    padding: 0 46px 0 16px !important;
    background: #f8fafc !important;
    border: 1.5px solid var(--brand-line, #E7E9EC) !important;
    border-radius: 12px !important;
    font-size: 0.92rem !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    color: var(--brand-dark, #1D2733) !important;
    transition: all 0.25s ease !important;
    outline: none !important;
    text-align: right !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    display: block !important;
}

.exit-popup__input::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.exit-popup__input:focus {
    border-color: var(--brand-accent, #C9A45C) !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 4px rgba(201, 164, 92, 0.15) !important;
}

.exit-popup__field:focus-within .exit-popup__field-icon {
    color: var(--brand-accent, #C9A45C);
}

/* Submit Button */
.exit-popup__btn {
    width: 100% !important;
    height: 52px !important;
    background: linear-gradient(135deg, var(--brand-primary, #0F2742) 0%, var(--brand-primary-dark, #0A1B2E) 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 14px !important;
    font-size: 1.02rem !important;
    font-weight: 800 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.25s ease !important;
    box-shadow: 0 10px 24px -6px rgba(15, 39, 66, 0.4) !important;
    box-sizing: border-box !important;
    margin-top: 4px !important;
}

.exit-popup__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px -6px rgba(15, 39, 66, 0.55) !important;
    background: linear-gradient(135deg, #153354 0%, var(--brand-primary, #0F2742) 100%) !important;
}

.exit-popup__btn svg {
    flex-shrink: 0;
}

/* Trust Indicators */
.exit-popup__trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.exit-popup__trust-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f8fafc;
    border: 1px solid var(--brand-line, #E7E9EC);
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #64748b;
}

.exit-popup__trust-item i {
    color: var(--brand-accent, #C9A45C);
    font-size: 0.8rem;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .exit-popup {
        padding: 32px 20px 24px;
        border-radius: 22px;
    }

    .exit-popup__title {
        font-size: 1.25rem;
    }

    .exit-popup__text {
        font-size: 0.85rem;
        margin-bottom: 18px;
    }

    .exit-popup__icon-wrap {
        width: 58px;
        height: 58px;
    }

    .exit-popup__icon-emoji {
        font-size: 28px;
    }

    .exit-popup__input {
        height: 46px !important;
        font-size: 0.88rem !important;
    }

    .exit-popup__btn {
        height: 48px !important;
        font-size: 0.95rem !important;
    }
}
