/* toast.css — глобальні auth/system повідомлення (django messages) */
.toast-stack {
  position: fixed;
  top: calc(1rem + env(safe-area-inset-top, 0px));
  right: max(1rem, env(safe-area-inset-right, 0px));
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  max-width: min(23rem, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 12px;
  background: rgba(13, 18, 64, 0.96);
  border: 1px solid rgba(34, 6, 199, 0.35);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  font-family: var(--font-body, 'Arimo', sans-serif);
  font-size: 0.875rem;
  line-height: 1.4;
  color: #e8e8f3;
  pointer-events: auto;
  animation: toast-in 0.25s ease-out;
}

.toast--error {
  background: rgba(64, 13, 13, 0.96);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.toast--warning {
  background: rgba(64, 45, 13, 0.96);
  border-color: rgba(232, 180, 41, 0.4);
  color: #f5d9a0;
}

.toast__text {
  flex: 1 1 auto;
  min-width: 0;
}

.toast__close {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  opacity: 0.6;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: opacity var(--transition-base, 0.2s ease);
  -webkit-tap-highlight-color: transparent;
}

.toast__close:hover {
  opacity: 1;
}

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

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

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

@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
  .toast.is-leaving { animation: none; opacity: 0; }
}

@media (max-width: 480px) {
  .toast-stack {
    left: 1rem;
    right: 1rem;
    max-width: none;
  }
}
