.am-toasts {
  position: fixed;
  top: 16px;
  right: 16px;
  left: auto;
  bottom: auto;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  width: min(420px, calc(100vw - 24px));
  pointer-events: none;
}

body:has(.shadcn-navbar) .am-toasts {
  top: 76px;
}

body.public-page .am-toasts {
  top: 88px;
}

.am-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 16px 14px 16px 16px;
  border: 1px solid transparent;
  border-left-width: 4px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  animation: am-toast-in 0.28s ease;
}

.am-toast.is-out {
  animation: am-toast-out 0.2s ease forwards;
}

.am-toast-icone {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin-top: 0;
  padding: 4px;
  border-radius: 999px;
}

.am-toast-texte {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.am-toast-close {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin: -4px -4px 0 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  opacity: 0.7;
}

.am-toast-close:hover {
  opacity: 1;
  background: rgba(15, 23, 42, 0.08);
}

.am-toast--success {
  background: #f4faf7;
  border-color: #c5e6d4;
  border-left-color: #6bb894;
  color: #2f6b52;
}

.am-toast--success .am-toast-icone {
  color: #4d8f70;
  background: #dff3e8;
}

.am-toast--success .am-toast-close {
  color: #4d8f70;
}

.am-toast--danger {
  background: #faf6f6;
  border-color: #e8cfcf;
  border-left-color: #d08989;
  color: #8a4a4a;
}

.am-toast--danger .am-toast-icone {
  color: #b06b6b;
  background: #f3e2e2;
}

.am-toast--danger .am-toast-close {
  color: #b06b6b;
}

.am-toast--warning {
  background: #faf8f3;
  border-color: #ead9b0;
  border-left-color: #d4b36a;
  color: #7a6234;
}

.am-toast--warning .am-toast-icone {
  color: #b08a45;
  background: #f3ebd4;
}

.am-toast--warning .am-toast-close {
  color: #b08a45;
}

@keyframes am-toast-in {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes am-toast-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}

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

@media (max-width: 575px) {
  .am-toasts {
    right: 12px;
    left: 12px;
    width: auto;
    align-items: stretch;
  }

  body:has(.shadcn-navbar) .am-toasts,
  body.public-page .am-toasts {
    top: 64px;
  }
}
