/* Design tokens only — global resets removed to avoid overriding
   Building OS host layout when loaded as a Module Federation remote.
   The host's Tailwind preflight already handles CSS resets. *//*
 * Tango Vision Design Tokens — v2
 * Single source of truth for all platform colors, spacing, typography.
 *
 * Brand: AI-native building management OS — digital twins for malls,
 * offices, campuses. Dark-first product. Orange (#F8A324) on deep
 * purple (#5B407F). Montserrat for display/UI, Open Sans Light for
 * long-form body. The wordmark is TANGO.VISION with 0.10em tracking.
 *
 * THREE layers of tokens live here:
 *  1) Brand ramp           --tv-*        (hex; constant across themes)
 *  2) shadcn semantic slots --primary, --background, --border, …
 *     as HSL channels (no hsl() wrapper) consumed via hsl(var(--…)).
 *     These drive every @tv/ui React component and the Tailwind preset.
 *  3) v2 semantic tokens   --bg, --fg, --accent-hover, --hairline,
 *     surface tints, status pairs, focus ring — DIRECT values consumed
 *     by the .tv-* component layer in components.css. These are NOT
 *     HSL channels; reference them bare, e.g. background: var(--bg).
 *
 * Theming: the platform toggles dark mode with the `.dark` class
 * (shadcn / next-themes convention). The v2 handoff toggles with
 * [data-theme]. BOTH are supported — `.dark, [data-theme="dark"]`
 * share one block, `:root, [data-theme="light"]` share the other.
 *
 * See CHANGES.md (handoff) + README for the v1 → v2 migration notes.
 *
 * Note: this file intentionally does NOT @import Google Fonts — a
 * nested @import mid-file violates the CSS spec once bundlers inline
 * stylesheets. Import "@tv/design-tokens/fonts.css" first instead.
 */

