/*
 * Bare form-control defaults. Skinned form layout lives in the c-form
 * component (added later); these are the element-level baselines every control
 * inherits.
 */

input, select, textarea, button {
  font-family: inherit;
  font-size: var(--fs-body);
  color: inherit;
}

label { display: block; }

/* Strip the browser's groove border and quirky legend box model; grouped
   styling comes from the form component. */
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-inline-size: 0;
}
legend { padding: 0; }

input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1.5px solid var(--field-line);
  border-radius: var(--r-sm);
  background: var(--field-bg);
  color: var(--field-ink);
}

textarea { min-height: 110px; resize: vertical; }

/* Bordered fields show focus via the tinted border (no outline needed). */
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal);
}

/* Checkboxes & radios have no border to tint — mirror the field focus with a
 * matching snug teal edge (same trigger + colour as a focused input border). */
input[type="checkbox"]:focus,
input[type="radio"]:focus {
  outline: 1.5px solid var(--teal);
  outline-offset: 1px;
}

/* Read-only: a value on show, not a box to type in. Dashed edge and the canvas
 * tint rather than the white field fill, so it reads as "stated" at a glance —
 * while staying selectable and copyable, which a disabled control is not. */
input[readonly]:not([type="checkbox"]):not([type="radio"]), textarea[readonly] {
  background: var(--surf-2);
  color: var(--ink-2);
  border-style: dashed;
  cursor: default;
}
input[readonly]:not([type="checkbox"]):not([type="radio"]):focus,
textarea[readonly]:focus { border-color: var(--field-line); }

::placeholder { color: var(--field-placeholder); opacity: 1; }
