/* ShiftHR UI Kit: the BUTTON family (Pass B kit-controls.css, "vocabulary preserved"), written
   directly in page markup in Web AND Admin. The class names are the kit's deliberately unprefixed
   btn-* set: btn-primary, btn-outline, btn-ghost, btn-secondary, btn-recognition, btn-action,
   btn-action-danger (on a btn-action), btn-signout, btn-icon (#1038); the sizes btn-md, btn-lg and
   btn-block, with btn-sm retiring; and the held-back group, .shui-hold-until-valid (#1040).

   Moved from ShiftHR.Web/wwwroot/css/components.css (C6 (a), 2026-09-28), where these were the
   first rules; Admin's own admin-base.css family retired onto them (Admin's btn-danger became
   btn-action btn-action-danger).

   CASCADE: Web links this file directly BEFORE css/components.css, the exact position the rules
   held, so every rule keeps its order (KitStylesheetWiringTests pins the position). No host
   stylesheet restyles a button (KitClassOwnershipConventionTests); the documented exemptions are
   Web public.css's header button and the call to action's inverse button.

   THE SIZE SCALE (RULED by the owner at 03:35 on 8 November 2026, Pass F: "it's easily readable and
   matches most of the design, can we make that default"; Lane KF, #1217). Three sizes, the same for
   every variant, on the density register's control tokens. S is the default with no size class:
   --control-s tall (28; 24 compact; 32 spacious), 10px across, 13px text, a 16px icon, radius-sm, a
   1px edge. btn-md steps to M, the field's height (--control-height; 16px across, 14px text, an 18px
   icon, radius-md): a button on the same line as a field; btn-icon stays at that height. btn-lg
   steps to L (--control-l: 44; 38; 48; 20px across, 15px text, a 20px icon, radius-md): a phone
   sheet's footer and the first-run welcome. btn-sm is the default now and RETIRES: it stays defined,
   as S, so no site restyles before a conformance lane removes it from the markup (KIT-R1). THE TOUCH
   STEP-UP (the guidelines' C6 and A8; Feature UIK, #1360): under a coarse pointer and under 540px every
   button steps to L (--control-l), the block before the public one. The public website keeps its own
   sizes until its own pass: the [data-density="spacious"] block at the end.

   THE FOCUS RING (UIK-1 (a), the owner, 25 November 2026: "one solid 2px culture-olive outline with a 2px
   offset on every kit control and row, clearing 3:1 in both themes"): --color-culture as a 2px outline
   2px out, the recognition button's too; the 3px glow (--shadow-focus) is no longer the focus mark.

   Kept differences from Pass B (ShiftHR.UI/KIT_REGISTER.md section 1, row 5): the primary's and
   the outline's transitions, and no opacity dim when disabled (#883). Added: the primary's, the
   outline's and the recognition hover's own text colour, so a host's link rule (Admin's a:hover)
   never recolours a button used as a link. */

.btn-primary, .btn-outline, .btn-ghost, .btn-action, .btn-secondary, .btn-recognition {
    font-family: inherit; box-sizing: border-box;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: var(--control-s); padding: 0 10px;
    font-size: var(--text-sm); line-height: 1.2;
    border-radius: var(--radius-sm); border-width: 1px;
    white-space: nowrap; cursor: pointer;
    transition: background var(--duration-fast) var(--ease-standard),
                border-color var(--duration-fast) var(--ease-standard),
                color var(--duration-fast) var(--ease-standard),
                box-shadow var(--duration-fast), transform var(--duration-fast);
}
:is(.btn-primary, .btn-outline, .btn-ghost, .btn-action, .btn-secondary, .btn-recognition) svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary:focus-visible, .btn-outline:focus-visible, .btn-ghost:focus-visible,
.btn-action:focus-visible, .btn-secondary:focus-visible, .btn-signout:focus-visible,
.btn-icon:focus-visible, .btn-recognition:focus-visible {
    outline: 2px solid var(--color-culture); outline-offset: 2px;
}

.btn-primary {
    background: var(--color-brand); color: var(--color-on-brand);
    font-weight: var(--font-semibold); border: 1px solid transparent;
    transition: background var(--duration-fast) var(--ease-standard),
                box-shadow var(--duration-fast), transform var(--duration-fast);
}
.btn-primary:hover { background: var(--color-brand-dark); color: var(--color-on-brand); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); box-shadow: none; }

