@import '../core/mixins.scss';

.radio-check {
  visibility: hidden;
  cursor: pointer;
  width: auto;
  position: absolute;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

fieldset {
  position: relative;
  margin-bottom: 10px;
}

.form-group {
  position: relative;
  margin-bottom: 20px;
  .label {
    position: relative;
  }
  .checkbox-input {
    margin-bottom: -15px;
  }
}

input, textarea, select, .selectize-input {
  font-family: 'Nunito Sans', 'Open Sans', sans-serif;
  height: 42px;
  padding: 10px;
  width: 100%;
  border-radius: 6px;
  border: 1px solid $gray-50;
  font-size: 14px;
  background-color: #fff;
  @include transition(0.4s all);

  &:focus {
    border-color: #9fccf5;
    outline: 0;
    box-shadow: #9fccf5 0px 0px 3px 0px, inset #9fccf5 0px 0px 3px 0px
  }
  &[input-money] {
    padding-left: 64px;
  }
  &[disabled] {
    cursor: not-allowed !important;
    opacity: 0.3;
  }
  &.success {
    border-color: $success;
    color: $success;
  }
}

.money-input {
  input {
    padding-left: 64px;
  }
}

.selectize-input {
  min-height: 42px;
  height: inherit;

  input {
    font-size: 14px;
    position: absolute !important;
    top: 0;
    left: 10px !important;
  }

  .item {
    white-space: nowrap;
    max-width: 90%;
    overflow-x: hidden;
    display: inline-block;
    vertical-align: middle;
  }

  &:after {
    top: 33% !important;
    right: 22px !important;
    border: none !important;
    margin-top: -3px !important;
  }
  &::after {
    border: none;
    font-family: "fxF";
    color: $primary-color;
  }
}

.dropdown-icon {
  .selectize-input {
   &:after {
      top: 40% !important;
    }
    &::after {
      font-size: 6px;
    }
  }
}

.dichotomous-radio {
  .pull-left {
    margin-right: 0.5em;
  }
}

input {
  &[type="checkbox"] {
    @extend .radio-check;
    & + b.left-checkbox {
      left: -12px;
      position: absolute;
      bottom: 10px;
      margin-right: 20px;
      display: block;
    }
    & + b:before {
      font-family: 'fontawesome';
      width: 21px;
      height: 21px;
      display: block;
      position: absolute;
      border-radius: 4px;
      font-size: 14px;
      line-height: 13px !important;
      border: 1px solid $gray-20;
      top: -17px;
      left: 15px;
      cursor: pointer;
      content: '\f00c';
      text-align: center;
      color: transparent;
      padding-top: 2.5px;
      @include transition(.3s all);
    }
    &:checked {
      & + b:before {
        color: #fff;
        border-color: transparent;
        background-color: $info;
      }
      &:hover {
        & + b:before {
          color: #fff;
        }
      }
    }
    &:hover {
      & + b:before {
        color: #888;
      }
    }
    &[disabled] {
      & + b:before {
        background: #DEDEDE;
        color: #DEDEDE;
      }
    }
    &.checkbox-disabled {
      &:checked {
        & + b:before {
          color: $blue-lighten-30;
        }
      };
      & + b:before {
        background: #DEDEDE;
        color: #DEDEDE;
        pointer-events: none;
      }
    }
  }
  &[type="radio"] {
    @extend .radio-check;
    & + b {
      position: relative;
      vertical-align: bottom;
    }

    & + b:before {
      font-family: 'fontawesome';
      width: 22px;
      height: 22px;
      display: block;
      position: relative;
      border: 1px solid $gray-20;
      cursor: pointer;
      background-color: #fff;
      border-radius: 50%;
      content: '';
      text-align: center;
      color: transparent;
    }

    & + b:after {
      width: 0px;
      height: 0px;
      content: '';
      background: $gray-50;
      border-radius: 50%;
      position: absolute;
      top: 50%;
      left: 50%;
      cursor: pointer;
      @include transform(translate(-50%, -50%));
      @include transition(.3s all);
    }
    &:checked {
      & + b:after {
        background-color: $info;
        width: 14px;
        height: 14px;
      }
      &:hover {
        & + b:after {
          background-color: $info;
        }
      }
    }
    &:hover {
      & + b:after {
        width: 14px;
        height: 14px;
        background-color: #888;
      }
    }
  }
}

.select-helper {
  position: absolute;
  top: 0;
  right: 40px;
}

.input-info {
  height: 42px;
  padding: 12px 16px 12px;
  font-size: 16px;
  line-height: 1;
  position: absolute;
  top: 27px;
  background-color: $gray-05;
  z-index: 2;
  border: 1px solid $gray-50;
  &.left {
    left: 0px;
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
  }
  &.right {
    right: 0px;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
  }
}

.calendar-btn {
  @extend .input-info;
  right: 0px;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  &:hover {
    background-color: $gray-05;
  }
}

.has-error {
  color: $danger;
  input, textarea, select {
    border-color: $danger;
  }
  .selectize-input {
    border-color: $danger;
  }
  .calendar-btn {
    border-left: 1px solid #af1010;

  }
  .input-info {
    &.left {
      border-right: 1px solid #af1010;
    }
    &.right {
      border-left: 1px solid #af1010;
    }
  }
}

.bounce-error {
  animation: bounce ease-out 0.4s 1;
}

.help-block {
  opacity: 0;
  animation: fade 1s 0.3s forwards, bounce ease-out 0.4s 1;
}

input[type="file"], textarea[type="file"] {
  border: 0;
  opacity: 0;
  margin-bottom: 0;
  position: relative;
  z-index: 99;
}

.base-64-button {
  input[type="file"], textarea[type="file"] {
    position: absolute;
    height: 51px;
    cursor: pointer;

    &:hover {
      & + .fx-btn {
        background-color: $blue-lighten-30;
      }
    }

  }
}

#page-wrapper {
  .public-register {
    &.edit-page {
      overflow: hidden;
    }
  }
}

.right-label {
  padding-left: 40px;
}

.floating-input-icon-plus {
  position: relative;

  &:before {
    position: absolute;
    top: 3px;
    right: -21px;
    content: '+';
    font-size: 22px;
  }
}

.form-error {
  width: 100%;
  clear: both;
  p {
    display: block;
    color: $danger !important;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 14px;
    float: right;
  }
}
.col {
  p {
    float: left;
  }
}