/* ------------------------------------------------------------------ */
/* 1 · BRAND RAMP — constant across light/dark                         */
/* ------------------------------------------------------------------ */
:root {
  /* ---------- Orange family ----------
     #F8A324 is canonical for digital surfaces (matches the SVG
     logomark). #FFBA07 is the print-stock equivalent and is also the
     focus ring (higher luminance → more visible on dark + purple).
     Never use both within the same UI element. */
  --tv-orange:       #F8A324;   /* CTAs, eyebrows, accents (canonical) */
  --tv-orange-warm:  #FFBA07;   /* print fill, focus ring, logomark fill */
  --tv-orange-soft:  #FECF6E;   /* radar rings, illustration strokes */
  --tv-orange-deep:  #D28D05;   /* pressed/hover-dark, printed ink */

  /* ---------- Purple / blue ---------- */
  --tv-purple-light: #8869AF;   /* top of gradient, lift on dark */
  --tv-purple-mid:   #6B4D93;   /* gradient mid (was --tv-purple-deep in v1) */
  --tv-purple:       #5B407F;   /* brand surface, card bg */
  --tv-purple-deep:  #3F2B5C;   /* deep brand shadow (genuinely darker — v2) */
  --tv-blue-mid:     #2661AF;   /* business-card gradient bottom */
  --tv-blue:         #0D46AB;   /* polygraphy accent, secondary action */

  /* ---------- Data / realtime ---------- */
  --tv-teal:         #2A7884;   /* chart series 04 */
  --tv-teal-bright:  #11DDDB;   /* live/info, chart series 02 */

  /* ---------- Neutrals (warm sand + cool dark) ---------- */
  --tv-black:        #111523;   /* primary ink, dark text on light */
  --tv-ink:          #322927;   /* warm ink, body on paper */
  --tv-gray-500:     #6A6B7A;   /* neutral mid, default icon on light */
  --tv-gray-300:     #9D9386;   /* warm gray, print secondary */
  --tv-gray-200:     #BDBDBD;
  --tv-cool-100:     #D7E4E5;   /* cool tint, dividers on print */
  --tv-sand-100:     #E0DAD3;
  --tv-sand-200:     #CFC8B9;
  --tv-sand-300:     #B5AB9B;
  --tv-white:        #FFFFFF;

  /* ---------- v1 ALIASES (deprecated — remove in v3) ---------- */
  --tv-gray-900:     var(--tv-black);     /* was #17171C — collapsed */
  --tv-gray-700:     var(--tv-ink);       /* was a dup of --tv-ink */
  --tv-gray-100:     var(--tv-cool-100);  /* was cool, mislabeled gray */

  /* ---------- Signature gradients ---------- */
  --tv-gradient-brand:  linear-gradient(180deg, var(--tv-purple) 0%, var(--tv-blue-mid) 100%);
  --tv-gradient-purple: linear-gradient(180deg, color-mix(in srgb, var(--tv-purple-light) 85%, transparent) 0%, color-mix(in srgb, var(--tv-purple-mid) 95%, transparent) 100%);
  --tv-gradient-warm:   linear-gradient(180deg, var(--tv-orange) 0%, var(--tv-orange-deep) 100%);

  /* ---------- Typography ---------- */
  /* --font-display and --font-sans intentionally alias the same family
     (Montserrat). They stay separate so swapping in Gotham Pro for
     display surfaces is a one-token change. */
  --font-display: "Montserrat", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-sans:    "Montserrat", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-body:    "Open Sans", "Montserrat", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --step--2: 0.75rem;     /* 12 — captions, eyebrows */
  --step--1: 0.875rem;    /* 14 — small UI */
  --step-0:  1rem;        /* 16 — body */
  --step-1:  1.125rem;    /* 18 */
  --step-2:  1.5rem;      /* 24 — subhead */
  --step-3:  2rem;        /* 32 — H3 */
  --step-4:  2.5rem;      /* 40 — H2 */
  --step-5:  3rem;        /* 48 — H1 */
  --step-6:  4.5rem;      /* 72 — roll-up headline */
  --step-7:  6rem;        /* 96 — hero display */

  --leading-tight: 1.05;
  --leading-snug:  1.2;
  --leading-body:  1.55;
  --leading-loose: 1.7;

  --tracking-tight:  -0.02em;
  --tracking-normal: 0;
  --tracking-wide:   0.10em;      /* TANGO.VISION wordmark */
  --tracking-xwide:  0.24em;      /* DIGITAL TWINS tag, eyebrows */

  /* ---------- Shape ---------- */
  --radius-xs:   4px;
  --radius-sm:   8px;
  --radius-md:   12px;            /* default card */
  --radius-lg:   20px;            /* QR tiles, flyer cards */
  --radius-xl:   28px;            /* hero panels */
  --radius-2xl:  40px;
  --radius-pill: 999px;

  /* ---------- Elevation ---------- */
  --shadow-sm: 0 1px 2px rgba(17,21,35,0.06), 0 1px 1px rgba(17,21,35,0.04);
  --shadow-md: 0 6px 18px rgba(17,21,35,0.10), 0 2px 4px rgba(17,21,35,0.05);
  --shadow-lg: 0 20px 40px rgba(17,21,35,0.16), 0 6px 12px rgba(17,21,35,0.08);
  --shadow-glow-orange: 0 0 0 1px rgba(248,163,36,0.35), 0 10px 30px rgba(248,163,36,0.25);
  --shadow-glow-purple: 0 0 0 1px rgba(91,64,128,0.40), 0 12px 36px rgba(91,64,128,0.30);
  --shadow-glow-teal:   0 0 0 1px rgba(17,221,219,0.30), 0 8px 24px rgba(17,221,219,0.20);

  /* ---------- Spacing (8-point) ---------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* ---------- Motion ---------- */
  --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in:    cubic-bezier(0.64, 0, 0.78, 0);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast:   140ms;
  --dur-base:   240ms;
  --dur-slow:   420ms;

  /* ---------- v2 semantic: theme-INVARIANT direct values ---------- */
  /* Always-light surfaces (docs, auth, print) regardless of theme. */
  --bg-page:   #FAFAF7;
  --bg-paper:  #F4F3EE;
  --surface:   #FFFFFF;          /* negative-space white, used sparingly */

  /* Ink for content that always sits on a light surface. */
  --fg-on-light:        #111523;
  --fg-on-light-body:   #322927; /* warm ink for body copy on paper */
  --fg-on-light-muted:  #6A6B7A;
  --fg-mono-light:      rgba(17,21,35,0.55);
  --border-on-light:    rgba(17,21,35,0.08);

  /* Accent companions (the canonical --accent stays HSL for shadcn). */
  --accent-hover: var(--tv-orange-deep);

  /* Status hues. --warning / --info collide with shadcn's HSL slots,
     so they are NOT redefined here as direct values — the .tv-*
     component layer uses --tv-orange / --tv-teal-bright + the tint
     pairs below. --danger is free (shadcn uses --destructive). */
  --danger: #E2533A;

  /* Status tint pairs (background + foreground for badges/banners).
     The -fg-on-dark variants flip per theme further down. */
  --success-bg: rgba(59,181,138,0.16);
  --success-fg: #3BB58A;
  --warning-bg: rgba(248,163,36,0.18);
  --warning-fg: #8A5A07;
  --danger-bg:  rgba(226,83,58,0.16);
  --danger-fg:  #9E3C28;
  --info-bg:    rgba(17,221,219,0.18);
  --info-fg:    #0B8684;
  --neutral-bg: rgba(17,21,35,0.08);
  --neutral-fg: #111523;

  /* Light-surface tint ramp (constant; used by .tv-on-light wrappers). */
  --surface-l-1: rgba(17,21,35,0.03);  /* hover on light */
  --surface-l-2: rgba(17,21,35,0.06);  /* selected on light */
  --surface-l-3: rgba(17,21,35,0.10);  /* heavy fill on light */
}

