@import '../helpers/helpers';
@import '../components/id-type-modal';
@import '../components/capture-modal';

.page_checkout-tradePro,
.page_checkout-confirmation-new {
  .checkout-tradepro {
    margin-top: 40px;
    padding-bottom: 30px;

    @include media-breakpoint-down(xs) {
      margin-left: -15px;
      margin-right: -15px;
    }

    .page-header {
      &__info {
        @include media-breakpoint-up(sm) {
          &:nth-child(2) {
            margin-top: 0;
          }
        }
      }
    }

    .checkout-tradepro__row:first-child {
      .checkout-tradepro__descr:first-child {
        padding-bottom: 10px;
      }
    }

    .checkout-tradepro__row:nth-child(2) {
      .checkout-tradepro__descr {
        .form-row:last-of-type {
          &::after {
            position: absolute;
            content: '';
            height: 1px;
            background: $gray;
            left: 15px;
            right: 15px;
            bottom: 0;
          }
        }
      }
    }

    &__paragraph {
      @include normal-text;
    }

    &__row {
      @include make-row;
    }

    &__title {
      margin: 10px 0;
      font-size: 1.25rem;
    }

    &__descr {

      @include make-col-ready;
      @include make-col(12);

      @include media-breakpoint-down(sm) {
        padding-left: 25px;
        padding-right: 25px;
      }

      @include media-breakpoint-up(md) {
        @include make-col(7, 9);
        @include make-col-offset(1, 9);
      }

      @include media-breakpoint-up(lg) {
        @include make-col(5, 9);
        @include make-col-offset(2, 9);
      }

      .warning-required {
        @include normal-text;
        font-weight: normal;

        @include media-breakpoint-down(sm) {
          margin: 20px 0;
        }

        &:first-of-type {
          font-size: .75rem;
          margin-bottom: 10px;
          font-weight: 500;
        }
      }

      .row-title {
        .ddn {
          width: 160px;
        }
      }

      .tradepro-terms {
        .warning-required {
          font-size: inherit;
          font-weight: 400;
        }
      }

      h3 {
        &:first-of-type {
          margin-bottom: 20px;

          & + .warning-required {
            font-size: .75rem;
            font-weight: 500;
          }
        }
      }

      .signup-tradepro__title {
        font-size: 1.25rem;
        margin-top: 1rem;
      }

      .form-row.chosen-proofs-error {
        margin: 0;

        .form-row__error {
          padding-left: 0;
        }
      }
    }

    &__card-title {
      margin: 30px 0 20px;
    }

    &__card-holder {
      @include make-col(12);

      @include media-breakpoint-down(md) {
        @include make-col-ready;
      }
    }

    &__card {
      @include make-col(12);
      @include make-col-ready;
      padding: 20px;
      margin-bottom: 20px;
      border: 1px solid $gray;
    }

    &__card-info {
      @include make-row;
      margin: 0;
      padding: 0;
      line-height: 1.375rem;
      color: $warm-grey;

      dt {
        @include make-col(6);
        color: $gray-dark;
        font-weight: 700;

        @include media-breakpoint-down(sm) {
          @include make-col(12);
        }
      }

      dd {
        @include make-col(6);
        text-align: right;

        @include media-breakpoint-down(sm) {
          @include make-col(12);
          text-align: left;
        }

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

    &__info {
      font-size: 1.25rem;

      @include media-breakpoint-down(sm) {
        font-size: 1.125rem;
      }
    }

    &__learn-more {
      display: inline-block;
      padding: 15px 0;
    }

    &__attach {
      &_id {
        margin: 15px 0;
      }

      &_first-form {
        margin: 15px 0 20px;
      }

      .btn-primary {
        padding: 0 10px;
        margin-right: 10px;

        .btn__text {
          font-size: 1.75rem;
        }
      }

      a {
        font-size: 1rem;
      }
    }

    .row-title {
      .form-row__field {
        @include media-breakpoint-down(sm) {
          @include make-col(12);
        }

        @include media-breakpoint-only(md) {
          @include make-col(4, 9);
        }

        @include media-breakpoint-up(lg) {
          @include make-col(2, 5);
        }
      }
    }

    .form-row__action {
      padding-top: 0;

      &::before {
        content: none;
      }

      .form-row__col-btn {
        min-width: 190px;

        @include media-breakpoint-only(md) {
          @include make-col(6);

          .btn,
          .btn-secondary {
            padding-left: 0;
            padding-right: 0;
            max-width: 145px;
          }

          .btn-secondary {
            margin-left: 50px;
          }
        }

        @include media-breakpoint-up(lg) {
          @include make-col(2, 9);

          &:first-child {
            @include make-col-offset(2, 9);
          }
        }
      }

      &_custom,
      &_device-customized {
        margin-top: 20px;

        @include media-breakpoint-only(md) {
          &::before {
            left: 65px;
            right: 65px;
          }
        }

        @include media-breakpoint-up(lg) {
          &::before {
            left: 8.33333%;
            right: 8.33333%;
          }
        }
      }

      &_custom {
        @include media-breakpoint-up(md) {
          .form-row__col-btn {
            &:first-child {
              margin-left: 0;
            }
          }
        }
      }
    }

    @include media-breakpoint-down(sm) {
      .form-row {
        padding: 0;
      }
    }

    .choose-id {
      display: inline-block;

      .actions__link {
        text-decoration: underline;
        font-weight: 500;
        font-size: 1rem;
      }

      .btn {
        color: $white;
        margin-right: 10px;
      }

      &:hover,
      .btn:hover {
        .btn {
          background-color: $white;
          border-color: $blue;
          color: $blue;
        }
      }
    }

    &__paragraph.warning-required {
      // sass-lint:disable no-important
      font-size: .875rem !important;
      margin-top: 0;
      font-weight: normal !important;
    }

    .tradepro-submit {
      @include media-breakpoint-up(md) {
        width: 260px;
      }
    }

    .icon {
      &__notification {
        position: absolute;
        right: 0;
        color: $green;

        svg {
          vertical-align: middle;
        }
      }
    }

    .chosen-form {
      position: relative;
      display: flex;
      justify-content: space-between;
      line-height: 30px;

      img {
        width: 30px;
        height: 30px;
      }

      &-container {
        .chosen-form-wrap {
          display: table;

          .form-row__error {
            margin-top: 0;
            padding: 5px 0;
          }

          &.chosen-proofs-error {
            margin: 0;
            display: flex;
          }
        }
      }

      .icon__notification {
        position: inherit;
        top: 3px;
        min-width: 24px;
      }
    }
  }

  .form-bg {
    padding-top: 30px;
  }

  .warning-required {
    font-weight: normal;
    margin: 10px 0;
  }

  .tradepro-terms {
    margin-top: 15px;
  }

  .tradepro-submit {
    @include media-breakpoint-only(md) {
      margin-left: 25%;
    }
  }

  .form-row__continue {
    @include media-breakpoint-down(sm) {
      display: none;
    }

    .form-row__col-btn {
      @include media-breakpoint-up(md) {
        @include make-col(6);

        .tradepro-shop-continue {
          max-width: 160px;
        }
      }
      @include media-breakpoint-up(lg) {
        padding-left: 25%;
      }
    }
  }

  .right-aside {
    .form-row__continue {
      @include media-breakpoint-down(sm) {
        display: block;
      }

      @include media-breakpoint-up(md) {
        display: none;
      }
    }
  }

  .container {
    .form-row__action:last-child {
      @include media-breakpoint-up(md) {
        padding-top: 0;

        &::before {
          content: none;
        }
      }
    }
  }
}
