/* Exit-intent "before you go" popup. Self-hosted, no third-party code.
   Built lazily by js/exit-popup.js only once a trigger actually fires,
   so none of this ever affects initial render/LCP. */

#xp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 17, 17, 0.55);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

#xp-overlay.xp-open { opacity: 1; }

#xp-card {
    background: #ffffff;
    border-radius: 18px;
    max-width: 440px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    transform: translateY(16px);
    transition: transform 0.25s ease;
}

#xp-overlay.xp-open #xp-card { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
    #xp-overlay, #xp-card { transition: none; }
}

#xp-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f3f3f3;
    color: #111111;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    z-index: 1;
}

#xp-close:hover { background: #e8e8e8; }

.xp-body {
    padding: 1.75rem 1.75rem 1.5rem;
    text-align: center;
    border-radius: 18px 18px 0 0;
}

.xp-heading {
    font-family: 'Barlow', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    color: #111111;
    margin-bottom: 0.5rem;
    line-height: 1.15;
}

.xp-offer {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary-accent, #D90429);
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.xp-subline {
    font-size: 0.92rem;
    color: #555555;
    font-weight: 500;
    margin-bottom: 1.4rem;
    line-height: 1.5;
}

.xp-form-error {
    color: var(--primary-accent, #D90429);
    font-size: 0.82rem;
    margin-top: 0.7rem;
    line-height: 1.4;
}

.xp-field {
    margin-bottom: 0.9rem;
    text-align: left;
}

.xp-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: #333333;
    margin-bottom: 0.35rem;
}

.xp-field input {
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: 1.05rem;
    border: 2px solid #e2e2e2;
    border-radius: 10px;
    background: #fafafa;
    font-family: 'Inter', sans-serif;
}

.xp-field input:focus {
    outline: none;
    border-color: var(--primary-accent, #D90429);
    background: #ffffff;
}

.xp-field input[aria-invalid="true"] {
    border-color: var(--primary-accent, #D90429);
    background: rgba(217, 4, 41, 0.04);
}

.xp-error {
    display: block;
    color: var(--primary-accent, #D90429);
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

.xp-btn {
    display: block;
    width: 100%;
    padding: 0.95rem 1rem;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1rem;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    font-family: 'Inter', sans-serif;
}

.xp-btn-primary {
    background: var(--primary-accent, #D90429);
    color: #ffffff;
    border-color: var(--primary-accent, #D90429);
}

.xp-btn-primary:hover { background: var(--secondary-accent, #A8001E); border-color: var(--secondary-accent, #A8001E); }
.xp-btn-primary:disabled { opacity: 0.7; cursor: default; }

.xp-consent {
    font-size: 0.72rem;
    color: #999999;
    margin-top: 0.9rem;
    line-height: 1.4;
}

.xp-success {
    text-align: center;
    padding: 1rem 0 0;
}

.xp-success-code {
    font-family: 'Barlow', sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    color: #111111;
    margin-bottom: 0.5rem;
    line-height: 1.25;
}

.xp-success-code strong { color: var(--primary-accent, #D90429); }

.xp-success-text { font-size: 0.92rem; color: #555555; margin-bottom: 1.2rem; }

/* ===================== Mobile: bottom slide-up card ===================== */
@media (max-width: 767px) {
    #xp-overlay {
        align-items: flex-end;
        padding: 0;
    }
    #xp-card {
        max-width: none;
        width: 100%;
        max-height: 35vh;
        border-radius: 18px 18px 0 0;
        transform: translateY(100%);
    }
    #xp-overlay.xp-open #xp-card { transform: translateY(0); }

    .xp-body { padding: 1.1rem 1.25rem 1rem; }
    .xp-heading { font-size: 1.1rem; margin-bottom: 0.3rem; }
    .xp-offer { font-size: 0.95rem; margin-bottom: 0.3rem; }
    .xp-subline { font-size: 0.8rem; margin-bottom: 0.8rem; }
    .xp-field { margin-bottom: 0.6rem; }
    .xp-field input { padding: 0.75rem 0.9rem; font-size: 1rem; }
    .xp-btn { padding: 0.8rem 1rem; font-size: 0.92rem; }
    .xp-form-error { margin-top: 0.5rem; }
    .xp-success-code { font-size: 1.15rem; }
    .xp-success-text { font-size: 0.85rem; margin-bottom: 0.8rem; }
    .xp-consent { font-size: 0.68rem; margin-top: 0.6rem; }
    #xp-close { top: 0.5rem; right: 0.5rem; width: 32px; height: 32px; }
}
