/* Shared ERIVA owner palettes.
   Core ERIVA and /training/ load this same file. Change niche RGB roles here;
   components and marketplace tools consume their semantic role names.
   Class-based fallbacks keep standalone/public .velora-v2 surfaces compatible. */

/* Default dark palette; shared with owner portals. */
.velora-v2,
html[data-eriva-theme="dark"] {
  --velora-bg: 10 10 11;
  --velora-surface: 17 17 19;
  --velora-elevated: 23 23 26;
  --velora-border: 31 31 34;
  --velora-borderHi: 42 42 46;
  --velora-fg: 250 250 250;
  --velora-fgMuted: 161 161 170;
  --velora-fgDim: 113 113 122;
  --velora-accent: 184 255 0;
  --velora-accentDim: 139 201 0;
  --velora-onAccent: 10 10 11;
  --velora-success: 0 212 170;
  --velora-warn: 255 184 0;
  --velora-danger: 255 93 93;
  --velora-info: 112 172 245;
  --velora-bg-hsl: 240 4.762% 4.118%;
  --velora-surface-hsl: 240 5.556% 7.059%;
  --velora-elevated-hsl: 240 6.122% 9.608%;
  --velora-border-hsl: 240 4.615% 12.745%;
  --velora-fg-hsl: 0 0% 98.039%;
  --velora-fgMuted-hsl: 240 5.028% 64.902%;
  --velora-accent-hsl: 76.706 100% 50%;
  --velora-onAccent-hsl: 240 4.762% 4.118%;
  --velora-danger-hsl: 0 100% 68.235%;
  --velora-success-hsl: 168.113 100% 41.569%;
  --velora-warn-hsl: 43.294 100% 50%;
}

/* The existing ERIVA light palette. */
.velora-v2[data-theme="light"],
html[data-eriva-theme="light"] {
  --velora-bg: 252 252 251;
  --velora-surface: 255 255 255;
  --velora-elevated: 247 247 245;
  --velora-border: 231 229 225;
  --velora-borderHi: 214 211 206;
  --velora-fg: 12 12 14;
  --velora-fgMuted: 82 82 91;
  --velora-fgDim: 161 161 170;
  --velora-accent: 74 124 0;
  --velora-accentDim: 92 153 0;
  --velora-onAccent: 255 255 255;
  --velora-success: 0 153 122;
  --velora-warn: 194 124 0;
  --velora-danger: 220 38 38;
  --velora-info: 36 95 165;
  --velora-bg-hsl: 60 14.286% 98.627%;
  --velora-surface-hsl: 0 0% 100%;
  --velora-elevated-hsl: 60 11.111% 96.471%;
  --velora-border-hsl: 40 11.111% 89.412%;
  --velora-fg-hsl: 240 7.692% 5.098%;
  --velora-fgMuted-hsl: 240 5.202% 33.922%;
  --velora-accent-hsl: 84.194 100% 24.314%;
  --velora-onAccent-hsl: 0 0% 100%;
  --velora-danger-hsl: 0 72.222% 50.588%;
  --velora-success-hsl: 167.843 100% 30%;
  --velora-warn-hsl: 38.351 100% 38.039%;
}

/* Beauty keeps its existing cream palette only in niche mode.
   Public/standalone beauty surfaces retain their original class-based fallback. */
