/*
 * Independent UI-state styling on ST8 roles (tokens.css).
 *
 * Every state is opt-in through a ti28 class, so this file changes nothing on
 * existing Storefront/WooCommerce markup until a template applies a class.
 * No template in this theme applies them yet.
 *
 * error, focus, disabled, read-only and loading are independent: each one
 * sets its own properties and none is derived from another. Error owns the
 * border colour, focus owns the outline, so a focused field in error keeps
 * both (ST8 UI-46 ERROR_FOCUS). Read-only is not disabled.
 * The host sets the matching ARIA state (aria-invalid, aria-disabled,
 * aria-readonly, aria-busy); a class alone is not an accessible state.
 *
 * Sources: ST8 UI-45, UI-46, UI-48 samples in data/geometry.json.
 */

.ti28-is-error {
  border-color: var(--ti28-error-text);
  border-width: var(--ti28-border-control-width);
  border-style: solid;
}

.ti28-is-disabled {
  background: var(--ti28-disabled-surface);
  color: var(--ti28-disabled-text);
  cursor: not-allowed;
}

/* ST8 has no separate read-only visual; only interaction is marked. */
.ti28-is-readonly {
  cursor: default;
}

.ti28-is-loading {
  cursor: progress;
}

/* Focus on the graphite surface uses the dark focus role (ST8 UI-45 FOCUS_DARK). */
.ti28-surface-dark :focus-visible {
  outline-color: var(--ti28-focus-dark);
}

/*
 * Messages (ST8 UI-48). Colour is never the only signal: the host renders a
 * label or icon with the text.
 */
.ti28-notice {
  border-radius: var(--ti28-radius-panel);
  color: var(--ti28-text-primary);
}

.ti28-notice--info {
  background: var(--ti28-surface-accent-soft);
}

.ti28-notice--warning {
  background: var(--ti28-warning-surface);
}

.ti28-notice--warning .ti28-notice__title {
  color: var(--ti28-warning-text);
}

.ti28-notice--error {
  background: var(--ti28-error-surface);
}

.ti28-notice--error .ti28-notice__title {
  color: var(--ti28-error-text);
}

/*
 * Confirmed event only. A template may apply this class only for a
 * confirmed RECEIVED or DUPLICATE_RECEIVED result, never for a click, an
 * HTTP response or a local draft. Nothing in this slice applies it.
 */
.ti28-notice--confirmed {
  background: var(--ti28-success-surface);
}

.ti28-notice--confirmed .ti28-notice__title {
  color: var(--ti28-success-text);
}
