.CSS_START_components_toasts {
  display: none;
}

.toasts_wrapper {
  position: fixed;
  bottom: 2rem;
  left: 1rem;
  z-index: 10000;
}

.toast {
  overflow: hidden;
  margin-bottom: 1rem;
  position: relative;
  padding: 1rem;
  border: 1px var(--color-success) solid;
  border-radius: 6px;
  width: 15rem;
  height: fit-content;
  background: white;
  display: flex;
  align-items: center;
  animation-name: start;
  animation-duration: 0.5s;
  opacity: 0.9;
  transition: 300ms ease-in-out;

  &:focus-within {
    border-width: 4px;
  }

  &.error {
    background: var(--color-error);
    border-color: var(--color-primary);

    .closeButton svg {
      fill: var(--color-primary);
    }
  }

  &.success {
    background: var(--color-success-light);
  }

  p {
    margin: 0;
    flex: 1;
    padding-right: 1em;
    overflow: hidden;
    user-select: text;
    text-overflow: ellipsis;
    width: 100%;
    height: 100%;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    color: var(--color-primary);
  }

  .toast_open {
    -webkit-line-clamp: unset;
  }

  .icon {
    height: 3rem;
    margin-right: 1rem;
  }

  .closeButton {
    position: absolute;
    right: 0;
    top: 0;
    height: 25px;
    width: 25px;
    padding: 5px;
    box-sizing: content-box;

    svg {
      height: 20px;
      width: 20px;
      fill: var(--color-success);
    }
  }
}

.leave {
  transform: translateX(-100%);
  transition: transform 0.5s;
}

.toRemove {
  height: 0;
  padding: 0;
  margin: 0;
  border: none;
  overflow: hidden;
  transition: height 0.1s, padding 0.1s, margin 0.1s;
}

@keyframes start {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0);
  }
}

.CSS_END_components_toasts {
  display: none;
}
