﻿> .input__group__border:first-child {
  border-top: none;
}
.input__group__border {
  border-top: 1px solid $input-border-color;
}

.input__divider {
  border-top: 1px solid $input-border-color;
  padding: 1rem;
  background-color: $input-divider-color;
}

.label--help-icon {
  cursor: pointer;
}

.input__base {
  position: relative;
  border-bottom: 1px solid $input-border-color;
  width: 100%; // Chrome yellow tint fix
  transition: 0.5s ease border-color;
  margin-bottom: 1rem;
  margin-top: 1.25rem;
  input:-webkit-autofill {
    box-shadow: 0 0 0 1000px white inset !important;
    -webkit-box-shadow: 0 0 0 1000px white inset !important;
  }
  /* VALIDATION ======================================= */
  .validation__container {
    position: absolute;
    top: 100%;
    right: 0;
    color: $input-validation-color;
    overflow: hidden;
    font-size: $input-validation-fontsize;
  }
  .validation__ul {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
    position: relative;
    transform: translateY(-20px);
    transition: 0.5s transform ease-in-out;
    .validation__item {
      white-space: nowrap;
      margin-left: 10px;
      list-style: none;
    }
  }
  &.validation__error {
    .validation__ul {
      transform: translateY(0);
    }
    .bar:before,
    .bar:after {
      background-color: $input-validation-error-bar-color;
    }
    border-bottom: 1px solid $input-validation-error-border-color !important;
  }
  /* INFO TEXT ======================================= */
  .info-text__container {
    position: absolute;
    top: 100%;
    left: 5px;
    overflow: hidden;
    font-size: $input-validation-fontsize;
  }
  .info-text__ul {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
    position: relative;
    transform: translateY(0);
    transition: 0.5s transform ease-in-out;
    .info-text__item {
      white-space: nowrap;
      list-style: none;
    }
  }
  &.validation__error {
    .info-text__ul {
      transform: translateY(-20px);
    }
  }
  /* LABEL ======================================= */
  label,
  span.label-classname {
    color: $input-label-color;
    font-size: 18px;
    font-weight: normal;
    position: absolute; // pointer-events: none;
    left: 5px;
    top: 5px;
    transition: 0.2s ease all;
    margin-bottom: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
  }
  $dim: 1.1rem;
  .label--help-icon {
    pointer-events: auto;
    bottom: 0.35rem;
    margin-left: 0.25rem;
    background-color: $input-label-color;
    border-radius: 50%;
    color: $input-text-color--white;
    text-align: center;
    height: $dim;
    width: $dim;
    min-width: $dim;
    line-height: $dim;
    font-size: $dim - 0.3;
    display: inline-block;
    transition: 0.2s ease all;
  }
  /* active state */
  input:placeholder-shown ~ label,
  input:focus ~ label,
  .filled ~ label,
  select:focus ~ label,
  textarea:focus ~ label,
  label.label--focused,
  span.label-classname.label--focused {
    top: -1rem;
    font-size: 14px;
    $dim-dif: -0.2rem;
    .label--help-icon {
      bottom: 0.25rem;
      height: $dim + $dim-dif;
      width: $dim + $dim-dif;
      min-width: $dim + $dim-dif;
      line-height: $dim + $dim-dif;
      font-size: $dim - 0.2 + $dim-dif;
    }
  }
  input:focus ~ label,
  .filled ~ label,
  select:focus ~ label,
  textarea:focus ~ label,
  label.label--focused,
  span.label-classname.label--focused {
    color: $primary-color;
  }
  /* BOTTOM BARS ================================= */
  .bar {
    position: absolute;
    bottom: 0;
    display: block;
    width: 100%;
  }
  .bar:before,
  .bar:after {
    content: '';
    height: 2px;
    width: 0;
    bottom: 0px;
    position: absolute;
    background-color: $primary-color;
    transition: 0.2s ease height, 0.5s ease background-color;
  }
  .bar:before {
    left: 50%;
  }
  .bar:after {
    right: 50%;
  }
  /* active state */
  input:focus ~ .bar:before,
  input:focus ~ .bar:after,
  textarea:focus ~ .bar:before,
  textarea:focus ~ .bar:after,
  select:focus ~ .bar:before,
  select:focus ~ .bar:after,
  label:focus ~ .bar:before,
  label:focus ~ .bar:after,
  .bar.focused:before,
  .bar.focused:after {
    width: 50%;
  }
  /* HIGHLIGHTER ================================== */
  .highlight {
    position: absolute;
    height: 24px;
    width: 100px;
    bottom: 5px;
    left: 0;
    pointer-events: none;
    opacity: 0.5;
  }
  /* active state */
  input:focus ~ .highlight,
  select:focus ~ .highlight {
    animation: inputHighlighter 0.3s ease;
  }
  input:focus {
    outline: none;
  }
  input:disabled,
  select:disabled {
    cursor: not-allowed;
    color: $input-label-color;
    background: transparent;
  }
  .input__button {
    display: inline-block; //background-color: $primary-color;
    padding: 6px 10px 7px 10px;
    svg.material-design-icon,
    & {
      font-weight: bold;
      transition: 0.2s all;
      color: $input-label-color;
      fill: $input-label-color;
      &:hover {
        color: $primary-color;
        fill: $primary-color;
      }
      display: inline-block;
      vertical-align: middle;
    }
  }
}

/* ANIMATIONS ================ */

@keyframes inputHighlighter {
  from {
    background: $primary-color;
  }
  to {
    width: 0;
    background: transparent;
  }
}
