/* btn-action.css, the ACTION colour layer. Declarations ONLY.
 *
 * WHAT THIS IS
 * The lime action pair for primary buttons (owner decision 2026-08-27):
 * fill #84D828 with a NEAR BLACK label, replacing white-on-brand-gradient
 * on app-shell buttons. The purple/blue/teal identity gradient is NOT
 * changed by this file: brand tokens in btn-brand.css keep painting the
 * ~20 non-button surfaces (icon tiles, category chips, meters, heroes)
 * and the whole marketing site. This file only feeds the button rules,
 * which read it as var(--btn-action-bg, var(--btn-brand-bg, ...)).
 *
 * WHERE IT LOADS, AND WHERE IT MUST NOT
 * Linked from the five app shells (dashboard / tenant / vendor / owner /
 * admin bases) plus the auth and applicant pages that sit on the
 * marketing shell but belong to the product journey. It is deliberately
 * NOT linked from public_website/ui/base.html: on any page without this
 * file every button rule falls through its var() chain to --btn-brand-bg
 * and renders exactly as before. That fallback chain is also the whole
 * rollback story: unlink this file (or delete the two --btn-action-*
 * declarations) and every button in the product is back to brand purple.
 * No call site holds a lime literal.
 *
 * LOAD ORDER IS LOAD-BEARING. The white-label <style> block in each shell
 * overrides --btn-action-bg / --btn-action-fg with scrim-over-PM-colours.
 * Custom properties on :root resolve by document order, so this file is
 * linked ABOVE that block in every shell, which is what lets the block's
 * later declarations win and a configured PM keep their own colours.
 * Moving the link below the block silently breaks white-label buttons.
 *
 * THE ONE CONSTRAINT EVERY VALUE BELOW SERVES
 * This lime is a LIGHT fill. White text on it measures 1.77:1 and a dark
 * scrim does not fix that, it only mutes the colour it is protecting
 * (same finding as the 2026-08-16 scrim removal). So the fill and its
 * label travel as a PAIR: --btn-action-bg is only ever painted under
 * --btn-action-fg (#1B2016, 9.36:1 at the light stop, 6.81:1 at the
 * darkest hover stop, i.e. AAA everywhere). Never put white or a
 * text-white class on this fill, and never lighten --action-ink: both
 * are asserted by tests/buildgate/test_color_standard.py, which walks
 * 41 points along each ramp against the DECLARED label colour.
 *
 * DERIVATION, same generator as the house gradients (btn-brand.css):
 * stop2 = OKLCH(L - delta) with chroma and hue HELD, base #84D828 at
 * oklch(79.8% 0.212 132.9). Holding hue is what stops the darker stop
 * drifting to olive. Deltas: 0.05 per step on the fill ramp.
 *   #84D828  base        9.36:1 vs #1B2016
 *   #74C700  L - 0.05    7.84:1
 *   #68BA00  L - 0.09    6.81:1
 *   #277800  action ink  5.57:1 vs #ffffff (green type, borders, ring)
 *   #E9F7E0 / #D9EECC    tonal fills, hold 4.99 / 4.52:1 under the ink
 */
:root {
  /* The pair. Painted together by the button rules, overridden together
     by the white-label blocks. */
  --btn-action-bg:    linear-gradient(135deg, #84D828 0%, #74C700 100%);
  --btn-action-fg:    #1B2016;

  /* Hover fill, one generator step darker at both stops. The pressed
     state keeps this fill; the press cue is the existing transform. */
  --btn-action-hover: linear-gradient(135deg, #74C700 0%, #68BA00 100%);

  /* Glow, replacing the blue rgba(106,158,255) pair on buttons only.
     Derived from the pressed stop so it reads as the fill's own shadow. */
  --btn-action-glow:       0 14px 30px -10px rgba(104, 186, 0, 0.45);
  --btn-action-glow-hover: 0 24px 40px -10px rgba(104, 186, 0, 0.55);

  /* Focus ring: a 2px hole in the surface colour, then the deep green.
     A green ring drawn straight onto the green fill is invisible, so the
     hole layer is load-bearing, not decoration. The button rules read
     these with transparent fallbacks, so on a page without this file the
     focus rule paints nothing new. */
  --btn-action-ring:      #277800;
  --btn-action-ring-hole: #ffffff;

  /* The flat family, for everything a gradient cannot be: green type,
     1px borders, tonal secondary fills. Siblings of the fill, not
     alternatives to it. */
  --action-ink:        #277800;
  --action-soft:       #E9F7E0;
  --action-soft-hover: #D9EECC;
}

/* OKLCH interpolation, same contract as btn-brand.css: identical stops,
   a rounder walk between them, and @supports is load-bearing because a
   custom property accepts any token sequence at parse time, so the plain
   declarations above are the real fallback only when guarded like this. */
@supports (background: linear-gradient(in oklch, red, blue)) {
  :root {
    --btn-action-bg:    linear-gradient(135deg in oklch, #84D828 0%, #74C700 100%);
    --btn-action-hover: linear-gradient(135deg in oklch, #74C700 0%, #68BA00 100%);
  }
}