.btn-outline {
    border: 1px solid var(--color-brand); color: var(--color-brand);
    background: transparent; font-weight: var(--font-semibold);
    transition: background var(--duration-fast);
}
.btn-outline:hover { background: var(--color-brand-light); color: var(--color-brand); }
.btn-outline:active { background: color-mix(in oklab, var(--color-brand-light) 70%, var(--color-brand)); }

.btn-ghost {
    color: var(--color-neutral-700); background: transparent; border: none;
    font-weight: var(--font-semibold);
}
.btn-ghost:hover { color: var(--color-brand); background: var(--color-surface-sunken); }

/* Recognition (gold): reserved for cultural-input reward actions only (brief section 1). */
.btn-recognition {
    background: var(--color-recognition); color: var(--color-on-recognition);
    font-weight: var(--font-semibold); border: 1px solid transparent;
}
.btn-recognition:hover { background: var(--color-recognition-hover); color: var(--color-on-recognition); box-shadow: var(--shadow-md); transform: translateY(-1px); }

.btn-secondary {
    border: 1px solid var(--color-border); background: var(--color-surface-raised);
    color: var(--color-neutral-700); font-weight: var(--font-semibold);
}
.btn-secondary:hover { border-color: var(--color-neutral-400); color: var(--color-neutral-900); }

.btn-action {
    border: 1px solid var(--color-border); background: var(--color-surface-raised);
    color: var(--color-neutral-700); font-weight: var(--font-semibold);
    transition: background var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast);
}
.btn-action:hover { border-color: var(--color-brand); color: var(--color-brand); background: var(--color-brand-light); }
.btn-action-danger { color: var(--color-error-text); border-color: var(--color-error-border); }   /* words in the error INK (A3): the fill hue is for an icon */
/* on the error tint the label takes the error INK: the error hue read 4.2:1 there (#1045) */
.btn-action-danger:hover { color: var(--color-error-text); border-color: var(--color-error); background: var(--color-error-light); }

/* Sign out on the size scale's S (C6): the family's height, padding, text and radius, the weight 600. A transition names
   its properties, never all: "all" animated the focus outline in from the browser's own (3px, grey, flush), #1370. */
.btn-signout {
    font-family: inherit; box-sizing: border-box;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: var(--control-s); padding: 0 10px;
    font-size: var(--text-sm); font-weight: var(--font-semibold); line-height: 1.2; color: var(--color-neutral-500);
    border-radius: var(--radius-sm); border: 1px solid var(--color-border);
    background: transparent; white-space: nowrap; cursor: pointer; transition: background var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast);
}
.btn-signout:hover { color: var(--color-neutral-900); border-color: var(--color-neutral-500); }

/* Icon only, round: Pass B's theme button (Pass B public.css .theme-btn, moved from Web public.css;
   #1038). The public header's theme and account buttons. It carries no text, so it always takes
   an aria-label. M, the field's height, in every register (the size scale). */
.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: var(--control-height); height: var(--control-height); padding: 0;
    border-radius: var(--radius-pill); border: 1px solid var(--color-border);
    background: var(--color-surface-raised); color: var(--color-neutral-600);
    cursor: pointer; transition: background var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast), box-shadow var(--duration-fast);
}
.btn-icon:hover { color: var(--color-culture); border-color: var(--color-border-brand); box-shadow: var(--shadow-sm); }
.btn-icon svg { width: 18px; height: 18px; }

/* The sizes. btn-sm is S, the default, and RETIRES with the conformance pass (KIT-R1): a site that
   still writes it renders as every other button. */
.btn-sm { min-height: var(--control-s); padding: 0 10px; font-size: var(--text-sm); }
.btn-md { min-height: var(--control-height); padding: 0 16px; gap: var(--space-2); font-size: var(--text-base); border-radius: var(--radius-md); }
.btn-md svg { width: 18px; height: 18px; }
.btn-lg { min-height: var(--control-l); padding: 0 20px; gap: var(--space-2); font-size: var(--text-md); border-radius: var(--radius-md); }
.btn-lg svg { width: 20px; height: 20px; }
.btn-block { width: 100%; }

