﻿/*
 * local-tokens.css — HAND-AUTHORED, app-owned token corrections. Unlike the vendored/generated design-
 * system layers (_content/Mud.Blazor/css/fod-ds-core*.tokens.css, vendored from the FOD npm package;
 * _content/Mud.Blazor/css/mud-tokens.css, generated from the read-only MUD KB), this file lives in
 * MISWSSP.Web itself — it exists for corrections this app needs that don't yet exist upstream, and
 * doesn't belong inside the shared Mud.Blazor RCL (which is consumed by all of the back-office UI, not
 * one feature).
 *
 * MIS-077 AC4: --color-text-danger-default measures ~4.437:1 against the dark-theme background
 * (#1e1e1e) by the WCAG relative-luminance formula — just under the 4.5:1 small-text AA floor. This
 * token is a same-hue, one-step-brighter variant for small/dense text contexts that need to clear AA
 * (e.g. AnnexTableRenderer's per-cell validation messages, font-size 0.75rem) without changing
 * --color-text-danger-default itself, which other consumers (MudInputSearch) rely on unchanged.
 * Load this file AFTER mud-tokens.css (index.html ordering) so it wins the cascade if the KB ever adds
 * the same name with a different value.
 */
:root {
  --color-text-danger-default-aa: #d92d20;   /* light theme: same as --color-text-danger-default, already AA (4.831:1) */
}

:root[data-theme="dark"] {
  --color-text-danger-default-aa: #f54438;   /* dark theme: --color-text-danger-default's red channel one hex step brighter (4.578:1) */
}

/*
 * FOD ships a --color-*-danger-* family and a .btn-destructive, but NO success counterpart — the only
 * success colours it defines are component-scoped (--file-item-icon-color-success, green-600 #039855) and
 * were never meant to back a filled button: white text on green-600 measures 3.74:1, under the 4.5:1
 * small-text AA floor. The report verdicts need a positive twin of the destructive button, so this is the
 * same DS green two steps down, where white clears AA (green-700 → 5.48:1).
 *
 * The dark values step DARKER, not lighter — mirroring how the DS's own dark sheet handles the same problem
 * (--color-background-danger-default goes red-600 → red-700) so a filled button keeps its weight against the
 * dark surface rather than glowing off it.
 */
:root {
  --color-background-success-default: var(--green-700, #027948);
  --color-background-success-default-hover: var(--green-800, #05603A);
}

:root[data-theme="dark"] {
  --color-background-success-default: var(--green-800, #05603A);
  --color-background-success-default-hover: var(--green-900, #054F31);
}

/*
 * RT-LIFE-5: --color-text-base-tertiary is the muted-text role, and it fails AA on the two light surfaces
 * the entry grid paints under it — 4.226:1 on --color-background-base-secondary (#f5f5f5, .cell-computed)
 * and 4.079:1 on --color-background-base-tertiary (#f1f1f1, .cell-blocked). Those cells carry every derived
 * total in a 564 annex, so they are DATA and the 4.5:1 small-text floor applies.
 *
 * One step down the design system's own grey ramp (gray-400 → gray-500) clears both (5.681 / 5.483) and
 * still reads as muted beside --color-text-base-secondary. The base token is left alone: every other muted
 * consumer sits on the page background, where it already clears AA.
 *
 * The dark value is the unchanged tertiary grey — it measures 6.586 / 5.530 on the dark surfaces.
 */
:root {
  --color-text-base-tertiary-aa: var(--gray-500, #616161);
}

:root[data-theme="dark"] {
  --color-text-base-tertiary-aa: var(--gray-300, #b2b2b2);
}

/*
 * --color-text-success-default-aa — success-coloured TEXT that clears WCAG 1.4.3 (4.5:1) on the light success
 * chip (--numeric-input-success-background-filled). The KB has no success text role, so the state chips borrowed
 * --file-item-icon-color-success, an ICON colour: 3.3:1 for the 16px "Publicat" label on the report viewer
 * (MW-479 E2E 2026-10-13). Green-700 measures about 4.9:1 there.
 *
 * The dark value is the icon token the chips used before, so the dark theme is unchanged by this file.
 */
:root {
  --color-text-success-default-aa: var(--green-700, #027948);
}

:root[data-theme="dark"] {
  --color-text-success-default-aa: var(--file-item-icon-color-success);
}
