/* Notifications "toast" : en haut à droite sur ordinateur, pleine largeur sur mobile */

.aavie-toast-region {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 380px;
  max-width: calc(100vw - 40px);
  pointer-events: none;
}

.aavie-toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 44px 20px 16px;
  border-radius: 10px;
  overflow: hidden;
  color: #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.aavie-toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.aavie-toast--success {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.aavie-toast--error {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.aavie-toast__icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.aavie-toast__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.aavie-toast__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
}

.aavie-toast__message {
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.aavie-toast__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
}

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

/* Trait de progression en bas du toast : se vide de droite à gauche pendant toute la durée */
.aavie-toast__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  background: rgba(255, 255, 255, 0.9);
  transform-origin: left center;
  animation-name: aavie-toast-progress;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

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

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

@media only screen and (max-width: 575px) {
  .aavie-toast-region {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
  }
}

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