/* THE TOUCH STEP-UP (C6, A8): on a touch screen, and under 540px, every button is L (--control-l: 44 in
   the app), whatever size class it carries; the round icon button too. After the sizes, so it outranks
   them at the same weight; before the public block, whose register keeps its own sizes. */
@media (pointer: coarse), (max-width: 540px) {
    :is(.btn-primary, .btn-outline, .btn-ghost, .btn-action, .btn-secondary, .btn-recognition, .btn-signout, .btn-sm, .btn-md, .btn-lg) {
        min-height: var(--control-l); padding: 0 20px; gap: var(--space-2); font-size: var(--text-md); border-radius: var(--radius-md);
    }
    :is(.btn-primary, .btn-outline, .btn-ghost, .btn-action, .btn-secondary, .btn-recognition, .btn-signout) svg { width: 20px; height: 20px; }
    .btn-icon { width: var(--control-l); height: var(--control-l); }
    .btn-icon svg { width: 20px; height: 20px; }
}

/* Reduced motion (A8, C11): a hover never lifts a button; its colours still change. */
@media (prefers-reduced-motion: reduce) {
    :is(.btn-primary, .btn-recognition):hover { transform: none; }
}

/* Disabled: uniform across the family (also covers [disabled] + aria-disabled).
   No opacity dim (#883): the disabled tokens ALREADY encode the dimmed
   affordance; stacking opacity on top halved contrast again and made disabled
   buttons illegible in dark mode (the ceremony's Continue). */
.btn-primary:disabled, .btn-outline:disabled, .btn-ghost:disabled, .btn-action:disabled,
.btn-secondary:disabled, .btn-recognition:disabled, .btn-signout:disabled,
.btn-primary[aria-disabled="true"], .btn-outline[aria-disabled="true"] {
    cursor: not-allowed; transform: none; box-shadow: none;
    background: var(--control-disabled-bg); color: var(--control-disabled-text);
    border-color: var(--control-disabled-border);
}
.btn-ghost:disabled { background: transparent; }

/* Held back until an input is valid (.shui-hold-until-valid, #1040): a group of inputs and the
   primary button that acts on them. While any input in the group is invalid (a required field
   empty, a typed phrase that does not match its pattern), the primary wears the disabled look;
   the moment every input is valid it is itself again. CSS only (:has(), zero JS), and the look
   only: the button stays operable, so the server's own check is the act (the affirm ceremony's
   typed phrase, #883). Retires the ceremony's .cer-ttc .cer-affirm-btn restyle. */
.shui-hold-until-valid:has(:invalid) .btn-primary {
    background: var(--control-disabled-bg); color: var(--control-disabled-text);
    border-color: var(--control-disabled-border); box-shadow: none; transform: none;
}

/* THE PUBLIC WEBSITE KEEPS ITS SIZES until its own pass (START-HERE, the designer's call (e) inside
   the 8 November ruling): under the marketing register ([data-density="spacious"], MainLayout's
   layout-public) every variant stands at its Pass B size, exactly as before the scale. DELETE THIS
   BLOCK at the public pass; nothing else depends on it. The rules for btn-sm and btn-lg come last
   so they outrank the family rule at the same weight. */
[data-density="spacious"] :is(.btn-primary, .btn-outline, .btn-ghost, .btn-action, .btn-secondary, .btn-recognition) {
    min-height: 0; gap: var(--space-2); font-size: var(--text-md); line-height: 1.5; border-radius: var(--radius-md);
}
[data-density="spacious"] .btn-primary, [data-density="spacious"] .btn-outline { padding: 11px 22px; border-width: 2px; }
[data-density="spacious"] .btn-ghost { padding: 11px 18px; }
[data-density="spacious"] .btn-recognition { padding: 10px 20px; border-width: 2px; }
[data-density="spacious"] .btn-secondary { padding: 10px 20px; }
[data-density="spacious"] .btn-action { padding: 6px 14px; font-size: var(--text-sm); border-radius: var(--radius-sm); }
[data-density="spacious"] .btn-sm { padding: 6px 14px; font-size: var(--text-sm); }
[data-density="spacious"] .btn-lg { padding: 13px 28px; font-size: var(--text-lg); }
