/* ShiftHR UI Kit — shared GLOBAL classes (Pass B).
   Consumer-rendered classes that cannot be component-scoped: FormField CONTROLS
   (the consumer supplies <input class="shui-input"> as ChildContent) and the
   graceful-degradation surface/modifier (applied to arbitrary nav items / CTAs).
   Served via /_content/ShiftHR.UI/css/kit-globals.css and linked in BOTH the Web
   (App.razor) and Admin (AdminApp.razor) hosts so the shared form language + the
   'currently unavailable' treatment reach both surfaces. All token-backed. */

/* ── Form controls ──────────────────────────────────────────────────────── */
/* Text-like controls */
.shui-input, .shui-select, .shui-textarea {
    width: 100%; font-family: inherit; font-size: var(--text-base); color: var(--color-neutral-900);
    background: var(--control-bg); border: 1px solid var(--control-border); border-radius: var(--control-radius);
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.shui-input, .shui-select { height: var(--control-height); padding: 0 var(--space-3); }
.shui-textarea { min-height: 84px; padding: var(--space-3); resize: vertical; line-height: 1.5; }
.shui-input::placeholder, .shui-textarea::placeholder { color: var(--control-placeholder); }
.shui-input:hover, .shui-select:hover, .shui-textarea:hover { border-color: var(--control-border-hover); }
/* The kit's focus ring (UIK-1 (a), the owner, 25 November 2026): one solid 2px culture-olive outline, 2px out, on
   every control and row, 3:1 or more on every surface in both themes (KitFocusRingTests); never the 3px glow. */
.shui-input:focus, .shui-select:focus, .shui-textarea:focus { outline: 2px solid var(--color-culture); outline-offset: 2px; border-color: var(--color-brand); }
.shui-input:disabled, .shui-select:disabled, .shui-textarea:disabled {
    background-color: var(--control-disabled-bg); color: var(--control-disabled-text);
    border-color: var(--control-disabled-border); cursor: not-allowed;
}
/* The select's chevron: the set's chevron-down (its path, its 1.8 stroke) in the muted ink, --color-neutral-500, at
   that token's value in each register: an image cannot read a token, so each theme names its own, and
   KitGlyphTests holds the three to tokens.css. */
.shui-select {
    appearance: none; padding-right: var(--space-8); cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364695B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
    background-repeat: no-repeat; background-position: right var(--space-3) center;
}
[data-theme="dark"] .shui-select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238B978A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
}
@media (prefers-color-scheme: dark) {
    [data-theme="system"] .shui-select {
        background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238B978A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
    }
}
/* error state on any control: add .is-invalid (FormField sets it when ValidationMessage present) */
.shui-input.is-invalid, .shui-select.is-invalid, .shui-textarea.is-invalid { border-color: var(--color-error); }

/* Checkbox + radio — accent-color keeps native a11y, theme-tinted */
.shui-check, .shui-radio {
    appearance: none; width: 18px; height: 18px; flex-shrink: 0; margin: 0; cursor: pointer;
    border: 1.5px solid var(--control-border-hover); background: var(--control-bg);
    transition: background var(--duration-fast), border-color var(--duration-fast);
    display: inline-grid; place-content: center;
}
.shui-check { border-radius: var(--radius-sm); }
.shui-radio { border-radius: var(--radius-full); }
.shui-check::before { content: ""; width: 10px; height: 10px; transform: scale(0); transition: transform var(--duration-fast) var(--ease-spring);
    box-shadow: inset 1em 1em var(--color-on-brand); clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%); }
.shui-radio::before { content: ""; width: 8px; height: 8px; border-radius: var(--radius-full); transform: scale(0); transition: transform var(--duration-fast) var(--ease-spring); box-shadow: inset 1em 1em var(--color-on-brand); }
.shui-check:checked, .shui-radio:checked { background: var(--color-brand); border-color: var(--color-brand); }
.shui-check:checked::before, .shui-radio:checked::before { transform: scale(1); }
.shui-check:focus-visible, .shui-radio:focus-visible { outline: 2px solid var(--color-culture); outline-offset: 2px; }
.shui-check:disabled, .shui-radio:disabled { background: var(--control-disabled-bg); border-color: var(--control-disabled-border); cursor: not-allowed; }
.shui-choice { display: inline-flex; align-items: center; gap: var(--space-3); font-size: var(--text-base); color: var(--color-neutral-800); cursor: pointer; }

