/**
 * CookieGate — DPDP Cookie Consent & Data Principal Rights
 * Developed & maintained by: Vijaya Kumar L, Lead Application Engineering, CIEL HR
 * © 2026 CIEL HR. Internal use only — not for sale or redistribution.
 *
 * tokens.css — the static design-token base injected into every CookieGate Shadow DOM host.
 * It defines the CIEL HR brand palette, the type/spacing/radius scales and the shared
 * resets. Per-site overrides (scheme Light/Dark/Auto/Custom, colours, radius, font) arrive
 * as a small inline <style id="ckg-tokens"> emitted by Consent\DesignTokens and as :host
 * custom properties set by ckg-mount.js — those WIN over these defaults because they are
 * declared later / more specifically. Keep this file free of component styles (see ckg-ui.css).
 */

/* --- Self-hosted Inter (latin 400/500/600/700). Registering @font-face inside a
 * Shadow DOM stylesheet makes the family available to that root; the theme font can
 * no longer bleed into CookieGate UI because :host + a universal * selector below
 * force Inter on every node. url() resolves relative to this file (assets/css/). --- */
@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/inter-400.woff2") format("woff2");
}
@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url("../fonts/inter-500.woff2") format("woff2");
}
@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("../fonts/inter-600.woff2") format("woff2");
}
@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../fonts/inter-700.woff2") format("woff2");
}
/* Metric-adjusted fallback so text occupies the SAME space before Inter arrives — the font
 * swap then changes glyphs but not line count/height, so there is no reflow/CLS (2.4.1 item 1).
 * Overrides from the Inter project's Arial-metric fallback. If no local match exists the stack
 * simply falls through to system-ui (unchanged behaviour). */
@font-face {
	font-family: "Inter Fallback";
	src: local("Arial"), local("Helvetica Neue"), local("Roboto"), local("Segoe UI"), local("Liberation Sans");
	ascent-override: 90.44%;
	descent-override: 22.52%;
	line-gap-override: 0%;
	size-adjust: 107.12%;
}

:host,
.ckg-scope {
	/* --- Brand palette (A00 §3) — the default for every site. ----------------- */
	--ckg-primary: #0363fc;
	--ckg-primary-hover: #0251d0;
	--ckg-primary-text: #ffffff;
	/* Darker ink for SMALL primary-coloured text on the tint background (#0363fc on
	 * #e8f0fe is only ~4.3:1; #0250cc is ~6:1 — AA for normal text). Use for chips /
	 * section tags / numbered badges, never for fills or buttons. */
	--ckg-primary-ink: #0250cc;
	--ckg-navy: #0a1931;
	--ckg-text: #0a1931;
	--ckg-tint: #e8f0fe;
	--ckg-success: #0d7a5f;
	--ckg-warning: #c47a00;
	--ckg-danger: #c62828;
	--ckg-muted: #5b6475;
	--ckg-border: #d7dce5;
	--ckg-surface: #ffffff;
	--ckg-page-bg: #f5f7fb;

	/* --- Type scale (A00 §4): 12 / 14 / 16 / 18 / 20 / 24 / 28 ----------------- */
	--ckg-fs-12: 12px;
	--ckg-fs-13: 13px;
	--ckg-fs-14: 14px;
	--ckg-fs-16: 16px;
	--ckg-fs-18: 18px;
	--ckg-fs-20: 20px;
	--ckg-fs-24: 24px;
	--ckg-fs-28: 28px;
	--ckg-lh: 1.5;

	/* --- Spacing scale: 4 / 8 / 12 / 16 / 24 / 32 / 48 ------------------------- */
	--ckg-sp-1: 4px;
	--ckg-sp-2: 8px;
	--ckg-sp-3: 12px;
	--ckg-sp-4: 16px;
	--ckg-sp-5: 24px;
	--ckg-sp-6: 32px;
	--ckg-sp-7: 48px;

	/* --- Radius: 8 (fields/buttons), 12–16 (cards) ---------------------------- */
	--ckg-radius: 8px;
	--ckg-radius-card: 16px;

	/* --- Controls ------------------------------------------------------------- */
	--ckg-field-h: 44px;
	--ckg-btn-h: 44px;
	--ckg-submit-h: 48px;
	--ckg-max-width: 820px;

	/* --- Elevation ------------------------------------------------------------ */
	--ckg-shadow-card: 0 1px 3px rgba(10, 25, 49, 0.08), 0 8px 28px rgba(10, 25, 49, 0.1);
	--ckg-shadow-pop: 0 10px 40px rgba(10, 25, 49, 0.2);

	/* --- Focus ring ----------------------------------------------------------- */
	--ckg-focus: 0 0 0 2px var(--ckg-surface), 0 0 0 4px var(--ckg-primary);

	/* Font: self-hosted Inter so the visitor UI is pixel-identical to the approved
	 * console design and the theme font can NEVER bleed in. A site may force a
	 * different family by setting --ckg-font (admin "fixed font"). */
	--ckg-font: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Fixed base font-size on the host so mounted components (forms, manage page, cookie table)
 * never follow the theme's <html> font-size. Every component size is in px, so this only
 * seeds em/inherited defaults predictably. */
:host { font-size: 16px; }

/* The scope element owns colour + font so the whole component inherits consistently. */
.ckg-scope {
	color: var(--ckg-text);
	font-family: var(--ckg-font);
	font-size: var(--ckg-fs-16);
	line-height: var(--ckg-lh);
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

/* Universal selector so NOTHING inside a CookieGate shadow root inherits the theme
 * font (headings/buttons/labels/inputs all render Inter). Inside a shadow root this
 * only ever matches CookieGate nodes, so it is safe and cannot leak to the page. */
:host *,
.ckg-scope,
.ckg-scope * {
	font-family: var(--ckg-font);
}

.ckg-scope *,
.ckg-scope *::before,
.ckg-scope *::after {
	box-sizing: border-box;
}

/* The [hidden] attribute must always win inside a CookieGate component (flex/grid rows
 * otherwise keep conditionally-hidden blocks visible — the S1 Nominee-fieldset bug). */
.ckg-scope [hidden] {
	display: none !important;
}
