/**
 * Notificaciones flotantes (Django messages).
 */
.app-toast-stack {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  width: min(100% - 2.5rem, 26rem);
  pointer-events: none;
}

.app-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: app-toast-in 240ms ease;
}

.app-toast--leaving {
  animation: app-toast-out 220ms ease forwards;
}

.app-toast__text {
  flex: 1;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.45;
}

.app-toast__close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin: -0.15rem -0.25rem 0 0;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.72;
  transition: opacity var(--transition-fast), background var(--transition-fast);
}

.app-toast__close:hover,
.app-toast__close:focus-visible {
  opacity: 1;
  background: rgba(15, 23, 42, 0.08);
  outline: none;
}

.app-toast--success {
  border-color: rgba(22, 163, 74, 0.35);
  background: #f0fdf4;
  color: #166534;
}

.app-toast--error {
  border-color: rgba(220, 38, 38, 0.3);
  background: #fef2f2;
  color: #991b1b;
}

.app-toast--warning {
  border-color: rgba(234, 179, 8, 0.4);
  background: #fffbeb;
  color: #854d0e;
}

.app-toast--info {
  border-color: rgba(59, 130, 196, 0.35);
  background: #eff6ff;
  color: #1e40af;
}

@keyframes app-toast-in {
  from {
    opacity: 0;
    transform: translateX(1rem);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes app-toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(1rem);
  }
}

@media (max-width: 640px) {
  .app-toast-stack {
    top: auto;
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    width: auto;
    align-items: stretch;
  }
}
