/* ==========================================================================
   Finora UI — Design tokens (Glass edition)
   Values prefixed --theme-* and --glass-alpha / --glass-blur are also written
   from Theme Settings (inc/css-variables.php). Everything else derives from
   them, so a change in the admin reaches every component.
   ========================================================================== */

:root {
	/* Brand */
	--theme-primary: #5B5FEF;
	--theme-primary-dark: #4848D8;
	--theme-secondary: #7C3AED;
	--theme-accent: #8B5CF6;
	--theme-success: #10B981;
	--theme-danger: #EF4444;
	--theme-warning: #F59E0B;
	--theme-primary-rgb: 91, 95, 239;
	--theme-secondary-rgb: 124, 58, 237;
	--theme-accent-rgb: 139, 92, 246;
	--theme-success-rgb: 16, 185, 129;
	--theme-danger-rgb: 239, 68, 68;

	/* Aliases for Elementor / custom CSS */
	--primary: var(--theme-primary);
	--primary-dark: var(--theme-primary-dark);
	--secondary: var(--theme-secondary);
	--accent: var(--theme-accent);
	--success: var(--theme-success);
	--danger: var(--theme-danger);
	--warning: var(--theme-warning);

	/* Readable brand-coloured text. Dark mode lightens it from the brand
	   colour itself (no hard-coded lavender), so a new primary applies everywhere. */
	--primary-ink: var(--theme-primary);
	--success-ink: #0B8F66;
	--success-ink: color-mix(in srgb, var(--theme-success) 72%, #000);

	/* Gradients */
	--gradient-primary: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
	--gradient-accent: linear-gradient(135deg, var(--theme-secondary) 0%, var(--theme-accent) 100%);
	--gradient-blue: linear-gradient(135deg, #3B82F6 0%, var(--theme-primary) 100%);
	--gradient-success: linear-gradient(135deg, #34D399 0%, var(--theme-success) 100%);
	--gradient-card: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 55%, var(--theme-accent) 100%);
	--gradient-ring: linear-gradient(135deg,
		rgba(255, 255, 255, .95) 0%,
		rgba(var(--theme-primary-rgb), .45) 35%,
		rgba(var(--theme-accent-rgb), .55) 65%,
		rgba(255, 255, 255, .7) 100%);

	/* Aurora (page glow the glass refracts) */
	--aurora-1: rgba(var(--theme-primary-rgb), .34);
	--aurora-2: rgba(var(--theme-accent-rgb), .30);
	--aurora-3: rgba(var(--theme-secondary-rgb), .22);
	--aurora-4: rgba(34, 211, 238, .22);

	/* Light palette (defaults) */
	--light-bg: #F5F6FB;
	--light-surface: #FFFFFF;
	--light-surface-rgb: 255, 255, 255;
	--dark-bg: #0B0D17;
	--dark-surface: #111525;
	--dark-surface-rgb: 17, 21, 37;
	--dark-card: #171B2D;

	/* Semantic surfaces — LIGHT (dark-mode.css flips these) */
	--bg: var(--light-bg);
	--bg-elevated: #EEF0F8;
	--surface: var(--light-surface);
	--surface-rgb: var(--light-surface-rgb);
	--surface-2: #F8F9FD;
	--surface-3: #F1F2F9;
	--surface-hover: rgba(var(--theme-primary-rgb), 0.07);
	--surface-active: rgba(var(--theme-primary-rgb), 0.12);

	--text: #141A33;
	--text-2: #4B5170;
	--text-3: #767C9B;
	--text-inverse: #FFFFFF;
	--text-on-primary: #FFFFFF;

	--border: rgba(20, 26, 51, 0.08);
	--border-strong: rgba(20, 26, 51, 0.14);
	--border-primary: rgba(var(--theme-primary-rgb), 0.32);

	--focus-ring: 0 0 0 3px rgba(var(--theme-primary-rgb), 0.35);

	/* Glass ------------------------------------------------------------ */
	--glass-alpha: .58;          /* panels: header, drawer, cards, dock */
	--glass-alpha-strong: .72;   /* floating layers: popovers, sheets   */
	--glass-blur: 24px;
	--glass-sat: 180%;

	--glass-bg: rgba(var(--surface-rgb), var(--glass-alpha));
	--glass-bg-strong: rgba(var(--surface-rgb), var(--glass-alpha-strong));
	--glass-bg-soft: rgba(var(--surface-rgb), calc(var(--glass-alpha) * .78)); /* controls */
	--glass-bg-hover: rgba(var(--surface-rgb), calc(var(--glass-alpha) + .18));

	--glass-stroke: rgba(255, 255, 255, .78);        /* light edge */
	--glass-stroke-soft: rgba(255, 255, 255, .45);
	--glass-edge: rgba(20, 26, 51, .07);             /* outer hairline for contrast */
	--glass-border: var(--glass-stroke);             /* legacy alias */
	--glass-border-dark: var(--glass-edge);          /* legacy alias */
	--glass-shine: linear-gradient(150deg, rgba(255,255,255,.72) 0%, rgba(255,255,255,.18) 34%, rgba(255,255,255,0) 58%);
	--glass-inner: inset 0 1px 0 rgba(255,255,255,.9), inset 0 -1px 0 rgba(255,255,255,.25);
	--glass-highlight: var(--glass-shine);
	--glass-tint: rgba(var(--theme-primary-rgb), 0.05);
	--glass-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));

	/* Shadows (soft, brand-tinted — glass should float, not sit) */
	--theme-shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 8px 24px -12px rgba(17, 24, 39, .12);
	--shadow-xs: 0 1px 2px rgba(17, 24, 39, .05);
	--shadow-sm: 0 1px 2px rgba(17, 24, 39, .04), 0 6px 16px -8px rgba(var(--theme-primary-rgb), .22);
	--shadow-md: var(--theme-shadow);
	--shadow-lg: 0 4px 10px rgba(17, 24, 39, .05), 0 28px 56px -18px rgba(var(--theme-primary-rgb), .30);
	--shadow-float: 0 24px 60px -16px rgba(var(--theme-primary-rgb), .32), 0 8px 20px -8px rgba(20, 26, 51, .14);
	--shadow-glass: 0 1px 1px rgba(20, 26, 51, .03), 0 12px 32px -12px rgba(var(--theme-primary-rgb), .22), 0 4px 12px -6px rgba(20, 26, 51, .08);
	--shadow-primary: 0 10px 26px -8px rgba(var(--theme-primary-rgb), .6);
	--shadow-glow: 0 0 0 1px rgba(var(--theme-primary-rgb), .18), 0 10px 30px -8px rgba(var(--theme-primary-rgb), .55);
	--shadow-inset-top: var(--glass-inner);

	/* Shape */
	--theme-radius: 16px;
	--theme-radius-card: 20px;
	--theme-radius-btn: 12px;
	--radius-xs: 8px;
	--radius-sm: 12px;
	--radius-md: var(--theme-radius);
	--radius-lg: var(--theme-radius-card);
	--radius-xl: 28px;
	--radius-full: 999px;

	/* Layout */
	--theme-container: 1280px;
	--container-narrow: 820px;
	--theme-space: 24px;
	--gutter: clamp(16px, 4vw, 32px);
	--header-height: 72px;
	--header-height-mobile: 64px;
	--header-opacity: 0.62;
	--header-blur: 22px;
	--header-border-w: 1px;
	--header-shadow: var(--theme-shadow);
	--drawer-width: 340px;
	--bottom-nav-height: 64px;
	--bottom-nav-active: var(--theme-primary);
	--bottom-nav-center-bg: var(--gradient-primary);
	--notif-badge: var(--theme-danger);
	--mobile-breakpoint: 1024px;
	--elementor-content: 1140px;
	--safe-bottom: env(safe-area-inset-bottom, 0px);
	--safe-top: env(safe-area-inset-top, 0px);
	--touch: 44px;

	/* Type */
	--theme-font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--theme-font-size: 16px;
	--theme-heading-weight: 700;
	--leading: 1.6;
	--tracking-tight: -0.015em;
	--font-numeric: "tnum" 1, "cv11" 1;

	/* Motion */
	--theme-anim: 1;
	--ease: cubic-bezier(.2, .8, .2, 1);
	--ease-out: cubic-bezier(.16, 1, .3, 1);
	--ease-spring: cubic-bezier(.34, 1.56, .64, 1);
	--ease-bounce: cubic-bezier(.68, -0.55, .27, 1.55);
	--dur-fast: calc(160ms * var(--theme-anim));
	--dur: calc(240ms * var(--theme-anim));
	--dur-slow: calc(380ms * var(--theme-anim));

	/* Z-index scale */
	--z-header: 900;
	--z-backdrop: 950;
	--z-drawer: 960;
	--z-popover: 980;
	--z-bottom-nav: 940;
	--z-tooltip: 990;

	/* Footer */
	/* Frosted by default; the Footer background setting replaces it with a solid colour. */
	--footer-bg: linear-gradient(180deg, rgba(var(--surface-rgb), calc(var(--glass-alpha) * .6)), rgba(var(--surface-rgb), calc(var(--glass-alpha) * .3)));
	--footer-text: var(--text-3);

	color-scheme: light;
}
