/*
 * TestWatch design tokens — the single source for colour, type and spacing.
 * Pages link this file and use var(--tw-*) instead of hard-coded values.
 * Light is the default; dark follows the OS unless a page forces a theme
 * with <html data-theme="light|dark">.
 */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&display=swap');

:root {
    --tw-font: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --tw-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --tw-bg: #f6f7fb;
    --tw-surface: #ffffff;
    --tw-hover: #f1f3f7;
    --tw-text: #17181c;
    --tw-muted: #5f6773;          /* 5.6:1 on white */
    --tw-line: #e3e6ec;
    --tw-accent: #ffc107;         /* brand yellow: fills only, never text on white */
    --tw-accent-text: #8a6500;    /* yellow-family text that passes AA on white */
    --tw-link: #1d4ed8;
    --tw-focus: #1d4ed8;

    --tw-success: #1b6b34;
    --tw-success-bg: #e7f5ea;
    --tw-warning: #8a5a00;
    --tw-warning-bg: #fff3bf;
    --tw-danger: #a51d1d;         /* white text on this is 7:1 */
    --tw-danger-bg: #ffe3e3;

    --tw-radius-sm: 8px;
    --tw-radius: 12px;
    --tw-radius-lg: 16px;
    --tw-space-1: 4px;
    --tw-space-2: 8px;
    --tw-space-3: 12px;
    --tw-space-4: 16px;
    --tw-space-6: 24px;
    --tw-shadow: 0 6px 24px rgba(15, 23, 42, .12);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --tw-bg: #0f1115;
        --tw-surface: #171a21;
        --tw-hover: #1f2430;
        --tw-text: #eef0f4;
        --tw-muted: #a6adbb;
        --tw-line: #2a2f3a;
        --tw-accent-text: #f0c04a;
        --tw-link: #8ab4ff;
        --tw-focus: #8ab4ff;
        --tw-success: #6fd28f;
        --tw-success-bg: #12301c;
        --tw-warning: #f0c04a;
        --tw-warning-bg: #33290d;
        --tw-danger: #ff8a80;
        --tw-danger-bg: #3a1714;
        --tw-shadow: 0 6px 24px rgba(0, 0, 0, .5);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --tw-bg: #0f1115;
    --tw-surface: #171a21;
    --tw-hover: #1f2430;
    --tw-text: #eef0f4;
    --tw-muted: #a6adbb;
    --tw-line: #2a2f3a;
    --tw-accent-text: #f0c04a;
    --tw-link: #8ab4ff;
    --tw-focus: #8ab4ff;
    --tw-success: #6fd28f;
    --tw-success-bg: #12301c;
    --tw-warning: #f0c04a;
    --tw-warning-bg: #33290d;
    --tw-danger: #ff8a80;
    --tw-danger-bg: #3a1714;
    --tw-shadow: 0 6px 24px rgba(0, 0, 0, .5);
    color-scheme: dark;
}

/* Shared risk pills (dashboard, review page, live console). */
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.pill.integrity-low { background: var(--tw-success-bg); color: var(--tw-success); }
.pill.integrity-medium { background: var(--tw-warning-bg); color: var(--tw-warning); }
.pill.integrity-high { background: var(--tw-danger-bg); color: var(--tw-danger); }
.pill.integrity-confirmed { background: var(--tw-danger); color: var(--tw-surface); }

/* Visible keyboard focus everywhere. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid var(--tw-focus);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}
