/**
 * Messages flash en position fixe (toasts) — visibles quel que soit le scroll.
 */

.flash-stack {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem;
  max-height: min(50vh, 20rem);
  overflow-y: auto;
  pointer-events: none;
  box-sizing: border-box;
}

.flash-stack--public {
  /* Sous la barre réseaux + marge (évite le bandeau fixe du haut) */
  top: 5.25rem;
}

/* Mobile : bande contact non fixe — toasts sous le bloc header typique */
@media (max-width: 639px) {
  .flash-stack--public {
    top: 1rem;
  }
}

@media (min-width: 768px) {
  .flash-stack--public {
    top: 6rem;
  }
}

.flash-stack--admin {
  top: 1rem;
}

.flash-stack .flash-message {
  pointer-events: auto;
  width: 100%;
  max-width: min(90vw, 28rem);
  border-radius: 14px;
  padding: 12px 16px;
  color: #0f172a;
  box-shadow:
    0 4px 6px -1px rgba(15, 23, 42, 0.08),
    0 10px 24px -4px rgba(15, 23, 42, 0.12);
  animation: flash-toast-in 0.35s ease-out;
  border-width: 1px;
  border-style: solid;
  background: #ffffff;
}

.flash-message--success {
  border-color: #16a34a;
  background: #f0fdf4;
}

.flash-message--error {
  border-color: #dc2626;
  background: #fef2f2;
}

.flash-message--warning {
  border-color: #d97706;
  background: #fffbeb;
}

.flash-message--info,
.flash-message--debug {
  border-color: #E60000;
  background: #ffffff;
}

.flash-message-hide {
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}

@keyframes flash-toast-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
