.toast {
  position: fixed;
  top: 15px;
  left: 50%;
  max-width: 80vw;

  padding: 15px 75px 15px 25px;
  border-radius: 10px;
  backdrop-filter: blur(3px);
  background-color: rgba(212, 212, 212, 0.85);
  box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transform: translateX(-50%) translateY(-100px) scale(0);

  z-index: 9;
}
.toast.success {
  background-color: rgba(204, 243, 201, 0.85);
}
.toast.error {
  background-color: rgba(243, 201, 201, 0.85);
}

.toast.active.close {
  animation: toast-close 0.35s ease-out forwards;
}
.toast.active {
  animation: toast-enter 0.35s ease-out forwards;
}
.toast.active::after {
  content: "";

  position: absolute;
  bottom: 0;
  left: 0;

  width: 100%;
  height: 5px;
  transform-origin: left;

  animation: timelapse 3s linear 0.35s forwards;
}

.toast.active.success::after {
  background-color: #71ad6d;
}

.toast.active.error::after {
  background-color: #ad6d6d;
}
@keyframes toast-enter {
  from {
    transform: translateX(-50%) translateY(-100px) scale(0);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes toast-close {
  from {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
  }
  to {
    transform: translateX(-50%) translateY(-100px) scale(0);
    opacity: 0;
  }
}

@keyframes timelapse {
  from {
    transform: scaleX(1);
    opacity: 1;
  }
  to {
    transform: scaleX(0);
    opacity: 0.25;
  }
}

@media screen and (max-width: 768px) {
  .toast {
    width: 90vw;
    max-width: none;
    padding: 10px 50px 10px 20px;
    font-size: clamp(16px, 5vw, 26px);
  }
}
