/* Light and dark themes. Colours used across styles.css / app.css are variables defined here.
   (--bg-xxxxxx = a surface, --fg-xxxxxx = text on a tint, --bd-xxxxxx = a border; the name is the light value.) */
:root {
  --bg-98a2b3: #98a2b3;
  --bg-c5ccd6: #c5ccd6;
  --bg-ccfbef: #ccfbef;
  --bg-d0d5dd: #d0d5dd;
  --bg-d1fadf: #d1fadf;
  --bg-dcfae6: #dcfae6;
  --bg-e0eaff: #e0eaff;
  --bg-ecfdf3: #ecfdf3;
  --bg-ede9fe: #ede9fe;
  --bg-eef0f3: #eef0f3;
  --bg-eef1f5: #eef1f5;
  --bg-eef2ff: #eef2ff;
  --bg-eff4ff: #eff4ff;
  --bg-f0fdf9: #f0fdf9;
  --bg-f1f5f9: #f1f5f9;
  --bg-f2f4f7: #f2f4f7;
  --bg-f5f7fa: #f5f7fa;
  --bg-f5f8ff: #f5f8ff;
  --bg-f8fafc: #f8fafc;
  --bg-f8faff: #f8faff;
  --bg-f9fafb: #f9fafb;
  --bg-fafbfc: #fafbfc;
  --bg-fcfcfd: #fcfcfd;
  --bg-fde68a: #fde68a;
  --bg-fee4e2: #fee4e2;
  --bg-fef0c7: #fef0c7;
  --bg-fef3c7: #fef3c7;
  --bg-fef3f2: #fef3f2;
  --bg-fff: #fff;
  --bg-fff7ed: #fff7ed;
  --bg-fffaeb: #fffaeb;
  --bg-fffbeb: #fffbeb;
  --fg-05603a: #05603a;
  --fg-0a6b5e: #0a6b5e;
  --fg-0e9384: #0e9384;
  --fg-1d2939: #1d2939;
  --fg-344054: #344054;
  --fg-5b21b6: #5b21b6;
  --fg-78350f: #78350f;
  --fg-92400e: #92400e;
  --fg-93370d: #93370d;
  --fg-b42318: #b42318;
  --bd-98a2b3: #98a2b3;
  --bd-abefc6: #abefc6;
  --bd-b8c0cc: #b8c0cc;
  --bd-c7d7fe: #c7d7fe;
  --bd-d0d5dd: #d0d5dd;
  --bd-e4e7ec: #e4e7ec;
  --bd-f0f2f5: #f0f2f5;
  --bd-fcd34d: #fcd34d;
  --bd-fde68a: #fde68a;
  --bd-fedf89: #fedf89;
  --bd-fff: #fff;
  --ok-text: var(--ok);
  --warn-text: var(--warn);
  --danger-text: #b42318; /* darker than --danger so small red text passes AA on light red backgrounds */
  --camera-shade: rgba(16, 24, 40, .55); /* dims the camera picture outside the selfie oval */
  --camera-oval: #ffffff;
  --primary-text: var(--primary);
  --primary-dark-text: var(--primary-dark);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1621; --card: #17212d; --text: #e6edf3; --muted: #a3b3c2; --line: #2c3b4c;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.5);
  --bg-98a2b3: #5b6b7c;
  --bg-c5ccd6: #3a4a5c;
  --bg-ccfbef: #0f332e;
  --bg-d0d5dd: #3a4a5c;
  --bg-d1fadf: #12331f;
  --bg-dcfae6: #12331f;
  --bg-e0eaff: #21335a;
  --bg-ecfdf3: #102c1b;
  --bg-ede9fe: #2c2350;
  --bg-eef0f3: #243242;
  --bg-eef1f5: #243242;
  --bg-eef2ff: #1b2b4d;
  --bg-eff4ff: #1b2b4d;
  --bg-f0fdf9: #0e2a26;
  --bg-f1f5f9: #243242;
  --bg-f2f4f7: #243242;
  --bg-f5f7fa: #243242;
  --bg-f5f8ff: #1f2b3d;
  --bg-f8fafc: #1c2734;
  --bg-f8faff: #1c2734;
  --bg-f9fafb: #1f2b39;
  --bg-fafbfc: #1c2734;
  --bg-fcfcfd: #1c2734;
  --bg-fde68a: #5a4510;
  --bg-fee4e2: #42201c;
  --bg-fef0c7: #3d3010;
  --bg-fef3c7: #3d3010;
  --bg-fef3f2: #3a1c19;
  --bg-fff: #17212d;
  --bg-fff7ed: #38260f;
  --bg-fffaeb: #33290f;
  --bg-fffbeb: #33290f;
  --fg-05603a: #86e3ae;
  --fg-0a6b5e: #6ad9c8;
  --fg-0e9384: #6ad9c8;
  --fg-1d2939: #e6edf3;
  --fg-344054: #c9d3de;
  --fg-5b21b6: #c9bbff;
  --fg-78350f: #fde68a;
  --fg-92400e: #fcd34d;
  --fg-93370d: #fcd34d;
  --fg-b42318: #ff9d92;
  --bd-98a2b3: #5b6b7c;
  --bd-abefc6: #1f6b40;
  --bd-b8c0cc: #4a5a6c;
  --bd-c7d7fe: #33508f;
  --bd-d0d5dd: #3d4d60;
  --bd-e4e7ec: #2c3b4c;
  --bd-f0f2f5: #2c3b4c;
  --bd-fcd34d: #6b5416;
  --bd-fde68a: #6b5416;
  --bd-fedf89: #6b5416;
  --bd-fff: #17212d;
  --ok-text: #6ee7a0;
  --warn-text: #fbbf24;
  --danger-text: #ff9d92;
  --camera-shade: rgba(0, 0, 0, .6);
  --camera-oval: #e6edf3;
  --primary-text: #8ab4ff;
  --primary-dark-text: #a9c7ff;
}

