.dig-text-field {
  $disabled-text-color: rgba($body-text-color, 0.3);
  $error-color: $red-500;

  font-size: 16px;
  line-height: 24px;

  width: (64px * 4);
  height: 48px;
  display: inline-block;
  position: relative;
  @include ease-out($property: height, $duration: 200ms);

  //Normal Text Field Styles
  //------------------------
  .dig-text-field-hint,
  .dig-text-field-floating-label {
    position: absolute;
    line-height: 48px;
    color: $disabled-text-color;
    opacity: 1;
    @include ease-out();
  }

  .dig-text-field-error {
    position: absolute;
    bottom: -10px;
    font-size: 12px;
    line-height: 12px;
    color: $error-color;
    @include ease-out();
  }

  .dig-text-field-input,
  .dig-text-field-textarea {
    position: relative;
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    background-color: $transparent;
    color: $body-text-color;
  }

  .dig-text-field-textarea {
    margin-top: 12px;
  }

  .dig-text-field-underline,
  .dig-text-field-focus-underline {
    position: absolute;
    width: 100%;
    bottom: 8px;
    margin: 0;
  }

  .dig-text-field-focus-underline {
    border-color: $primary-1-color;
    border-bottom-width: 2px;
    transform: scaleX(0);
    @include ease-out();
  }

  &.dig-has-error {
    .dig-text-field-focus-underline {
      border-color: $error-color;
      transform: scaleX(1);
    }
  }

  &.dig-has-value {
    .dig-text-field-hint {
      opacity: 0;
    }
  }

  &.dig-is-disabled {

    .dig-text-field-input {
      color: $disabled-text-color;
    }

    .dig-text-field-underline {
      border: none;
      height: 40px;
      overflow: hidden;

      //hack because border style dotted just doesn't look right
      //border-bottom-style: dotted;
      &:after {
        content: '..............................................................................................................................................................................................................................................................................................................................................................';
        position: absolute;
        top: 23px;
        color: $disabled-text-color;
      }
    }
  }

  &.dig-is-focused {
    .dig-text-field-focus-underline {
      transform: scaleX(1);
    }
  }

  //Floating Label Text Field Styles
  //--------------------------------
  &.dig-has-floating-labels {
    height: 72px;

    .dig-text-field-floating-label {
      top: 24px;
      transform: scale(1) translate3d(0, 0, 0);
      transform-origin: left top;
    }

    .dig-text-field-hint {
      top: 24px;
      opacity: 0;
    }

    .dig-text-field-input {
      padding-top: 24px;
    }

    &.dig-has-value,
    &.dig-is-focused {
      .dig-text-field-floating-label {
        transform: scale(0.75) translate3d(0, -18px, 0);
      }
    }

    &.dig-has-value {
      .dig-text-field-floating-label {
        color: rgba($body-text-color, 0.5);
      }
    }

    &.dig-is-disabled {
      .dig-text-field-hint {
        color: $disabled-text-color;
      }
    }

    &.dig-is-focused {

      .dig-text-field-hint {
        opacity: 1;
      }

      .dig-text-field-floating-label {
        transform: scale(0.75) translate3d(0, -18px, 0);
        color: $primary-1-color;
      }

      &.dig-has-error {
        .dig-text-field-floating-label {
          color: $error-color;
        }
      }

      &.dig-has-value {
        .dig-text-field-hint {
          opacity: 0;
        }
      }
    }
  }
}
