/* The two themes — the only file in the site that names a colour (V1 §18;
   tests/test_web_frontend.py fails on a colour literal anywhere else).

   Light is the main theme. Every page follows the reader's system theme
   until the switch is pressed (W8b8, Р-237: `data-sm-theme` on <html>, this
   browser's choice, put there by the server) — since W8b10 the public pages
   too, the landing and the way in (Р-237 as of 24.11.2026: Р-119's light
   public pages are retired). Accent: a deep blue, close to indigo; green is
   taken by success. In the dark theme shadows do not separate anything, so
   components separate by a border, and the semantic colours are their own
   values, not the light ones dimmed. */

:root {
  --sm-bg: #ffffff;
  --sm-surface: #f5f6fa;
  --sm-text: #1c2230;
  --sm-muted: #586174;
  --sm-border: #d8dbe5;
  --sm-accent: #3730a3;
  --sm-accent-hover: #2e2785;
  --sm-on-accent: #ffffff;
  --sm-danger: #b42318;
  --sm-danger-hover: #912018;
  --sm-on-danger: #ffffff;
  --sm-success: #067647;
  /* A caution, not a danger (W6a, Р-230): a message that looks like a contact. */
  --sm-warning: #b54708;
  --sm-focus: rgba(55, 48, 163, 0.35);
  /* W8b10: a checked box's and radio's mark, in the accent's own text colour
     (--sm-on-accent) — drawn by Bootstrap from an image, so the colour stands
     in the image, here. */
  --sm-check-mark: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
  --sm-radio-mark: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e");
}

/* The phone's dark theme — until the switch chooses light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-sm-theme="light"]) {
    --sm-bg: #12141c;
    --sm-surface: #1a1d28;
    --sm-text: #e6e8ef;
    --sm-muted: #a2a8b7;
    --sm-border: #2f3443;
    --sm-accent: #a5b4fc;
    --sm-accent-hover: #c7d2fe;
    --sm-on-accent: #12141c;
    --sm-danger: #f97066;
    --sm-danger-hover: #fda29b;
    --sm-on-danger: #12141c;
    --sm-success: #47cd89;
    --sm-warning: #fdb022;
    --sm-focus: rgba(165, 180, 252, 0.45);
    --sm-check-mark: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%2312141c' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
    --sm-radio-mark: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%2312141c'/%3e%3c/svg%3e");
  }
}

/* W8b8 (Р-237): the switch's dark, whatever the phone's — the same values,
   held equal to the block above by tests/test_theme.py. */
:root[data-sm-theme="dark"] {
  --sm-bg: #12141c;
  --sm-surface: #1a1d28;
  --sm-text: #e6e8ef;
  --sm-muted: #a2a8b7;
  --sm-border: #2f3443;
  --sm-accent: #a5b4fc;
  --sm-accent-hover: #c7d2fe;
  --sm-on-accent: #12141c;
  --sm-danger: #f97066;
  --sm-danger-hover: #fda29b;
  --sm-on-danger: #12141c;
  --sm-success: #47cd89;
  --sm-warning: #fdb022;
  --sm-focus: rgba(165, 180, 252, 0.45);
  --sm-check-mark: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%2312141c' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
  --sm-radio-mark: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%2312141c'/%3e%3c/svg%3e");
}
