/*
 * Fardowsa shared web layer.
 * Source of truth: ~/stacks/Brand/web — copied into each app as /brand/ by sync-brand.sh.
 * Everything here is prefixed --fd- / .fd- so it never collides with an app's own styles.
 * An app sets its accent with <html data-fd-product="finance"> (or overrides --fd-accent itself).
 */

/* fonts:start — generated by Brand/apply-fonts.py from Brand/fonts.json */
@font-face {
  font-family: "Quantico";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/quantico-latin-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Quantico";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/quantico-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Quantico";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/quantico-latin-700-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Quantico";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/quantico-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/space-grotesk-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/plus-jakarta-sans-latin-wght-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: italic;
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin-wght-italic.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
}
/* fonts:end */

:root {
  /* Colour roles follow the brand kit (Nocturne Alloy): Midnight Void background · Black Alloy depth/ink · Titanium Ice
     text · Steel Teal primary · Slate Blue interactive · Dusk Violet highlights · Oxide Copper energy/progress.
     Every colour token (--fardowsa-* master colours, --fd-* semantic tokens, and an --*-rgb channel twin of each for
     rgb(var(--x-rgb) / alpha)) comes from Brand/palette.json via Brand/apply-palette.py. */
  /* palette:start — generated by Brand/apply-palette.py from Brand/palette.json (dark scheme).
     Change colours in palette.json and run the script; edits here are overwritten. */
  --fardowsa-background: #090D11;
  --fardowsa-text: #E7ECEA;
  --fardowsa-primary: #6B8791;
  --fardowsa-interactive: #385D73;
  --fardowsa-highlight: #7C6A8F;
  --fardowsa-energy: #B06B5E;
  --fardowsa-ink: #080B0E;
  --fardowsa-parchment: #F3F5F4;
  --fardowsa-success: #73B6A3;
  --fardowsa-warning: #D6AC69;
  --fardowsa-danger: #D67979;
  --fardowsa-olive: var(--fardowsa-background);
  --fardowsa-obsidian: var(--fardowsa-ink);
  --fardowsa-juniper: var(--fardowsa-primary);
  --fardowsa-deep-teal: var(--fardowsa-interactive);
  --fardowsa-patina: var(--fardowsa-highlight);
  --fardowsa-ember-clay: var(--fardowsa-energy);
  --fardowsa-archery: #708A7A;
  --fardowsa-watch: #AA6E69;
  --fardowsa-cloud: #68A3B2;
  --fardowsa-finance: #A58C63;
  --fardowsa-flow: #4F8493;
  --fardowsa-habitat: #728577;
  --fardowsa-monitor: #52717A;
  --fardowsa-phani: #88729A;
  --fardowsa-talk: #99717C;
  --fardowsa-jobhunt: #6A759C;
  --fardowsa-egear: #8C8556;
  --fardowsa-bharat: #9B6B4E;
  --fardowsa-health: #4F9C87;
  --fd-bg: #090D11; --fd-bg-rgb: 9 13 17;
  --fd-bg-elev: #101418; --fd-bg-elev-rgb: 16 20 24;
  --fd-surface: #11171C; --fd-surface-rgb: 17 23 28;
  --fd-surface-2: #182127; --fd-surface-2-rgb: 24 33 39;
  --fd-sunken: #090D11; --fd-sunken-rgb: 9 13 17;
  --fd-well: #090C10; --fd-well-rgb: 9 12 16;
  --fd-line-solid: #29343B; --fd-line-solid-rgb: 41 52 59;
  --fd-text: #E7ECEA; --fd-text-rgb: 231 236 234;
  --fd-text-soft: #C0C8C8; --fd-text-soft-rgb: 192 200 200;
  --fd-muted: #99A5A7; --fd-muted-rgb: 153 165 167;
  --fd-faint: #6B6F70; --fd-faint-rgb: 107 111 112;
  --fd-primary: #6B8791; --fd-primary-rgb: 107 135 145;
  --fd-primary-hover: #77919A; --fd-primary-hover-rgb: 119 145 154;
  --fd-primary-ink: #080B0E; --fd-primary-ink-rgb: 8 11 14;
  --fd-primary-deep: #3A4950; --fd-primary-deep-rgb: 58 73 80;
  --fd-interactive: #385D73; --fd-interactive-rgb: 56 93 115;
  --fd-interactive-text: #7893A2; --fd-interactive-text-rgb: 120 147 162;
  --fd-highlight: #7C6A8F; --fd-highlight-rgb: 124 106 143;
  --fd-highlight-text: #9789A7; --fd-highlight-text-rgb: 151 137 167;
  --fd-energy: #B06B5E; --fd-energy-rgb: 176 107 94;
  --fd-energy-text: #BB8075; --fd-energy-text-rgb: 187 128 117;
  --fd-accent-text: #79939C; --fd-accent-text-rgb: 121 147 156;
  --fd-focus: #7893A2; --fd-focus-rgb: 120 147 162;
  --fd-success: #73B6A3; --fd-success-rgb: 115 182 163;
  --fd-warning: #D6AC69; --fd-warning-rgb: 214 172 105;
  --fd-danger: #D67979; --fd-danger-rgb: 214 121 121;
  --fd-ink: #080B0E; --fd-ink-rgb: 8 11 14;
  --fd-chart-1: #3690BF; --fd-chart-1-rgb: 54 144 191;
  --fd-chart-2: #B65C4C; --fd-chart-2-rgb: 182 92 76;
  --fd-chart-3: #38A48B; --fd-chart-3-rgb: 56 164 139;
  --fd-chart-4: #936CB8; --fd-chart-4-rgb: 147 108 184;
  --fd-chart-5: #B7893B; --fd-chart-5-rgb: 183 137 59;
  --fd-chart-6: #B25976; --fd-chart-6-rgb: 178 89 118;
  --fd-chart-7: #6AAED5; --fd-chart-7-rgb: 106 174 213;
  --fd-chart-8: #CE8071; --fd-chart-8-rgb: 206 128 113;
  --fd-chart-9: #71C0AA; --fd-chart-9-rgb: 113 192 170;
  --fd-chart-10: #AF8ECF; --fd-chart-10-rgb: 175 142 207;
  --fd-chart-11: #D1AA6E; --fd-chart-11-rgb: 209 170 110;
  --fd-chart-12: #CB7D94; --fd-chart-12-rgb: 203 125 148;
  --fd-chart-other: #606B6F; --fd-chart-other-rgb: 96 107 111;
  --fd-bg-rgbc: 9, 13, 17;   /* comma form for apps that need it */
  --fd-line: rgb(231 236 234 / 0.12);
  --fd-line-strong: rgb(231 236 234 / 0.22);
  --fd-accent: var(--fd-primary);
  --fd-accent-ink: var(--fd-primary-ink);
  --fd-accent-soft: rgb(107 135 145 / 0.25);
  --fd-header: rgb(16 20 24 / 0.92);   /* sticky, blurred top bars */
  --fd-shadow: 0 12px 32px -16px rgb(8 11 14 / 0.55);
  /* palette:end */


  /* Type, four roles (Brand/fonts.json): display = main headings, heading = section headings, card titles and
     product names, ui = body text, mono = figures. Change them there and run apply-fonts.py. */
  /* font-roles:start — generated by Brand/apply-fonts.py from Brand/fonts.json */
  --fardowsa-font-display: "Quantico", "Space Grotesk", Georgia, serif;
  --fardowsa-font-heading: "Space Grotesk", "Plus Jakarta Sans", Arial, sans-serif;
  --fardowsa-font-ui: "Plus Jakarta Sans", Arial, Helvetica, sans-serif;
  --fardowsa-font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fardowsa-font-editorial: var(--fardowsa-font-heading);   /* the older name for the heading face */
  /* font-roles:end */
  --fardowsa-radius-sm: 8px;
  --fardowsa-radius-md: 14px;
  --fardowsa-radius-lg: 24px;
}

