/* Family Court theme — tokens for every court-facing surface: the website,
   eForms (plugin, Aailaa stage 3), Madhoshi, decks. Adopted 2026-11-06; grew
   out of the eForms palette adopted 2026-11-04 (Q36). Record: familycourt-theme.md.
   Token names match the eForms prototype's base.css so its CSS works unchanged.
   The source of truth is fc-eforms-project/design/; consumers hold copies. */

:root {
  /* Colour — light (the default; the public forms are light only) */
  --color-primary: #6d1a41;          /* the court plum: headers, buttons, links, focus */
  --color-primary-dark: #45122c;     /* hover, pressed, dark bands, footers */
  --color-primary-light: #f6ecf1;    /* tinted panels, selected rows, info boxes */
  --color-on-primary: #ffffff;       /* text on a primary fill */
  --color-accent: #a52056;           /* emphasis and calls to action apart from primary */
  --color-bg: #f7f4f6;               /* page background, warm off-white */
  --color-surface: #ffffff;          /* cards, inputs, tables */
  --color-text: #23131c;
  --color-text-secondary: #6b6069;   /* captions, help text, placeholders */
  --color-border: #e6dee2;           /* hairlines, input borders (decorative; focus uses primary) */
  --color-border-focus: #6d1a41;
  --color-error: #d32f2f;
  --color-error-bg: #fdecea;
  --color-success: #2e7d32;
  --color-warning: #f9a825;          /* dark text on it, never white */

  /* Type */
  --font-dv: "Faruma", "MV Faseyha", "Noto Sans Thaana", sans-serif;          /* Dhivehi body */
  --font-dv-display: "MV Waheed", "Faruma", "MV Faseyha", sans-serif;         /* Dhivehi headings, banners */
  --font-en: "Open Sans", "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;            /* reference codes, IDs */
  --text-base: calc(1 * var(--fc-rem));                 /* 16px; Thaana runs one step larger at the same role */
  --text-sm: calc(0.875 * var(--fc-rem));
  --text-lg: calc(1.125 * var(--fc-rem));
  --text-h3: calc(1.2 * var(--fc-rem));
  --text-h2: calc(1.5 * var(--fc-rem));
  --text-h1: calc(2 * var(--fc-rem));
  --leading: 1.5;
  --leading-dv: 1.9;                 /* Thaana needs more line height */

  /* Shape and space */
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
  --transition: 0.2s ease;
  --max-width: 880px;                /* reading width for forms and articles */
  --touch: 44px;                     /* minimum height of buttons and inputs */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px;

  /* Header bar. Public: white with plum text. The intranet block turns it solid plum. */
  --header-bg: #ffffff;
  --header-fg: #6d1a41;

  /* The court website's own chrome (theGem options, read from dev.familycourt.gov.mv
     2026-11-05). Reference only: the website keeps these neutrals around the forms;
     its link and menu plum (#580f41) moves to --color-primary. See the record. */
  --site-dark: #3c3950;
  --site-body: #5f727f;
  --site-muted: #99a9b5;
  --site-hover: #00bcd4;             /* hover highlight only, never text */
  --site-button: #b6c6c9;
  --site-border: #dfe5e8;
  --site-bg: #f1f2f4;
  --site-bg-alt: #f4f6f7;
  --site-menu-dark: #212331;
}

/* Intranet surface (Madhoshi) — opt in with data-surface="intranet" on <html>.
   Same plum, but cool neutrals, a teal accent the public site never uses,
   MV Utheemu for Thaana display, and a denser scale for staff on desktops.
   The header already names the intranet; no chip or marker is added.
   Contrast: teal on cool bg 5.3, white on teal 5.8, ink on cool bg 15.8,
   secondary on cool bg 5.6 (all AA or better). */
[data-surface="intranet"] {
  --color-accent: #00707a;           /* intranet accent: chips, "on" states, section numbers */
  --color-bg: #f3f4f6;               /* cool grey, Madhoshi's today */
  --color-text: #1a1a1a;
  --color-text-secondary: #5a6270;
  --color-border: #e3e5e8;
  --font-dv-display: "MV Utheemu", "Faruma", sans-serif;
  --text-base: calc(0.875 * var(--fc-rem));             /* 14px: denser for staff screens */
  --touch: 36px;
  --radius: 12px;                    /* Madhoshi's module cards */
  --max-width: 1100px;
  --header-bg: #6d1a41;              /* solid plum header bar: the intranet signature */
  --header-fg: #ffffff;
}

/* Dark — opt in with data-theme="dark" on <html> or any container (Madhoshi).
   The public forms never switch. Ratios in familycourt-theme.md. */
[data-theme="dark"] {
  --color-primary: #d78ab8;          /* links, outlines, focus on dark */
  --color-primary-dark: #6d1a41;     /* filled buttons and bands keep the court plum */
  --color-primary-light: #2a1f28;
  --color-on-primary: #23131c;       /* on a #d78ab8 fill; use white on a #6d1a41 fill */
  --color-accent: #e8a0c4;
  --color-bg: #191419;
  --color-surface: #211a20;
  --color-text: #ece5ea;
  --color-text-secondary: #a898a3;
  --color-border: #3a2f38;
  --color-border-focus: #d78ab8;
  --color-error: #ff7b7b;
  --color-error-bg: #3a1c1c;
  --color-success: #5fc97c;
  --color-warning: #f4b400;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.6);
}
