/**
 * Component: Toast
 * Rendered/dismissed by assets/js/components/toast.js into the
 * #sf-toast-region live region (added to footer.php). Visually reuses
 * the alert color language so success/error/etc. stay consistent with
 * the rest of the design system.
 */

.toast-region {
  position: fixed;
  z-index: var(--sf-z-toast);
  bottom: var(--sf-space-5);
  right: var(--sf-space-5);
  left: var(--sf-space-5);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sf-space-3);
  pointer-events: none;
}
@media (min-width: 640px) {
  .toast-region { left: auto; width: 360px; }
}

.toast {
  pointer-events: auto;
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: var(--sf-space-3);
  background: var(--sf-ink);
  color: var(--sf-on-ink);
  border-radius: var(--sf-radius-md);
  padding: var(--sf-space-4) var(--sf-space-4);
  box-shadow: var(--sf-shadow-lg);
  font-size: var(--sf-text-sm);
  animation: sf-toast-in var(--sf-duration-base) var(--sf-ease);
}

.toast.is-leaving {
  animation: sf-toast-out var(--sf-duration-base) var(--sf-ease) forwards;
}

.toast__icon { flex-shrink: 0; width: 1.1em; height: 1.1em; margin-top: 0.1em; }
.toast__body { flex: 1; min-width: 0; }
.toast__title { font-weight: var(--sf-weight-semibold); margin-bottom: 0.125rem; }
.toast__message { color: var(--sf-on-ink-muted); }

.toast__dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--sf-on-ink-muted);
  width: 1.5rem; height: 1.5rem;
  border-radius: var(--sf-radius-full);
  display: flex; align-items: center; justify-content: center;
}
.toast__dismiss:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.toast--success { border-left: 3px solid var(--sf-green); }
.toast--error { border-left: 3px solid var(--sf-red); }
.toast--warning { border-left: 3px solid var(--sf-amber); }
.toast--info { border-left: 3px solid var(--sf-indigo-100); }

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