.notification {
  padding: 8px 40px;
  border: 1px solid;
  position: relative;
  line-height: 1.57143;

  &__icon {
    position: absolute;
    left: 8px;
    top: 7px;
    font-size: 1rem;
  }

  &__close {
    position: absolute;
    right: 8px;
    top: 8px;
    font-size: 0.875rem;
    color: $warm-grey;
    cursor: pointer;

    &_white {
      color: $white;
    }
  }

  &__hide {
    position: absolute;
    right: 8px;
    top: 8px;
    font-size: 0.875rem;
    color: $warm-grey;
    cursor: pointer;
  }

  &_success {
    border-color: $green;
    background: $green-transparent5;
    font-weight: 500;

    .notification__icon {
      color: $green;
    }
  }

  &_warning {
    border-color: $yellow;
    background: $yellow-transparent5;
    font-weight: 500;

    .notification__icon {
      color: $yellow;
    }
  }

  &_info {
    border-color: $blue;
    background: $blue-transparent5;

    .notification__icon {
      color: $blue;
    }
  }

  &_reminder {
    color: $white;
    background: $warm-grey;
    width: 100%;
  }

  &_error {
    border-color: $red;
    background: $red-transparent5;
    font-weight: 500;

    .notification__icon {
      color: $red;
      display: flex;
      justify-content: center;
      align-items: center;
      align-content: center;
    }
  }

  &:not(:only-child) {
    margin-bottom: 8px;
  }

  &:only-child,
  &:last-child {
    margin-bottom: 20px;
  }

  @include media-breakpoint-down(sm) {
    margin-bottom: 30px;
  }

  &_app {
    position: relative;
    padding: 5px 15px;
    color: $white;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 0;
    text-align: left;

    &-error {
      background-color: $app-error;
    }

    &-success {
      background-color: $green;
    }

    &:nth-child(2) {
      border-top: 2px solid $white;
    }

    .notification__close {
      top: 4px;
      right: 4px;
      color: $white;
    }
  }

  &__wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    .title {
      font-weight: 500;
      font-size: 0.875rem;
      line-height: 1.5rem;
      margin-bottom: 0;
    }

    .description {
      font-weight: 400;
      font-size: 0.875rem;
      line-height: 1.375rem;
      margin-bottom: 0;
    }
  }
}

.accordion-notifications {
  &-list {
    min-height: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.15s ease-out;

    .notification-item {
      margin: 0;
      font-weight: normal;

      &:first-child {
        margin-top: 10px;
      }
    }
  }

  &-item-input {
    display: none;

    &:checked ~ .accordion-notifications {
      &-list {
        max-height: 400px;
        overflow: auto;
        transition: max-height 1s ease-in;
      }

      &-view-all {
        transform: rotate(0);
      }
    }
  }

  &-view-all {
    position: absolute;
    left: 0;
    margin-top: 20px;
    color: $red;
    text-decoration: underline;
    cursor: pointer;
  }
}

.toast-container {
  background-color: $white;
  position: fixed;
  left: 50%;
  bottom: 48px;
  z-index: $zindex-modal;
  max-width: 640px;
  transform: translate(-50%, calc(100% + 48px));
  animation: toast-slide-up 0.25s ease-out forwards;
}

.toast {
  @include font-size(14);
  @include line-height(22);

  display: flex;
  align-items: center;
  min-height: 48px;
  margin-bottom: 0 !important;
  padding: 8px;
  border: 5px solid $white;
  box-shadow: none;
  font-weight: 500;

  .notification__icon {
    @include font-size(16);

    position: static;
    display: flex;
    flex: 0 0 24px;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 8px;
    transform: none;
  }

  &.notification_success {
    background-color: rgba($green, 0.05);

    .notification__icon {
      color: $green;
    }
  }

  &.notification_warning {
    background-color: rgba($orange, 0.05);

    .notification__icon {
      color: $yellow;
    }
  }

  &.notification_error {
    background-color: rgba($red, 0.05);

    .notification__icon {
      color: $red;
    }
  }
}

@keyframes toast-slide-up {
  from {
    transform: translate(-50%, calc(100% + 48px));
  }

  to {
    transform: translate(-50%, 0);
  }
}

@include media-breakpoint-down(sm) {
  .toast-container {
    bottom: 48px;
    width: max-content;
    max-width: calc(100% - 32px);
  }
}