/* Toggle switch (pure CSS) */
.shui-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; cursor: pointer; }
.shui-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.shui-switch-slider { position: absolute; inset: 0; background: var(--color-neutral-300); border-radius: var(--radius-pill); transition: background var(--duration-normal) var(--ease-standard); }
.shui-switch-slider::before { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: var(--radius-full); background: var(--color-surface-raised); box-shadow: var(--shadow-sm); transition: transform var(--duration-normal) var(--ease-spring); }
.shui-switch input:checked + .shui-switch-slider { background: var(--color-brand); }
.shui-switch input:checked + .shui-switch-slider::before { transform: translateX(20px); }
.shui-switch input:focus-visible + .shui-switch-slider { outline: 2px solid var(--color-culture); outline-offset: 2px; }
.shui-switch input:disabled + .shui-switch-slider { opacity: .5; cursor: not-allowed; }
/* Reduced motion (A8, C11): the tick, the dot and the thumb change at once; nothing moves. */
@media (prefers-reduced-motion: reduce) {
    .shui-check, .shui-radio, .shui-check::before, .shui-radio::before, .shui-switch-slider, .shui-switch-slider::before { transition: none; }
}

/* ── NativePopover content (#1038) ──────────────────────────────────────── */
/* The consumer writes the panel's content, so its vocabulary is global: a heading line (the
   signed-in address, say), then items (links or buttons). */
.shui-native-popover-title {
    padding: 4px 10px var(--space-2); margin: 0 0 var(--space-2);
    border-bottom: 1px solid var(--color-border);
    font-size: var(--text-sm); color: var(--color-neutral-600); overflow-wrap: anywhere;
}
.shui-native-popover-item {
    display: flex; align-items: center; gap: var(--space-3); width: 100%; text-align: left;
    padding: 7px 10px; border: none; background: none; border-radius: var(--radius-md);
    font-family: inherit; font-size: var(--text-sm); color: var(--color-neutral-700);
    text-decoration: none; cursor: pointer;
    transition: background-color var(--duration-fast) var(--ease-standard);
}
/* The row hover (RULED by the owner at 03:35 on 8 November 2026; Lane KF, #1217; the guidelines' C7): an item
   answers the pointer with the kit's row tint, only where there is a pointer, and a press with the current-page
   tint; the shape is the item at the medium radius inside the panel's padding; the words keep their colour. */
@media (hover: hover) { .shui-native-popover-item:hover { background: var(--row-hover-bg); } }
.shui-native-popover-item:active { background: var(--row-press-bg); }
.shui-native-popover-item:focus-visible { outline: 2px solid var(--color-culture); outline-offset: 2px; }

/* ── Popover menu content (moved from Popover.razor.css, #1040) ──────────── */
/* The consumer writes a Popover's panel content, so the menu vocabulary is global: scoped to
   Popover.razor.css it never reached a consumer's items (REPORTED by the kit lane, #1038). A title
   line, a menu, its items (MenuItem renders one) and a divider; the danger item names an act that
   cannot be undone lightly (Deactivate, Remove). */
.shui-popover-title { font-size: var(--text-sm); font-weight: var(--font-semibold); color: var(--color-neutral-900); padding: 4px 10px var(--space-2); }
.shui-popover-menu { display: flex; flex-direction: column; gap: 2px; min-width: 180px; }
.shui-popover-menu-item {
    display: flex; align-items: center; gap: var(--space-3); width: 100%; text-align: left;
    padding: 7px 10px; border: none; background: none; border-radius: var(--radius-md);
    font-family: inherit; font-size: var(--text-sm); color: var(--color-neutral-700); cursor: pointer;
    white-space: nowrap;
    transition: background-color var(--duration-fast) var(--ease-standard);
}
@media (hover: hover) {
    .shui-popover-menu-item:hover { background: var(--row-hover-bg); }
    .shui-popover-menu-item--danger:hover { background: var(--color-error-light); }
}
.shui-popover-menu-item:not(.shui-popover-menu-item--danger):active { background: var(--row-press-bg); }
.shui-popover-menu-item:focus-visible { outline: 2px solid var(--color-culture); outline-offset: 2px; }
.shui-popover-menu-item--danger { color: var(--color-error-text); }
.shui-popover-menu-icon { width: 18px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; text-align: center; font-size: var(--text-sm); }
.shui-popover-menu-icon svg { width: 16px; height: 16px; }
/* an item's quieter trailing words (a workspace's tier and region, a shortcut), pushed to the end */
.shui-popover-menu-detail { margin-left: auto; padding-left: var(--space-4); font-size: var(--text-xs); color: var(--color-neutral-600); }
.shui-popover-menu-divider { border: none; border-top: 1px solid var(--color-border-light); margin: 4px 0; }

/* ── A row of fields (FormField Row, #1040) ─────────────────────────────── */
/* A filter bar: fields side by side, wrapping on a narrow screen, their controls on one baseline.
   Each field in it takes FormField's Row variant (its width and spacing are FormField's own). */
.shui-field-row { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: flex-end; }

