/* ==========================================================================
   Exit Notice — frontend styles
   WCAG 2.1 AA compliant: colour contrast ≥ 4.5:1, focus indicators,
   motion preference respected.

   SPECIFICITY STRATEGY: Every rule except the overlay itself and the body
   scroll-lock is scoped under #exit-notice-overlay. The ID contributes
   specificity (1,0,0), which reliably beats theme class/element selectors
   without resorting to !important.
   ========================================================================== */

/* ---- Overlay ------------------------------------------------------------ */
#exit-notice-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0);
    transition: background 240ms ease;
    box-sizing: border-box;
}

#exit-notice-overlay[hidden] {
    display: none;
}

#exit-notice-overlay.en-visible {
    display: flex;
    background: rgba(0, 0, 0, .55);
}

/* ---- Body scroll lock --------------------------------------------------- */
body.en-body-lock {
    overflow: hidden;
}

/* ---- Dialog box --------------------------------------------------------- */
#exit-notice-overlay .en-dialog {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    padding: 40px 36px 32px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    transform: scale(.92) translateY(12px);
    opacity: 0;
    transition: transform 240ms cubic-bezier(.34,1.56,.64,1),
                opacity   200ms ease;
    box-sizing: border-box;
    margin: 0 auto;
    font-family: inherit;
}

#exit-notice-overlay.en-visible .en-dialog {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ---- Icon --------------------------------------------------------------- */
#exit-notice-overlay .en-icon {
    color: var(--en-icon-color, #b91c1c);
    margin: 0 0 16px;
    line-height: 1;
}

#exit-notice-overlay .en-icon svg {
    width: 44px;
    height: 44px;
    display: block;
    margin: 0 auto;
}

/* ---- Title -------------------------------------------------------------- */
#exit-notice-overlay .en-title {
    margin: 0 0 12px;
    padding: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
    font-family: inherit;
    text-align: center;
    background: none;
    border: none;
    box-shadow: none;
}

/* ---- Message ------------------------------------------------------------ */
#exit-notice-overlay .en-message {
    margin: 0 0 28px;
    padding: 0;
    font-size: .95rem;
    line-height: 1.65;
    color: #374151;
    font-family: inherit;
    text-align: center;
    background: none;
}

#exit-notice-overlay .en-message a {
    color: #1d4ed8;
    text-decoration: underline;
}

#exit-notice-overlay .en-message a:hover {
    color: #1e40af;
}

/* ---- Actions container -------------------------------------------------- */
#exit-notice-overlay .en-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ---- Shared button reset + base styles ---------------------------------- */
#exit-notice-overlay .en-btn,
#exit-notice-overlay .en-btn:link,
#exit-notice-overlay .en-btn:visited {
    display: block;
    width: 100%;
    padding: 13px 24px;
    box-sizing: border-box;
    font-size: .9375rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    letter-spacing: normal;
    text-transform: none;
    border-radius: 6px;
    border-width: 2px;
    border-style: solid;
    outline: none;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
}

/* ---- Continue button ---------------------------------------------------- */
#exit-notice-overlay .en-btn--continue,
#exit-notice-overlay .en-btn--continue:link,
#exit-notice-overlay .en-btn--continue:visited {
    background: var(--en-continue-bg, #b91c1c);
    color: var(--en-continue-text, #ffffff);
    border-color: var(--en-continue-bg, #b91c1c);
}

#exit-notice-overlay .en-btn--continue:hover,
#exit-notice-overlay .en-btn--continue:focus-visible {
    background: var(--en-continue-hover-bg, #991b1b);
    border-color: var(--en-continue-hover-bg, #991b1b);
    color: var(--en-continue-text, #ffffff);
    text-decoration: none;
}

/* ---- Cancel button ------------------------------------------------------ */
#exit-notice-overlay .en-btn--cancel,
#exit-notice-overlay .en-btn--cancel:link,
#exit-notice-overlay .en-btn--cancel:visited {
    background: var(--en-cancel-bg, #ffffff);
    color: var(--en-cancel-text, #374151);
    border-color: #d1d5db;
}

#exit-notice-overlay .en-btn--cancel:hover,
#exit-notice-overlay .en-btn--cancel:focus-visible {
    background: var(--en-cancel-hover-bg, #f3f4f6);
    border-color: #9ca3af;
    color: var(--en-cancel-text, #374151);
    text-decoration: none;
}

/* ---- Focus rings (WCAG 2.4.11) ----------------------------------------- */
#exit-notice-overlay .en-btn:focus-visible,
#exit-notice-overlay .en-close:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 3px;
}

#exit-notice-overlay .en-btn:focus,
#exit-notice-overlay .en-close:focus {
    outline: 3px solid #2563eb;
    outline-offset: 3px;
}

/* ---- Close (×) button --------------------------------------------------- */
#exit-notice-overlay .en-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 140ms ease, color 140ms ease;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
}

#exit-notice-overlay .en-close:hover {
    background: #f3f4f6;
    color: #111827;
    border-color: transparent;
}

/* ---- Reduce-motion (WCAG 2.3.3) ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    #exit-notice-overlay,
    #exit-notice-overlay .en-dialog {
        transition: none;
    }
    #exit-notice-overlay .en-dialog {
        transform: none;
    }
}

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 480px) {
    #exit-notice-overlay .en-dialog {
        padding: 32px 20px 24px;
        border-radius: 10px;
    }

    #exit-notice-overlay .en-title {
        font-size: 1.1rem;
    }
}

/* ---- Windows High Contrast mode ---------------------------------------- */
@media (forced-colors: active) {
    #exit-notice-overlay .en-btn--continue {
        background: ButtonText;
        color: ButtonFace;
        border-color: ButtonText;
    }

    #exit-notice-overlay .en-btn--cancel {
        background: ButtonFace;
        color: ButtonText;
        border-color: ButtonText;
    }

    #exit-notice-overlay .en-dialog {
        border: 2px solid ButtonText;
    }
}
