/* overlays.css — Confirm dialog, cookie banner, flash toasts.
 * Uses the global qb-* design tokens (mint #65D6A5, pure-neutral
 * charcoal surfaces, IBM Plex Sans). Self-contained — preserves the
 * DOM ids/classes that base.js wires up programmatically. */

/* =====================================================================
   FLASH TOAST — top-centered, dismissible
   ===================================================================== */
.qb-flash-stack {
    position: fixed;
    top: 64px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    pointer-events: none;
}
.flash-toast {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: min(560px, calc(100vw - 32px));
    padding: 12px 14px 12px 16px;
    background: #141414;
    border: 1px solid #2A2A2A;
    border-left-width: 3px;
    border-left-color: #65D6A5;
    color: #EDEDED;
    font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    line-height: 1.45;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 28px -8px rgba(0, 0, 0, 0.55);
    animation: qb-flash-in 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.flash-toast--info    { border-left-color: #65D6A5; }
.flash-toast--success { border-left-color: #4FA875; }
.flash-toast--warning { border-left-color: #D4B248; }
.flash-toast--error   { border-left-color: #C25450; }

.flash-toast__msg     { flex: 1 1 auto; }
.flash-toast__msg a   { color: #65D6A5; text-decoration: underline; text-underline-offset: 2px; }
.flash-toast__msg a:hover { color: #84E0BA; }

.flash-toast__close {
    flex-shrink: 0;
    width: 24px; height: 24px;
    background: transparent;
    border: 0;
    color: #797979;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.12s ease, background-color 0.12s ease;
    padding: 0;
}
.flash-toast__close:hover { color: #EDEDED; background: #1C1C1C; }
.flash-toast__close svg { width: 12px; height: 12px; display: block; }

@keyframes qb-flash-in {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =====================================================================
   COOKIE BANNER — bottom-centered, low chrome
   ===================================================================== */
#cookie-banner {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 90;
    width: calc(100% - 32px);
    max-width: 560px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
#cookie-banner.hidden { display: none; }
.qb-cookie {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 14px 12px 18px;
    background: #141414;
    border: 1px solid #2A2A2A;
    color: #B5B5B5;
    font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 12px 32px -10px rgba(0, 0, 0, 0.6);
}
.qb-cookie__text { flex: 1 1 auto; }
.qb-cookie__text a {
    color: #65D6A5;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.qb-cookie__actions {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
}
.qb-cookie__btn {
    flex-shrink: 0;
    background: #65D6A5;
    color: #04231A;
    border: 1px solid #65D6A5;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.qb-cookie__btn:hover { background: #84E0BA; border-color: #84E0BA; }
.qb-cookie__btn:focus-visible { outline: 2px solid #65D6A5; outline-offset: 2px; }
/* "Necessary only" — equal layer / equal click cost as "Accept all", just a
   quieter fill so the page doesn't read as a dark pattern. */
.qb-cookie__btn--ghost {
    background: transparent;
    color: #C9C9C9;
    border-color: #3A3A3A;
}
.qb-cookie__btn--ghost:hover { background: #1F1F1F; border-color: #4A4A4A; color: #E5E5E5; }

@media (max-width: 480px) {
    .qb-cookie { flex-direction: column; align-items: stretch; gap: 10px; }
    .qb-cookie__actions { width: 100%; }
    .qb-cookie__btn { flex: 1 1 0; padding: 10px 14px; }
}

/* =====================================================================
   CONFIRM DIALOG — used by base.js for any [data-confirm] form
   Preserves IDs (#confirm-dialog, #confirm-body, #confirm-ok, #confirm-cancel)
   and class names (.confirm-overlay, .confirm-modal, .confirm-btn) so the
   existing JS keeps working. Visual only — no logic change.
   ===================================================================== */
.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: qb-confirm-fade 0.16s ease both;
}
.confirm-overlay.hidden { display: none; }

.confirm-modal {
    width: 100%;
    max-width: 440px;
    background: #141414;
    border: 1px solid #2A2A2A;
    padding: 28px 28px 22px;
    box-shadow: 0 32px 64px -16px rgba(0, 0, 0, 0.7);
    font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
    animation: qb-confirm-pop 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.confirm-title {
    font-family: "IBM Plex Sans", sans-serif;
    font-weight: 600;
    font-size: 1.125rem;
    color: #FFFFFF;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0 0 10px;
}
.confirm-body {
    color: #B5B5B5;
    font-size: 14px;
    line-height: 1.55;
    margin: 0 0 24px;
}
.confirm-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.confirm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    min-width: 96px;
    padding: 0 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.confirm-btn-secondary {
    background: transparent;
    color: #EDEDED;
    border-color: #3A3A3A;
}
.confirm-btn-secondary:hover {
    background: #1C1C1C;
    border-color: #4D4D4D;
    color: #FFFFFF;
}
.confirm-btn-danger {
    background: #C25450;
    color: #FFFFFF;
    border-color: #C25450;
    font-weight: 600;
}
.confirm-btn-danger:hover { background: #D26A66; border-color: #D26A66; }

.confirm-btn:focus-visible {
    outline: 2px solid #65D6A5;
    outline-offset: 2px;
}

@keyframes qb-confirm-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes qb-confirm-pop {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
    .confirm-modal { padding: 22px 20px 18px; }
    .confirm-actions { flex-direction: column-reverse; }
    .confirm-btn { width: 100%; min-width: 0; }
}
