.root {
  overflow: hidden;
  text-overflow: ellipsis;
}

.input-wrapper {
  position: relative;
  padding-top: var(--control-label-height);
}

.underline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: #e7eaee;
}

.label {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  transform: translateY(
    calc(-50% + var(--control-label-height) + (var(--control-height-m) / 2))
  );
  transition: transform 0.2s ease;
  pointer-events: none;
}

.label_floating {
  transform: translateY(0) scale(0.75);
}

.label,
.input {
  font-size: var(--typo-size-m);
  line-height: var(--typo-line-height-m);
}

.input {
  box-sizing: border-box;
  appearance: none;
  display: block;
  width: 100%;
  height: var(--control-height-m);
  font-family: inherit;
  color: var(--color-text);
  outline: 0;
  border: 0;
  border: none;
  background-color: var(--control-background);
  transition: border-color 0.2s;
}

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

.input:-webkit-autofill {
  /* this prevents autofilled input background-color change in Chrome */
  transition: background-color 5000s ease-in-out 0s;
}

.input:invalid {
  box-shadow: none; /* disable unnecessary :invalid box-shadow in Firefox */
}

.input:matches(:focus, .input_invalid) ~ .underline {
  height: 2px;
}

.input:focus ~ .underline {
  background: var(--color-primary);
}

.input_invalid ~ .underline {
  background: var(--color-danger);
}

.input_disabled {
  opacity: 0.65;
  cursor: not-allowed;
  color: #8492a5;
}

.input_textarea {
  padding-top: 7px;
  padding-bottom: 7px;
  height: auto;
  resize: vertical;
}
