/* *** Forms *** */

/* * General * */
button {
  @extend  .bb-btn;
}
button[type="submit"],
input[type="submit"],
#buddypress #register-page input[type=submit],
#buddypress #activate-page .button {
  height: auto;
  padding: 14px 35px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  text-transform: uppercase;
  cursor: pointer;
  border: 0 none;
  font-family: inherit;
  -webkit-appearance: none;
  transition: all 0.1s ease-out;

  &[disabled="disabled"] {
    opacity: 0.7;
  }
}
button[type="submit"],
input[type="submit"],
#buddypress #register-page input[type=submit],
#buddypress #activate-page .button {
  @extend .hvr-box-shadow;
}

.touchevents {
  button {
    &:focus, &:active {
      box-shadow: none;
    }
  }
}

input[type='tel'],
input[type='text'],
input[type='number'],
input[type='date'],
input[type='time'],
input[type='url'],
input[type='email'],
input[type='search'],
input[type='password'] {
    -webkit-appearance: none;
       -moz-appearance: none;
            appearance: none;
  outline: 0;
}

select,
textarea,
input[type='tel'],
input[type='text'],
input[type='number'],
input[type='date'],
input[type='time'],
input[type='url'],
input[type='email'],
input[type='search'],
input[type='password'],
.select2-search--dropdown .select2-search__field {
  display: block;
  width: 100%;
  padding: 12px 14px;
  text-align: center;
  font-size: 14px;
  line-height: 1.42857143;
  color: inherit;
  border: 2px solid #ececec;
  background-color: transparent;
  font-family: inherit;
}
input,select {
  height: 48px;
}
input[type='checkbox'],
input[type='radio'] {
  height: auto;
}
input,select,textarea {
  &.error {
    border-color: #FF0000 !important;
  }
}
textarea {
  padding: 20px 14px;
  height: 170px;
  resize: none;
}

