/*
 * Minimal shared shadow-root reset, prepended once to the bundled
 * `ds.css` every component links to (see `scripts/build-ds-css.mjs` in
 * src). The design-system skill requires a single global reset
 * (`global.css`), but that is light-DOM only and cannot reach into a
 * shadow root. This is the shadow-DOM equivalent: box-sizing plus a
 * token-driven focus ring.
 *
 * Focus-ring color on inverse surfaces is not handled with `:host-context`
 * here: `ds-section[data-surface="inverse"]` re-points the
 * `--elvaio-color-focus` custom property for its whole subtree, and every
 * component (light or shadow DOM) that reads that token for its focus ring
 * inherits the override automatically, because custom properties inherit
 * through shadow boundaries.
 */
:host {
  box-sizing: border-box;
}

:host *,
:host *::before,
:host *::after {
  box-sizing: border-box;
}

:host(:focus-visible) {
  outline: var(--elvaio-focus-width) solid var(--elvaio-color-focus);
  outline-offset: 2px;
  border-radius: var(--elvaio-radius-field);
}


:host {
  display: block;
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--elvaio-space-02);
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: var(--elvaio-space-02);
}

.text {
  font-family: var(--elvaio-font-body);
  font-weight: var(--elvaio-font-weight-button);
  font-size: var(--elvaio-font-size-body);
  color: var(--elvaio-color-text);
}

.optional {
  font-weight: var(--elvaio-font-weight-body);
  color: var(--elvaio-color-text-muted);
}

.hint,
.error {
  margin: 0;
  font-size: var(--elvaio-font-size-small);
}

.hint {
  color: var(--elvaio-color-text-muted);
}

.hint:empty {
  display: none;
}

.error {
  display: flex;
  align-items: center;
  gap: var(--elvaio-space-02);
  font-weight: var(--elvaio-font-weight-semibold);
  color: var(--elvaio-color-tone-danger);
}

.error:empty {
  display: none;
}

.has-error .hint {
  display: none;
}

/* Base input/select/textarea styling (border, padding, hover/focus, error
   state) lives in `global.css`'s unscoped `[slot="control"]` rule, not
   here: `::slotted()` can't take a trailing `:hover`/`:focus-visible`
   pseudo-class, so splitting interactive states across two stylesheets for
   the same elements would be more confusing than consolidating. */
