/*
 * Kompan UI design tokens.
 *
 * Each --kompan-* token forwards to the design system's token of the same meaning, keeping the
 * MudBlazor variable it used to read as the var() fallback:
 *
 *     --kompan-palette-surface: var(--color-bg-primary, var(--mud-palette-surface));
 *
 * An app that links the design system's stylesheet (_content/Kompan.UI.Design/css/variables.css)
 * therefore renders the design system's values; one that does not renders exactly what it did
 * before. That is what makes adopting the tokens non-breaking, and it is deliberate rather than
 * defensive: the two sources do not agree everywhere yet, and the disagreements are the design
 * team's call, not ours. See ADR-0038 and ADR-0039.
 *
 * Two deltas to know about, both visible only where the design tokens are linked:
 *   - --kompan-radius-default becomes 10px (--radius-md) against MudBlazor's 4px.
 *   - Dark surfaces become the design system's neutral ramp (#151516/#282a2d/#212224) rather than
 *     KompanTheme's blue-tinted one (#27272F/#30303A/#383842). MudBlazor's own chrome still reads
 *     the C# palette, so until KompanTheme is aligned the two disagree in dark mode.
 *
 * Consumers (and the library's own CSS) depend on --kompan-* only — never --mud-* or --color-*.
 * Tokens marked "no design-system equivalent" keep their MudBlazor source; each says why.
 */
:root {
    /* Surfaces & structure */
    --kompan-palette-surface: var(--color-bg-primary, var(--mud-palette-surface));
    --kompan-palette-background: var(--color-bg-secondary, var(--mud-palette-background));
    --kompan-palette-background-gray: var(--color-bg-subtle, var(--mud-palette-background-gray));
    --kompan-palette-surface-hover: var(--color-bg-secondary-hover, var(--mud-palette-surface-hover));
    --kompan-palette-divider: var(--color-border-secondary, var(--mud-palette-divider));
    --kompan-palette-lines-inputs: var(--color-input-border-primary, var(--mud-palette-lines-inputs));
    --kompan-palette-lines-default: var(--color-border-primary, var(--mud-palette-lines-default));

    /* No design-system equivalent: --color-bg-overlay is an opaque surface, not a scrim with alpha,
       so aliasing it here would turn every overlay solid. */
    --kompan-palette-overlay-dark: var(--mud-palette-overlay-dark);
    --kompan-palette-overlay-light: var(--mud-palette-overlay-light);

    /* Brand */
    --kompan-palette-primary: var(--color-bg-brand-solid, var(--mud-palette-primary));
    --kompan-palette-primary-text: var(--color-text-solid, var(--mud-palette-primary-text));

    /* No design-system equivalent: MudBlazor's *-hover is a translucent tint laid over a surface,
       while the design system expresses hover as a second solid (--color-button-primary-bg-hover).
       Swapping one for the other is a component change, not a token alias. */
    --kompan-palette-primary-hover: var(--mud-palette-primary-hover);

    /* Neutral / dark */
    --kompan-palette-dark: var(--color-bg-solid, var(--mud-palette-dark));
    --kompan-palette-dark-text: var(--color-text-solid, var(--mud-palette-dark-text));

    /* Text */
    --kompan-palette-text-primary: var(--color-text-primary, var(--mud-palette-text-primary));
    --kompan-palette-text-secondary: var(--color-text-secondary, var(--mud-palette-text-secondary));
    --kompan-palette-text-disabled: var(--color-text-quaternary, var(--mud-palette-text-disabled));

    /* Action states */
    --kompan-palette-action-default: var(--color-fg-tertiary, var(--mud-palette-action-default));
    /* No design-system equivalent: hover is per-component upstream, not a palette-wide action colour. */
    --kompan-palette-action-default-hover: var(--mud-palette-action-default-hover);
    --kompan-palette-action-disabled: var(--color-text-quaternary, var(--mud-palette-action-disabled));
    --kompan-palette-action-disabled-background: var(--color-button-primary-bg-disabled, var(--mud-palette-action-disabled-background));

    /* Status / semantic */
    --kompan-palette-error: var(--color-bg-error-solid, var(--mud-palette-error));
    --kompan-palette-error-text: var(--color-fg-error-primary, var(--mud-palette-error-text));
    --kompan-palette-warning: var(--color-bg-warning-solid, var(--mud-palette-warning));
    --kompan-palette-warning-text: var(--color-fg-warning-primary, var(--mud-palette-warning-text));
    --kompan-palette-success: var(--color-bg-success-solid, var(--mud-palette-success));
    --kompan-palette-success-text: var(--color-fg-success-primary, var(--mud-palette-success-text));
    /* No design-system equivalent: same hover-as-tint mismatch as --kompan-palette-primary-hover. */
    --kompan-palette-success-hover: var(--mud-palette-success-hover);

    /* No design-system equivalent: the design system has no `info` tokens at all — not renamed,
       absent. Raised with the design team; until it has them, info stays MudBlazor's. */
    --kompan-palette-info: var(--mud-palette-info);
    --kompan-palette-info-text: var(--mud-palette-info-text);

    /* Shape & elevation */
    --kompan-radius-default: var(--radius-md, var(--mud-default-borderradius));

    /* There is deliberately no --kompan-radius-button beside these: KompanButton wears the design
       system's own .kompan-button, whose rule reads --radius-button-md directly (ADR-0051). A façade
       token would be a second source for a radius that already has one, and the two could disagree. */

    /* Inputs have their own radius upstream, and it is not --radius-md. md rather than lg: our
       fields render at one size, and lg is the design system's large-field variant. */
    --kompan-radius-input: var(--radius-input-md, var(--mud-default-borderradius));
    --kompan-elevation-1: var(--effect-styles-shadows-shadow-xs, var(--mud-elevation-1));

    /* Scalars — no design-system equivalent: upstream bakes alpha into each colour rather than
       exposing an opacity scalar to multiply by. */
    --kompan-palette-border-opacity: var(--mud-palette-border-opacity);
}
