/* ==========================================================================
 * Toast notifications (global)
 * Reuses the requested visual language without Tailwind.
 * ========================================================================== */

:root {
  --toast-success: #16a34a;  /* green */
  --toast-error: #dc2626;    /* red */
  --toast-warning: #d97706;  /* amber */
  --toast-info: var(--color-primary-500, #2563eb);
  --toast-shadow: 0px 20px 45px rgba(15, 23, 42, 0.15);
  --toast-radius: 18px;
}

.toast-stack {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  width: min(22rem, calc(100vw - 1.5rem));
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 1090;
  pointer-events: none;
}

@media (max-width: 640px) {
  .toast-stack {
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
  }
}

.toast-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1rem 1rem 0.9rem;
  background: var(--color-neutral-0, #fff);
  border-radius: var(--toast-radius);
  box-shadow: var(--toast-shadow);
  border-left: 4px solid var(--toast-accent, var(--toast-info));
  color: var(--color-neutral-800, #1f2937);
  pointer-events: auto;
  min-width: 0;
  transform: translateZ(0);
}

.toast-card__icon {
  font-size: 1.25rem;
  margin-top: 0.15rem;
  color: var(--toast-accent, var(--toast-info));
}

.toast-card__content {
  flex: 1;
  min-width: 0;
}

.toast-card__title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: inherit;
}

.toast-card__description {
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.7);
  margin: 0;
  line-height: 1.35;
}

.toast-card__close {
  background: none;
  border: 0;
  color: rgba(15, 23, 42, 0.5);
  cursor: pointer;
  padding: 0.15rem;
  margin: -0.15rem -0.25rem 0 0;
  transition: color 0.2s ease;
}

.toast-card__close:hover,
.toast-card__close:focus-visible {
  color: rgba(15, 23, 42, 0.85);
}

[data-toast-level="success"] { --toast-accent: var(--toast-success); }
[data-toast-level="error"],
[data-toast-level="danger"] { --toast-accent: var(--toast-error); }
[data-toast-level="warning"] { --toast-accent: var(--toast-warning); }
[data-toast-level="info"] { --toast-accent: var(--toast-info); }

@keyframes toast-slide-in {
  from { transform: translate3d(80px, 0, 0); opacity: 0; }
  to { transform: translate3d(0, 0, 0); opacity: 1; }
}

@keyframes toast-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.toast-enter {
  animation: toast-slide-in 0.35s ease forwards;
}

.toast-exit {
  animation: toast-fade-out 0.25s ease forwards;
}

@media (prefers-reduced-motion: reduce) {
  .toast-enter,
  .toast-exit {
    animation-duration: 0.01s;
  }
}
