/* Synced from ReforgeLicenseServer/wwwroot/shared/carbon/ - keep in sync manually */
/* ==========================================================================
   Soft Carbon — Base
   Reset, theme-driven page colors, Carbon's signature 2px focus outline,
   and the global reduced-motion kill-switch.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cds-background);
  color: var(--cds-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Theme islands repaint their own background */
[data-carbon-theme] {
  background-color: var(--cds-background);
  color: var(--cds-text-primary);
}

::selection {
  background: var(--cds-highlight);
  color: var(--cds-text-primary);
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--cds-link-primary);
  text-decoration: none;
  transition: color var(--cds-duration-fast-01) var(--cds-easing-productive);
}

a:hover {
  color: var(--cds-link-primary-hover);
  text-decoration: underline;
}

hr {
  border: 0;
  border-top: 1px solid var(--cds-border-subtle);
  margin: var(--cds-spacing-06) 0;
}

/* --------------------------------------------------------------------------
   Focus — Carbon's signature 2px outline. The outline radius should hug the
   element: components set border-radius, outline follows automatically.
   -------------------------------------------------------------------------- */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--cds-focus);
  outline-offset: 1px;
}

/* Filled controls (primary/danger buttons) need an inset gap so the outline
   reads against the fill. Applied per-component via this helper. */
.focus-inset:focus-visible {
  outline: 2px solid var(--cds-focus);
  outline-offset: -3px;
  box-shadow: inset 0 0 0 1px var(--cds-focus-inset);
}

/* --------------------------------------------------------------------------
   Screen-reader-only utility + skip link (visible on focus)
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only.skip-link:focus,
a.sr-only:focus {
  position: fixed;
  top: var(--cds-spacing-03);
  left: var(--cds-spacing-03);
  z-index: 10000;
  width: auto;
  height: auto;
  margin: 0;
  padding: var(--cds-spacing-04) var(--cds-spacing-05);
  clip: auto;
  white-space: normal;
  background: var(--cds-background);
  color: var(--cds-link-primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--cds-shadow);
}

/* --------------------------------------------------------------------------
   Reduced motion — global kill-switch. Components may add their own
   refinements; this guarantees nothing keeps moving.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
