/* ---------------------------------------------------------------------------
 * GWS Design Tokens
 *
 * Derived from the GWS Design System & UX Specification. The specification is
 * explicit that final brand hex values come from an approved brand palette and
 * must not be independently invented by developers — so the brand values below
 * are PLACEHOLDERS, clearly marked, to be replaced once the palette is issued.
 * Token NAMES and their behaviour are the stable contract; the hex values are not.
 *
 * Rules encoded here:
 *   - 4px spacing scale: 4, 8, 12, 16, 24, 32, 40, 48.
 *   - Status is never communicated by colour alone; every status token has a
 *     paired text/icon treatment in components.css.
 *   - Focus rings are high contrast and never removed.
 * ------------------------------------------------------------------------- */

:root {
	/* --- Brand (PLACEHOLDER — replace with approved GWS palette) --------- */
	--gws-brand-primary: #1f4ed8;
	--gws-brand-primary-hover: #1a41b4;
	--gws-brand-primary-contrast: #ffffff;
	--gws-brand-secondary: #0f766e;

	/* --- Surfaces -------------------------------------------------------- */
	--gws-surface-page: #f6f7f9;
	--gws-surface-card: #ffffff;
	--gws-surface-raised: #ffffff;
	--gws-surface-subtle: #eef1f5;
	--gws-surface-overlay: rgba(15, 23, 42, 0.45);
	--gws-surface-sidebar: #101828;
	--gws-surface-sidebar-active: #1d2939;

	/* --- Text ------------------------------------------------------------ */
	--gws-text-primary: #101828;
	--gws-text-secondary: #475467;
	--gws-text-muted: #667085;
	--gws-text-inverse: #ffffff;
	--gws-text-link: var(--gws-brand-primary);

	/* --- Borders --------------------------------------------------------- */
	--gws-border-default: #e4e7ec;
	--gws-border-strong: #d0d5dd;
	--gws-border-focus: #1f4ed8;
	--gws-border-selected: var(--gws-brand-primary);

	/* --- Status ---------------------------------------------------------- */
	--gws-status-success: #067647;
	--gws-status-success-bg: #ecfdf3;
	--gws-status-warning: #b54708;
	--gws-status-warning-bg: #fffaeb;
	--gws-status-danger: #b42318;
	--gws-status-danger-bg: #fef3f2;
	--gws-status-info: #175cd3;
	--gws-status-info-bg: #eff8ff;

	/* --- Spacing (4px scale) --------------------------------------------- */
	--gws-space-1: 4px;
	--gws-space-2: 8px;
	--gws-space-3: 12px;
	--gws-space-4: 16px;
	--gws-space-6: 24px;
	--gws-space-8: 32px;
	--gws-space-10: 40px;
	--gws-space-12: 48px;

	/* --- Radius ---------------------------------------------------------- */
	--gws-radius-sm: 6px;
	--gws-radius-md: 10px;
	--gws-radius-lg: 16px;
	--gws-radius-full: 999px;

	/* --- Elevation ------------------------------------------------------- */
	--gws-shadow-none: none;
	--gws-shadow-subtle: 0 1px 2px rgba(16, 24, 40, 0.06);
	--gws-shadow-raised: 0 8px 24px rgba(16, 24, 40, 0.12);

	/* --- Typography ------------------------------------------------------ */
	--gws-font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--gws-font-size-display: 1.75rem;
	--gws-font-size-h2: 1.25rem;
	--gws-font-size-h3: 1.0625rem;
	--gws-font-size-body: 0.9375rem;
	--gws-font-size-label: 0.8125rem;
	--gws-font-size-caption: 0.75rem;
	--gws-line-height-body: 1.6;
	--gws-font-weight-medium: 550;
	--gws-font-weight-bold: 650;

	/* --- Layout ---------------------------------------------------------- */
	--gws-sidebar-width: 248px;
	--gws-header-height: 60px;
	--gws-content-max-width: 1200px;

	/* --- Motion ---------------------------------------------------------- */
	--gws-transition: 140ms ease;
}

/*
 * Dark mode is defined at token level so components never need to know about it.
 * The Design System permits dark mode provided surface hierarchy stays legible.
 */
@media (prefers-color-scheme: dark) {
	:root:not([data-gws-theme="light"]) {
		--gws-surface-page: #0c111d;
		--gws-surface-card: #161b26;
		--gws-surface-raised: #1d2330;
		--gws-surface-subtle: #1d2330;
		--gws-surface-sidebar: #060a13;
		--gws-surface-sidebar-active: #1d2330;

		--gws-text-primary: #f5f6f8;
		--gws-text-secondary: #cdd2dc;
		--gws-text-muted: #98a2b3;

		--gws-border-default: #2b313e;
		--gws-border-strong: #3b4252;

		--gws-status-success-bg: #05301f;
		--gws-status-warning-bg: #3a2405;
		--gws-status-danger-bg: #3a1210;
		--gws-status-info-bg: #0b2a5c;
	}
}

@media (prefers-reduced-motion: reduce) {
	:root {
		--gws-transition: 0ms;
	}
}
