.alerts-host {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

.alerts-stack {
  position: absolute;
  top: clamp(12px, 2vw, 18px);
  right: clamp(12px, 2vw, 18px);
  left: auto;
  transform: none;
  width: min(600px, calc(100vw - 25px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.alert-toast {
  pointer-events: auto;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  padding: 10px;
  display: grid;
  grid-template-columns: 50px 1fr 40px;
  gap: 10px;
  align-items: center;
  background-color: white;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.alert-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  border: 1px solid var(--gray4);
  background: var(--gray5);
}

.alert-icon i {
  font-size: 20px;
  color: var(--gray2);
}

.alert-content {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.alert-title {
  font-size: 13px;
  font-weight: 900;
  color: var(--gray1);
  letter-spacing: -0.3px;
  display: none;
}

.alert-message {
  font-size: 14px;
  font-weight: bold;
  line-height: 1.7;
  color: var(--gray2);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.alert-close {
  width: 35px;
  height: 35px;
  border-radius: var(--radius-md);
  background-color: var(--gray6);
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition:
    transform var(--duration) ease,
    background var(--duration) ease,
    box-shadow var(--duration) ease,
    opacity var(--duration) ease;
}

.alert-close i {
  font-size: 16px;
  color: var(--gray1);
  transition: var(--duration);
}

@media (hover: hover) and (pointer: fine) {
  .alert-close:hover {
    transform: scale(1.05);
    border-color: var(--gray3);
  }

  .alert-close:hover i {
    color: var(--error-color);
  }
}

.alert-progress {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0px;
  height: 4px;
  border-radius: 999px;
  background: var(--gray5);
  overflow: hidden;
}

.alert-progress > i {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: right;
  transform: scaleX(1);
  background: currentColor;
}

.alert-toast {
  box-shadow: 0 10px 70px rgba(0, 0, 0, 0.4);
}

.alert-toast[data-type="success"],
.alert-toast[data-type="success"] .alert-icon i {
  color: var(--success-color);
}
.alert-toast[data-type="error"],
.alert-toast[data-type="error"] .alert-icon i {
  color: var(--error-color);
}
.alert-toast[data-type="warning"],
.alert-toast[data-type="warning"] .alert-icon i {
  color: var(--warning-color);
}
.alert-toast[data-type="info"],
.alert-toast[data-type="info"] .alert-icon i {
  color: var(--declarative-color);
}

/* animation */

@keyframes toast-in {
  0% {
    opacity: 0;
    transform: translateY(-14px) scale(0.94);
    filter: blur(10px);
  }
  70% {
    opacity: 1;
    transform: translateY(2px) scale(1.02);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
    filter: blur(8px);
  }
}

.alert-toast.is-in {
  animation: toast-in 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.alert-toast.is-out {
  animation: toast-out 260ms ease both;
}


@media (max-width: 968px) {
  .alerts-stack {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    display: flex;
  }
}