.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.field--flush {
  margin-bottom: 0;
}

.field__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.field__input {
  width: 100%;
  border: none;
  border-bottom: 2px solid var(--color-border);
  border-radius: 0;
  background-color: transparent;
  padding: 0.625rem 0.125rem;
  font-size: 1rem;
  color: var(--color-text);
  min-height: 44px;
  transition: border-color 0.15s ease;
}

.field__input--borderless {
  border-bottom: none;
  padding: 0;
  min-height: 0;
}

select.field__input {
  padding-right: 2.25rem;
}

/* Keeps the underline look but swaps the native OS arrow for one that matches
   the rest of the app — used for long option lists (e.g. country) where a
   real <select> (native search-by-typing, keyboard scroll) beats a custom
   panel, but the default browser chrome still looks out of place. */
.field__input--select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.25rem center;
  background-size: 13px;
}

.field__input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

.field__input:focus {
  outline: none;
  border-bottom-color: var(--color-brand);
}

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

.field__control {
  position: relative;
  display: flex;
  align-items: center;
}

.field__control .field__input {
  padding-right: 2.25rem;
}

.field__toggle {
  position: absolute;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
}

.field__toggle:hover {
  color: var(--color-text);
}

.field__toggle:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.field__hint {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.field__error {
  font-size: 0.8125rem;
  color: var(--color-danger-text);
}