/* Frost White surface (print, documentation) — opt in with <html data-fd-theme="light"> */
[data-fd-theme="light"] {
  /* palette-light:start — generated by Brand/apply-palette.py from palette.json. */
  --fd-bg: #F3F5F4;
  --fd-bg-elev: #FAFBFB;
  --fd-surface: #FFFFFF;
  --fd-surface-2: #E7E9E8;
  --fd-text: #080B0E;
  --fd-muted: #66696A;
  --fd-faint: #87898A;
  --fd-accent-text: #566C74;
  --fd-interactive-text: #385D73;
  --fd-highlight-text: #736284;
  --fd-energy-text: #99574B;
  --fd-focus: #385D73;
  --fd-success: #407B6A;
  --fd-warning: #916928;
  --fd-danger: #C54242;
  --fd-chart-1: #007BAD;
  --fd-chart-2: #AA4A3A;
  --fd-chart-3: #018F76;
  --fd-chart-4: #7C52A3;
  --fd-chart-5: #AD7C1D;
  --fd-chart-6: #AC5371;
  --fd-chart-other: #8B9497;
  --fd-line: rgb(8 11 14 / 0.10);
  --fd-line-strong: rgb(8 11 14 / 0.20);
  --fd-shadow: 0 12px 32px -18px rgb(8 11 14 / 0.30);
  /* palette-light:end */
}