/* ------------------------------------------------------------------ */
/* 2 + 3 · LIGHT THEME (default) — shadcn HSL slots + v2 direct values */
/*   :root and [data-theme="light"] share this block.                  */
/* ------------------------------------------------------------------ */
:root,
[data-theme="light"] {
  /* --- shadcn HSL channels (consumed via hsl(var(--…))) --- */
  --primary: 35 94% 56%;              /* #F8A324 — Tango orange */
  --primary-foreground: 232 35% 11%;  /* #111523 — ink on orange */

  --background: 60 27% 98%;           /* #FAFAF7 — warm off-white */
  --foreground: 232 35% 11%;          /* #111523 */
  --card: 0 0% 100%;
  --card-foreground: 232 35% 11%;
  --popover: 0 0% 100%;
  --popover-foreground: 232 35% 11%;

  --secondary: 266 33% 38%;           /* #5B407F — deep purple */
  --secondary-foreground: 0 0% 100%;
  --muted: 40 10% 90%;                /* warm gray */
  --muted-foreground: 236 6% 45%;     /* #6A6B7A */
  --accent: 35 94% 56%;               /* same as primary on light */
  --accent-foreground: 232 35% 11%;

  --destructive: 9 73% 55%;           /* #E2533A */
  --destructive-foreground: 0 0% 100%;
  --success: 158 51% 47%;             /* #3BB58A */
  --success-foreground: 0 0% 100%;
  --warning: 35 94% 56%;              /* brand orange */
  --warning-foreground: 232 35% 11%;
  --info: 179 86% 47%;                /* #11DDDB */
  --info-foreground: 232 35% 11%;

  --border: 232 35% 11% / 0.10;       /* rgba(17,21,35,0.10) */
  --input: 232 35% 11% / 0.10;
  --ring: 43 100% 51%;                /* #FFBA07 — focus */

  --sidebar-background: 60 27% 98%;
  --sidebar-foreground: 232 35% 11%;
  --sidebar-primary: 35 94% 56%;
  --sidebar-primary-foreground: 232 35% 11%;
  --sidebar-accent: 40 10% 90%;
  --sidebar-accent-foreground: 232 35% 11%;
  --sidebar-border: 232 35% 11% / 0.10;
  --sidebar-ring: 43 100% 51%;

  --chart-1: 35 94% 56%;              /* orange */
  --chart-2: 188 52% 34%;             /* teal */
  --chart-3: 266 33% 38%;             /* purple */
  --chart-4: 218 85% 36%;             /* blue */
  --chart-5: 179 86% 47%;             /* teal-bright */

  --radius: 0.75rem;                  /* 12px — default card */

  /* --- v2 direct semantic tokens (light) --- */
  --bg:          #FAFAF7;
  --bg-elevated: #FFFFFF;
  --bg-panel:    #F4F3EE;

  --fg:          #111523;
  --fg-muted:    rgba(17,21,35,0.68);
  --fg-subtle:   rgba(17,21,35,0.45);
  --fg-mono-dark: rgba(17,21,35,0.55);  /* JetBrains on light */

  --hairline:      rgba(17,21,35,0.08); /* card / table hairline border */
  --border-strong: rgba(17,21,35,0.16);

  --accent-on-accent: #FFFFFF;          /* white on orange when light */

  /* Focus ring needs darker amber on light (#FFBA07 fails contrast). */
  --focus:            var(--tv-orange-deep);
  --focus-ring:       0 0 0 2px var(--bg-page), 0 0 0 4px var(--tv-orange-deep);
  --focus-ring-light: 0 0 0 2px var(--bg-page), 0 0 0 4px var(--tv-orange-deep);

  /* Status fg-on-dark variants flip to their light-on-light tints. */
  --success-fg-on-dark: var(--success-fg);
  --warning-fg-on-dark: var(--warning-fg);
  --danger-fg-on-dark:  var(--danger-fg);
  --info-fg-on-dark:    var(--info-fg);
  --neutral-bg-on-dark: var(--neutral-bg);
  --neutral-fg-on-dark: var(--neutral-fg);

  /* Surface tints resolve to the dark-on-light ramp. */
  --surface-d-1: var(--surface-l-1);
  --surface-d-2: var(--surface-l-2);
  --surface-d-3: var(--surface-l-3);
  --surface-d-4: rgba(17,21,35,0.14);

  color-scheme: light;
}