/* ── Card-interior type (#1040) ─────────────────────────────────────────── */
/* The type inside a Card's body, which the consumer writes: an eyebrow over a heading, body text,
   a quieter meta line, and a figure (a number over its label). Every one is display: block, so it
   also works as a span inside a clicked card (a button holds phrasing content only). Inks clear
   WCAG AA on the card surfaces in both themes (neutral-600 and darker). */
/* The eyebrow (UIK-4 (a), the owner, 25 November 2026: "mono capitals at +0.04em in a neutral ink, no rule, gold
   stays recognition only"): Plex Mono at 500 (A4's mono weights), never gold, no rule beside it. */
.shui-card-eyebrow { display: block; margin: 0 0 var(--space-1); font-family: var(--font-mono); font-size: var(--text-2xs); font-weight: var(--font-medium); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--color-neutral-600); }
.shui-card-heading { display: block; margin: 0; font-size: var(--text-md); font-weight: var(--font-semibold); line-height: var(--leading-snug); color: var(--color-neutral-900); }
.shui-card-text { display: block; margin: var(--space-1) 0 0; font-size: var(--text-sm); line-height: var(--leading-normal); color: var(--color-neutral-700); }
.shui-card-meta { display: block; margin: var(--space-1) 0 0; font-size: var(--text-xs); line-height: var(--leading-normal); color: var(--color-neutral-600); overflow-wrap: anywhere; }
.shui-card-figure { display: block; }
.shui-card-figure-value { display: block; font-size: var(--text-2xl); font-weight: var(--font-bold); line-height: 1.1; letter-spacing: var(--tracking-tight); color: var(--color-neutral-900); }
.shui-card-figure-label { display: block; margin-top: var(--space-1); font-size: var(--text-xs); color: var(--color-neutral-600); }

/* ── The scrim and the spotlight (Scrim, #1040; for the guided tour) ──────── */
/* The scrim dims the page below the one element in the spotlight: Modal's overlay covers
   everything, a tour must not. Layers: the scrim (500), the spotlit element lifted above it (501),
   the docked panel above both (502), all under the Modal (1000) and the popovers (1500). The
   spotlit element is shown, not operated (pointer-events: none); the tour moves by its panel. */
.shui-scrim { position: fixed; inset: 0; z-index: 500; background: var(--color-surface-overlay); animation: shui-scrim-in var(--duration-normal) var(--ease-out); }
.shui-spotlit {
    position: relative; z-index: 501; pointer-events: none; border-radius: var(--radius-md);
    box-shadow: 0 0 0 4px rgba(var(--color-brand-rgb), .3), 0 0 24px rgba(var(--color-brand-rgb), .15);
}
.shui-scrim-dock {
    position: fixed; z-index: 502; bottom: var(--space-8); left: 50%; transform: translateX(-50%);
    width: calc(100% - 48px); max-width: 420px;
}
/* ScrimDock takes focus as a region (#1046): the ring shows for the keyboard only. */
.shui-scrim-dock:focus { outline: none; }
.shui-scrim-dock:focus-visible { outline: 2px solid var(--color-culture); outline-offset: 2px; border-radius: var(--radius-md); }
@keyframes shui-scrim-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .shui-scrim { animation: none; } }

/* ── Navigation focus restoration ───────────────────────────────────────── */
/* Focus moves to the page's h1 after navigation (Web: the kit's NavigationFocus and
   PageHeading, #1049; Admin: <FocusOnNavigate Selector="h1">); without suppression
   every page paints a focus ring on its heading after navigation (#655). Keyboard users lose nothing — headings are
   not interactive stops. Lives here (not base.css) because Admin links
   kit-globals but not base.css. */
h1:focus, h1:focus-visible { outline: none; }

/* ── Graceful degradation ───────────────────────────────────────────────── */
/* ┌─ GRACEFUL DEGRADATION (§5.6) — when a feature is killed (AI off, module       ┐
   │  disabled, billing lapse) every entry point renders disabled/calm and NEVER   │
   │  throws. The AI panel is this pattern's first consumer.                        │
   └──────────────────────────────────────────────────────────────────────────────┘ */
