/* =====================================================================
   MyCivic — Corporate Identity tokens (v1, 2026-06-09)
   Canonical brand colours, derived from the official decks + mycivic.eu.
   Spec: docs/BRAND.md.  Mobile apps reuse these token NAMES.
   Retires the EU palette (#003399 / #FFCC00) and the dark-editorial theme.
   ===================================================================== */
:root {
  /* 2026-09-27: values moved to the MyCivic brand palette (Civic Blue #1F4E79, slate, cloud, grey;
     teal = verified/on track, amber = watch/on site, red = overdue only). Token names unchanged. */
  /* ---- Brand ---- */
  --mc-navy:        #1F4E79;   /* primary: headings, primary buttons, brand bar */
  --mc-navy-deep:   #163A5C;   /* primary hover/active */
  --mc-blue:        #1F4E79;   /* interactive: links, primary actions */
  --mc-blue-logo:   #1F4E79;   /* logo, secondary headings */
  --mc-blue-bright: #2A6BA6;   /* focus ring, selected, data-viz primary */
  --mc-sky:         #BFD3E6;   /* light blue fills, chart bands */
  --mc-teal:        #2FA7A0;   /* accent: success/active/positive, citizen accent */
  --mc-teal-deep:   #1C7A73;   /* teal hover/active */
  --mc-on-blue:     #FFFFFF;   /* text/icons on a Civic Blue fill (ported from v0/essential) */

  /* ---- Neutrals (light) ---- */
  --mc-paper:       #F7F9FB;   /* app background */
  --mc-surface:     #FFFFFF;   /* cards, panels */
  --mc-surface-alt: #EEF2F6;   /* mint secondary surface */
  --mc-line:        #D9E1E8;   /* borders, dividers */
  --mc-line-strong: #B8C3CE;   /* input borders, strong dividers */
  --mc-ink:         #2F3A45;   /* primary text */
  --mc-ink-muted:   #5B6773;   /* secondary text, labels */
  --mc-ink-faint:   #8A96A3;   /* captions, disabled, placeholder */

  /* ---- Status: case lifecycle (maps to the up-to-11 statuses) ---- */
  --mc-st-new:       #1F4E79;  /* submitted / received */
  --mc-st-assigned:  #163A5C;  /* under review / assigned */
  --mc-st-progress:  #D9892B;  /* in progress */
  --mc-st-waiting:   #D9892B;  /* waiting — external */
  --mc-st-done:      #2FA7A0;  /* resolved / closed */
  --mc-st-alert:     #B8453B;  /* overdue / escalated */
  --mc-st-muted:     #8A96A3;  /* rejected / duplicate / none */

  /* ---- Diverging KPI scale (dashboards/charts) ---- */
  --mc-good:        #2FA7A0;
  --mc-attention:   #D9892B;
  --mc-warn:        #D9892B;
  --mc-breach:      #B8453B;
  --mc-none:        #8A96A3;

  /* ---- Six civic indices ---- */
  --mc-i-responsiveness: #155BA0;
  --mc-i-resolution:     #3E9B6B;
  --mc-i-speed:          #179E9F;
  --mc-i-recurrence:     #C9A24B;
  --mc-i-transparency:   #6AA9D6;
  --mc-i-trust:          #033661;

  /* ---- Service categories (12, tenant-customizable) ---- */
  --mc-c-roads:        #155BA0;
  --mc-c-water:        #179E9F;
  --mc-c-parks:        #3E9B6B;
  --mc-c-lighting:     #C9A24B;
  --mc-c-waste:        #9C8460;
  --mc-c-mobility:     #1E6BB8;
  --mc-c-publicspace:  #6AA9D6;
  --mc-c-environment:  #117B7C;
  --mc-c-hygiene:      #7FB0A0;
  --mc-c-safety:       #C5544A;
  --mc-c-democracy:    #5C6B8C;
  --mc-c-other:        #9AA5AE;

  /* ---- Type ---- */
  --mc-font-display: 'Inter Tight', 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mc-font-body:    'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mc-font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  /* ---- Shape ---- */
  --mc-radius:    10px;
  --mc-radius-sm: 6px;
  --mc-radius-lg: 14px;   /* ported from v0/essential: the slab's own glass tiles */
  --mc-radius-xl: 22px;   /* ported from v0/essential: the Civic Blue hero slab */
  --mc-shadow:    0 1px 2px rgba(31,78,121,.06), 0 4px 16px rgba(31,78,121,.06);
  --mc-ease:      cubic-bezier(.22, .61, .36, 1);   /* ported from v0/essential: the slab tiles' hover feel */

  /* ---- The Civic Blue hero slab (ported from v0/essential): text and tile colours ON the
     slab's own gradient, not on --ground, so they keep their own tokens rather than the page's
     ink/muted scale; theme-invariant like the slab itself. ---- */
  --mc-slab-eyebrow: #BFD6EA;   /* the slab's eyebrow line */
  --mc-slab-sub:      #DCE8F3;   /* the slab's caption, tile labels and side note */
  --mc-slab-bad:      #F4B4AB;   /* a slab tile's value when it counts something overdue */
  --mc-slab-ok:       #7FD6CF;   /* a slab tile's value when it counts something verified/on track */

  /* ---- Logo (set when operator supplies PNGs; see docs/BRAND.md §Logo) ---- */

  /* ---- AA text variants (2026-06-10 WCAG audit) — use for TEXT-SIZED ink on light
     surfaces; the parent tokens stay for fills/strokes/bands (1.4.11 only needs 3:1). ---- */
  --mc-good-text:       #1C7A73;   /* was --mc-good #3E9B6B (3.17:1 on paper) */
  --mc-attention-text:  #7A4A10;   /* was --mc-attention #C9A24B (2.21:1) */
  --mc-warn-text:       #7A4A10;   /* was --mc-warn #D98341 (2.67:1) */
  --mc-breach-text:     #8E2F27;   /* was --mc-breach #C5544A (4.09:1, large-only) */
  --mc-none-text:       #5B6773;   /* was --mc-none / ink-faint #9AA5AE (2.32:1) */
  --mc-teal-text:       #1C7A73;   /* was --mc-teal #179E9F (3.02:1) */
  --mc-blue-text:       #1F4E79;   /* = --mc-blue in light; split token so dark can ramp
                                      link/badge TEXT (#6FA8DC) while --mc-blue stays a fill */
  --mc-ink-muted-text:  #4A5663;   /* was --mc-ink-muted #66768D (4.27 on paper, 3.98 on
                                      surface-alt); 4.86/5.27/4.54 on paper/surface/surface-alt */
  --mc-sky-text:        #2F6A9A;   /* was --mc-sky / transparency #6AA9D6 (2.35:1) */
  --mc-i-resolution-text:     #327E57;
  --mc-i-speed-text:          #127D7E;
  --mc-i-recurrence-text:     #8A6C29;
  --mc-i-transparency-text:   #2F76A9;
  /* i-responsiveness (#155BA0) and i-trust (#033661) need no -text variant — they pass AA as-is. */
  --mc-c-waste-text:    #826E50;
  --mc-c-hygiene-text:  #4C7A6B;
}

