@import '../../../styles/variables';

.numberInput {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  height: $text-input-height;
  border: 2px solid var(--input-background);
  border-radius: $text-input-border-radius;
  background: var(--input-background);
  position: relative;

  &.active {
    @include active-input;
  }

  &.error {
    border: 2px solid var(--input-error);
    border-top-right-radius: 3px;
    border-top-left-radius: 3px;
  }

  .errorIcon {
    position: absolute;
    right: 8px;
    top: 10px;
  }

  .errorMessage {
    background-color: var(--input-error);
    color: $white;
    position: absolute;
    top: 39px;
    left: -2px;
    width: 100%;
    font-size: 0.7rem;
    padding: 5px 2px;
    border-radius: 3px;
    z-index: 9999;
    text-align: center;
  }

  .cleave {
    flex: 1 1 auto;
    box-sizing: border-box;
    width: 100%;
    height: $text-input-height;
    line-height: $text-input-height;
    color: var(--input-text);
    background: var(--input-background);
    font-size: $text-input-font-size;

    ::placeholder {
      color: purple !important;
    }
  }

  .maxButton {
    flex: 0 1 auto;
    border: none;
    color: var(--button-max-amount-text);
    background: var(--button-max-amount-background);
    font-size: 12px;
    font-weight: 600;
    width: auto;
    padding: 12px;
    border-radius: 0;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    height: auto;

    &:hover:not([disabled]) {
      @extend .maxButton;
      background: var(--button-max-amount-background) !important;
    }
  }
}

.numberInput ::placeholder {
  color: var(--input-placeholder);
}
