/* Theme control and contrast support for secondary/legacy GovtSave pages. */
.gs-site-theme-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid #b9c8d7;
  border-radius: 999px;
  background: #ffffff;
  color: #162638;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .18);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.gs-site-theme-toggle:hover { transform: translateY(-1px); background: #f1f5f9; }
.gs-site-theme-toggle:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 3px; }
.gs-theme-symbol { font-size: 16px; line-height: 1; }
html.dark-mode .gs-site-theme-toggle {
  border-color: #526780;
  background: #172638;
  color: #f1f5f9;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .36);
}
html.dark-mode .gs-site-theme-toggle:hover { background: #22364d; }
html.dark-mode .gs-site-theme-toggle:focus-visible { outline-color: #7dd3fc; }

/* Light-mode account-recovery eyebrow meets normal text contrast. */
body.auth-page .auth-eyebrow { color: #76551f !important; }

/* Account recovery pages share the same contrast-safe dark palette. */
html.dark-mode body.auth-page {
  --auth-bg: #0b1524;
  --auth-card: #142438;
  --auth-text: #edf4fb;
  --auth-muted: #c1cede;
  --auth-border: #3a4f66;
  background: radial-gradient(ellipse at top left, #142c37 0, transparent 45%), #0b1524 !important;
  color: #edf4fb !important;
}
html.dark-mode body.auth-page .auth-card {
  background: #142438 !important;
  border-color: #3a4f66 !important;
  color: #eaf2fa !important;
  box-shadow: 0 20px 55px rgba(0, 0, 0, .28);
}
html.dark-mode body.auth-page .auth-card :is(h1, h2, h3, strong) { color: #f1f6fc !important; }
html.dark-mode body.auth-page .auth-card :is(.auth-lead, .auth-note, .auth-card form label, .helptext, ul:not(.errorlist)) {
  color: #c7d4e2 !important;
  opacity: 1 !important;
}
html.dark-mode body.auth-page .auth-card .auth-eyebrow { color: #f3d28f !important; }
html.dark-mode body.auth-page .auth-card a:not(.auth-brand):not(.auth-button) { color: #8de1c7 !important; }
html.dark-mode body.auth-page .auth-card input:not([type="checkbox"]):not([type="radio"]),
html.dark-mode body.auth-page .auth-card select,
html.dark-mode body.auth-page .auth-card textarea {
  background: #0d1b2c !important;
  border-color: #526780 !important;
  color: #f1f6fc !important;
  -webkit-text-fill-color: #f1f6fc !important;
}
html.dark-mode body.auth-page .auth-card input::placeholder,
html.dark-mode body.auth-page .auth-card textarea::placeholder { color: #bfccdb !important; opacity: 1 !important; }
html.dark-mode body.auth-page .auth-success-icon { background: #17382f; border-color: #2c6251; color: #8de1c7; }

/* Older login/register and password-confirm screens had fixed white surfaces. */
body.auth-legacy-page { color: #1b2d40; }
body.auth-legacy-page .card { border: 1px solid #d6e0e9; }
body.auth-legacy-page .card p, body.auth-legacy-page .card label { color: #33485e; }
body.auth-legacy-page .card .helptext, body.auth-legacy-page .card ul { color: #4b5f73; }
body.auth-legacy-page .card input, body.auth-legacy-page .card select, body.auth-legacy-page .card textarea {
  color: #172b3d;
  background: #fff;
  border-color: #b9c8d7;
}
body.auth-legacy-page .card a { color: #075f49; text-underline-offset: 3px; }
html.dark-mode body.auth-legacy-page {
  background: #0b1524 !important;
  color: #eaf2fa !important;
}
html.dark-mode body.auth-legacy-page .card {
  background: #142438 !important;
  border-color: #3a4f66 !important;
  color: #eaf2fa !important;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .3);
}
html.dark-mode body.auth-legacy-page .card :is(h1, h2, h3, strong) { color: #f1f6fc !important; }
html.dark-mode body.auth-legacy-page .card p,
html.dark-mode body.auth-legacy-page .card label,
html.dark-mode body.auth-legacy-page .card .helptext,
html.dark-mode body.auth-legacy-page .card ul {
  color: #c7d4e2 !important;
  opacity: 1 !important;
}
html.dark-mode body.auth-legacy-page .card a { color: #8de1c7 !important; }
html.dark-mode body.auth-legacy-page .card input,
html.dark-mode body.auth-legacy-page .card select,
html.dark-mode body.auth-legacy-page .card textarea {
  background: #0d1b2c !important;
  border-color: #526780 !important;
  color: #f1f6fc !important;
  -webkit-text-fill-color: #f1f6fc !important;
}
html.dark-mode body.auth-legacy-page .card input::placeholder { color: #bfccdb !important; }

/* The older saved-calculations dashboard used inline white card backgrounds. */
body.dashboard-page { color: #162638; }
html.dark-mode body.dashboard-page {
  background: #0b1524 !important;
  color: #eaf2fa !important;
}
html.dark-mode body.dashboard-page .container {
  background: #132237 !important;
  border-color: #3a4f66 !important;
  color: #eaf2fa !important;
}
html.dark-mode body.dashboard-page :is(.summary-card, .calculation, .input-summary, .input-chip, .empty-state, .calculation-header, details, .year-table-wrap) {
  background: #17283d !important;
  border-color: #3a4f66 !important;
  color: #eaf2fa !important;
}
html.dark-mode body.dashboard-page :is(h1, h2, h3, h4, p, strong, label, summary, td, th, .welcome, .muted, small) {
  color: #e5edf7 !important;
}
html.dark-mode body.dashboard-page :is(.muted, .welcome, .input-chip, .empty-state, .year-table td) { color: #c2cfdd !important; }
html.dark-mode body.dashboard-page a:not(.download-pdf-btn) { color: #8de1c7 !important; }
html.dark-mode body.dashboard-page .year-table th,
html.dark-mode body.dashboard-page .year-table td { border-color: #3a4f66 !important; }
html.dark-mode body.dashboard-page .download-pdf-btn { color: #fff !important; }

/* Secondary country guide pages inherit the same readable surface tokens. */
html.dark-mode body.market-detail-page .section { background: #0b1524; color: #e5edf7; }
html.dark-mode body.market-detail-page .guide-card {
  background: #142438 !important;
  border-color: #3a4f66 !important;
  color: #d8e4f0 !important;
}
html.dark-mode body.market-detail-page .guide-card :is(h1, h2, h3, h4, strong) { color: #f1f6fc !important; }
html.dark-mode body.market-detail-page .guide-card :is(p, li, span) { color: #c7d4e2; }
html.dark-mode body.market-detail-page .guide-card a { color: #8de1c7; }
html.dark-mode body.market-detail-page .guide-tag { color: #8de1c7; }
@media (max-width: 600px) {
  .gs-site-theme-toggle { right: 12px; bottom: 12px; min-height: 42px; padding: 9px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .gs-site-theme-toggle { transition: none; }
}

/* Final brand/accent contrast details. */
body.auth-page .auth-brand { color: #124c36 !important; }
body.auth-page .auth-brand em { color: #76551f !important; }
html.dark-mode body.auth-page .auth-brand { color: #edf4fb !important; }
html.dark-mode body.auth-page .auth-brand em { color: #8de1c7 !important; }
html.dark-mode body.market-detail-page .guide-card .guide-tag {
  border-color: #2c6251 !important;
  background: #183a32 !important;
  color: #8de1c7 !important;
}