/* Movinn design tokens: the values every app and every Movinn.Ui component draws from.

   Source: the Movinn Brand & Design Guide (Edition 1, Sept 2026), checked against production code. Where the two
   disagree the code wins, as the guide itself says; the product register below is pms-web's theme contract
   (Movinn.Pms/wwwroot/css/customStyling.css, 2026-11-18) moved here verbatim, so pms-web can delete its copy without
   a pixel changing. Velocity's --velocity-* variables carry the same values and become these names when it adopts.

   Hand-written, not Tailwind output. Link it in the layout BEFORE the app's own stylesheet:

     <link rel="stylesheet" href="~/_content/Movinn.Ui/css/movinn-tokens.css" asp-append-version="true" />

   Everything sits in the movinn-tokens cascade layer. Loaded first, that layer is ordered before the app's own
   layers, so it is the floor: an app can override a token deliberately (in any layer, or unlayered) and the
   override wins, but nothing here can beat an app's styles by accident.

   Registers (the guide's term for a family of surfaces):
     product  default, on :root. PMS and Velocity Pro: indigo on gray, system UI, 8px controls.
     dark     data-theme="dark" on <html>. PMS only; Velocity has no dark theme.
     web      data-register="web" on any element. The public website and the resident portal: rose on warm
              grounds, Karla. Opt-in, so a Movinn.Ui component placed inside it picks up the
              customer-facing look without a second component.
   Email and print (orange/teal) are not here: templates can't link a stylesheet. Their values are in --brand-*. */

