/*
 * utilities.css (M-23)
 * --------------------------------------------------------------------------
 * Token-based replacements for the small set of Bootstrap utility/component
 * classes that the markup still references after Bootstrap was removed.
 * Bootstrap is GONE from this project; every class below is implemented with
 * the WBeauty design-system tokens (variables.css) and standard CSS only.
 *
 * Scope is deliberately minimal -- only classes that were genuinely provided
 * by Bootstrap and are still present in live markup:
 *   .spinner-border / .spinner-border-sm  (admin loading spinners)
 *   .text-primary / .text-light           (spinner colour modifiers)
 *   .visually-hidden                       (a11y screen-reader text)
 *   .me-2                                  (margin-end spacing)
 *   .form-text                             (form helper text, AdminTreatments)
 * Other Bootstrap-ish classes still in the markup are defined as GLOBAL,
 * token-based rules in app.css -- specifically: the button family
 * (.btn / .btn-primary / .btn-secondary / .btn-danger / .btn-success /
 * .btn-outline / .btn-text and the .btn-sm / .btn-lg size modifiers), the
 * form families (.form-group / .form-label / .form-input / .form-select /
 * .form-control / .form-error), the .alert base + variants
 * (.alert-success / .alert-error / .alert-danger / .alert-warning /
 * .alert-info), .card, .container, the modal-* family, and small utilities
 * (.text-center / .text-muted / .mt-* / .mb-* / .flex* / .grid*). Components
 * may additionally carry their own scoped versions of these classes in their
 * *.razor.css; those win over the globals via higher specificity. They are
 * NOT redefined here -- this file only holds the utilities listed above.
 */

/* Loading spinner -- replaces Bootstrap .spinner-border with the project's
 * established brand-primary rotating-ring style (mirrors the scoped admin spinners and
 * app.css .spinner). 2rem default to match Bootstrap's footprint. */
.spinner-border {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  vertical-align: -0.125em;
  border: 0.25em solid var(--neutral-gray-light);
  border-right-color: var(--brand-primary);
  border-radius: 50%;
  animation: spinner-border-rotate 0.75s linear infinite;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.2em;
}

@keyframes spinner-border-rotate {
  to { transform: rotate(360deg); }
}

/* Spinner colour modifiers (Bootstrap shipped these as text-* utilities, used
 * only on spinners in this app -- they set currentColor for the ring). */
.text-primary { color: var(--brand-primary) !important; }
.text-light { color: var(--neutral-white) !important; }

/* When a colour modifier is present, the visible part of the ring follows it. */
.spinner-border.text-primary { border-right-color: var(--brand-primary); }
.spinner-border.text-light { border-right-color: var(--neutral-white); }

/* Accessible visually-hidden text (a11y) -- standard clip pattern, used for
 * the screen-reader "loading" label next to spinners. */
.visually-hidden,
.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Margin-end spacing (Bootstrap .me-2 == 0.5rem). Mapped to the spacing scale
 * (--space-xs is 8px == 0.5rem). */
.me-2 { margin-right: var(--space-xs) !important; }

/* Form helper text under inputs (Bootstrap .form-text). */
.form-text {
  display: block;
  margin-top: var(--space-xs);
  font-size: var(--small-size);
  color: var(--text-medium);
}
