.text-input {
  display: flex;
  flex-direction: column;
  gap: var(--app-spacing-xs);
  width: 100%;
}

.text-input__label {
  font-size: var(--app-font-size-sm);
  font-weight: 600;
  color: var(--app-color-text);
}

.text-input__field {
  width: 100%;
  min-height: var(--app-touch-target);
  padding: var(--app-spacing-sm) var(--app-spacing-md);
  border: 1px solid var(--app-color-border-strong);
  border-radius: var(--app-radius-md);
  background: var(--app-color-surface);
  color: var(--app-color-text);
  font-size: var(--app-font-size-base);
  font-family: inherit;
  outline: none;
  transition: border-color var(--app-transition-fast), box-shadow var(--app-transition-fast);
}

.text-input__field::placeholder {
  color: var(--app-color-text-muted);
}

.text-input__field:focus {
  border-color: var(--app-color-primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

.text-input--valid .text-input__field {
  border-color: var(--app-color-success);
}

.text-input--invalid .text-input__field {
  border-color: var(--app-color-error);
}

.text-input--invalid .text-input__field:focus {
  box-shadow: 0 0 0 3px rgba(214, 40, 40, 0.15);
}

.text-input__meta {
  display: flex;
  justify-content: space-between;
  gap: var(--app-spacing-md);
  font-size: var(--app-font-size-xs);
  min-height: 1.2em;
}

.text-input__helper {
  color: var(--app-color-text-muted);
  flex: 1 1 auto;
}

.text-input__helper--error {
  color: var(--app-color-error);
  font-weight: 500;
}

.text-input__counter {
  flex: 0 0 auto;
  color: var(--app-color-text-muted);
  font-variant-numeric: tabular-nums;
}
