/* Notification premium après soumission de formulaire */
.form-toast-stack {
  position: fixed;
  z-index: 9999;
  inset: auto 20px 24px auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.form-toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 14px;
  padding: 18px 18px 16px;
  border-radius: 16px;
  border: 1px solid rgba(168, 85, 247, 0.35);
  background:
    linear-gradient(155deg, rgba(28, 22, 44, 0.96), rgba(15, 13, 23, 0.98));
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(124, 58, 237, 0.18);
  color: #f5f0ff;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}

.form-toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.form-toast.is-leaving {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
}

.form-toast--error {
  border-color: rgba(248, 113, 113, 0.45);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.45),
    0 0 32px rgba(239, 68, 68, 0.12);
}

.form-toast__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #c4b5fd;
}

.form-toast--error .form-toast__icon {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

.form-toast__icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.form-toast__body {
  min-width: 0;
  padding-top: 2px;
}

.form-toast__title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.form-toast__message {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #c8bddf;
}

.form-toast__close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #d6ccef;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.form-toast__close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.form-toast__close:focus-visible {
  outline: 2px solid rgba(168, 85, 247, 0.7);
  outline-offset: 2px;
}

.form-toast__close svg {
  width: 16px;
  height: 16px;
}

.form-toast__progress {
  grid-column: 1 / -1;
  height: 3px;
  margin-top: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.form-toast__progress i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c3aed, #a855f7);
  transform-origin: left center;
  transform: scaleX(1);
}

.form-toast--error .form-toast__progress i {
  background: linear-gradient(90deg, #dc2626, #f87171);
}

@media (max-width: 560px) {
  .form-toast-stack {
    inset: auto 12px 16px 12px;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .form-toast {
    transition: opacity 0.15s ease;
    transform: none;
  }

  .form-toast.is-visible,
  .form-toast.is-leaving {
    transform: none;
  }

  .form-toast__progress {
    display: none;
  }
}