/* ---- Brand mark image (MyCivic "C" mark, transparent PNG): replaces the lettered "M" badge.
   The badge's navy fill would hide the navy mark, so it is dropped; in dark theme the mark
   sits on a light rounded badge to keep contrast. The login card's teal dot is part of the mark. */
.mark-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.login-mark.has-img, .nav-brand .mark.has-img, .pp-brand .mark.has-img { background: transparent; padding: 0; }
.login-mark.has-img::after { display: none; }
html:not(.theme-light) .login-mark.has-img,
html:not(.theme-light) .nav-brand .mark.has-img,
html:not(.theme-light) .pp-brand .mark.has-img { background: #f5f2ea; padding: 3px; }

/* ---- Map basemap (OpenStreetMap tiles, see map-shared.js): muted in the light theme so report
   pins and heat stand out (close to the old CARTO light look); inverted for the dark theme. ---- */
.mc-osm-tiles { filter: saturate(0.45) brightness(1.04) contrast(0.95); }
html:not(.theme-light) .mc-osm-tiles { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9) saturate(0.35); }

/* Interface language switch (templates/partials/_lang_switch.html): a <details> disclosure that
   shows only the current language (MK / SQ / EN) in its summary; the other languages appear
   only inside the panel once opened. This is the base look for any page that does not load
   static/css/refresh.css (login, the citizen portal); shell.css restyles the shell top-bar
   version as a 36px pill + white card (Claude Design "App shell" handoff). */
.lang-menu { position: relative; display: inline-flex; margin: 0; flex: none; }
.lang-menu summary {
  display: inline-flex; align-items: center; gap: 4px; list-style: none; cursor: pointer;
  border: 1px solid var(--mc-line-strong); border-radius: 7px; padding: 5px 9px;
  font-family: var(--mc-font-mono); font-size: .75rem; letter-spacing: 0.06em; color: var(--mc-ink-muted-text);
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover { color: var(--mc-ink); }
.lang-menu .chev { width: 10px; height: 10px; transition: transform .15s; }
.lang-menu[open] .chev { transform: rotate(180deg); }
.lang-menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; margin: 0; min-width: 150px;
  display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: var(--mc-surface); border: 1px solid var(--mc-line); border-radius: 10px; box-shadow: var(--mc-shadow);
}
.lang-menu-panel button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; border: 0; background: transparent;
  cursor: pointer; padding: 6px 9px; border-radius: 6px; text-align: left;
}
.lang-menu-panel button:hover { background: var(--mc-surface-alt); }
.lang-menu-panel .code { font-family: var(--mc-font-mono); font-size: .72rem; font-weight: 700; letter-spacing: .05em; color: var(--mc-ink-muted-text); }
.lang-menu-panel .name { font-size: .82rem; color: var(--mc-ink); }
.lang-menu summary:focus-visible, .lang-menu-panel button:focus-visible {
  outline: none; box-shadow: 0 0 0 3px rgba(31, 78, 121, .22);
}
