/** Notifications toast (.app-toast) */
/* ═══════════════════════════════════════════════════════════════════════
   12. TOASTS — Notifications éphémères (refonte UI 2026, réf Pennylane)
   ───────────────────────────────────────────────────────────────────────
   Remplace les anciens bandeaux statiques `<div class="msg-flash">` placés
   en haut de page. Les toasts apparaissent en bas à droite, s'auto-ferment
   après ~4s, sont fermables manuellement (croix), et empilables.

   Pilotés par js/toasts.js qui expose window.toast.success/error/info.
   Côté serveur, App\Ui\Toast::render() emit le <script> qui déclenche.
   ─────────────────────────────────────────────────────────────────────── */

.app-toasts {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;  /* nouveaux en bas */
    gap: 10px;
    max-width: calc(100vw - 48px);
    pointer-events: none;            /* le container ne capte pas, les toasts si */
}
/* Toasts mobile : voir css/responsive/layout.css */

.app-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 280px;
    max-width: 420px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 3px solid #94a3b8;  /* couleur dépend du type, surchargé ci-dessous */
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(15,23,42,0.10), 0 2px 4px rgba(15,23,42,0.05);
    font-size: 0.8125rem;
    color: #0f172a;
    line-height: 1.4;
    animation: appToastIn 0.22s cubic-bezier(0.21, 1.02, 0.73, 1);
    transform-origin: bottom right;
}
.app-toast.is-leaving {
    animation: appToastOut 0.18s ease forwards;
}

.app-toast__icon {
    flex-shrink: 0;
    width: 18px; height: 18px;
    margin-top: 1px;
    display: flex; align-items: center; justify-content: center;
}
.app-toast__body {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
}
.app-toast__close {
    flex-shrink: 0;
    width: 20px; height: 20px;
    margin: -2px -4px 0 0;
    padding: 0;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; line-height: 1;
    transition: background 0.12s ease, color 0.12s ease;
}
.app-toast__close:hover { background: #f1f5f9; color: #475569; }

/* Variantes par type — colorent juste la bordure gauche + l'icône */
.app-toast--success { border-left-color: #16a34a; }
.app-toast--success .app-toast__icon { color: #16a34a; }
.app-toast--error   { border-left-color: #dc2626; }
.app-toast--error   .app-toast__icon { color: #dc2626; }
.app-toast--info    { border-left-color: #006EB9; }
.app-toast--info    .app-toast__icon { color: #006EB9; }
.app-toast--warning { border-left-color: #d97706; }
.app-toast--warning .app-toast__icon { color: #d97706; }

@keyframes appToastIn {
    from { opacity: 0; transform: translateX(40px) scale(0.96); }
    to   { opacity: 1; transform: translateX(0)    scale(1); }
}
@keyframes appToastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(40px); }
}