@layer movinn-tokens {
  :root {
    /* Brand core. Identity colours, the same in every register; not for UI state. */
    --brand-marble-green: #416e71;
    --brand-rose: #e4586b;
    --brand-orange: #fe7515;
    --brand-teal: #085a5a;
    --brand-gray: #3c3c3c;
    --font-brand: Karla, "Helvetica Neue", system-ui, sans-serif;
    --font-display: "Playfair Display", Georgia, serif;
  }

  /* Product register ------------------------------------------------------------------------------------------ */

  :root,
  [data-theme="basic"] {
    color-scheme: light;

    /* Grounds */
    --color-app-bg: #ffffff;
    --color-surface: #ffffff;
    --color-surface-elevated: #ffffff;
    --color-sidebar-surface: #ffffff;
    --color-header-surface: #ffffff;

    /* Text */
    --color-text-primary: #111827;
    --color-text-secondary: #4b5563;
    --color-text-muted: #6b7280;
    --color-text-subtle: #9ca3af;
    --color-icon-muted: #4b5563;

    /* Lines and hover */
    --color-border: #e5e7eb;
    --color-border-strong: #d1d5db;
    --color-hover: #f3f4f6;

    /* Accent */
    --color-accent: #4f46e5;
    --color-accent-strong: #4338ca;
    --color-accent-soft: #eef2ff;
    --color-accent-text: #ffffff;
    --color-accent-contrast: #4338ca;

    /* Status trios: tinted ground, text, and the border of a chip drawn on that ground. */
    --color-positive-bg: #ecfdf5;
    --color-positive-text: #047857;
    --color-positive-border: #a7f3d0;
    --color-warning-bg: #fffbeb;
    --color-warning-text: #92400e;
    --color-warning-border: #fde68a;
    --color-danger-bg: #fef2f2;
    --color-danger-text: #b91c1c;
    --color-danger-border: #fecaca;
    --color-info-bg: #eff6ff;
    --color-info-text: #1d4ed8;
    --color-info-border: #bfdbfe;

    /* Status accents: solid markers on white, like a table row's 4px left bar. The -border values above are far
       too pale for that. Not in the guide; pms-web's code, which matches its Move In/Out metric cards. */
    --color-positive-accent: #00c950;
    --color-positive-accent-muted: #7bf1a8;
    --color-warning-accent: #fe9a00;
    --color-danger-accent: #fb2c36;
    --color-info-accent: #2b7fff;

    /* Elevation */
    --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.08);
    --shadow-floating: 0 16px 36px rgba(15, 23, 42, 0.16);

    /* Chart series, used in this order. Charts are chrome-free: no gridlines, no y-axis, 2px smooth strokes. */
    --chart-1: #3b82f6;
    --chart-2: #10b981;
    --chart-3: #f59e0b;
    --chart-4: #6366f1;
    --chart-5: #ef4444;

    /* Shape. Named by role, not size, so a component asks for "a control" and each register decides what that is. */
    --radius-nav: 4px;
    --radius-tab: 6px;
    --radius-control: 8px;
    --radius-card: 12px;
    --radius-chip: 9999px;

    /* Type. The product register uses the platform's UI face. Sizes only; the guide's weights are page title,
       card title, KPI and eyebrow 600, tile title 500, and the KPI comparison is muted text. */
    --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --tracking-tight: -0.025em;
    --text-page-title: 2.25rem;
    --text-card-title: 1.25rem;
    --text-kpi: 1.875rem;
    --text-kpi-comparison: 1.375rem;
    --text-body: 0.875rem;
    --text-tile-title: 0.8125rem;
    --text-eyebrow: 0.625rem;
    --tracking-eyebrow: 0.14em;

    /* Motion and focus. A token built from var() resolves where it is declared, so every scope that changes what it
       refers to declares it again (the web register below); the tests check that. */
    --duration-ui: 150ms;
    --focus-ring: 0 0 0 3px var(--color-accent-soft);
  }

  /* Dark (PMS) ------------------------------------------------------------------------------------------------- */

  [data-theme="dark"] {
    color-scheme: dark;

    --color-app-bg: #0b1220;
    --color-surface: #111827;
    --color-surface-elevated: #182132;
    --color-sidebar-surface: #0f172a;
    --color-header-surface: #0f172a;

    --color-text-primary: #e5e7eb;
    --color-text-secondary: #cbd5e1;
    --color-text-muted: #94a3b8;
    --color-text-subtle: #64748b;
    --color-icon-muted: #cbd5e1;

    --color-border: #273449;
    --color-border-strong: #334155;
    --color-hover: #1e293b;

    --color-accent: #818cf8;
    --color-accent-strong: #6366f1;
    --color-accent-soft: rgba(129, 140, 248, 0.16);
    --color-accent-text: #0f172a;
    --color-accent-contrast: #c7d2fe;

    --color-positive-bg: rgba(16, 185, 129, 0.14);
    --color-positive-text: #6ee7b7;
    --color-positive-border: rgba(52, 211, 153, 0.24);
    --color-warning-bg: rgba(245, 158, 11, 0.16);
    --color-warning-text: #fcd34d;
    --color-warning-border: rgba(245, 158, 11, 0.26);
    --color-danger-bg: rgba(239, 68, 68, 0.16);
    --color-danger-text: #fca5a5;
    --color-danger-border: rgba(248, 113, 113, 0.28);
    --color-info-bg: rgba(59, 130, 246, 0.16);
    --color-info-text: #93c5fd;
    --color-info-border: rgba(96, 165, 250, 0.28);

    /* One step lighter than the light accents: the 500 weights carry against white and glare against a dark ground. */
    --color-positive-accent: #05df72;
    --color-positive-accent-muted: rgba(5, 223, 114, 0.45);
    --color-warning-accent: #ffb900;
    --color-danger-accent: #ff6467;
    --color-info-accent: #51a2ff;

    --shadow-soft: 0 1px 2px rgba(2, 6, 23, 0.45);
    --shadow-floating: 0 18px 40px rgba(2, 6, 23, 0.48);

    --focus-ring: 0 0 0 3px var(--color-accent-soft);
  }

  /* Web register ----------------------------------------------------------------------------------------------- */
  /* Only what differs from product. Values from code: the rose trio and warm lines are the resident portal's
     (Movinn.VisitorApp customStyling.css), the ink and sunken ground the website's (mvnGray, secondaryBg). Status
     trios and chart series stay as in product: a warning reads the same on every surface. */

  [data-register="web"] {
    --color-app-bg: #fcfbfa;
    --color-surface: #ffffff;
    --color-surface-elevated: #ffffff;
    --color-sidebar-surface: #f7f5f3;
    --color-header-surface: #ffffff;

    --color-text-primary: #3c3c3c;
    --color-text-secondary: #4a4e52;
    --color-text-muted: #6f6b65;
    --color-text-subtle: #8b8781;
    --color-icon-muted: #4a4e52;

    --color-border: #e6e2dd;
    --color-border-strong: #d8d5d0;
    --color-hover: #f7f5f3;

    --color-accent: #e4586b;
    --color-accent-strong: #a63a4d;
    --color-accent-soft: #f7e6e9;
    --color-accent-text: #ffffff;
    --color-accent-contrast: #b8455a;

    /* Inputs and the date boxes keep 8px here too (--radius-control, unchanged): only the site's call-to-action
       buttons are pills, and those are the website's own, not a shared component. */

    --font-ui: var(--font-brand);
    --duration-ui: 300ms;
    --focus-ring: 0 0 0 3px var(--color-accent-soft);
  }
}
