/* Dark theme (owner approved 2026-11-11). Loaded after fairbot.css + pages.css; everything is scoped to
   html[data-theme="dark"], which the script in base.html sets from the visitor's choice (header button) or, with no
   choice saved, from the system setting.
   New design colours: define them as tokens in fairbot.css and give them a dark value here. */

html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"] .fb {
  --fb-blue-dark: #6cb6ea;   /* text links: 7.6:1 on the page background */
  --fb-navy: #d3e6f6;        /* used as a text colour (brand, tags, burger) */
  --fb-green-dark: #5cc361;  /* text on dark ("Save 17%") */
  --fb-ink: #e3eaf1;
  --fb-muted: #9fb0c1;
  --fb-line: #2a3a4c;
  --fb-soft: #172230;
  --fb-bg: #0e1621;
  --fb-surface: #141e2a;
  --fb-tint: #1a3550;        /* replaces the light blue tints (#e3f0fa, #e8f2fa) */
  --fb-input: #101923;
  --fb-input-line: #3a4b5e;
  --fb-shadow: rgba(0, 0, 0, .45);
  background: var(--fb-bg);
}

/* ---------------------------------------------------------------- surfaces that were white */
html[data-theme="dark"] .fb-card,
html[data-theme="dark"] .fb-zoom,
html[data-theme="dark"] .fb-thumb,
html[data-theme="dark"] .fb-plan,
html[data-theme="dark"] .fb-ver,
html[data-theme="dark"] .fb-release-card,
html[data-theme="dark"] .fb-featured,
html[data-theme="dark"] .fb-newslist,
html[data-theme="dark"] .fb-date,
html[data-theme="dark"] .fb-article,
html[data-theme="dark"] .fb-stats,
html[data-theme="dark"] .fb-faq details,
html[data-theme="dark"] .fb-post-hero,
html[data-theme="dark"] .fb-post-list-panel,
html[data-theme="dark"] .fb-pager-step,
html[data-theme="dark"] .fb-btn-outline,
html[data-theme="dark"] .fb-nav-toggle { background-color: var(--fb-surface); }