html:not([data-eriva-theme]) .beauty-niche,
html[data-eriva-theme-mode="niche"][data-eriva-niche="beauty"] {
  color-scheme: light;
  --velora-bg: 250 247 242;
  --velora-surface: 255 250 240;
  --velora-elevated: 255 253 248;
  --velora-border: 229 218 196;
  --velora-borderHi: 208 184 121;
  --velora-fg: 51 47 41;
  --velora-fgMuted: 95 87 77;
  --velora-fgDim: 117 107 93;
  --velora-accent: 82 107 82;
  --velora-accentDim: 70 95 71;
  --velora-onAccent: 255 253 248;
  --velora-success: 70 120 84;
  --velora-warn: 201 169 106;
  --velora-danger: 168 77 70;
  --velora-info: 36 95 165;
  --velora-bg-hsl: 37.5 44.444% 96.471%;
  --velora-surface-hsl: 40 100% 97.059%;
  --velora-elevated-hsl: 42.857 100% 98.627%;
  --velora-border-hsl: 40 38.824% 83.333%;
  --velora-fg-hsl: 36 10.87% 18.039%;
  --velora-fgMuted-hsl: 33.333 10.465% 33.725%;
  --velora-accent-hsl: 120 13.228% 37.059%;
  --velora-onAccent-hsl: 42.857 100% 98.627%;
  --velora-danger-hsl: 4.286 41.176% 46.667%;
  --velora-success-hsl: 136.8 26.316% 37.255%;
  --velora-warn-hsl: 39.789 46.798% 60.196%;
}

/* Training: warm white, cream surfaces and a readable brown accent. */
html[data-eriva-theme-mode="niche"][data-eriva-niche="training"] {
  color-scheme: light;
  --velora-bg: 255 253 251;
  --velora-surface: 255 255 255;
  --velora-elevated: 250 247 243;
  --velora-border: 233 227 220;
  --velora-borderHi: 211 194 173;
  --velora-fg: 37 37 42;
  --velora-fgMuted: 95 88 80;
  --velora-fgDim: 119 115 111;
  --velora-accent: 128 92 60;
  --velora-accentDim: 108 75 48;
  --velora-onAccent: 255 253 251;
  --velora-success: 57 119 85;
  --velora-warn: 159 105 35;
  --velora-danger: 175 69 61;
  --velora-info: 36 95 165;
  --velora-bg-hsl: 30 100% 99.216%;
  --velora-surface-hsl: 0 0% 100%;
  --velora-elevated-hsl: 34.286 41.176% 96.667%;
  --velora-border-hsl: 32.308 22.807% 88.824%;
  --velora-fg-hsl: 240 6.329% 15.49%;
  --velora-fgMuted-hsl: 32 8.571% 34.314%;
  --velora-accent-hsl: 28.235 36.17% 36.863%;
  --velora-onAccent-hsl: 30 100% 99.216%;
  --velora-danger-hsl: 4.211 48.305% 46.275%;
  --velora-success-hsl: 147.097 35.227% 34.51%;
  --velora-warn-hsl: 33.871 63.918% 38.039%;
}

html[data-eriva-theme="dark"] { color-scheme: dark; }
html[data-eriva-theme="light"] { color-scheme: light; }

/* Action fills are distinct from the accent used for links and icons.
   Public roots resolve these aliases against their own inline brand colors. */
.velora-v2,
[data-booking-theme-root],
html[data-eriva-theme] {
  --velora-action: var(--velora-accent);
  --velora-actionHover: var(--velora-accentDim);
  --velora-onAction: var(--velora-bg);
  --velora-action-hsl: var(--velora-accent-hsl);
  --velora-onAction-hsl: var(--velora-bg-hsl);
}
html[data-eriva-theme] {
  --velora-onAction: var(--velora-onAccent);
  --velora-onAction-hsl: var(--velora-onAccent-hsl);
}
html[data-eriva-theme="light"] {
  --velora-actionHover: 66 111 0;
}
html[data-eriva-theme-mode="niche"][data-eriva-niche="beauty"] {
  --velora-actionHover: var(--velora-accentDim);
}
html[data-eriva-theme-mode="niche"][data-eriva-niche="training"] {
  --velora-action: 239 228 214;
  --velora-actionHover: 231 216 198;
  --velora-onAction: 37 37 42;
  --velora-action-hsl: 33.6 43.86% 88.824%;
  --velora-onAction-hsl: 240 6.329% 15.49%;
}
