/* --- tui-textfield (Taiga Input) --- */
tui-textfield.sg-tui-textfield[tuiAppearance][data-appearance='textfield'] {
  --tui-focus: var(--sg-color-textfield-focus-border);
  --t-shadow: none;
  box-shadow: none;
  background-color: var(--sg-color-textfield-bg);
  outline: 1px solid transparent;
  outline-offset: -1px;
  border-width: 0;
  border-radius: var(--sg-textfield-radius, var(--tui-radius-l));
  filter: none;
  transition:
    background-color 0.15s ease,
    outline-color 0.15s ease;
}

tui-textfield.sg-tui-textfield[tuiAppearance][data-appearance='textfield']::before,
tui-textfield.sg-tui-textfield[tuiAppearance][data-appearance='textfield']::after {
  box-shadow: none;
}

tui-textfield.sg-tui-textfield[tuiAppearance][data-appearance='textfield']:hover:not(:focus-within):not(
    [data-state='disabled']
  ):not(._disabled),
tui-textfield.sg-tui-textfield[tuiAppearance][data-appearance='textfield'][data-state='hover']:not(:focus-within) {
  --t-shadow: none;
  box-shadow: none;
  background-color: var(--sg-color-textfield-hover-bg);
  outline: 1px solid transparent;
  outline-offset: -1px;
}

tui-textfield.sg-tui-textfield[tuiAppearance][data-appearance='textfield']:focus-within,
tui-textfield.sg-tui-textfield[tuiAppearance][data-appearance='textfield'][data-focus='true'],
tui-textfield.sg-tui-textfield[tuiAppearance][data-appearance='textfield']:focus-visible:not([data-focus='false']) {
  --t-shadow: none;
  box-shadow: none;
  background-color: var(--sg-color-textfield-focus-bg);
  outline: 1px solid var(--sg-color-textfield-focus-border);
  outline-offset: -1px;
}

tui-textfield.sg-tui-textfield[tuiAppearance][data-appearance='textfield'] input:not(.t-filler) {
  background: transparent;
  outline: none;
  box-shadow: none;
}

tui-textfield.sg-tui-textfield[tuiAppearance][data-appearance='textfield']:focus-within input:not(.t-filler),
tui-textfield.sg-tui-textfield[tuiAppearance][data-appearance='textfield'][data-focus='true'] input:not(.t-filler) {
  outline: none;
  box-shadow: none;
}

tui-textfield.sg-tui-textfield[tuiAppearance][data-appearance='textfield']:focus-within [tuiLabel],
tui-textfield.sg-tui-textfield[tuiAppearance][data-appearance='textfield'][data-focus='true'] [tuiLabel] {
  color: var(--sg-color-textfield-focus-label) !important; /* Taiga: color … !important на [tuiLabel] */
}

tui-textfield.sg-tui-textfield[tuiAppearance][data-appearance='textfield']:focus-within input:not(.t-filler)::placeholder,
tui-textfield.sg-tui-textfield[tuiAppearance][data-appearance='textfield'][data-focus='true']
  input:not(.t-filler)::placeholder {
  color: var(--sg-color-textfield-focus-label);
}

tui-textfield.sg-tui-textfield[tuiAppearance][data-appearance='textfield'] textarea {
  background: transparent;
  outline: none;
  box-shadow: none;
  color: var(--sg-color-text);
}

tui-textfield.sg-tui-textfield[tuiAppearance][data-appearance='textfield']:focus-within textarea,
tui-textfield.sg-tui-textfield[tuiAppearance][data-appearance='textfield'][data-focus='true'] textarea {
  outline: none;
  box-shadow: none;
}

/* --- нативные поля (datetime-local, text, …) --- */
.sg-native-input {
  box-sizing: border-box;
  min-block-size: var(--sg-native-input-min-height, 2rem);
  padding: var(--sg-native-input-padding, 0.35rem 0.5rem);
  border: 1px solid transparent;
  outline: 1px solid transparent;
  outline-offset: -1px;
  border-radius: var(--sg-textfield-radius, var(--tui-radius-l));
  background: var(--sg-color-textfield-bg);
  color: var(--sg-color-text);
  font: inherit;
  box-shadow: none;
  transition:
    background-color 0.15s ease,
    outline-color 0.15s ease;
}

.sg-native-input:hover:not(:disabled) {
  background: var(--sg-color-textfield-hover-bg);
  outline: 1px solid transparent;
  outline-offset: -1px;
}

.sg-native-input:focus {
  outline: 1px solid var(--sg-color-textfield-focus-border);
  outline-offset: -1px;
  background: var(--sg-color-textfield-focus-bg);
  border-color: transparent;
}

.sg-native-input:focus-visible {
  outline: 1px solid var(--sg-color-textfield-focus-border);
  outline-offset: -1px;
}

.sg-native-input:disabled {
  opacity: var(--tui-disabled-opacity);
}
