/* Form field – visible label, input, optional hint and an error message under the input.
   .field              wrapper
   .field__label       always visible, never replaced by the placeholder
   .field__input       52 px tall, 17 px text (no zoom on iOS)
   .field__hint        muted helper text
   .field__error       shown when the input has aria-invalid="true"; link it with aria-describedby
   Edges are sharp like the panels; keyboard focus uses the LED ring. */

.field {
  --field-radius: 3px;
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.field__label {
  font-size: var(--text-small);
  font-weight: 600;
}

.field__input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--field-radius);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: var(--text-body);
  transition:
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
}

.field__input::placeholder {
  color: color-mix(in srgb, var(--fg-muted) 70%, transparent);
}

.field__input:hover {
  border-color: color-mix(in srgb, var(--fg) 35%, var(--line-strong));
}

.field__input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.field__input[aria-invalid="true"] {
  border-color: var(--error);
}

.field__input[aria-invalid="true"]:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--error) 22%, transparent);
}

.field__input:disabled {
  background: var(--bg-raised);
  color: var(--fg-muted);
  cursor: not-allowed;
}

.field__hint {
  font-size: var(--text-small);
  color: var(--fg-muted);
}

.field__error {
  display: flex;
  gap: 0.45em;
  align-items: baseline;
  font-size: var(--text-small);
  font-weight: 500;
  color: var(--error);
}

.field__error::before {
  content: "!";
  flex: none;
  display: grid;
  place-items: center;
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  background: var(--error);
  color: var(--bg);
  font-size: 0.8em;
  font-weight: 700;
  transform: translateY(0.1em);
}

.field__error[hidden] {
  display: none;
}
