/* assets/css/toast.css — centered modal-style notification dialog.
   A square-ish card with an icon, a title, a message and action buttons — not the
   thin banner that used to slide in from the top. */

.toast-host {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.toast-host.is-open { display: flex; }

.toast-scrim {
    position: absolute;
    inset: 0;
    background: rgba(14, 26, 36, .45);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity .2s cubic-bezier(.22, .61, .36, 1);
}
.toast-host.is-in .toast-scrim { opacity: 1; }

/* ---------- the box ---------- */
.toast {
    position: relative;
    width: 100%;
    max-width: 360px;
    background: var(--surface, #fff);
    border: 1px solid var(--line, #dceaf5);
    border-radius: 20px;
    padding: 26px 22px 18px;
    text-align: center;
    box-shadow: 0 26px 60px -22px rgba(22, 35, 46, .45);
    animation: toast-pop .26s cubic-bezier(.22, .61, .36, 1) both;
}
.toast-host.is-out .toast { animation: toast-pop-out .18s cubic-bezier(.22, .61, .36, 1) both; }

@keyframes toast-pop {
    from { opacity: 0; transform: translateY(12px) scale(.94); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-pop-out {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(6px) scale(.97); }
}

/* ---------- icon badge ---------- */
.toast-ico {
    width: 54px;
    height: 54px;
    margin: 0 auto 14px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: var(--bg-sky, #eaf6ff);
    color: var(--sky-d, #1f86c6);
}
.toast-ico svg { width: 27px; height: 27px; }

/* ---------- text ---------- */
.toast-body { display: grid; gap: 6px; }
.toast-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink, #16232e);
    letter-spacing: -.01em;
    margin: 0;
}
.toast-msg {
    font-size: 13px;
    line-height: 1.6;
    color: var(--ink-2, #5d7285);
    margin: 0;
    word-break: break-word;
}

/* ---------- actions ---------- */
.toast-actions {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}
.toast-actions .btn { width: 100%; height: 42px; font-size: 13.5px; }

/* close X in the corner */
.toast-x {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--ink-3, #8497a6);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background-color .14s cubic-bezier(.22,.61,.36,1), color .14s cubic-bezier(.22,.61,.36,1);
}
.toast-x:hover { background: var(--bg-sky, #eaf6ff); color: var(--ink-2, #5d7285); }
.toast-x svg { width: 14px; height: 14px; }

/* ---------- variants ---------- */
.toast-success .toast-ico { background: #e8f9f0; color: #2fa86a; }
.toast-error   .toast-ico { background: #fdeeee; color: #e05c5c; }
.toast-warning .toast-ico { background: #fff5e5; color: #dd9820; }
.toast-info    .toast-ico { background: #eaf6ff; color: #2e9adb; }

/* ---------- dark ---------- */
html.theme-dark .toast { background: #16202b; border-color: #26343f; }
html.theme-dark .toast-title { color: #e8f2fa; }
html.theme-dark .toast-msg { color: #9fb3c4; }
html.theme-dark .toast-ico { background: #1e2c39; }
html.theme-dark .toast-success .toast-ico { background: #16322a; color: #5ecfa1; }
html.theme-dark .toast-error   .toast-ico { background: #36201f; color: #f08989; }
html.theme-dark .toast-warning .toast-ico { background: #362c18; color: #e8b561; }
html.theme-dark .toast-info    .toast-ico { background: #14283a; color: #74c3ee; }

@media (max-width: 420px) {
    .toast { max-width: 100%; padding: 22px 18px 16px; }
    .toast-ico { width: 48px; height: 48px; margin-bottom: 12px; }
    .toast-ico svg { width: 24px; height: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    .toast, .toast-host.is-out .toast { animation: none; }
    .toast-scrim { transition: none; }
}
