@import './../../../../sources/styles/include.scss';

$component: 'form-result-new';
$template: 'form-3';

@mixin transition($time, $property) {
  -webkit-transition: $property $time;
  -moz-transition: $property $time;
  -ms-transition: $property $time;
  -o-transition: $property $time;
  transition: $property $time;
}
@mixin box-sizing($sizing) {
  -webkit-box-sizing: $sizing;
  -moz-box-sizing: $sizing;
  box-sizing: $sizing;
}
@mixin border-radius($radius) {
  -webkit-border-radius: $radius;
  -moz-border-radius: $radius;
  border-radius: $radius;
}

.widget.c-#{$component}.c-#{$component}-#{$template} {
  position: relative;
  z-index: 0;

  .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: 40px;
      font-weight: 500;
      line-height: 52px;
      @extend %text-align;
    }
    &-description {
      font-size: 14px;
      font-weight: normal;
      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 {
      position: relative;

      &-wrap {
        margin-top: 20px;
        margin-bottom: 20px;
      }
      &-input {
        display: block;
        font-size: 16px;
        line-height: 25px;
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        padding: 17px 20px;
        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.4s, opacity);
        }
        &:focus::placeholder {
          opacity: 1;
        }
        &-error {
          border-bottom-color: #C50000!important;

          &::placeholder {
            color: #C50000!important;
          }
        }
      }
      textarea {
        height: 93px;
        max-height: 250px;
      }

      label {
        position: absolute;
        top: 15px;
        left: 20px;
        margin: 0;
        font-size: 16px;
        line-height: 25px;
        font-weight: normal;
        @include transition(0.4s, null);
      }

      &[data-active="true"] label {
        top: -20px;
        font-size: 12px;
        line-height: 20px;
      }
    }
    &-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 {
      &-checkbox {
        display: block;
        position: relative;
      }
      input {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        padding: 0;
        margin: 0;
        border: none;
        opacity: 0;
        z-index: 1;

        &:checked {
          & + .widget-form-result-new-consent-indicator {
            &::before {
              display: block;
            }
          }
        }
      }
      &-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(2px);
        }
      }
      &-content {
        font-size: 14px;
        line-height: 1.5;

        a {
          text-decoration: underline;
        }
      }
    }
    &-submit {
      &-wrap {
        margin-top: 32px;
        overflow: hidden;
      }
      &:hover {
        color: #fff;
        cursor: pointer;
      }
    }
  }
  &[data-background='true'] {
    padding-top: 60px;
    padding-bottom: 60px;
  }
  &[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;
          }
        }
        label {
          @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;
          }
        }

        label {
          @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;
  }

  @media all and (max-width: 768px) {
    .widget-#{$component} {
      &-title {
        font-size: 35px;
        line-height: 40px;
      }
      &-description {
        font-size: 13px;
        line-height: 18px;
      }
    }
  }
  @include breakpoint-custom(500) {
    .widget-#{$component} {
      &-consent {
        &-container {
          order: 1;
        }
      }
      &-submit {
        &-container {
          order: 2;
        }
      }
    }
  }
}