[data-fd-product="archery"] { --fd-product: var(--fardowsa-archery); }
[data-fd-product="watch"]   { --fd-product: var(--fardowsa-watch); }
[data-fd-product="cloud"]   { --fd-product: var(--fardowsa-cloud); }
[data-fd-product="finance"] { --fd-product: var(--fardowsa-finance); }
[data-fd-product="flow"]    { --fd-product: var(--fardowsa-flow); }
[data-fd-product="habitat"] { --fd-product: var(--fardowsa-habitat); }
[data-fd-product="monitor"] { --fd-product: var(--fardowsa-monitor); }
[data-fd-product="phani"]   { --fd-product: var(--fardowsa-phani); }
[data-fd-product="talk"]    { --fd-product: var(--fardowsa-talk); }
[data-fd-product="jobhunt"] { --fd-product: var(--fardowsa-jobhunt); }
[data-fd-product="egear"]   { --fd-product: var(--fardowsa-egear); }
[data-fd-product="bharat"]   { --fd-product: var(--fardowsa-bharat); }

/* ---------- Lockup ----------
   Product:  [symbol] FARDOWSA (wordmark, small) over "Finance" (Space Grotesk)
   Phani:    [symbol] "Phani" over "by Fardowsa"
   Master:   [symbol] FARDOWSA (wordmark, large)                                   */

.fd-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--fd-text);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.fd-lockup-symbol { width: 30px; height: 30px; flex: none; display: block; }
.fd-lockup-text { display: grid; gap: 5px; justify-items: start; }
.fd-lockup-wordmark { display: block; height: 8px; width: auto; }
.fd-lockup-product {
  font-family: var(--fardowsa-font-editorial);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1;
}
.fd-lockup-by {
  font-family: var(--fardowsa-font-editorial);
  font-size: 11px;
  color: var(--fd-muted);
}
.fd-lockup--master .fd-lockup-wordmark { height: 13px; }
.fd-lockup--master .fd-lockup-symbol { width: 28px; height: 28px; }

/* ---------- Brand details from the board ---------- */

.fd-eyebrow {
  font: 600 11px/1.3 var(--fardowsa-font-ui);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fd-muted);
}
.fd-rule { display: block; width: 32px; height: 2px; border: 0; margin: 16px 0; background: var(--fd-energy); }
.fd-display { font-family: var(--fardowsa-font-display); font-weight: 400; letter-spacing: 0.01em; }
.fd-heading { font-family: var(--fardowsa-font-heading); font-weight: 500; letter-spacing: -0.01em; }
/* Figures: even-width digits so amounts, scores and readings line up. */
.fd-num { font-family: var(--fardowsa-font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ---------- Header actions: user + app switcher ---------- */

.fd-actions { display: inline-flex; align-items: center; gap: 8px; }

.fd-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 13px/1 var(--fardowsa-font-ui);
  color: var(--fd-muted);
}
.fd-user[hidden] { display: none; }
.fd-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--fd-surface-2);
  border: 1px solid var(--fd-line-strong);
  color: var(--fd-text);
  font-weight: 600;
  font-size: 12px;
}
.fd-user a { color: var(--fd-muted); text-decoration: none; }
.fd-user a:hover { color: var(--fd-text); }
@media (max-width: 560px) { .fd-user-name { display: none; } }