select {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  padding-right: 24px;
  background-image: url('../images/caret-down.svg');
  background-size: auto 18px;
  background-repeat: no-repeat;
  background-position: right center;
  &::-ms-expand {
    display: none;
  }
}
input[type=checkbox], input[type=radio] {
  margin: 4px 0 0;
  padding: 0;
  margin-top: 1px\9;
  line-height: normal;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
input[type='button'], input[type="search"] {
  -webkit-appearance: none;
}
.input-field {
  position: relative;
  margin-bottom: 10px;
}

label {
  display: block;
  max-width: 100%;
  margin-bottom: 5px;
}
.bb-checkbox, .bb-radio, .bb-checkbox-inline, .bb-radio-inline {
  position: relative;
  display: block;
  margin-top: 10px;
  margin-bottom: 10px;

  label {
    min-height: 20px;
    padding-left: 20px;
    margin-bottom: 0;
    font-weight: 400;
    cursor: pointer;
  }
  input[type=checkbox], input[type=radio] {
    position: absolute;
    margin-top: 4px\9;
    margin-left: -20px;
    left:0;
    top:4px;
  }
}

/* Captcha Styling */
.google-captcha-code {
  display: inline-block;
}
.captcha-container {
  padding: 22px 5%;
  margin-bottom: 21px !important;
}
.form-captcha {
  text-align: left;
  position: relative;
  margin-bottom: 10px;
  overflow: hidden;

  img {
    max-width: 100%;
    width: 100%;
  }
  .refresh-captcha {
    position: absolute;
    right: 10px;
    top:50%;
    margin-top: -18px;
    color: #4c4c4c;
    opacity: 0.6;
    &:before {
      content: "\f021";
      color: inherit;
      font-size: 25px;
      font-family: $icon-font-family;
    }
  }
}
.google-captcha-code {
  display: inline-block;
}

/* * Select2 Plugin Specific Styles * */
.select2-container .select2-selection--single {
  height: 48px;
  text-align: center;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 48px;
}
.select2-container .select2-selection--single .select2-selection__rendered {
  padding-left: 12px;
  font-size: 14px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 44px;
  top: 2px;
}
.select2-container--default .select2-selection--single,
.select2-container--default .select2-search--dropdown .select2-search__field,
.select2-dropdown {
  border: 2px solid #ececec;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
  text-align: left;
}
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option[aria-selected=true] {
  color: inherit;
  background-color: #f1f1f1;
}
.select2-container--default .select2-results__option[aria-selected=true] {
  background-color: #e5e5e5;
}
.select2-results {
  background: #fafafa;
}
.select2-results__option {
  padding: 6px 6px 6px 12px;
  font-size: 14px;
}

//.select2-search input {
//  border: none;
//  text-align: left;
//}
//.select2-drop {
//  margin-top: -3px;
//  overflow: hidden;
//}
//.select2-drop, .select2-dropdown-open.select2-drop-above .select2-choice {
//  border: 3px solid #ececec;
//}
//.select2-drop.select2-drop-above.select2-drop-active {
//  border-top: 3px solid #ececec;
//}
//.select2-dropdown-open.select2-drop-above .select2-choice {
//  border-top-color: inherit;
//}
//.select2-container .select2-choice, .select2-dropdown-open.select2-drop-above .select2-choice {
//  border-color: inherit;
//}

/* * Form Components * */

/* Form block */
// This is a block with background considered for group of controls
.bb-form-block {
  padding: 25px;
  border-radius: 5px;
  select, textarea, input[type="tel"], input[type="text"], input[type="number"], input[type="date"], input[type="time"], input[type="url"], input[type="email"], input[type="search"], input[type="password"] {
    text-align: left;
  }
  label {
    font-size: 14px;
  }
  .input-field {
    margin-bottom: 20px;
    &:last-child {
      margin-bottom: 0;
    }
  }

  @media (min-width: $screen-sm-min) {
    padding: 45px;
  }
}

/* Input with addon */
.bb-input-addon {
  position: relative;
  .search-field {
    padding-right: 50px;
    text-align: left;
  }
  button[type=submit].search-submit {
    position: absolute;
    top: 13px;
    right: 14px;
    padding: 0;
    margin: 0;
    width: auto;
    font-size: 15px;
    background: none;
    &:before {
      font-family: $icon-font-family;
      content: "\e973";
      font-size: 21px;
    }
    &:hover {
      box-shadow: none;
      opacity: 0.7;
    }
  }
}

/* Form Row Actions */
// This is for the case when we have capcha and button in the same row
.bb-form-row-actions {
  width: 100%;
  .captcha-container {
    width: 100%;
    margin-bottom: 0px !important;
  }
  .input-field, .captcha-container, input[type='submit'] {
    display: inline-block;
    width: 100%;
  }
  .captcha-col, .btn-col {
    text-align: center;
    padding-top: 20px;
  }

  // Google Captcha Specific Styling
  .google-captcha-code {
    @include transform(scale(0.8));
    @include transform-origin(50% 50%);
    @include calc(margin-left, '(100% - 304px) / 2');
  }

  @media (min-width: $screen-xs-min) {
    .input-field, input[type='submit'], .captcha-container {
      width: 300px;
    }
  }
  @media(min-width: 304px + $container-padding * 2) {
    // Google Captcha Specific Styling
    .google-captcha-code {
      @include transform(scale(0.9));
      margin-left: 0;
    }
  }
  @media (min-width: 960px) {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    // Google Captcha Specific Styling
    .google-captcha-code {
      @include transform-origin(0 50%);
      @include transform(scale(1));
    }
    .captcha-col, .btn-col {
      display: inline-block;
      float: none;
      height: 100%;
      vertical-align: middle;
      text-align: left;
    }
    .btn-col {
      text-align: right;
      flex-grow: 10;
      float: right;
    }
    input[type='submit'], .input-field {
      width: auto;
    }
  }
}
.two-sidebar {
  .bb-form-row-actions {
    input[type=submit] {
      padding: 14px 20px;
      font-size: 15px;
    }
  }
}

/* Form Row with Checkbox and Label */
.bb-row-check-label {
  text-align: left;
  line-height: 16px;
  .form-input,.form-label {
    line-height: 1em;
    vertical-align: middle;
    margin: 0;
  }
  .form-label {
    display: inline;
    color: inherit;
    font-size: 14px;
  }
  a:hover {
    text-decoration: underline;
  }
}

/* Password Strength Tool */
.bb-pass-strength {
  @include clearfix();
  font-size: 14px;
  margin-bottom: 15px;
  .pass-status-msg, .pass-progress-bar {
    clear: both;
  }
  .pass-status-msg {
    width: 100%;
    margin-bottom: 10px;
  }
  .pass-msg-title, .pass-status-msg {
    float: left;
  }
  .pass-msg-value {
    font-weight: bold;
    float: right;
  }
  .pass-progress-bar {
    position: relative;
    width: 100%;
    height: 8px;
    background-color: #ececec;
    border-radius: 25px;
    &:before {
      content: '';
      width: 0;
      transition: width 0.25s ease-in;
      position: absolute;
      left: 0;
      top: 0;
      height: 100%;
      border-radius: 25px 0 0 25px;
    }
  }
  &.bb-mismatch-pass {
    font-size: 16px;
    color: $danger-color;
    .pass-msg-value {
      font-weight: normal;
      float: none;
    }
    .pass-status-msg {
      margin: 0;
    }
  }
  &.bb-short-pass {
    .pass-msg-value {
      color: $danger-color;
    }
    .pass-progress-bar {
      &:before {
        width: 25%;
        background-color: $danger-color;
      }
    }
  }
  &.bb-weak-pass {
    .pass-msg-value {
      color: $warning-color;
    }
    .pass-progress-bar {
      &:before {
        width: 50%;
        background-color: $warning-color;
      }
    }
  }
  &.bb-good-pass {
    .pass-msg-value {
      color: $info-color;
    }
    .pass-progress-bar {
      &:before {
        width: 75%;
        background-color: $info-color;
      }
    }
  }
  &.bb-strong-pass {
    .pass-msg-value {
      color: $success-color;
    }
    .pass-progress-bar {
      &:before {
        width: 100%;
        background-color: $success-color;
        border-radius: 25px;
      }
    }
  }
}