/* ════════════════════════════════════════════════════════════
   Notifications (toasts) — boutique, connexion et administration
   ════════════════════════════════════════════════════════════ */
.toast-stack {
  position: fixed;
  top: calc(var(--header-h, 72px) + 14px);
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast-stack--auth,
.toast-stack--admin { top: 20px; }

.toast {
  --t-accent: #15244F;
  --t-soft: #EEF1F7;
  pointer-events: auto;
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr 26px;
  align-items: start;
  gap: 12px;
  padding: 14px 12px 16px 14px;
  background: #fff;
  color: #1B2440;
  border: 1px solid rgba(21, 36, 79, .08);
  border-radius: 10px;
  box-shadow: 0 14px 34px -10px rgba(15, 26, 58, .28), 0 2px 6px rgba(15, 26, 58, .06);
  overflow: hidden;
  font: 400 .9rem/1.45 'DM Sans', system-ui, -apple-system, sans-serif;
  animation: toast-in .38s cubic-bezier(.16, 1, .3, 1) both;
}
.toast--success { --t-accent: #1F7A4D; --t-soft: #E6F3EC; }
.toast--error   { --t-accent: #B42318; --t-soft: #FCEBE9; }
.toast--warning { --t-accent: #A15C07; --t-soft: #FDF1DF; }
.toast--info    { --t-accent: #8A6E2C; --t-soft: #F6EEDD; }

.toast__icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--t-soft);
  color: var(--t-accent);
}
.toast__icon svg { width: 18px; height: 18px; }

.toast__body { min-width: 0; padding-top: 1px; }
.toast__title {
  display: block;
  margin: 0 0 2px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--t-accent);
}
.toast__msg {
  margin: 0;
  color: #2A3350;
  overflow-wrap: anywhere;
}

.toast__close {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #8A90A2;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.toast__close:hover { background: #F1F2F6; color: #1B2440; }
.toast__close:focus-visible { outline: 2px solid var(--t-accent); outline-offset: 1px; }
.toast__close svg { width: 14px; height: 14px; }

.toast__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--t-accent);
  opacity: .55;
  transform-origin: left center;
  animation: toast-bar var(--t-duree, 5s) linear forwards;
}
.toast:hover .toast__bar,
.toast:focus-within .toast__bar { animation-play-state: paused; }

.toast.is-leaving { animation: toast-out .25s ease forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(24px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(24px); }
}
@keyframes toast-bar {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

@media (max-width: 600px) {
  .toast-stack,
  .toast-stack--auth,
  .toast-stack--admin {
    top: 12px;
    right: 16px;
    left: 16px;
    width: auto;
  }
  @keyframes toast-in {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: none; }
  }
  @keyframes toast-out {
    to { opacity: 0; transform: translateY(-12px); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast, .toast.is-leaving { animation-duration: .01ms; }
  .toast__bar { animation: none; }
}

/* Thème sombre de l'administration */
body.admin-body.dark .toast {
  background: #1B2130;
  border-color: rgba(255, 255, 255, .08);
  color: #E6E9F2;
}
body.admin-body.dark .toast__msg { color: #C9CEDC; }
body.admin-body.dark .toast__close:hover { background: rgba(255, 255, 255, .08); color: #fff; }
body.admin-body.dark .toast--success { --t-soft: rgba(31, 122, 77, .2);  --t-accent: #5FD39A; }
body.admin-body.dark .toast--error   { --t-soft: rgba(180, 35, 24, .22); --t-accent: #F28B82; }
body.admin-body.dark .toast--warning { --t-soft: rgba(161, 92, 7, .25);  --t-accent: #F5B94E; }
body.admin-body.dark .toast--info    { --t-soft: rgba(196, 154, 78, .2); --t-accent: #E0B95B; }