.fd-switcher { position: relative; display: inline-block; }
.fd-switcher-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--fardowsa-radius-sm);
  background: transparent;
  color: var(--fd-muted);
  cursor: pointer;
}
.fd-switcher-button:hover,
.fd-switcher-button[aria-expanded="true"] {
  color: var(--fd-text);
  background: var(--fd-surface-2);
  border-color: var(--fd-line);
}
.fd-switcher-button:focus-visible,
.fd-switcher-item:focus-visible { outline: 2px solid var(--fd-focus); outline-offset: 2px; }
.fd-switcher-button svg { width: 18px; height: 18px; display: block; }

.fd-switcher-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10000;
  width: min(420px, calc(100vw - 32px));
  padding: 10px;
  border: 1px solid var(--fd-line-strong);
  border-radius: var(--fardowsa-radius-md);
  background: var(--fd-bg-elev);
  box-shadow: var(--fd-shadow);
  font-family: var(--fardowsa-font-ui);
  text-align: left;
}
.fd-switcher-panel[hidden] { display: none; }
.fd-switcher-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 8px 10px;
  border-bottom: 1px solid var(--fd-line);
  margin-bottom: 6px;
}
.fd-switcher-wordmark { display: block; height: 10px; width: auto; }
.fd-switcher-head a { font-size: 12px; color: var(--fd-energy-text); text-decoration: none; }
.fd-switcher-head a:hover { text-decoration: underline; }
.fd-switcher-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.fd-switcher-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px;
  border-radius: var(--fardowsa-radius-sm);
  color: var(--fd-text);
  text-decoration: none;
  min-width: 0;
}
.fd-switcher-item:hover { background: var(--fd-surface-2); }
.fd-switcher-item[aria-current="page"] { background: rgb(var(--fd-interactive-rgb) / 0.55); }
.fd-switcher-item img { width: 30px; height: 30px; flex: none; border-radius: 22%; }
.fd-switcher-item span { display: grid; min-width: 0; }
.fd-switcher-item b { font-size: 13px; font-weight: 600; }
.fd-switcher-item small {
  font-size: 11px;
  line-height: 1.35;
  color: var(--fd-muted);
}

/* ---------- Footer ---------- */

.fd-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
  padding: 20px clamp(16px, 4vw, 40px);
  border-top: 1px solid var(--fd-line);
  color: var(--fd-faint);
  font: 400 12px/1.5 var(--fardowsa-font-ui);
}
.fd-footer a { color: var(--fd-muted); text-decoration: none; }
.fd-footer a:hover { color: var(--fd-text); }
.fd-footer-brand { display: inline-flex; align-items: center; gap: 10px; }
.fd-footer-wordmark { display: block; height: 8px; width: auto; opacity: .85; }
.fd-footer-brand > img:first-child { width: 16px; height: 16px; }
.fd-footer-tagline { font-family: var(--fardowsa-font-heading); }

/* ---------- Banner (Home → Admin → Messages) ---------- */
.fd-banner {
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 9px 44px 9px 16px;
  font: 500 14px/1.4 var(--fardowsa-font-ui);
  color: var(--fd-text);
  text-align: center;
}
.fd-banner-info { background: rgb(var(--fd-interactive-rgb) / 0.55); border-bottom: 1px solid rgb(var(--fd-interactive-text-rgb) / 0.4); }
.fd-banner-warn { background: rgb(var(--fd-energy-rgb) / 0.45); border-bottom: 1px solid rgb(var(--fd-energy-text-rgb) / 0.45); }
.fd-banner-close {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.fd-banner-close:hover { background: rgb(var(--fd-text-rgb) / 0.1); }
