/* Placeholder */

@mixin myg-input__placeholder {
  &::-webkit-input-placeholder {
    @include myg-animate__transition(color);

    color: myg-theme__color(text, dark) !important;
  }

  &:-moz-placeholder {
    @include myg-animate__transition(color);

    color: myg-theme__color(text, dark) !important;
  }

  &::-moz-placeholder {
    @include myg-animate__transition(color);

    color: myg-theme__color(text, dark) !important;
  }

  &:-ms-input-placeholder {
    @include myg-animate__transition(color);

    color: myg-theme__color(text, dark) !important;
  }

  &:active,
  &:focus {
    &::-webkit-input-placeholder {
      color: myg-theme__color(text, base) !important;
    }

    &:-moz-placeholder {
      color: myg-theme__color(text, base) !important;
    }

    &::-moz-placeholder {
      color: myg-theme__color(text, base) !important;
    }

    &:-ms-input-placeholder {
      color: myg-theme__color(text, base) !important;
    }
  }
}

/* Input */

@mixin myg-input---error {
  border-color: myg-theme__color(error);

  &:active,
  &:focus {
    box-shadow: 0 0 0 myg__px(3.5) rgba(myg-theme__color(error, null, true), 0.35);
  }
}

@mixin myg-input---success {
  border-color: myg-theme__color(success);

  &:active,
  &:focus {
    box-shadow: 0 0 0 myg__px(3.5) rgba(myg-theme__color(success, null, true), 0.35);
  }
}

@mixin myg-input---disabled {
  color: myg-theme__color(text, lighter);

  &::-webkit-input-placeholder {
    color: myg-theme__color(text, lighter) !important;
  }

  &:-moz-placeholder {
    color: myg-theme__color(text, lighter) !important;
  }

  &::-moz-placeholder {
    color: myg-theme__color(text, lighter) !important;
  }

  &:-ms-input-placeholder {
    color: myg-theme__color(text, lighter) !important;
  }
}

@mixin myg-input---no-outline {
  box-shadow: none !important;
}

@mixin myg-input__input {
  @include myg-font(sans-serif);
  @include myg-theme__border-radius(1);
  @include myg-input__placeholder;
  @include myg-animate__transition;

  background: myg-theme__color(background, light);
  border: myg__px(1) solid myg-theme__color(border);
  color: myg-theme__color(text, darker);
  font-size: myg__px(15);
  line-height: 1.58;
  padding: myg__px(12) myg__px(16) myg__px(13);
  width: 100%;

  &:active,
  &:focus {
    border-color: myg-theme__color(accent, base);
    box-shadow: 0 0 0 myg__px(3.5) rgba(myg-theme__color(accent, base, true), 0.35);
  }
}

/* Textarea */

@mixin myg-input__textarea {
  @include myg-font(sans-serif);
  @include myg-theme__border-radius(1);
  @include myg-input__placeholder;
  @include myg-animate__transition;

  background: myg-theme__color(background, lighter);
  border: myg__px(1) solid myg-theme__color(border);
  color: myg-theme__color(text, dark);
  font-size: myg__px(15);
  line-height: 1.75;
  max-width: 100%;
  min-height: myg__px(125);
  min-width: 100%;
  padding: myg__px(12) myg__px(16) myg__px(13);
  width: 100%;

  &:active,
  &:focus {
    border-color: myg-theme__color(accent, base);
    box-shadow: 0 0 0 myg__px(3.5) rgba(myg-theme__color(accent, base, true), 0.35);
  }
}
