/*
 * Moptix design tokens. The only file in the app that holds raw colour values.
 * Light is the default; dark applies from the OS preference unless the user forced a theme
 * with data-theme on <html>, and data-theme="dark" forces dark regardless of the OS.
 * The *-strong colours carry white text on filled buttons and links at WCAG AA (4.5:1);
 * plain --color-primary (#0891B2) is the brand accent for rings, indicators and icons.
 */

@font-face {
    font-family: 'Figtree';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/figtree-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Figtree';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/figtree-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Noto Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/noto-sans-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Noto Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/noto-sans-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    color-scheme: light;

    /* Surfaces and text */
    --color-page: #F6FAFB;
    --color-surface: #FFFFFF;
    --color-surface-sunken: #EEF5F8;
    --color-surface-hover: #E8F3F7;
    --color-border: #D7E6EC;
    --color-border-strong: #B5CED8;
    --color-text: #164E63;
    --color-text-muted: #4B6B78;
    --color-text-subtle: #6B8792;
    --color-overlay: rgba(8, 28, 36, 0.5);

    /* Intent */
    --color-primary: #0891B2;
    --color-primary-hover: #0E7490;
    --color-primary-strong: #0E7490;
    --color-primary-strong-hover: #155E75;
    --color-primary-soft: #E0F4F9;
    --color-on-primary: #FFFFFF;
    --color-success: #059669;
    --color-success-hover: #047857;
    --color-success-strong: #047857;
    --color-success-strong-hover: #065F46;
    --color-success-soft: #E1F5EE;
    --color-on-success: #FFFFFF;
    --color-warning: #D97706;
    --color-warning-text: #92400E;
    --color-warning-soft: #FDF1DE;
    --color-danger: #DC2626;
    --color-danger-hover: #B91C1C;
    --color-danger-text: #991B1B;
    --color-danger-soft: #FDE8E8;
    --color-on-danger: #FFFFFF;
    --color-info-text: #0E7490;
    --color-neutral-soft: #EEF2F4;
    --color-neutral-text: #3F5560;
    --color-focus: #0891B2;

    /* Spacing: 8px scale with a 4px half step */
    --space-0: 0;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 999px;

    /* Shadow */
    --shadow-sm: 0 1px 2px rgba(16, 52, 66, 0.06);
    --shadow-md: 0 4px 8px rgba(16, 52, 66, 0.08);
    --shadow-lg: 0 10px 24px rgba(16, 52, 66, 0.12);
    --shadow-xl: 0 20px 40px rgba(16, 52, 66, 0.18);

    /* Type */
    --font-heading: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-body: 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;

    /* Sizing */
    --touch-target: 44px;
    --row-height: 44px;
    --focus-ring-width: 3px;
    --sidebar-width: 240px;
    --sidebar-width-collapsed: 64px;
    --topbar-height: 64px;
    --bottomnav-height: 64px;
    --content-max-width: 1200px;

    /* Motion */
    --duration-fast: 120ms;
    --duration-normal: 200ms;
    --easing-standard: cubic-bezier(0.2, 0, 0, 1);

    /* Layers */
    --z-base: 0;
    --z-sticky: 10;
    --z-nav: 20;
    --z-overlay: 40;
    --z-modal: 50;
    --z-toast: 60;
}

