/**************************\
  Basic Modal Styles
\**************************/
.bp-modal {
  &.modal {
    &.top-content-modal {
      .modal__overlay__inner {
        padding-top: 0;
        position: absolute;
        top: 0;

        .modal__content {
          display: flex;
          flex-direction: column;
        }
      }
    }

    &.modal-max-width {
      .modal__overlay__inner {
        padding: 0;

        .modal__close {
          color: #000;
        }
      }

      .modal__container {
        max-width: 100vw;
        width: 100%;
      }
    }

    &.modal__sale-content {
      .modal__container {
        max-width: 800px;
      }
    }

    .modal__container {
      padding: 32px 50px;

      &.modal__container-2 {
        max-width: 1050px;
        padding: 20px 30px 28px;
      }
    }
  }

  .modal__overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;

    &.bg-dark {
      background-color: rgba(0, 0, 0, 0.75);

      .modal__content {
        .modal__close {
          &:before {
            color: #000;
          }
        }
      }

      .modal__close {
        &:before {
          color: #fff;
        }
      }
    }
  }

  .modal__overlay__inner {
    max-height: 100vh;
    overflow-y: auto;
    width: 100%;
    padding: 85px 15px;
    margin-bottom: 85px;

    .modal__close {
      position: absolute;
      right: 15px;
      top: 5px;
      font-size: 36px;
      z-index: 1000;
      transition: opacity ease-in-out 0.3s;
      background-color: initial;
      color: #fff;

      &:hover {
        opacity: 0.7;
        text-decoration: none;
      }
    }
  }

  .modal__container {
    background-color: #fff;
    padding: 32px 104px;
    max-width: 640px;
    margin: 0 auto;
    border-radius: 0;
    box-sizing: border-box;

    width: auto;
    height: auto;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.16);
  }

  .modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;

    .modal__close {
      position: absolute;
      top: -25px;
      right: -25px;
    }

    .modal__header__inner {
      display: flex;
      flex-wrap: wrap;

      > p {
        width: 100%;
        display: block;
      }
    }
  }

  .modal__footer {
    height: auto;
    margin-bottom: 50px;

    .modal_links {
    }

    .modal_links__item {
      //flex-basis: 100%;
      text-align: center;
      color: $gray2;
      font-size: 18px;
      font-weight: 400;
      text-decoration: none;
      margin-bottom: 20px;

      &:hover {
        text-decoration: underline;
      }

      &:last-child {
        margin-bottom: 0;
      }
    }
  }

  .modal__title {
    margin-top: 0;
    @include font-size-block(36px, 1.23, 400);
    color: $gray;
    box-sizing: border-box;
    font-weight: 500;
    margin-bottom: 11px;
  }

  .modal__subtitle {
    font-size: 32px;
    line-height: 1.2;
    font-weight: 300;
    text-align: center;
    letter-spacing: 0;
    color: #000000;
  }

  .modal__small-label {
    color: $lGray;
    @include font-size-block(14px, 1.55, 400);
  }

  .modal__close {
    background: transparent;
    border: 0;
    outline: none !important;

    &:before {
      content: "\2715";
    }
  }

  .modal__content {
    margin-top: 2rem;
    margin-bottom: 0;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.8);

    .errors-group {
      margin-bottom: 10px;
      text-align: center;

      p {
        margin: 0;
      }
    }

    .modal__content-overflow {
      max-height: 450px;
      background: #ffffff 0 0 no-repeat padding-box;
      border: 1px solid #707070;
      overflow: auto;
      scrollbar-color: #000 #f3f1f1;
      scrollbar-width: thin;
      transition: scrollbar-color 0.2s ease-out;
    }

    .modal__content__item {
      margin: 0 0 7px 0;
      font-size: 18px;
      font-weight: 700;
      border-bottom: 1px solid #c3c3c3;

      &.modal__content__item-light {
        font-weight: 400;
        flex-wrap: wrap;

        &.modal__content__item-light-text {
          text-align: left;

          span {
            text-align: left;
          }
        }
      }

      strong {
        display: inline-block;
        min-width: 35%;
        text-align: left;
      }

      span {
        display: block;
        font-weight: 400;
        flex-basis: 100%;
        text-align: right;
      }
    }

    .modal__close {
      &:before {
        color: #000;
      }
    }
  }

  .modal__btn {
    font-size: 0.875rem;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    background-color: #e6e6e6;
    color: rgba(0, 0, 0, 0.8);
    border-radius: 0.25rem;
    border-style: none;
    border-width: 0;
    cursor: pointer;
    -webkit-appearance: button;
    text-transform: none;
    overflow: visible;
    line-height: 1.15;
    margin: 0;
    will-change: transform;
    -moz-osx-font-smoothing: grayscale;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    transition: -webkit-transform 0.25s ease-out;
    transition: transform 0.25s ease-out, -webkit-transform 0.25s ease-out;

    &:focus,
    &:hover {
      -webkit-transform: scale(1.05);
      transform: scale(1.05);
    }
  }

  .modal__btn-primary {
    background-color: #00449e;
    color: #fff;
  }

  &.micromodal-slide {
    display: none;

    &.is-open {
      display: block;
    }

    &[aria-hidden="false"] {
      .modal__overlay {
        animation: mmfadeIn 0.3s cubic-bezier(0, 0, 0.2, 1);
      }

      .modal__container {
        animation: mmslideIn 0.3s cubic-bezier(0, 0, 0.2, 1);
      }
    }

    &[aria-hidden="true"] {
      .modal__overlay {
        animation: mmfadeOut 0.3s cubic-bezier(0, 0, 0.2, 1);
      }

      .modal__container {
        animation: mmslideOut 0.3s cubic-bezier(0, 0, 0.2, 1);
      }
    }

    .modal__container,
    .modal__overlay {
      will-change: transform;
      z-index: 999;
    }
  }

  .bp-from {
    .bp-form-group {
      input {
        &.bp-form-check-input {
          &:checked {
            + label {
              &::after {
                top: 8px;
              }
            }
          }
        }
      }
    }
  }
}

