/* Toast notifications: shared by server flashes and window.showToast (static/toast.js).
   Self-contained so standalone pages (login, landing, 2FA...) don't need Tailwind. */

.toast-container {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 24rem;
  max-width: calc(100vw - 2rem);
  pointer-events: none;
}

@media (max-width: 639px) {
  .toast-container { left: 1rem; width: auto; }
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #fff;
  color: #374151;
  font-size: 0.875rem;
  line-height: 1.4;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  animation: toast-in 0.3s ease;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.is-leaving { opacity: 0; transform: translateX(1rem); }

.toast-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-top: 0.45rem;
  border-radius: 50%;
  background: #2563eb;
}
.toast.success .toast-dot { background: #16a34a; }
.toast.error .toast-dot { background: #dc2626; }
.toast.warning .toast-dot { background: #f59e0b; }

.toast-message { flex: 1; overflow-wrap: anywhere; }

.toast-close {
  flex-shrink: 0;
  margin: -0.125rem -0.25rem 0 0;
  padding: 0.125rem;
  border: 0;
  border-radius: 0.25rem;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  line-height: 0;
}
.toast-close:hover { color: #374151; }
.toast-close:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }

.dark .toast { background: #1f2937; border-color: #374151; color: #e5e7eb; }
.dark .toast-close:hover { color: #fff; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(1rem); }
  to { opacity: 1; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; transition: none; }
}
