.textAreaWrapper {
  margin-bottom: $row_space;
  position: relative;
  display: flex;
  cursor: auto;
  align-items: center;

  &::before {
    content: '';
    position: absolute;
    background: #fff;
    width: auto;
    top: 1px;
    left: 5px;
  }

  textarea {
    width: 100% !important;
    outline: none;
    box-sizing: border-box;
    border-radius: 5px;
    box-shadow: none !important;

    background: #FFF;
    border: $border;

    -webkit-appearance: none;

    &:focus {
      border-color: lighten($btn_red, 10%);

      + .placeholder {
        font-size: vw(10);
      }
    }

    &.notEmpty {

      + .placeholder {
        font-size: vw(10);
      }
    }
  }
}

.checked {

  &:before {
    background: url('./images/check.svg') no-repeat;
    content: '';
    position: absolute;
    background-size: cover;
  }
}

.error {

  &::before {
    background: #f9dfe5;
  }

  textarea {
    background: #f9dfe5;
    border-color: lighten($btn_red, 10%);
  }

  .placeholder {
    color: lighten($btn_red, 10%);

    &:before {
      background: #f9dfe5;
    }
  }
}

.placeholder {
  position: absolute;
  margin: 0;
  transition: all .2s ease 0s;
  cursor: text;
  font-weight: 200;

  span {
    z-index: 1;
    position: relative;
  }

  &::before {
    content: '';
    position: absolute;
    top: 50%;
    width: 100%;
    height: 1px;
    background: #fff;
    left: 0;
  }
}


@include media-mobile {

  .textAreaWrapper {

    &::before {
      height: vw(25);
      right: vw(15);
    }

    textarea {
      padding: vw(22) vw(15) vw(13) vw(15);
      font-size: vw(16);
      height: vw(120) !important;

      &.notEmpty {

        + .placeholder {
          top: vw(-20);
        }
      }

      &:focus,
      &.notEmpty {

        + .placeholder {
          top: vw(-7) !important;
        }
      }

      &.checked {
        padding: vw(22) vw(43) vw(13) vw(15);
      }
    }

    .placeholder {
      top: vw(7);
    }
  }

  .checked {

    textarea {
      padding-right: vw(45);
    }

    &::before {
      width: vw(25);
      height: vw(20);
      right: vw(15);
    }
  }

  .placeholder {
    top: vw(5);
    padding: 0 vw(5);
    left: vw(10);
    line-height: vw(40);
  }
}

@include media-except-mobile {

  .textAreaWrapper {

    &::before {
      height: 10px;
      right: 15px;
    }

    textarea {
      padding: 15px;
      font-size: 13px;
      height: 120px !important;

      &:focus,
      &.notEmpty {

        + .placeholder {
          font-size: 10px;
          line-height: 22px;
          margin-top: -11px;
        }
      }
    }
  }

  .mobile {

    textarea {
      padding: 22px 15px 19px;
      font-size: 16px;

      &:focus,
      &.notEmpty {
        + .placeholder {
          top: -7px !important;
        }
      }

      &.checked {
        padding: 22px 43px 13px 15px;
      }
    }

    .placeholder {
      top: 7px;
    }
  }

  .checked {

    textarea {
      padding-right: 45px;
    }

    &::before {
      width: 25px;
      height: 20px;
      right: 15px;
    }
  }

  .placeholder {
    top: 0;
    left: 10px;
    padding: 0 5px;
    line-height: 48px;
    color: $main_dark;
  }
}
