/* ── Toast container ── */
#toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
  width: 380px;
}

/* ── Toast ── */
.toast {
  width: 100%;
  pointer-events: all;
  background: rgba(255,255,255,0.94);
  border: 1px solid var(--color-border, rgba(15,14,26,.10));
  border-radius: 16px;
  backdrop-filter: blur(22px);
  box-shadow: 0 8px 32px rgba(120,130,160,.14), inset 0 1px 0 rgba(255,255,255,.95);
  padding: 14px 14px 18px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  overflow: hidden;
  animation: toastIn .38s cubic-bezier(.22,.68,0,1.2) both;
}

.toast.removing {
  animation: toastOut .32s ease-in forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(28px) scale(.96); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0) scale(1); max-height: 120px; margin-bottom: 0; }
  to   { opacity: 0; transform: translateX(28px) scale(.95); max-height: 0; padding-top: 0; padding-bottom: 0; border-width: 0; }
}

/* Barre d'accent gauche : retirée.
   L'icône colorée et la barre de progression portent déjà le code couleur du
   toast ; un troisième rappel alourdissait la carte sans rien apprendre. */

/* Progress bar */
.toast-progress {
  position: absolute;
  bottom: 7px; left: 16px;
  height: 3px;
  max-width: calc(100% - 32px);
  border-radius: 999px;
  animation: toastProgress linear forwards;
}
.toast.t-success .toast-progress { background: linear-gradient(90deg, var(--green), #7de8c8); }
.toast.t-error   .toast-progress { background: linear-gradient(90deg, var(--red), #ff99b4); }
.toast.t-warning .toast-progress { background: linear-gradient(90deg, var(--orange), #ffd08c); }
.toast.t-info    .toast-progress { background: linear-gradient(90deg, var(--accent), var(--accent2)); }

@keyframes toastProgress { from { width: 100%; } to { width: 0%; } }

/* Icône */
.toast-icon {
  width: 30px; height: 30px;
  flex-shrink: 0;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
/* `stroke-linecap: round` n'est pas cosmetique ici. Ces icones dessinent le
   point du point d'exclamation avec `h.01`, un trait d'un centieme d'unite qui
   n'existe QUE grace a une extremite arrondie. Sans elle il se rend en eclat
   invisible : le point disparait et il ne reste qu'une barre tronquee. Meme
   chose pour les icones d'avertissement et d'information. */
.toast-icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.toast.t-success .toast-icon { background: rgba(94,207,174,.14); }
.toast.t-success .toast-icon svg { stroke: var(--green); }
.toast.t-error   .toast-icon { background: rgba(255,107,138,.12); }
.toast.t-error   .toast-icon svg { stroke: var(--red); }
.toast.t-warning .toast-icon { background: rgba(255,184,108,.14); }
.toast.t-warning .toast-icon svg { stroke: var(--orange); }
.toast.t-info    .toast-icon { background: rgba(124,158,255,.12); }
.toast.t-info    .toast-icon svg { stroke: var(--accent); }

/* Texte */
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: .86rem; font-weight: 600; color: var(--color-text-primary, var(--text)); margin-bottom: 3px; }
.toast-msg   { font-size: .8rem; font-weight: 400; color: var(--color-text-secondary, var(--muted)); line-height: 1.5; }

/* Fermer */
.toast-close {
  width: 24px; height: 24px;
  flex-shrink: 0;
  border-radius: 7px;
  background: none; border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
  margin-top: 1px;
}
.toast-close:hover { background: rgba(0,0,0,.06); }
.toast-close svg { width: 12px; height: 12px; stroke: var(--muted); fill: none; stroke-width: 2; }

/* Responsive */
@media (max-width: 480px) {
  #toast-container {
    top: 72px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}
