/* CampusQCM - Global toast system */
.cq-toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.cq-toast {
  --cq-toast-accent: #6366f1;
  --cq-toast-bg: rgba(15, 23, 42, 0.92);
  --cq-toast-border: rgba(99, 102, 241, 0.28);
  min-width: min(360px, calc(100vw - 32px));
  max-width: 420px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 18px;
  color: #f8fafc;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.12), transparent 34%),
    var(--cq-toast-bg);
  border: 1px solid var(--cq-toast-border);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(18px);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
  transition: opacity 180ms ease, transform 180ms ease;
}

.cq-toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.cq-toast.is-leaving {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
}

.cq-toast__icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--cq-toast-accent) 20%, transparent);
  color: #fff;
  font-size: 1rem;
}

.cq-toast__body {
  min-width: 0;
}

.cq-toast__title {
  display: block;
  margin: 0 0 3px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
}

.cq-toast__message {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: rgba(248, 250, 252, 0.86);
}

.cq-toast__close {
  border: 0;
  background: transparent;
  color: rgba(248, 250, 252, 0.7);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.cq-toast__close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.cq-toast--success {
  --cq-toast-accent: #10b981;
  --cq-toast-border: rgba(16, 185, 129, 0.3);
}

.cq-toast--warning {
  --cq-toast-accent: #f59e0b;
  --cq-toast-border: rgba(245, 158, 11, 0.3);
}

.cq-toast--danger {
  --cq-toast-accent: #ef4444;
  --cq-toast-border: rgba(239, 68, 68, 0.3);
}

.cq-toast--info {
  --cq-toast-accent: #6366f1;
  --cq-toast-border: rgba(99, 102, 241, 0.3);
}

@media (max-width: 640px) {
  .cq-toast-stack {
    top: auto;
    right: 12px;
    left: 12px;
    bottom: 14px;
  }

  .cq-toast {
    min-width: 0;
    max-width: none;
  }
}