/* Dark theme values, shared by the OS preference and the forced dark theme. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --color-page: #0F1D24;
        --color-surface: #152831;
        --color-surface-sunken: #11222A;
        --color-surface-hover: #1B323D;
        --color-border: #24404B;
        --color-border-strong: #355866;
        --color-text: #E6F1F5;
        --color-text-muted: #A9C2CC;
        --color-text-subtle: #8AA5B0;
        --color-overlay: rgba(0, 0, 0, 0.6);
        --color-primary: #22B8DA;
        --color-primary-hover: #4CC9E6;
    --color-primary-strong: #22B8DA;
    --color-primary-strong-hover: #4CC9E6;
        --color-primary-soft: #133846;
        --color-on-primary: #06222B;
        --color-success: #10B981;
        --color-success-hover: #34D399;
    --color-success-strong: #10B981;
    --color-success-strong-hover: #34D399;
        --color-success-soft: #123A30;
        --color-on-success: #04261C;
        --color-warning: #F59E0B;
        --color-warning-text: #FCD34D;
        --color-warning-soft: #3A2C12;
        --color-danger: #EF4444;
        --color-danger-hover: #F87171;
        --color-danger-text: #FCA5A5;
        --color-danger-soft: #3D1A1D;
        --color-on-danger: #FFFFFF;
        --color-info-text: #67D4EC;
        --color-neutral-soft: #1F3640;
        --color-neutral-text: #C3D6DD;
        --color-focus: #22B8DA;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.35);
        --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.4);
        --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.5);
    }
}

:root[data-theme="dark"],
[data-theme="dark"] {
    color-scheme: dark;
    --color-page: #0F1D24;
    --color-surface: #152831;
    --color-surface-sunken: #11222A;
    --color-surface-hover: #1B323D;
    --color-border: #24404B;
    --color-border-strong: #355866;
    --color-text: #E6F1F5;
    --color-text-muted: #A9C2CC;
    --color-text-subtle: #8AA5B0;
    --color-overlay: rgba(0, 0, 0, 0.6);
    --color-primary: #22B8DA;
    --color-primary-hover: #4CC9E6;
    --color-primary-strong: #22B8DA;
    --color-primary-strong-hover: #4CC9E6;
    --color-primary-soft: #133846;
    --color-on-primary: #06222B;
    --color-success: #10B981;
    --color-success-hover: #34D399;
    --color-success-strong: #10B981;
    --color-success-strong-hover: #34D399;
    --color-success-soft: #123A30;
    --color-on-success: #04261C;
    --color-warning: #F59E0B;
    --color-warning-text: #FCD34D;
    --color-warning-soft: #3A2C12;
    --color-danger: #EF4444;
    --color-danger-hover: #F87171;
    --color-danger-text: #FCA5A5;
    --color-danger-soft: #3D1A1D;
    --color-on-danger: #FFFFFF;
    --color-info-text: #67D4EC;
    --color-neutral-soft: #1F3640;
    --color-neutral-text: #C3D6DD;
    --color-focus: #22B8DA;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* A light island inside a dark page (used by the component gallery). */
[data-theme="light"] {
    color-scheme: light;
    --color-page: #F6FAFB;
    --color-surface: #FFFFFF;
    --color-surface-sunken: #EEF5F8;
    --color-surface-hover: #E8F3F7;
    --color-border: #D7E6EC;
    --color-border-strong: #B5CED8;
    --color-text: #164E63;
    --color-text-muted: #4B6B78;
    --color-text-subtle: #6B8792;
    --color-overlay: rgba(8, 28, 36, 0.5);
    --color-primary: #0891B2;
    --color-primary-hover: #0E7490;
    --color-primary-strong: #0E7490;
    --color-primary-strong-hover: #155E75;
    --color-primary-soft: #E0F4F9;
    --color-on-primary: #FFFFFF;
    --color-success: #059669;
    --color-success-hover: #047857;
    --color-success-strong: #047857;
    --color-success-strong-hover: #065F46;
    --color-success-soft: #E1F5EE;
    --color-on-success: #FFFFFF;
    --color-warning: #D97706;
    --color-warning-text: #92400E;
    --color-warning-soft: #FDF1DE;
    --color-danger: #DC2626;
    --color-danger-hover: #B91C1C;
    --color-danger-text: #991B1B;
    --color-danger-soft: #FDE8E8;
    --color-on-danger: #FFFFFF;
    --color-info-text: #0E7490;
    --color-neutral-soft: #EEF2F4;
    --color-neutral-text: #3F5560;
    --color-focus: #0891B2;
    --shadow-sm: 0 1px 2px rgba(16, 52, 66, 0.06);
    --shadow-md: 0 4px 8px rgba(16, 52, 66, 0.08);
    --shadow-lg: 0 10px 24px rgba(16, 52, 66, 0.12);
    --shadow-xl: 0 20px 40px rgba(16, 52, 66, 0.18);
}
