/* Toast messages, see js/general/toast.js */

.toast-container {
  position: fixed;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 380px;
  max-width: calc(100% - 32px);
  padding: 0;
  pointer-events: none;
}

.toast-container--top-left,
.toast-container--top-center,
.toast-container--top-right {
  top: 16px;
}

.toast-container--bottom-left,
.toast-container--bottom-center,
.toast-container--bottom-right {
  bottom: 16px;
}

.toast-container--top-left,
.toast-container--bottom-left {
  left: 16px;
}

.toast-container--top-right,
.toast-container--bottom-right {
  right: 16px;
}

.toast-container--top-center,
.toast-container--bottom-center {
  left: 50%; transform: translateX(-50%);
}

.toast {
  --toast-accent: #3b82f6;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-sizing: border-box;
  padding: 16px 40px 16px 16px;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2933;
  font-size: 14px;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.18);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-container--top-left .toast,
.toast-container--top-center .toast,
.toast-container--top-right .toast {
  transform: translateY(-8px);
}

.toast--visible {
  opacity: 1;
  transform: translateY(0) !important;
}

.toast--info { --toast-accent: oklch(0.623 0.214 259.815); }
.toast--success { --toast-accent: oklch(0.704 0.14 182.503); }
.toast--warning { --toast-accent: oklch(0.769 0.188 70.08); }
.toast--error { --toast-accent: oklch(0.577 0.245 27.325); }

.toast::before {
  content: "i";
  flex: 0 0 14px;
  height: 14px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--toast-accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 10px;
  line-height: 14px;
  text-align: center;
}

.toast--success::before { content: "\2713"; }
.toast--warning::before { content: "!"; }
.toast--error::before { content: "!"; }

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

.toast__title {
  font-size: 14px;
  font-weight: 500;
  color: oklch(27.4% 0.006 286.033);
}

.toast__description {
  margin-top: 2px; color: #4b5563;
}

.toast__button {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 14px;
  border: 0;
  border-radius: 6px;
  background: var(--toast-accent);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.toast__button:hover,
.toast__button:focus {
  filter: brightness(0.92);
  color: #ffffff;
  text-decoration: none;
}

.toast__button--subtle {
  margin-top: 8px;
  padding: 0;
  border-radius: 2px;
  background: none;
  font-size: 12px;
  color: color-mix(in oklab, var(--toast-accent) 85%, black);
  text-align: left;
}

.toast__button--subtle:hover,
.toast__button--subtle:focus {
  filter: none;
  color: color-mix(in oklab, var(--toast-accent) 95%, black);
}

.toast__close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  font-size: 20px;
  line-height: 28px;
  cursor: pointer;
}

.toast__close:hover,
.toast__close:focus {
  background: #f3f4f6;
  color: #111827;
}

@media (max-width: 480px) {
  .toast-container {
    left: 16px !important;
    right: 16px !important;
    width: auto;
    transform: none !important;
  }
}

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