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

/* ── Toast ── */
.toast {
  width: 100%;
  pointer-events: all;
  background: rgba(255,255,255,0.72);
  border: 1.5px solid rgba(255,255,255,.92);
  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 14px 16px;
  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; }
}

/* Accent bar gauche */
.toast::before {
  content: '';
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 0 2px 2px 0;
}
.toast.t-success::before { background: var(--green); }
.toast.t-error::before   { background: var(--red); }
.toast.t-warning::before { background: var(--orange); }
.toast.t-info::before    { background: var(--accent); }

/* Progress bar */
.toast-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 2.5px;
  border-radius: 0 0 16px 16px;
  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: 34px; height: 34px;
  flex-shrink: 0;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.toast-icon svg { width: 16px; height: 16px; fill: none; stroke-width: 2; }

.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: .84rem; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.toast-msg   { font-size: .76rem; font-weight: 300; color: 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;
  }
}
