/* ATBI Software design tokens for the shared micro-SaaS shell (Account Hub plan H1.1). Every colour, size and space in saas.css comes
   from here, and app pages use only these tokens (no page-level colours). Copied from portal/wwwroot/css/tokens.css (itself ported from
   CGS) with --portal- renamed --saas-: ATBI blue (decision H-D5). Light by default; dark follows the OS unless the user picks one
   (html[data-theme]).

   Breakpoints (CSS variables can't be used inside @media, so these are the values saas.css uses):
     phone   < 768px   (built for 360px first)
     tablet  768px–1279px
     desktop ≥ 1280px                                                                            */

:root {
    color-scheme: light;

    /* Brand and neutrals. ATBI blue (decision L1, 2026-10-23). Neutrals are blue-grey (charcoal in dark mode).
       --saas-color-brand is for non-text marks (icons, spinner, focus ring, borders). Blue that carries
       text (buttons, links) uses --saas-color-brand-action, a darker step that passes AA with white.
       In dark mode the lighter blues pass everywhere. */
    --saas-color-brand: #0078d4;
    --saas-color-brand-strong: #005a9e;
    --saas-color-brand-soft: #e8f1fb;
    --saas-color-brand-action: #0f6cbd;
    --saas-color-brand-action-hover: #115ea3;
    --saas-color-on-brand: #ffffff;

    --saas-color-bg: #f4f6f8;
    --saas-color-surface: #ffffff;
    --saas-color-sidebar: #ffffff;
    --saas-color-surface-2: #eef1f4;
    --saas-color-border: #e2e6ea;
    --saas-color-border-strong: #c9d0d7;
    --saas-color-text: #111827;
    --saas-color-text-muted: #556070;
    --saas-color-focus: #0078d4;

    --saas-color-success: #067647;
    --saas-color-success-soft: #e7f6ee;
    --saas-color-warning: #9a5b00;
    --saas-color-warning-soft: #fff4e0;
    --saas-color-danger: #b42318;
    --saas-color-danger-soft: #fdecea;
    --saas-color-info: #0f6cbd;
    --saas-color-info-soft: #e8f1fb;

    --saas-color-scrim: rgb(15 17 26 / 45%);

    /* Type: system fonts (no web-font download), fluid between 360px and 1280px */
    --saas-font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --saas-font-mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
    --saas-text-xs: 0.75rem;
    --saas-text-sm: 0.875rem;
    --saas-text-md: clamp(0.9375rem, 0.91rem + 0.12vw, 1rem);
    --saas-text-lg: clamp(1.0625rem, 1.02rem + 0.2vw, 1.1875rem);
    --saas-text-xl: clamp(1.375rem, 1.25rem + 0.55vw, 1.75rem);
    --saas-text-2xl: clamp(1.625rem, 1.45rem + 0.8vw, 2.125rem);
    --saas-leading: 1.55;
    --saas-weight-medium: 550;
    --saas-weight-bold: 650;

    /* Space: fluid gutters, fixed small steps */
    --saas-space-1: 0.25rem;
    --saas-space-2: 0.5rem;
    --saas-space-3: 0.75rem;
    --saas-space-4: 1rem;
    --saas-space-5: 1.5rem;
    --saas-space-6: 2rem;
    --saas-gutter: clamp(1rem, 0.6rem + 1.8vw, 2rem);

    /* Shape and depth */
    --saas-radius-sm: 6px;
    --saas-radius-md: 10px;
    --saas-radius-lg: 14px;
    --saas-shadow-sm: 0 1px 2px rgb(16 24 40 / 6%);
    --saas-shadow-md: 0 4px 16px rgb(16 24 40 / 10%);
    --saas-shadow-lg: 0 16px 48px rgb(16 24 40 / 18%);

    /* Layout */
    --saas-tap: 44px;              /* minimum tap target */
    --saas-sidebar-width: 256px;
    --saas-topbar-height: 56px;
    --saas-content-max: 1200px;
    --saas-motion: 160ms ease;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --saas-color-brand: #5aa9f0;
        --saas-color-brand-strong: #9cc9f5;
        --saas-color-brand-soft: #12263f;
        --saas-color-brand-action: #7ab8f5;
        --saas-color-brand-action-hover: #a3cdf7;
        --saas-color-on-brand: #0b1118;
        --saas-color-bg: #17191c;
        --saas-color-surface: #1e2125;
        --saas-color-sidebar: #0d0f11;
        --saas-color-surface-2: #25292e;
        --saas-color-border: #2f3338;
        --saas-color-border-strong: #42474e;
        --saas-color-text: #e6edf3;
        --saas-color-text-muted: #a3a9b0;
        --saas-color-focus: #5aa9f0;
        --saas-color-success: #4ade80;
        --saas-color-success-soft: #13301f;
        --saas-color-warning: #fbbf24;
        --saas-color-warning-soft: #33280f;
        --saas-color-danger: #f87171;
        --saas-color-danger-soft: #3a1717;
        --saas-color-info: #7ab8f5;
        --saas-color-info-soft: #12263f;
        --saas-color-scrim: rgb(0 0 0 / 60%);
        --saas-shadow-md: 0 4px 16px rgb(0 0 0 / 40%);
        --saas-shadow-lg: 0 16px 48px rgb(0 0 0 / 55%);
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --saas-color-brand: #5aa9f0;
    --saas-color-brand-strong: #9cc9f5;
    --saas-color-brand-soft: #12263f;
    --saas-color-brand-action: #7ab8f5;
    --saas-color-brand-action-hover: #a3cdf7;
    --saas-color-on-brand: #0b1118;
    --saas-color-bg: #17191c;
    --saas-color-surface: #1e2125;
    --saas-color-sidebar: #0d0f11;
    --saas-color-surface-2: #25292e;
    --saas-color-border: #2f3338;
    --saas-color-border-strong: #42474e;
    --saas-color-text: #e6edf3;
    --saas-color-text-muted: #a3a9b0;
    --saas-color-focus: #5aa9f0;
    --saas-color-success: #4ade80;
    --saas-color-success-soft: #13301f;
    --saas-color-warning: #fbbf24;
    --saas-color-warning-soft: #33280f;
    --saas-color-danger: #f87171;
    --saas-color-danger-soft: #3a1717;
    --saas-color-info: #7ab8f5;
    --saas-color-info-soft: #12263f;
    --saas-color-scrim: rgb(0 0 0 / 60%);
    --saas-shadow-md: 0 4px 16px rgb(0 0 0 / 40%);
    --saas-shadow-lg: 0 16px 48px rgb(0 0 0 / 55%);
}
