@import '../helpers/helpers';
@import '../common/scroll-disable';
@import './print_quiz';
@import '../components/error-frame';

.main-quiz {
  padding: 0;
}

.header-quiz {
  text-align: center;

  &-image {
    z-index: $header;
    position: relative;
  }
}

.error-quiz {
  margin: 40px 0;
}

.quiz {
  &-container {
    padding-top: 0;
    padding-bottom: 0;

    &--final {
      padding-top: 5px;
      padding-bottom: 55px;
    }
  }

  &-title {
    font-weight: 500;
    font-size: 2rem;
    line-height: 2.5rem;
    color: $blue-dark;
    margin-bottom: 20px;
    margin-top: 30px;
    text-align: center;

    .quiz-title-highlight {
      color: $blue;
    }
  }

  &-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;

    &__image {
      width: 100%;
    }

    &__content {
      display: flex;
      justify-content: center;
      width: 100%;
      background: $white-transparent80;
      box-shadow: 0 6px 24px $black-transparent10;
      backdrop-filter: blur(11.5px);
      border-radius: 12px;
      margin-top: -55px;
      padding: 22px 10px 40px;
    }

    &__list {
      gap: 24px;
      max-width: 338px;
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      padding-left: 0;
      margin-bottom: 0;

      li {
        list-style-type: none;
        width: 100%;
        max-width: 122px;
        text-align: center;

        img {
          width: 100%;
          max-width: 80px;
          height: auto;
        }

        p {
          font-weight: 400;
          font-size: .75rem;
          line-height: 1rem;
          color: $gray-dark;
          margin-bottom: 0;
        }
      }
    }
  }

  &-actions {
    margin: 20px auto 0;
    display: flex;
    flex-wrap: wrap;
    grid-gap: 20px 69px;
    justify-content: center;
    max-width: 400px;
  }

  &-disclaimer {
    margin-top: 20px;
    font-weight: 300;
    font-size: .75rem;
    line-height: 1.25rem;
    color: $gray-dark;
  }

  &-modal {
    .modal-box {
      &__body {
        width: 100%;
      }

      &__content {
        padding: 24px 0;
      }

      &__inner-row {
        margin: 0;
        max-width: 100%;
      }

      &__header {
        padding: 0 0 20px;
        margin-bottom: 24px;
        border-bottom: 0;
        position: relative;

        &::after {
          content: '';
          border-bottom: 4px solid $blue;
          position: absolute;
          bottom: 0;
          left: 50%;
          transform: translate(-50%, -50%);
          width: 100%;
          border-radius: 4px;
        }
      }

      &__inner-columns {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 0;
      }

      &__btn-close {
        opacity: 1;
        top: -5px;
        right: -5px;

        svg path {
          fill: $gray-dark;
        }
      }
    }

    .modal-title {
      margin-bottom: 16px;
    }

    &__form {
      .form-row {
        margin-bottom: 32px;

        &__field {
          padding: 0;
        }

        &__label {
          margin-bottom: 8px;

          &:before {
            margin-right: 4px;
          }
        }
      }
    }

    &__controls {
      display: flex;
      justify-content: flex-end;

      .btn {
        width: 100%;
        max-width: 110px;

        & + .btn {
          margin-left: 12px;
        }
      }
    }

    &__subtitle {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;

      .subtitle-confirmation {
        display: flex;
        align-items: center;

        svg {
          font-size: 1.3rem;

          path {
            fill: $blue;
          }
        }

        span {
          margin-left: 8px;
          font-weight: 700;
        }
      }

      .quiz-steps {
        font-size: .75rem;
      }
    }

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

      h2 {
        @include heading-1;
        margin-bottom: 16px;
      }

      p {
        margin-bottom: 0;
      }
    }

    &--final {
      .quiz-modal__controls {
        padding: 24px 0;
      }
    }
  }
}

@include media-breakpoint-down(sm) {
  .quiz-modal__form {
    .form-row__label,
    .form-row__error {
      padding-right: 0;
      padding-left: 0;
    }
  }
}

@include media-breakpoint-up(sm) {
  .quiz-summary {
    &__content {
      padding: 30px;
    }

    &__list {
      max-width: 430px;
    }
  }
}

@include media-breakpoint-up(md) {
  .quiz {
    &-summary__content {
      margin-top: -95px;
    }

    &-actions {
      margin-top: 30px;
      flex-direction: row;
      max-width: 100%;
      grid-gap: 80px;
    }

    &-container--final {
      padding-top: 30px;
      padding-bottom: 30px;
    }

    &-modal {
      .modal-dialog {
        margin-top: 72px;
      }

      .modal-box__content {
        padding: 24px;
        max-width: 720px;
        margin: 0 auto;
      }

      &__form {
        .form-row {
          &__field {
            padding-right: 15px;
            padding-left: 15px;
          }
        }
      }
    }
  }
}

@include media-breakpoint-only(md) {
  .quiz {
    &-title {
      margin-bottom: 30px;
    }

    &-summary {
      &__image {
        width: calc(100% - 14px);
      }

      &__list {
        gap: 8px 24px;
      }
    }
  }
}

@include media-breakpoint-up(lg) {
  .quiz {
    &-container--final {
      padding-top: 50px;
      padding-bottom: 70px;
    }

    &-title {
      margin-bottom: 25px;
    }

    &-summary__list {
      max-width: 100%;
    }

    &-actions {
      margin-top: 55px;
    }

    &-disclaimer {
      margin-top: 70px;
    }
  }
}

@include media-breakpoint-up(xl) {
  .quiz-summary {
    flex-direction: row;

    &__content {
      width: 100%;
      max-width: 963px;
      position: absolute;
      right: 0;
      bottom: 28px;
      padding: 40px 8px;
    }

    &__list {
      display: flex;
      flex-direction: row;
      flex-wrap: nowrap;
      margin: 0;

      li {
        max-width: 173px;
      }
    }

    &__image {
      max-width: 838px;
    }
  }
}
