/* ==========================================================================
   Toast notifications — fixed bottom-center, auto/manual dismiss.
   Dark-theme by default (this app defaults to dark mode); semantic tinted
   background + full border per type. Uses app design tokens with fallbacks.
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: calc(100% - 2rem);
  max-width: 32rem;
  pointer-events: none; /* clicks pass through to the page behind */
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  background: var(--wt-surface, #1e1830);
  color: var(--wt-text, #efeaf7);
  border: 1px solid var(--wt-border, #392f54);
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  pointer-events: auto; /* but the toasts themselves are interactive */
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.toast-show {
  opacity: 1;
  transform: translateY(0);
}

.toast.toast-hide {
  opacity: 0;
  transform: translateY(1rem);
}

/* Type accents — semantic tinted background + matching text and border */
/* Near-opaque semantic fills with white text so messages stay readable over
   any page content (the old 0.12 tints were too transparent). */
.toast-notice {
  background: rgba(6, 95, 70, 0.95);
  color: #ffffff;
  border-color: rgba(16, 185, 129, 0.9);
}

.toast-alert {
  background: rgba(153, 27, 27, 0.95);
  color: #ffffff;
  border-color: rgba(239, 68, 68, 0.9);
}

.toast-content {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.45;
  color: inherit;
}

.toast-dismiss {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  background: transparent;
  color: var(--wt-text-muted, #b9aed4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.4rem;
  transition: color 0.2s ease, background 0.2s ease;
}

.toast-dismiss:hover,
.toast-dismiss:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: var(--wt-text, #efeaf7);
}

/* Responsive — full-width edges and larger touch targets on mobile */
@media (max-width: 640px) {
  .toast-container {
    bottom: 1rem;
    width: calc(100% - 1.5rem);
  }

  .toast {
    padding: 0.8rem 1rem;
  }

  .toast-content {
    font-size: 0.9rem;
  }

  .toast-dismiss {
    width: 2.75rem;
    height: 2.75rem;
  }
}

/* Respect reduced-motion: no slide, just appear/disappear */
@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: opacity 0.2s ease;
    transform: none;
  }

  .toast.toast-show,
  .toast.toast-hide {
    transform: none;
  }
}