/* Things that don't follow the general rules */
input, select, textarea { color: var(--text); }
.sig-card img { background: #fff; border-radius: 6px; }           /* signatures are dark ink on white "paper" */
html[data-theme="dark"] .sig-pad { background: #fff; }
html[data-theme="dark"] a, html[data-theme="dark"] button.link { color: var(--primary-text); }
html[data-theme="dark"] button.link.danger, html[data-theme="dark"] button.danger { color: var(--danger-text); }
html[data-theme="dark"] .sidebar a, html[data-theme="dark"] .login-brand a { color: #c9d8e4; }
html[data-theme="dark"] .btn, html[data-theme="dark"] a.btn { color: var(--text); }
html[data-theme="dark"] .btn.primary, html[data-theme="dark"] a.btn.primary, html[data-theme="dark"] button.primary { color: #fff; }
html[data-theme="dark"] button:hover, html[data-theme="dark"] .btn:hover { background: #243242; }
html[data-theme="dark"] button.primary:hover, html[data-theme="dark"] .btn.primary:hover { background: var(--primary-dark); }
html[data-theme="dark"] button.ghost:hover { background: rgba(255,255,255,.1); }
html[data-theme="dark"] .login, html[data-theme="dark"] .login-main { background: var(--bg); }
html[data-theme="dark"] .login-box { background: var(--card); }
html[data-theme="dark"] .toast { background: #2c3b4c; border: 1px solid #3d4d60; }
html[data-theme="dark"] .toast.err { background: #b42318; border-color: #b42318; }
html[data-theme="dark"] .notice { color: var(--text); }
html[data-theme="dark"] .modal-bg { background: rgba(0,0,0,.65); }
html[data-theme="dark"] input:focus, html[data-theme="dark"] select:focus, html[data-theme="dark"] textarea:focus { outline-color: #33508f; }
html[data-theme="dark"] :focus-visible { outline-color: #8ab4ff; }
html[data-theme="dark"] altcha-widget { --altcha-color-base: #17212d; --altcha-color-base-content: #e6edf3; --altcha-border-color: #3d4d60; --altcha-color-neutral: #243242; --altcha-color-neutral-content: #e6edf3; }
.theme-toggle .icon { width: 1.05rem; height: 1.05rem; }
@media print { html[data-theme="dark"] { color-scheme: light; --bg: #fff; --card: #fff; --text: #1d2330; --muted: #667085; --line: #e4e7ec; } }
html[data-theme="dark"] .pad-clear { color: #1546c4; }
html[data-theme="dark"] a.plain-light, html[data-theme="dark"] .portal-head a { color: #fff; }
.wizard-steps a, .wizard-steps a:hover { text-decoration: none; }
.theme-row { margin-top: 1.25rem; }
@media (max-width: 640px) {
  .portal-user .theme-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .portal-user .theme-toggle { padding: .35rem .6rem; }
}
altcha-widget .altcha a, altcha-widget .altcha-popover a { text-decoration: underline; text-underline-offset: 2px; } /* the widget removes underlines; links must not rely on colour alone */
