:root {
  --feria-toast-width: 390px;
  --feria-toast-radius: 18px;
}

.feria-toast-region {
  position: fixed;
  z-index: 1200;
  top: 22px;
  right: 22px;
  display: flex;
  width: min(var(--feria-toast-width), calc(100vw - 32px));
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.feria-toast-seed {
  display: none;
}

.feria-toast {
  --toast-accent: #4f8cff;
  --toast-accent-rgb: 79, 140, 255;
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 28px;
  gap: 11px;
  align-items: center;
  width: 100%;
  min-height: 74px;
  overflow: hidden;
  padding: 13px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--feria-toast-radius);
  background:
    linear-gradient(135deg, rgba(var(--toast-accent-rgb), 0.13), transparent 46%),
    rgba(13, 17, 24, 0.94);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #fff;
  pointer-events: auto;
  backdrop-filter: blur(18px) saturate(1.35);
  transform-origin: top right;
  animation: feria-toast-enter 580ms cubic-bezier(0.16, 1.35, 0.3, 1) both;
}

.feria-toast[data-type="success"] {
  --toast-accent: #36d68b;
  --toast-accent-rgb: 54, 214, 139;
}

.feria-toast[data-type="error"],
.feria-toast[data-type="danger"] {
  --toast-accent: #ff5d68;
  --toast-accent-rgb: 255, 93, 104;
}

.feria-toast[data-type="warning"] {
  --toast-accent: #ffbd3e;
  --toast-accent-rgb: 255, 189, 62;
}

.feria-toast[data-type="info"],
.feria-toast[data-type="debug"] {
  --toast-accent: #55a7ff;
  --toast-accent-rgb: 85, 167, 255;
}

.feria-toast.is-leaving {
  animation: feria-toast-leave 320ms cubic-bezier(0.4, 0, 1, 1) forwards;
}

.feria-toast__icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(var(--toast-accent-rgb), 0.35);
  border-radius: 14px;
  background: rgba(var(--toast-accent-rgb), 0.14);
  color: var(--toast-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.feria-toast__icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.feria-toast__content {
  min-width: 0;
}

.feria-toast__title {
  margin: 0 0 3px;
  color: #fff;
  font: 700 0.78rem/1.2 "Montserrat", sans-serif;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.feria-toast__message {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font: 400 0.84rem/1.42 "Lato", sans-serif;
  overflow-wrap: anywhere;
}

.feria-toast__close {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  align-self: start;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.46);
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease;
}

.feria-toast__close:hover,
.feria-toast__close:focus-visible {
  outline: 0;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.feria-toast__close svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.feria-toast__progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.feria-toast__progress::after {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(var(--toast-accent-rgb), 0.4), var(--toast-accent));
  content: "";
  transform-origin: left;
  animation: feria-toast-progress var(--toast-duration, 5000ms) linear forwards;
}

.feria-toast:hover .feria-toast__progress::after {
  animation-play-state: paused;
}

@keyframes feria-toast-enter {
  0% {
    opacity: 0;
    transform: translate3d(45px, -8px, 0) scale(0.82);
  }
  62% {
    opacity: 1;
    transform: translate3d(-5px, 0, 0) scale(1.025);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes feria-toast-leave {
  to {
    opacity: 0;
    transform: translate3d(42px, -4px, 0) scale(0.88);
  }
}

@keyframes feria-toast-progress {
  to {
    transform: scaleX(0);
  }
}

@media (max-width: 700px) {
  .feria-toast-region {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  .feria-toast {
    min-height: 68px;
    grid-template-columns: 38px minmax(0, 1fr) 26px;
    gap: 9px;
    padding: 11px 10px;
  }

  .feria-toast__icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .feria-toast,
  .feria-toast.is-leaving,
  .feria-toast__progress::after {
    animation-duration: 1ms !important;
  }
}
