.alert {
  display: flex;
  color: #563e28;
  position: fixed;
  gap: 1rem;
  top: 70px;
  right: 1.5rem;
  width: 24rem;
  background-color: #fff;
  box-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.25);
  border-radius: 0.5rem;
  max-width: calc(100% - 6rem);
  z-index: 100;
  padding: 1.25rem;
  overflow: clip;
  transform: translateX(calc(100% + 1.5rem));
  animation: slideInOut 10s forwards cubic-bezier(0.33, 0, 0.66, 1.33);
  animation-play-state: var(--animation-play-state);
}

.alert:hover {
  --animation-play-state: paused;
}

.alert:before {
  content: "";
  display: block;
  inset: 0 0 auto;
  height: 0.5rem;
  transform-origin: left;
  position: absolute;
  animation: countdown 8s forwards linear;
  animation-play-state: var(--animation-play-state);
  animation-delay: 1s;
}

.alert__text {
  margin: 0.3rem 0 0;
}

.alert__header {
  margin: 0;
}

.alert__action {
  margin-left: auto;
}

.alert__icon {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background-size: 3rem;
  margin-bottom: auto;
}

.button {
  appearance: none;
  background: no-repeat;
  border: none;
  font: inherit;
  margin: 0;
  color: currentColor;
  padding: 0;
}

.alert.success .alert__icon {
  background-color: #49a87d;
  color: #fff;
}

.alert.success .alert__icon::before {
  content: "\f00c";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 14px;
  color: #fff;
}

.alert.success:before {
  background-color: #49a87d;
}

.alert.error .alert__icon {
  background-color: #d60518;
  color: #fff;
}

.alert.error:before {
  background-color: #d60518;
}

.alert.error .alert__icon::before {
  content: "\f00d";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 14px;
  color: #fff;
}

@keyframes slideInOut {
  0% {
    transform: translateX(calc(100% + 1.5rem));
  }
  10% {
    transform: translateX(0);
  }
  90% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(100% + 1.5rem));
  }
}

@keyframes countdown {
  0%   { transform: scaleX(1); }
  100% { transform: scaleX(0); }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(100% + 1.5rem));
    opacity: 0;
  }
}