.shui-unavailable { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3); padding: var(--space-10) var(--space-6); background: var(--unavailable-bg); border: 1px dashed var(--unavailable-border); border-radius: var(--radius-lg); color: var(--unavailable-text); }
.shui-unavailable-icon { width: 44px; height: 44px; border-radius: var(--radius-full); background: var(--color-surface); border: 1px solid var(--color-border); display: inline-flex; align-items: center; justify-content: center; color: var(--color-neutral-400); }
.shui-unavailable-icon svg { width: 20px; height: 20px; }
.shui-unavailable-title { font-size: var(--text-md); font-weight: var(--font-semibold); color: var(--color-neutral-600); }
.shui-unavailable-desc { font-size: var(--text-sm); max-width: 38ch; line-height: var(--leading-normal); }
/* the second line (UnavailableCard Detail, #1040): what the feature is, under why it is closed */
.shui-unavailable-detail { font-size: var(--text-sm); max-width: 44ch; line-height: var(--leading-normal); color: var(--color-neutral-600); }
.shui-unavailable-actions { display: flex; gap: var(--space-2); justify-content: center; margin-top: var(--space-2); }
/* entry-point modifier — apply to any nav item / button that points at a killed feature */
.is-unavailable { opacity: .45; pointer-events: none; cursor: default; filter: grayscale(.4); position: relative; }
.is-unavailable::after { content: "Currently unavailable"; position: absolute; inset: auto auto auto 0; }
.is-unavailable .is-unavailable::after { content: none; }
/* nav-item flavour: keep it inert + show a tiny status dot instead of a tooltip clutter */
.shui-nav-item.is-unavailable::after { content: none; }

/* ── Wizard platform seams (Pass C-ready; rendered by separate authoring surfaces) ── */
/* ── Wizard PLATFORM scaffolding (Pass C-ready seams) ──────────────────────────
   A wizard is assembled from platform-defined BLOCKS (closed ecosystem — no
   workspace-authored blocks). A step holds one OR many blocks. Two origins:
     • origin="platform"  — Operator-authored (e.g. a Wellness epic); workspaces get
                            only enable/disable, never field edits.
     • origin="feature"   — AUTO-GENERATED from a feature's published schema/manifest
                            (one Operator switch; no per-feature wizard code).
   Workspace HR/People admins toggle which blocks + fields are on / required; the run
   can emit an artifact (e.g. an Interview Guide .docx). These classes give every
   one of those states a home so Pass C styles nothing from scratch. */
.shui-wz-origin { display: inline-flex; align-items: center; gap: var(--space-2); font-family: var(--font-mono); font-size: var(--text-2xs); letter-spacing: var(--tracking-wide); text-transform: uppercase; padding: 2px 8px; border-radius: var(--radius-pill); }
.shui-wz-origin--platform { background: var(--color-purple-light); color: var(--color-purple); }
.shui-wz-origin--feature  { background: var(--color-info-light);   color: var(--color-info-text); }

.shui-wz-blocks { display: flex; flex-direction: column; gap: var(--space-3); }
.shui-wz-block { border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); overflow: hidden; transition: border-color var(--duration-fast), opacity var(--duration-fast); }
.shui-wz-block-head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); }
.shui-wz-block-title { flex: 1; display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-base); font-weight: var(--font-semibold); color: var(--color-neutral-900); }
.shui-wz-block-tag { font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--color-neutral-500); }
.shui-wz-block-body { padding: var(--space-3) var(--space-4) var(--space-4); border-top: 1px solid var(--color-border-light); display: flex; flex-direction: column; gap: var(--space-1); }
.shui-wz-block.is-on  { border-color: var(--color-border-brand); }
.shui-wz-block.is-off { opacity: .55; }
.shui-wz-block.is-off .shui-wz-block-body { display: none; }
/* workspace-enforced: locked ON, toggle disabled, a calm lock marker (not an error) */
.shui-wz-block.is-locked { border-color: var(--color-border-brand); }
.shui-wz-lock { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: var(--text-2xs); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--color-neutral-600); }   /* a neutral ink: gold is recognition only (A3) */
.shui-wz-lock svg { width: 12px; height: 12px; }

/* field rows inside a block (each field on/off + required — reuses FormField a11y) */
.shui-wz-field { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; font-size: var(--text-sm); color: var(--color-neutral-700); }
.shui-wz-field + .shui-wz-field { border-top: 1px solid var(--color-border-light); }
.shui-wz-field .name { flex: 1; display: flex; align-items: center; gap: var(--space-2); }
.shui-wz-field.is-off .name { color: var(--color-neutral-500); text-decoration: line-through; }
.shui-wz-req { font-family: var(--font-mono); font-size: var(--text-2xs); padding: 1px 7px; border-radius: var(--radius-pill); background: var(--color-brand-light); color: var(--color-brand-dark); }
.shui-wz-req--optional { background: var(--color-neutral-100); color: var(--color-neutral-500); }
.shui-wz-field-src { font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--color-neutral-500); }

/* output artifact chip (the run produces something — e.g. a .docx) */
.shui-wz-output { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--color-culture-light); color: var(--color-culture-dark); font-size: var(--text-sm); font-weight: var(--font-medium); }
.shui-wz-output svg { width: 18px; height: 18px; flex-shrink: 0; }
