/* Corebility design tokens. Loaded after the Metronic bundle and before
   custom.css in every layout (docs/redesign/specs/01-design-tokens.md).
   Names are roles, not colours. Do not use raw values in new CSS. */

:root {
  /* surface */
  --canvas: #f6f6f6;  --paper: #ffffff;  --paper-2: #f6f6f6;
  /* ink */
  --ink: #181c32;  --body: #333333;  --muted: #5e6278;
  --faint: #8891a5;               /* non-text only */
  /* line */
  --line: #eceef1;  --border-strong: #848c98;
  /* accent: what a studio's colour replaces (brandAccentStyle(), T-416) */
  --accent: #125c65;  --accent-text: #125c65;  --accent-strong: #0c3e45;
  --accent-hover: #0f4f57;  --accent-soft: #def0f3;  --on-accent: #ffffff;
  --accent-rgb: 18, 92, 101;  --accent-hover-rgb: 15, 79, 87;  /* channels of --accent-hover; keep in step */
  --accent-deep: #0b3f46;  --accent-mist: #e4f0f0;  /* custom.css's own deep and mist shades (T-416) */
  /* status (fixed: never take the studio accent) */
  --ok: #2f6b4f;  --ok-bg: #eaf4ee;
  --info: #2a5a8c;  --info-bg: #eaf1f8;
  --warn: #8a5300;  --warn-bg: #fdf3e3;
  --alert: #a4262c;  --alert-bg: #fdeceb;
  --focus: var(--accent-text);  /* draw as a two-tone ring: 2px var(--paper) gap inside the outline (SPEC 3.1) */
  /* shape */
  --r-sm: 8px;  --r-md: 12px;  --r-lg: 16px;  --r-pill: 999px;
  --shadow: 0 1px 2px rgba(24, 28, 50, 0.04), 0 14px 34px -18px rgba(18, 92, 101, 0.28);
  /* type: px, because html is 12px !important (style.bundle.css) */
  --font-ui: 'Poppins', 'DM Sans', sans-serif;   /* Poppins is not loaded yet: falls through to DM Sans (Q2b) */
  --font-display: 'Poppins', 'DM Sans', sans-serif;
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-base: 16px;
  --fs-lg: 18px; --fs-xl: 20px; --fs-2xl: 24px; --fs-3xl: 30px;
  /* spacing */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
}

/* Dark values. DEFINED, NOT USED: nothing sets data-theme="dark" yet.
   Deliberately not data-bs-theme: that name switches on Metronic's own dark blocks (Q5). */
[data-theme="dark"] {
  --canvas: #0e1315;  --paper: #151b1e;  --paper-2: #1c2326;
  --ink: #eef2f3;  --body: #d3dadc;  --muted: #a2acb1;  --faint: #76828a;
  --line: #2a3337;  --border-strong: #6b777d;
  --accent: #5ab4bf;  --accent-text: #86cfd7;  --accent-strong: #a6e0e6;
  --accent-hover: #74c0ca;  --accent-soft: #163238;  --on-accent: #0a1f22;
  --accent-rgb: 90, 180, 191;  --accent-hover-rgb: 116, 192, 202;
  --accent-deep: #a6e0e6;  --accent-mist: #163238;
  --ok: #7fcf9f;  --ok-bg: #16301f;
  --info: #93c0ec;  --info-bg: #15283a;
  --warn: #f2b65c;  --warn-bg: #2d2414;
  --alert: #ff8f86;  --alert-bg: #341b1a;
  --shadow: 0 0 0 1px var(--line);
}

/* The website's names, kept so copied snippets work. Do not use in new CSS.
   --teal-hover follows --accent-hover: the website's #2a8995 fails AA under white text. */
:root {
  --teal: var(--accent);  --teal-hover: var(--accent-hover);  --teal-deep: var(--accent-strong);
  --teal-soft: var(--accent-soft);  --ink-soft: var(--muted);  --on-teal: var(--on-accent);
  --rail-w: 260px;
}

/* Bootstrap mapping (light only; the dark slice adds its own). Only names the
   bundled Bootstrap 5.3.0-alpha1 / Metronic declares on :root. Specificity (0,2,0)
   beats the bundle's :root regardless of order. Three values move on purpose:
   --bs-primary-rgb (bundle typo 25, 92, 101) and --bs-link-hover-color and its -rgb twin
   (#2a8995 gives white text 4.11:1; ordinary <a> hover reads the -rgb one). */
:root:not([data-theme="dark"]) {
  --bs-primary: var(--accent);
  --bs-primary-inverse: var(--on-accent);
  --bs-text-primary: var(--accent-text);
  --bs-component-active-bg: var(--accent);
  --bs-component-checked-bg: var(--accent);
  --bs-component-hover-color: var(--accent-text);
  --bs-menu-link-color-hover: var(--accent-text);
  --bs-menu-link-color-show: var(--accent-text);
  --bs-menu-link-color-here: var(--accent-text);
  --bs-menu-link-color-active: var(--accent-text);
  --bs-ribbon-label-bg: var(--accent);
  --bs-link-color: var(--accent-text);
  --bs-body-bg: var(--paper);
  --bs-body-color: var(--body);
  --bs-heading-color: var(--ink);
  --bs-gray-700: var(--muted);
  --bs-gray-900: var(--ink);
  --bs-primary-rgb: var(--accent-rgb);
  --bs-link-color-rgb: var(--accent-rgb);
  --bs-link-hover-color: var(--accent-hover);
  --bs-link-hover-color-rgb: var(--accent-hover-rgb);
}

/* T-416: rules the Metronic bundle paints with a hard-coded #125c65, pointed at
   the accent so a studio's colour reaches them. Same selectors as the bundle,
   loaded after it, so these win without !important (except where it has one).
   custom.css also reads --brand-soft, --brand-wash, --brand-line, --brand-pop,
   --brand-pop-soft and --brand-rgb, always with today's literal as fallback:
   they are set only by a studio's colour, never here. */
.form-check-input:checked,
.form-check-input[type="checkbox"]:indeterminate { background-color: var(--accent); border-color: var(--accent); }
.form-check.form-check-solid .form-check-input[type="checkbox"]:indeterminate { background-color: var(--accent); }
.form-range::-webkit-slider-thumb { background-color: var(--accent); }
.form-range::-moz-range-thumb { background-color: var(--accent); }
.btn-primary {
  --bs-btn-bg: var(--accent);  --bs-btn-border-color: var(--accent);
  --bs-btn-disabled-bg: var(--accent);  --bs-btn-disabled-border-color: var(--accent);
}
.btn-outline-primary {
  --bs-btn-color: var(--accent-text);  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent);  --bs-btn-hover-border-color: var(--accent);
  --bs-btn-active-bg: var(--accent);  --bs-btn-active-border-color: var(--accent);
  --bs-btn-disabled-color: var(--accent-text);  --bs-btn-disabled-border-color: var(--accent);
}
.nav-pills { --bs-nav-pills-link-active-bg: var(--accent); }
.progress,
.progress-stacked { --bs-progress-bar-bg: var(--accent); }
.link-primary { color: var(--accent-text) !important; }
.separator.separator-content.border-primary::after,
.separator.separator-content.border-primary::before { border-color: var(--accent) !important; }
div::-webkit-scrollbar-thumb,
main::-webkit-scrollbar-thumb,
ol::-webkit-scrollbar-thumb,
pre::-webkit-scrollbar-thumb,
span::-webkit-scrollbar-thumb,
ul::-webkit-scrollbar-thumb { background-color: var(--accent); }
