/*
 * Ringer's one theme file: every colour the app uses, for dark and light mode.
 * Brand colours come from config/brand_colours.php (primary Blue, secondary Green, tertiary Slate).
 * `-rgb` tokens are space-separated triplets for translucent fills: rgb(var(--primary-rgb) / 0.12).
 * Dark is the default. partials/theme sets data-theme before first paint: the viewer's pick, else the system setting.
 */
:root,
:root[data-theme="dark"] {
    color-scheme: dark;

    --primary: #60A5FA;
    --primary-rgb: 96 165 250;
    --primary-text: #60A5FA;
    --on-primary: #111827;
    --secondary: #4ADE80;
    --secondary-rgb: 74 222 128;
    --secondary-text: #4ADE80;
    --tertiary: #94A3B8;
    --tertiary-rgb: 148 163 184;
    --tertiary-text: #94A3B8;

    --danger: #ef4444;
    --danger-rgb: 239 68 68;
    --danger-text: #f87171;
    --danger-fill: #dc2626;
    --warning: #f59e0b;
    --warning-rgb: 245 158 11;
    --warning-text: #fbbf24;
    --accent-pink: #ec4899;
    --accent-pink-rgb: 236 72 153;
    --accent-pink-text: #f472b6;
    --accent-teal: #06b6d4;
    --accent-teal-rgb: 6 182 212;
    --accent-teal-text: #22d3ee;

    --bg: #050608;
    --surface: #0b0d12;
    --surface-2: #13161e;
    --border: #2a3042;
    --border-strong: #657086;
    --text: #e8eaf0;
    --text-muted: #8892a4;
    --text-faint: #808b9e;
    --tint-rgb: 255 255 255;
    --muted-rgb: 100 116 139;
}

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

    --primary: #2563EB;
    --primary-rgb: 37 99 235;
    --primary-text: #2563EB;
    --on-primary: #ffffff;
    --secondary: #16A34A;
    --secondary-rgb: 22 163 74;
    --secondary-text: #15803D;
    --tertiary: #475569;
    --tertiary-rgb: 71 85 105;
    --tertiary-text: #475569;

    --danger: #dc2626;
    --danger-rgb: 220 38 38;
    --danger-text: #b91c1c;
    --danger-fill: #dc2626;
    --warning: #d97706;
    --warning-rgb: 217 119 6;
    --warning-text: #a16207;
    --accent-pink: #db2777;
    --accent-pink-rgb: 219 39 119;
    --accent-pink-text: #be185d;
    --accent-teal: #0891b2;
    --accent-teal-rgb: 8 145 178;
    --accent-teal-text: #0e7490;

    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-2: #f1f3f6;
    --border: #dde1e8;
    --border-strong: #7d8798;
    --text: #111827;
    --text-muted: #4b5563;
    --text-faint: #5f6b7a;
    --tint-rgb: 0 0 0;
    --muted-rgb: 100 116 139;
}

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.theme-toggle {
    background: none; border: 1px solid var(--border); border-radius: 6px; color: var(--text-muted);
    font-size: 12px; padding: 4px 9px; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
