@import './../../../../sources/styles/include.scss';

$component: 'form-result-new';
$template: 'form-2';

.widget.c-#{$component}.c-#{$component}-#{$template} {
  position: relative;

  .widget-#{$component} {
    &-background {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 1;
    }
    &-body {
      position: relative;
      z-index: 2;
    }
    &-error {
      font {
        font-weight: bold;
      }
    }
    &-title {
      font-size: 48px;
      font-weight: bold;
      line-height: 58px;
      @extend %text-align;
    }
    &-description {
      font-size: 14px;
      font-weight: bold;
      line-height: 21px;
      margin-top: 20px;
      @extend %text-align;
    }
    &-sent {
      font-size: 16px;
      font-weight: bold;
      line-height: 24px;
      margin-top: 25px;
      @extend %text-align;
    }
    &-fields {
      min-height: 20px;
      margin-top: 50px;
      margin-bottom: -20px;
    }
    &-field {
      &-wrap {
        margin-bottom: 20px;
      }
      &-input {
        display: block;
        font-size: 14px;
        line-height: 21px;
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        padding: 15px 25px;
        background-color: transparent;
        border-top: none;
        border-left: none;
        border-right: none;
        border-bottom: 1px solid #FFF;
        outline: none;
        @include box-sizing(border-box);

        &::placeholder {
          opacity: 0.5;
          @include transition(0.35s, opacity);
        }
        &:focus::placeholder {
          opacity: 1;
        }
        &-error {
          border-bottom-color: #C50000 !important;

          &::placeholder {
            color: #C50000 !important;
          }
        }
      }
      textarea {
        height: 93px;
        max-height: 250px;
      }
    }
    &-captcha {
      display: inline-block;

      &-wrap {
        font-size: 0;
        margin-top: 35px;
        @extend %text-align;
      }
      &-title {
        font-size: 14px;
        font-weight: bold;
        line-height: 14px;
        margin-bottom: 10px;
      }
      &-input {
        display: inline-block;
        text-align: center;
        width: 180px;
        min-width: initial;
        max-width: initial;
      }
    }
    &-consent {
      font-size: 0;
      margin-top: 35px;
      @extend %text-align;

      label {
        text-align: left;
      }
      &-indicator-wrap {
        position: relative;
        display: block;
        overflow: hidden;
      }
      &-indicator {
        display: block;
        position: relative;
        width: 17px;
        height: 17px;
        background-color: #FFF;
        border: 1px solid rgba(0, 0, 0, 0.15);
        cursor: pointer;
        z-index: 2;
        @include border-radius(2px);

        &::before {
          content: '';
          display: none;
          position: absolute;
          top: 3px;
          left: 3px;
          right: 3px;
          bottom: 3px;
          background-color: #333;
          @include border-radius(1px);
        }
      }
      &-content {
        font-size: 14px;
        font-weight: 600;
        line-height: 1.5;

        a {
          text-decoration: underline;
        }
      }
      input {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        border: none;
        opacity: 0;

        &:checked + .widget-form-result-new-consent-indicator {
          &::before{
            display: block;
          }
        }
      }
      & + .widget-form-result-new-submit-wrap {
        margin-top: 20px;
      }
    }
    &-submit {
      font-size: 16px;
      font-weight: 600;
      line-height: 1;
      padding: 18px 40px;
      @include border-radius(28px);

      &[disabled] {
        background-color: #F2F2F2;
        border-color: #E8E8E8;
        cursor: pointer;
      }
      &-wrap {
        font-size: 0;
        margin-top: 35px;
        @extend %text-align;
      }
    }
  }
  &[data-background='true'] {
    padding-top: 75px;
    padding-bottom: 75px;
  }
  &[data-theme='dark'] {
    .widget-#{$component} {
      &-error {
        font {
          color: #333!important;
        }
      }
      &-title {
        @extend %theme-dark;
      }
      &-description {
        @extend %theme-dark;
      }
      &-sent {
        @extend %theme-dark;
      }
      &-field {
        &-input {
          @extend %theme-dark;
          border-bottom-color: #333;

          &::placeholder {
            @extend %theme-dark;
          }
        }
      }
      &-captcha {
        &-title {
          @extend %theme-dark;
        }
      }
      &-consent {
        &-content {
          @extend %theme-dark;

          a {
            @extend %theme-dark;
          }
        }
      }
    }
  }
  &[data-theme='light'] {
    .widget-#{$component} {
      &-error {
        font {
          color: #FFF!important;
        }
      }
      &-title {
        @extend %theme-light;
      }
      &-description {
        @extend %theme-light;
      }
      &-sent {
        @extend %theme-light;
      }
      &-field {
        &-input {
          @extend %theme-light;
          border-bottom-color: #FFF;

          &::placeholder {
            @extend %theme-light;
          }
        }
      }
      &-captcha {
        &-title {
          @extend %theme-light;
        }
      }
      &-consent {
        &-content {
          @extend %theme-light;

          a {
            @extend %theme-light;
          }
        }
      }
    }
  }
  %text-align {
    &[data-align='left'] {
      text-align: left;
    }
    &[data-align='center'] {
      text-align: center;
    }
    &[data-align='right'] {
      text-align: right;
    }
  }
  %theme-dark {
    color: #333;
  }
  %theme-light {
    color: #FFF;
  }

  @include breakpoint-768() {
    .widget-#{$component} {
      &-title {
        font-size: 35px;
        line-height: 40px;
      }
      &-description {
        font-size: 13px;
        line-height: 18px;
      }
      &-consent {
        &-content {
          font-size: 13px;
        }
      }
    }
  }
  @include breakpoint-custom(500) {
    .widget-#{$component} {
      &-consent,
      &-submit-wrap {
        &[data-align='left'],
        &[data-align='right'] {
          text-align: center;
        }
      }
    }
  }
}