@import "../../global/reset";
@import "../../global/color";
@import "../../global/utils";

$input_font_size: 0.8rem;
$readonly_color: #aaaaaa;
$color_error: red;
$color_right: green;
.ipt {
  border: 1px solid #eeeeee;
  border-radius: 0.3rem;
  -webkit-border-radius: 0.3rem;
  -moz-border-radius: 0.3rem;
  outline: none;
  font-size: $input_font_size;
  padding: 0px 0.5rem;
  &:read-only {
    height: 2rem;
    color: $readonly_color;
  }
}

.ipt[type=text], .ipt[type=password], .ipt[type=number] {
  height: 2rem;
  line-height: 2rem;
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.1rem;
  margin-bottom: 0.1rem;
}

.ipt[type=checkbox], .ipt[type=radio] {
  display: none;
}

.ipt[type=checkbox] + label {
  line-height: 2rem;
  margin: 0.5rem;
  vertical-align: middle;
  background-color: #fafbfa;
  padding: 10px;
  border-radius: 2rem;
  display: inline-block;
  position: relative;
  -webkit-transition: all 0.1s ease-in;
  transition: all 0.1s ease-in;
  width: 1rem;
}

.ipt[type=checkbox] + label:after {
  content: ' ';
  position: absolute;
  top: 0;
  -webkit-transition: box-shadow 0.1s ease-in;
  transition: box-shadow 0.1s ease-in;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 2rem;
  box-shadow: inset 0 0 0 0 #eee, 0 0 1px rgba(0, 0, 0, 0.4);
}

.ipt[type=checkbox] + label:before {
  content: ' ';
  position: absolute;
  background: white;
  z-index: 99;
  top: 0px;
  left: 0px;
  width: 1rem;
  -webkit-transition: all 0.1s ease-in;
  transition: all 0.1s ease-in;
  height: 1rem;
  border-radius: 2rem;
  box-shadow: 0 3px 1px rgba(0, 0, 0, 0.05), 0 0px 1px rgba(0, 0, 0, 0.3);
}

.ipt[type=checkbox]:active + label:after {
  box-shadow: inset 0 0 0 20px #eee, 0 0 1px #eee;
}

.ipt[type=checkbox] + label:active {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0px 1px 3px rgba(0, 0, 0, 0.1);
}

.ipt[type=checkbox]:checked + label:before {
  content: ' ';
  position: absolute;
  left: 1rem;
  border-radius: 100px;
}

.ipt[type=checkbox]:checked + label:after {
  content: ' ';
  font-size: 1.5em;
  position: absolute;
  background: #4cda60;
  box-shadow: 0 0 1px #4cda60;
}

.ipt-primary {

  &:focus {
    border: 1px solid map_get($primary_color, active);
  }

}

.ipt-success {

  &:focus {
    border: 1px solid map_get($success_color, active);
  }
}

.ipt-info {

  &:focus {
    border: 1px solid map_get($info_color, active);
  }
}

.ipt-warning {

  &:focus {
    border: 1px solid map_get($warning_color, active);
  }
}

.ipt-danger {
  &:focus {
    border: 1px solid map_get($danger_color, active);
  }
}

.ipt-default {
  &:focus {
    border: 1px solid map_get($default_color, active);
  }
}
.ipt-outline{
  border-radius: 0;
  border: none;
  border-bottom: 1px solid map_get($default_color,normal);
  &:focus {
    border-bottom: 1px solid map_get($default_color,active);
  }
}


.ipt-error {

  height: 2rem;

  color: $color_error;
  border: 1px solid $color_error;

}

.ipt-right {
  height: 2rem;

  color: $color_right;
  border: 1px solid $color_right;

}

