/*
 * FYGO Exit Save popup. Self-contained: the FYGO palette is re-declared
 * here (the plugin must not depend on the theme's stylesheets), and every
 * rule is prefixed fygo-es so nothing leaks in or out.
 */
.fygo-es {
    --fyes-orange: #FF6B35;
    --fyes-navy: #0A1628;
    --fyes-ink: #0F0F0F;
    --fyes-muted: #6B7280;
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.fygo-es[hidden] { display: none; }
html.fyes-open { overflow: hidden; }

.fygo-es-mask {
    position: absolute;
    inset: 0;
    background: rgba(10, 22, 40, 0.55);
}

.fygo-es-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 18px;
    padding: 30px 26px 26px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(10, 22, 40, 0.35);
    animation: fyes-in 0.22s ease-out;
}
@keyframes fyes-in {
    from { opacity: 0; transform: translateY(14px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

.fygo-es-x {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--fyes-muted);
    font-size: 22px;
    line-height: 34px;
    padding: 0;
    cursor: pointer;
}
.fygo-es-x:hover { background: #F3F4F6; color: var(--fyes-ink); }

.fygo-es-brand {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.28em;
    color: var(--fyes-orange);
    margin-bottom: 10px;
}

.fygo-es-title {
    margin: 0 0 10px;
    font-size: 21px;
    line-height: 1.25;
    font-weight: 800;
    color: var(--fyes-navy);
}

.fygo-es-body {
    margin: 0 0 20px;
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--fyes-muted);
}

.fygo-es-claim {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 12px;
    background: var(--fyes-orange);
    color: #fff;
    font-size: 15.5px;
    font-weight: 700;
    padding: 14px 18px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.fygo-es-claim:hover { background: #E85A25; }
.fygo-es-claim.is-busy { opacity: 0.7; cursor: wait; }

.fygo-es-no {
    border: 0;
    background: none;
    margin-top: 12px;
    font-size: 13px;
    color: var(--fyes-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.fygo-es-no:hover { color: var(--fyes-ink); }

/* ── Success state ───────────────────────────────────────────────────── */
.fygo-es-done-tick {
    width: 46px;
    height: 46px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #E8F8EF;
    color: #0E9F4E;
    font-size: 22px;
    line-height: 46px;
}
.fygo-es-done-line {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fyes-muted);
}
.fygo-es-code {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: var(--fyes-navy);
    border: 2px dashed #D1D5DB;
    border-radius: 12px;
    padding: 12px 10px;
    margin: 0 0 12px;
    user-select: all;
}
.fygo-es-copy {
    border: 1.5px solid var(--fyes-navy);
    border-radius: 12px;
    background: #fff;
    color: var(--fyes-navy);
    font-size: 14px;
    font-weight: 700;
    padding: 11px 16px;
    width: 100%;
    cursor: pointer;
}
.fygo-es-copy:hover { background: var(--fyes-navy); color: #fff; }
.fygo-es-note {
    margin: 14px 0 16px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--fyes-muted);
}
.fygo-es-keep {
    border: 0;
    background: none;
    font-size: 13px;
    font-weight: 700;
    color: var(--fyes-navy);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.fygo-es-err {
    margin: 12px 0 0;
    font-size: 13px;
    color: #D63638;
}

/* The honeypot: present for bots, invisible to everyone else. */
.fygo-es-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* ── Mobile: a bottom sheet, thumb reachable, never full-screen ──────── */
@media (max-width: 640px) {
    .fygo-es { align-items: flex-end; padding: 0; }
    .fygo-es-card {
        max-width: none;
        border-radius: 18px 18px 0 0;
        padding: 26px 20px calc(22px + env(safe-area-inset-bottom, 0px));
        animation: fyes-up 0.25s ease-out;
    }
    @keyframes fyes-up {
        from { transform: translateY(100%); }
        to   { transform: none; }
    }
}

@media (prefers-reduced-motion: reduce) {
    .fygo-es-card { animation: none; }
}