/* ------------------------------------------------------------------ */
/* DARK THEME — the primary product surface.                           */
/*   .dark (shadcn/next-themes) and [data-theme="dark"] share this.    */
/*   App chrome #0E1020, elevated panels #181A2E.                      */
/* ------------------------------------------------------------------ */
.dark,
[data-theme="dark"] {
  /* --- shadcn HSL channels --- */
  --primary: 35 94% 56%;
  --primary-foreground: 232 35% 11%;

  --background: 233 38% 9%;           /* #0E1020 — app bg */
  --foreground: 0 0% 100%;
  --card: 233 31% 14%;                /* #181A2E — elevated */
  --card-foreground: 0 0% 100%;
  --popover: 233 31% 14%;
  --popover-foreground: 0 0% 100%;

  --secondary: 266 33% 38%;
  --secondary-foreground: 0 0% 100%;
  --muted: 233 28% 17%;               /* #1F223A — panel */
  --muted-foreground: 0 0% 100% / 0.68;
  --accent: 35 94% 56%;
  --accent-foreground: 232 35% 11%;

  --destructive: 9 73% 55%;
  --destructive-foreground: 0 0% 100%;
  --success: 158 51% 47%;
  --success-foreground: 0 0% 100%;
  --warning: 35 94% 56%;
  --warning-foreground: 232 35% 11%;
  --info: 179 86% 47%;
  --info-foreground: 232 35% 11%;

  --border: 0 0% 100% / 0.10;         /* rgba(255,255,255,0.10) */
  --input: 0 0% 100% / 0.10;
  --ring: 43 100% 51%;                /* #FFBA07 focus */

  --sidebar-background: 233 38% 9%;
  --sidebar-foreground: 0 0% 100%;
  --sidebar-primary: 35 94% 56%;
  --sidebar-primary-foreground: 232 35% 11%;
  --sidebar-accent: 233 28% 17%;
  --sidebar-accent-foreground: 0 0% 100%;
  --sidebar-border: 0 0% 100% / 0.10;
  --sidebar-ring: 43 100% 51%;

  --chart-1: 35 94% 58%;
  --chart-2: 179 86% 47%;
  --chart-3: 270 41% 60%;
  --chart-4: 218 85% 56%;
  --chart-5: 158 51% 55%;

  --radius: 0.75rem;

  /* --- v2 direct semantic tokens (dark) --- */
  --bg:          #0E1020;
  --bg-elevated: #181A2E;
  --bg-panel:    #1F223A;

  --fg:          #FFFFFF;
  --fg-muted:    rgba(255,255,255,0.68);
  --fg-subtle:   rgba(255,255,255,0.45);
  --fg-mono-dark: rgba(255,255,255,0.55);

  --hairline:      rgba(255,255,255,0.10);
  --border-strong: rgba(255,255,255,0.22);

  --accent-on-accent: #111523;          /* black on orange, AAA 10.2 */

  --focus:      #FFBA07;
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--focus);
  --focus-ring-light: 0 0 0 2px var(--bg-page), 0 0 0 4px var(--tv-orange-deep);

  /* Status fg-on-dark variants brighten for dark surfaces. */
  --success-fg-on-dark: #5BD0A4;
  --warning-fg-on-dark: var(--tv-orange-warm);
  --danger-fg-on-dark:  #F0816B;
  --info-fg-on-dark:    var(--tv-teal-bright);
  --neutral-bg-on-dark: rgba(255,255,255,0.10);
  --neutral-fg-on-dark: var(--fg);

  /* Surface tints resolve to the white-on-dark ramp. */
  --surface-d-1: rgba(255,255,255,0.04);
  --surface-d-2: rgba(255,255,255,0.06);
  --surface-d-3: rgba(255,255,255,0.10);
  --surface-d-4: rgba(255,255,255,0.14);

  color-scheme: dark;
}

/* ------------------------------------------------------------------ */
/* Reduced motion — system default (v2).                               */
/* Zeroes the duration tokens + forces single-iteration animations.    */
/* The radar pulse re-enables itself inside a no-preference gate.       */
/* ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur-base: 0ms;
    --dur-slow: 0ms;
  }
  *, *::before, *::after {
    animation-duration: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0ms !important;
  }
}

/* ------------------------------------------------------------------ */
/* Base resets                                                         */
/* ------------------------------------------------------------------ */
*,
*::before,
*::after {
  border-color: hsl(var(--border));
}

body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
}

/* Keyboard focus — always visible, always brand amber. The .tv-*
   component layer additionally renders a 2-ring box-shadow focus ring
   via var(--focus-ring); this outline is the platform-wide default for
   everything else. */
:where(*):focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}
/*$vite$:1*/