/* soft shadows: navy shadows vanish on a dark page, black ones read as depth */
html[data-theme="dark"] .fb-plan,
html[data-theme="dark"] .fb-ver,
html[data-theme="dark"] .fb-featured,
html[data-theme="dark"] .fb-article,
html[data-theme="dark"] .fb-stats,
html[data-theme="dark"] .fb-post-hero,
html[data-theme="dark"] .fb-post-list-panel:not(.has-hero),
html[data-theme="dark"] .fb-form-card,
html[data-theme="dark"] .fb-nl-card,
html[data-theme="dark"] .fb-zoom,
html[data-theme="dark"] .fb-solo > .fb-renew-status,
html[data-theme="dark"] .fb-release.is-latest .fb-release-card { box-shadow: 0 16px 40px var(--fb-shadow); }
html[data-theme="dark"] a.fb-card:hover,
html[data-theme="dark"] .fb-thumb:hover { box-shadow: 0 10px 28px var(--fb-shadow); border-color: #3a4f66; }
html[data-theme="dark"] .fb-plan-featured { border-color: var(--fb-green); box-shadow: 0 16px 40px rgba(46, 158, 51, .22); }

/* light blue tints */
html[data-theme="dark"] .fb-card-icon,
html[data-theme="dark"] .fb-tags li,
html[data-theme="dark"] .fb-nav-links a.is-active,
html[data-theme="dark"] .fb .fb-main .fb-need,
html[data-theme="dark"] .fb .fb-tagchips a,
html[data-theme="dark"] .fb .fb-article-toc a.is-current { background-color: var(--fb-tint); }
html[data-theme="dark"] .fb-side-cta { background: linear-gradient(160deg, #183048, var(--fb-surface)); }
html[data-theme="dark"] .fb-ver-logo { background: var(--fb-soft); }
html[data-theme="dark"] .fb-post-hero-img { background: var(--fb-soft); }
html[data-theme="dark"] .fb .fb-tagchips a:hover,
html[data-theme="dark"] .fb .fb-tagchips a.is-active { background-color: var(--fb-blue); color: #fff; }

/* ---------------------------------------------------------------- blue bands: deeper, so they don't glare */
html[data-theme="dark"] .fb-announce { background: #0a2238; }
html[data-theme="dark"] .fb-hero { background: linear-gradient(180deg, #1b5f93 0%, #1b5f93 55%, #154a7a 100%); }
html[data-theme="dark"] .fb-page-head { background: linear-gradient(180deg, #1b5f93 0%, #1b5f93 55%, #154a7a 100%); }
html[data-theme="dark"] .fb-cta-band { background: linear-gradient(135deg, #154a7a, #0e2f50); }
html[data-theme="dark"] .fb-featured-ver { background: linear-gradient(160deg, #1b5f93, #0e2f50); }
html[data-theme="dark"] .fb-btn-ghost:hover { background: #fff; color: #0f3557; }

/* ---------------------------------------------------------------- header + footer */
html[data-theme="dark"] .fb-header { background: rgba(14, 22, 33, .97); }
@supports (backdrop-filter: blur(8px)) { html[data-theme="dark"] .fb-header { background: rgba(14, 22, 33, .85); } }
html[data-theme="dark"] .fb-header.is-scrolled { box-shadow: 0 6px 20px rgba(0, 0, 0, .5); }
html[data-theme="dark"] .fb-search input:focus { background: var(--fb-input); }
html[data-theme="dark"] .fb-footer { background: #0a1119; }
html[data-theme="dark"] .fb-footer-bottom { border-top-color: rgba(255, 255, 255, .08); }

/* ---------------------------------------------------------------- form fields */
html[data-theme="dark"] .fb-field input,
html[data-theme="dark"] .fb-field textarea,
html[data-theme="dark"] .fb-sub-form input,
html[data-theme="dark"] .fb-nl-form input { background: var(--fb-input); border-color: var(--fb-input-line); color: var(--fb-ink); }
html[data-theme="dark"] .fb-field input::placeholder,
html[data-theme="dark"] .fb-field textarea::placeholder,
html[data-theme="dark"] .fb-sub-form input::placeholder,
html[data-theme="dark"] .fb-nl-form input::placeholder { color: #6f7f90; }
html[data-theme="dark"] .fb-field input.is-invalid,
html[data-theme="dark"] .fb-field textarea.is-invalid,
html[data-theme="dark"] .fb-nl-form input.is-invalid { border-color: #e2685a; }
html[data-theme="dark"] .fb .fb-field small.fb-field-error,
html[data-theme="dark"] .fb .fb-field-error { color: #ff8f80; }

/* ---------------------------------------------------------------- small greys */
html[data-theme="dark"] .fb-pager-step.is-disabled,
html[data-theme="dark"] .fb-newslist-go { color: #4f5f70; }
html[data-theme="dark"] .fb-article-toc a::before { color: #66778a; }
html[data-theme="dark"] .fb-pay i { color: #8494a6; }
html[data-theme="dark"] .fb-pay-badge { background: #8494a6; color: #0e1621; }

/* ---------------------------------------------------------------- what's new */
html[data-theme="dark"] .fb-release-dot { background: var(--fb-bg); border-color: #3d5166; }
html[data-theme="dark"] .fb-release.is-latest .fb-release-dot { border-color: #3d5166; }
html[data-theme="dark"] .fb-release.is-latest .fb-release-card { border-color: #2f6b33; }
html[data-theme="dark"] .fb-chip-new { background: #173a1b; color: #8fdc93; }
html[data-theme="dark"] .fb .fb-pill-latest { background: #173a1b; color: #8fdc93; }
html[data-theme="dark"] .fb-chip-improved { background: #16324b; color: #8cc7f0; }
html[data-theme="dark"] .fb-chip-fix { background: #3d2610; color: #f5b77a; }
html[data-theme="dark"] .fb-chip-autopilot { background: #3b1730; color: #f19acb; }
html[data-theme="dark"] .fb-chip-automation { background: #2a1d45; color: #c3a6f2; }
html[data-theme="dark"] .fb-chip-minor,
html[data-theme="dark"] .fb-chip-plain { background: #232f3c; color: #a9b6c3; }

/* ---------------------------------------------------------------- renewal */
html[data-theme="dark"] .fb-renew-demo { background: #3a3210; color: #f0dc8a; }
html[data-theme="dark"] .fb-renew-demo code { background: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .fb-renew-status.is-grace,
html[data-theme="dark"] .fb-solo > .fb-renew-status.is-grace { background: #132619; border-color: #2a5530; }
html[data-theme="dark"] .fb-renew-status.is-grace .fb-card-icon { background: #1c3d22; }

/* ---------------------------------------------------------------- images */
/* Screenshots of the (light) Windows app stay as they are; dim them a touch so they don't flash. */
html[data-theme="dark"] .fb-zoom img,
html[data-theme="dark"] .fb-thumb img,
html[data-theme="dark"] .fb-prose img,
html[data-theme="dark"] .fb-post-card img,
html[data-theme="dark"] .fb-post-hero-img img { filter: brightness(.92); }

/* ---------------------------------------------------------------- old Drupal/Bootstrap 3 bits in stored content */
html[data-theme="dark"] .fb .btn-default { background: var(--fb-surface); border-color: var(--fb-input-line); color: var(--fb-ink); }
html[data-theme="dark"] .fb .table-responsive { border-color: var(--fb-line); }

/* ---------------------------------------------------------------- popups (flash messages) */
/* form results: the inline notice (pages.css) */
html[data-theme="dark"] .fb-notice-success { --fb-notice-bg: #13281a; --fb-notice-line: #2b5a33; --fb-notice-tile: #1d3f25; --fb-notice-accent: #8fdc93; }
html[data-theme="dark"] .fb-notice-error { --fb-notice-bg: #2c1714; --fb-notice-line: #6b2c26; --fb-notice-tile: #45211c; --fb-notice-accent: #ff8f80; }

/* ---------------------------------------------------------------- theme switch (header) */
.fb-theme-toggle { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  padding: 0; border: 1px solid var(--fb-line); border-radius: 8px; background: var(--fb-soft); color: var(--fb-ink);
  font-size: 16px; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.fb-theme-toggle:hover { color: var(--fb-blue-dark); border-color: var(--fb-blue); }
.fb-theme-toggle:focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }
/* The sun is our own SVG (a disc with straight rays): Font Awesome's sun has pointed rays that read as a badge. */
.fb-theme-toggle .fb-icon-sun { display: none; }
html[data-theme="dark"] .fb-theme-toggle .fb-icon-sun { display: block; }
html[data-theme="dark"] .fb-theme-toggle .fa-moon { display: none; }
@media (max-width: 991px) {
  /* brand · theme · burger on one row, the menu opens below */
  .fb-theme-toggle { order: 1; margin-left: auto; width: 44px; height: 44px; }
  .fb-header-bar > .fb-nav-toggle { order: 2; margin-left: 8px; }
  .fb-header-bar > .fb-nav { order: 3; }
}

/* Blog topics row in the blue head (phones/tablets): keep the translucent chips, not the dark tint. */
@media (max-width: 991px) {
  html[data-theme="dark"] .fb .fb-tagchips-strip a { background-color: rgba(255, 255, 255, .12); color: #fff; }
  html[data-theme="dark"] .fb .fb-tagchips-strip a:hover,
  html[data-theme="dark"] .fb .fb-tagchips-strip a.is-active { background-color: #fff; color: #10324f; }
}