/**************************\
  Demo Animation Style
\**************************/
@keyframes mmfadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes mmfadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes mmslideIn {
  from {
    transform: translateY(-15%);
  }

  to {
    transform: translateY(0);
  }
}

@keyframes mmslideInLeft {
  from {
    transform: translateX(-15%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes mmslideOut {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(10%);
  }
}

@keyframes mmslideOutLeft {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(10%);
  }
}

.bp-modal {
  &.modal,
  &.md-modal {
    .modal__header {
      height: auto;

      .modal__title {
        width: 100%;
        text-align: center;
        color: #000000;
        font-size: 32px;
        margin-bottom: 0;
        text-transform: uppercase;
        position: relative;
        padding-top: 64px;
        font-weight: 500;

        &.modal__title_without-logo {
          padding-top: 0;

          &::before {
            display: none;
          }
        }

        &::before {
          content: "";
          background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg%3E%3Cg%3E%3Cpath fill='%23c8c8c8' d='M23.796 35.677c-.77-1.261-1.508-2.231-2.098-3.87-.407-.012-.893-.34-1.146-.803-.922-1.691-1.4-4.348-1.099-5.195.18-.513.724-.598 1.129-.586-.165-4.489 1.283-7.637 3.449-9.526-.365.049-.665.125-.575.035.479-1.884 3.313-1.755 3.326-1.754-.576-.831.579-2.423 1.023-2.511.084.51.859 1.068 1.856 1.344 1.811.502 3.119 1.019 3.89 1.359 3.453 1.368 6.178 4.99 5.954 11.056.389.007.854.12 1.019.587.299.847-.178 3.509-1.101 5.201-.234.427-.67.753-1.056.806-.606 1.642-1.364 2.629-2.136 3.893-.535.883-1.076 1.562-1.682 2.031.012 1.838.343 4.811 1.687 5.356 3.851 1.56 11.032 4.823 12.86 7.351C44.09 55.129 37.376 58 30 58c-7.375 0-14.089-2.871-19.095-7.548 1.908-2.964 10.541-6.629 12.952-7.352 1.397-.418 1.771-3.624 1.817-5.29-.688-.476-1.286-1.163-1.878-2.133zM30 0C13.458 0 0 13.458 0 30s13.458 30 30 30 30-13.458 30-30S46.542 0 30 0z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
          height: 60px;
          width: 60px;
          @include item-g-center();
          top: 0;
        }
      }
    }
  }
}
