/* Gago toast – shared site + admin; always above modals and loaders */
:root {
  --gago-toast-z: 10010;
  --gago-toast-duration: 4500ms;
}

.gago-toast-container {
  position: fixed;
  top: max(1.25rem, env(safe-area-inset-top, 0px));
  right: max(1.25rem, env(safe-area-inset-right, 0px));
  z-index: var(--gago-toast-z);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.625rem;
  max-width: min(calc(100vw - 2rem), 22rem);
  pointer-events: none;
}

.gago-toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 2.5rem 0.875rem 0.875rem;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.45;
  color: #fff;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.12),
    0 12px 28px -4px rgba(0, 0, 0, 0.22);
  pointer-events: auto;
  overflow: hidden;
  animation: gago-toast-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.gago-toast--leaving {
  animation: gago-toast-out 0.28s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.gago-toast__icon-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-top: 0.05rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.gago-toast__icon {
  display: block;
  width: 1.125rem;
  height: 1.125rem;
}

.gago-toast__message {
  flex: 1;
  margin: 0;
  min-width: 0;
  word-wrap: break-word;
}

.gago-toast__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.15s, background 0.15s;
}

.gago-toast__close:hover,
.gago-toast__close:focus-visible {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}

.gago-toast__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  transform-origin: left center;
  background: rgba(255, 255, 255, 0.45);
  animation: gago-toast-progress var(--gago-toast-duration, 4500ms) linear forwards;
}

.gago-toast--paused .gago-toast__progress {
  animation-play-state: paused;
}

.gago-toast--success {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  border-color: rgba(255, 255, 255, 0.2);
}

.gago-toast--error {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  border-color: rgba(255, 255, 255, 0.2);
}

.gago-toast--info {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-color: rgba(255, 255, 255, 0.2);
}

.gago-toast--warning {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  border-color: rgba(255, 255, 255, 0.2);
}

@keyframes gago-toast-in {
  from {
    opacity: 0;
    transform: translateX(1.25rem) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes gago-toast-out {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(1rem) scale(0.96);
  }
}

@keyframes gago-toast-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

@media (max-width: 480px) {
  .gago-toast-container {
    top: max(0.75rem, env(safe-area-inset-top, 0px));
    right: max(0.75rem, env(safe-area-inset-right, 0px));
    left: max(0.75rem, env(safe-area-inset-left, 0px));
    max-width: none;
    align-items: stretch;
  }

  .gago-toast {
    font-size: 0.875rem;
    padding: 0.75rem 2.25rem 0.75rem 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gago-toast,
  .gago-toast--leaving {
    animation: none;
  }

  .gago-toast__progress {
    display: none;
  }
}
