/* Labelled fields, the shape every form input shares. */
.field{
  text-align:left;
  margin-bottom:var(--sp-3);
}
/* --text-secondary, not --text-muted: a label is read, and muted measures 2.61:1
 * on a card against secondary's 5.80:1. */
.field label{
  display:block;
  font-size:var(--fs-xs);
  font-weight:600;
  letter-spacing:.03em;
  text-transform:uppercase;
  color:var(--text-secondary);
  margin-bottom:var(--sp-1-5);
}
.field .input-wrap{
  display:flex;
  align-items:center;
  gap:var(--sp-2);
  border:1px solid var(--border-color-strong);
  border-radius:var(--radius-sm);
  padding:var(--sp-2) var(--sp-3);
  transition:border-color var(--transition), box-shadow var(--transition), background var(--transition);
  background:var(--bg-input);
}
.field .input-wrap:focus-within{
  border-color:var(--border-focus);
  box-shadow:var(--primary-glow);
  background:var(--bg-input-focus);
}
.field .input-wrap .icon{flex:none;color:var(--text-muted);}
.field input,
.field select{
  border:none;
  outline:none;
  background:transparent;
  font-size:var(--fs-base);
  width:100%;
  color:var(--text-color);
  font-family:inherit;
}
/* Every `.field select` places its own chevron inside `.input-wrap` (`icon('chevron-down')`);
 * without this the browser's native arrow renders a second one beside it. */
.field select{appearance:none;-webkit-appearance:none;-moz-appearance:none;}

/* A rejected field states what is wrong in words, next to the input — colour
 * alone would be the only signal for anyone who cannot see it. */
.field-error{
  margin-top:var(--sp-1-5);
  font-size:var(--fs-xs);
  color:var(--status-failed);
}
.field:has(.field-error) .input-wrap{border-color:var(--status-failed);}
.field-hint{
  margin-top:var(--sp-1-5);
  font-size:var(--fs-xs);
  color:var(--text-secondary);
}

/* A checkbox labels itself horizontally, so it drops the uppercase caption the
 * other fields use above their input. */
.field--checkbox label{
  display:flex;
  align-items:center;
  gap:var(--sp-2);
  text-transform:none;
  letter-spacing:0;
  font-size:var(--fs-base);
  font-weight:600;
  color:var(--text-color);
  margin-bottom:0;
}
.field--checkbox input{width:auto;accent-color:var(--primary-color);}

/* A field inside a table cell (a dictionary value, a tablet name on review): the
 * same input shape with no caption above it and no margin below. The cell's
 * header or an aria-label names it. */
.field--inline{margin-bottom:0;min-width:12rem;}

.form-actions{
  display:flex;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:var(--sp-2);
  margin-top:var(--sp-5);
}
/* A button that posts to its own route sits in its own form; the form adds no box. */
.form-actions form{display:contents;}
/* A phone stacks the actions at full width, with the primary (last in the markup) on
 * top, so a row of two to four buttons never wraps raggedly or scrolls sideways. */
@media (max-width:560px){
  .form-actions{flex-direction:column-reverse;align-items:stretch;}
  .form-actions .btn{width:100%;}
}
