@use '/src/styles/typography';
@use '/src/styles/mixins';

.wrapper {
  display: flex;
  gap: var(--cl-m-gap);
  align-items: center;
  border: var(--cl-primary-border);
  border-radius: var(--cl-border-radius);
  padding: var(--cl-m-gap);
  background-color: var(--cl-primary-background);
  position: relative;

  &:has(input:focus) {
    border: var(--cl-outline-border);
  }

  &:has(input[aria-invalid='true']) {
    border: var(--cl-accent-border);
  }

  &:has(input[disabled]) {
    @include mixins.disabled();
  }

  & > span:nth-child(2) {
    display: flex;
    gap: var(--cl-s-gap);
    align-items: center;
  }
}

.input {
  @include typography.font-style(core, base);
  color: var(--cl-primary-color);
  padding: 0;
  border: none;
  display: inline-block;
  background: transparent;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  flex-grow: 1;
  min-width: 0;
  line-height: 1.5;

  &:focus-visible {
    outline: none;
  }

  &:placeholder-shown + span {
    display: none !important;
  }

  &::-webkit-outer-spin-button,
  &::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }

  &[type='number'] {
    -moz-appearance: textfield;
  }
}
