/* ============================================================
   Kit — field.css   (reusable part: a labeled input field)
   Label + control (optional leading icon segment) + hint.
   States: default, focus, filled, error. Focus picks up the
   accent; error is semantic orange (not the brand).
   ============================================================ */

.bp-field { display: flex; flex-direction: column; gap: 6px; }

.bp-field__label { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--bp-surface-foreground); }
.bp-field__label .req { color: var(--bp-error); }

.bp-field__control {
  display: flex; align-items: stretch;
  border: 1px solid var(--bp-border-strong);
  border-radius: var(--bp-radius-btn); corner-shape: squircle;   /* same radius as a button */
  background: var(--bp-surface);
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.bp-field__icon {
  flex: none; width: 40px;
  display: grid; place-items: center;
  border-right: 1px solid var(--bp-border-strong);
  color: var(--bp-surface-muted);
}
.bp-field__icon svg { width: 18px; height: 18px; }
/* per-field Lottie illustration: static at rest, plays its pinch/hover
   segment once on hover (mounted by the slice via BPMotif.mountHoverOnce) */
.bp-field__icon .bp-field__anim { width: 20px; height: 20px; display: block; }
.bp-field__input {
  flex: 1; min-width: 0;
  border: none; outline: none; background: transparent;
  font: inherit; font-size: 15px; font-weight: 400;   /* regular; the filled state below bumps it to 600 */
  height: 40px; padding: 0 14px;          /* button height */
  color: var(--bp-surface-foreground);
}
.bp-field__input::placeholder { color: var(--bp-surface-muted); }
.bp-field__hint { font-size: 12px; line-height: 18px; color: var(--bp-surface-muted); }

/* focus */
.bp-field__control:focus-within,
.bp-field--focus .bp-field__control {
  border-color: var(--bp-accent);
  box-shadow: 0 0 0 3px var(--bp-accent-tint);
}

/* filled (icon + value read darker) */
.bp-field--filled .bp-field__icon { color: var(--bp-surface-foreground); }
.bp-field--filled .bp-field__input { font-weight: 600; }

/* error */
.bp-field--error .bp-field__control { border-color: var(--bp-error); }
.bp-field--error .bp-field__icon {
  color: var(--bp-error);
  border-right-color: color-mix(in srgb, var(--bp-error) 38%, white);
}
.bp-field--error .bp-field__hint { color: var(--bp-error); }
.bp-field--error.bp-field--focus .bp-field__control {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bp-error) 18%, white);
}

/* a quiet text prefix (#, $, @, https://) instead of the icon segment */
.bp-field__prefix {
  flex: none; display: grid; place-items: center;
  padding: 0 0 0 12px;
  color: var(--bp-surface-muted); font-size: 14px; font-weight: 600;
}

/* ---- small size: a 32px control for compact toolbars ---- */
.bp-field--sm .bp-field__input { height: 32px; font-size: 13px; padding: 0 10px; }
.bp-field--sm .bp-field__icon { width: 32px; }
.bp-field--sm .bp-field__icon svg { width: 16px; height: 16px; }
.bp-field--sm .bp-field__prefix { padding-left: 10px; font-size: 13px; }
.bp-field--sm .bp-field__prefix + .bp-field__input { padding-left: 6px; }
