/*
 * Toasts: system messages shown as dismissible notices in the middle of the screen.
 *
 * Plain CSS on purpose. The homepage does not load Tailwind, and these have to
 * look the same on every page. Colours match the sign-in page's old message
 * boxes: green for status, amber for warnings, red for errors.
 */
.cc-toasts {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(420px, calc(100vw - 32px));
  margin: 0;
  padding: 0;
  pointer-events: none;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.cc-toasts:empty { display: none; }

.cc-toast {
  --toast-bg: #F0FAF2;
  --toast-border: #BBE5C3;
  --toast-ink: #1D5B2B;
  --toast-accent: #2E8B4A;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-sizing: border-box;
  padding: 14px 12px 14px 16px;
  background: var(--toast-bg);
  color: var(--toast-ink);
  border: 1px solid var(--toast-border);
  border-left: 4px solid var(--toast-accent);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(23, 24, 26, 0.14), 0 1px 3px rgba(23, 24, 26, 0.1);
  font-size: 14px;
  line-height: 1.5;
  pointer-events: auto;
  animation: cc-toast-in 0.22s ease-out;
}
.cc-toast--warning {
  --toast-bg: #FFF8E8;
  --toast-border: #F2D9A0;
  --toast-ink: #7A5410;
  --toast-accent: #C98A12;
}
.cc-toast--error {
  --toast-bg: #FFF3F3;
  --toast-border: #F2C0C0;
  --toast-ink: #8C2222;
  --toast-accent: #C93434;
}
.cc-toast.is-leaving {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.cc-toast__icon { flex: none; display: flex; margin-top: 1px; color: var(--toast-accent); }
.cc-toast__body { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.cc-toast__body p { margin: 0; }
.cc-toast__body a { color: inherit; text-decoration: underline; }
.cc-toast__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.cc-toast__close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: -4px 0 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--toast-ink);
  opacity: 0.7;
  cursor: pointer;
}
.cc-toast__close[hidden] { display: none; }
.cc-toast__close:hover { opacity: 1; background: rgba(23, 24, 26, 0.08); }
.cc-toast__close:focus-visible { opacity: 1; outline: 2px solid var(--toast-ink); outline-offset: 1px; }

@keyframes cc-toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .cc-toast { animation: none; }
  .cc-toast.is-leaving { transition: none; }
}
@media (max-width: 480px) {
  .cc-toasts { width: calc(100vw - 16px); }
}
