:root {
  color-scheme: light;
  --theme-bg: #fff;
  --theme-surface: #fff;
  --theme-soft: #f5f0e7;
  --theme-text: #5b3101;
  --theme-heading: #7d4606;
  --theme-accent: #813e03;
  --theme-header: #592b02;
  --theme-band: #c9b487;
  --theme-control-bg: #f5ebd8;
  --theme-control-text: #592b02;
  --theme-control-hover: #e7d6b5;
  --theme-gold: #db7314;
  --theme-border: #b69c70;
  --theme-focus: #2e7d32;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --theme-bg: #20170f;
  --theme-surface: #302219;
  --theme-soft: #38281d;
  --theme-text: #f0e3cc;
  --theme-heading: #f0d099;
  --theme-accent: #e8b86d;
  --theme-header: #1b110a;
  --theme-band: #3a2a1d;
  --theme-control-bg: #38281d;
  --theme-control-text: #f0e3cc;
  --theme-control-hover: #523a28;
  --theme-gold: #f4b65c;
  --theme-border: #927454;
  --theme-focus: #ffcf78;
  --background-color: var(--theme-bg);
  --default-color: var(--theme-text);
  --heading-color: var(--theme-heading);
  --accent-color: var(--theme-accent);
  --surface-color: var(--theme-surface);
  --contrast-color: #20170f;
  --text-color: var(--theme-text);
  --primary-color: var(--theme-header);
  --secondary-color: var(--theme-band);
  --light-color: var(--theme-soft);
  --border-color: var(--theme-border);
  --background-txt-color: var(--theme-text);
  --background-houver-btn-color: var(--theme-surface);
}

:root[data-theme="dark"] .light-background {
  --background-color: var(--theme-soft);
  --surface-color: var(--theme-surface);
}

:root[data-theme="dark"] .accent-background {
  --background-color: var(--theme-band);
  --default-color: var(--theme-text);
  --heading-color: var(--theme-heading);
}

:root[data-theme="dark"] .dark-background {
  --background-color: var(--theme-bg);
  --default-color: var(--theme-text);
  --heading-color: var(--theme-heading);
  --surface-color: var(--theme-surface);
  --contrast-color: #20170f;
}

:root[data-theme="dark"] .header { background-color: var(--theme-header); }
:root[data-theme="dark"] .navmenu a,
:root[data-theme="dark"] .navmenu a:focus { color: var(--theme-text); }
:root[data-theme="dark"] .navmenu li:hover > a,
:root[data-theme="dark"] .navmenu .active { color: var(--theme-heading); }
:root[data-theme] .right_col .section-title h2 { color: var(--heading-color); }
:root[data-theme="dark"] .header .cta-btn { background: var(--theme-heading); color: #20170f; }
:root[data-theme="dark"] .bg-principal { background-color: var(--theme-header); }
:root[data-theme="dark"] .news-ticker,
:root[data-theme="dark"] .call-to-action,
:root[data-theme="dark"] .call-to-action[style],
:root[data-theme="dark"] .serve[style] { background-color: var(--theme-band) !important; }
:root[data-theme="dark"] .container-texto-1 h2,
:root[data-theme="dark"] .container-texto-2 h2 { color: var(--theme-gold); }
:root[data-theme="dark"] .container-texto-1 button,
:root[data-theme="dark"] .container-texto-2 button { background: var(--theme-header); }
:root[data-theme="dark"] .container-texto-1 button a,
:root[data-theme="dark"] .container-texto-2 button a { color: var(--theme-text); }
:root[data-theme="dark"] .testimonials[style],
:root[data-theme="dark"] section[style*="background-color: #fff"],
:root[data-theme="dark"] section[style*="background-color: #f5f0e7"] { background-color: var(--theme-bg) !important; }
:root[data-theme="dark"] .faq .faq-item:hover { background-color: var(--theme-control-hover); }
:root[data-theme="dark"] .btn-faq,
:root[data-theme="dark"] .btn-orientacoes { background: var(--theme-heading); color: #20170f; }
:root[data-theme="dark"] .stats .stats-item { border: 1px solid var(--theme-border); }
:root[data-theme="dark"] .appointment .php-email-form input,
:root[data-theme="dark"] .appointment .php-email-form textarea,
:root[data-theme="dark"] .appointment .php-email-form select,
:root[data-theme="dark"] #cadastroForm input,
:root[data-theme="dark"] #cadastroForm select,
:root[data-theme="dark"] #cadastroForm textarea { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border); }
:root[data-theme="dark"] .appointment .php-email-form input::placeholder,
:root[data-theme="dark"] #cadastroForm input::placeholder { color: #c2ae92; }
:root[data-theme="dark"] #form-container { background: var(--theme-surface); }
:root[data-theme="dark"] #form-header h1,
:root[data-theme="dark"] .section-title,
:root[data-theme="dark"] .input-group label { color: var(--theme-heading); }
:root[data-theme="dark"] .serve,
:root[data-theme="dark"] .nao-serve,
:root[data-theme="dark"] #container-pode .p-3,
:root[data-theme="dark"] #container-nao-pode .p-3 { background-color: var(--theme-soft) !important; }
:root[data-theme="dark"] .texto-doacao,
:root[data-theme="dark"] #container-nao-pode .p-3 h3,
:root[data-theme="dark"] #container-nao-pode .p-3 p { color: var(--theme-text); }
:root[data-theme="dark"] .banner { background-color: var(--theme-band); }
:root[data-theme="dark"] :focus-visible { outline-color: var(--theme-focus) !important; }
:root[data-theme="dark"] .footer-logo,
:root[data-theme="dark"] .footer .rn-logo { background: #f5f0e7; border-radius: 6px; padding: 4px; }
:root[data-theme="dark"] .ticker-title,
:root[data-theme="dark"] .ticker-item { color: var(--theme-text); }
:root[data-theme="dark"] .privacy-page { background: var(--theme-bg); color: var(--theme-text); }
:root[data-theme="dark"] .privacy-page header { background: var(--theme-header); }
:root[data-theme="dark"] .privacy-page main { background: var(--theme-surface); }
:root[data-theme="dark"] .privacy-page h2,
:root[data-theme="dark"] .privacy-page a { color: var(--theme-heading); }
:root[data-theme="dark"] .privacy-page header a { color: var(--theme-text); }
:root[data-theme="dark"] .privacy-page .meta,
:root[data-theme="dark"] .privacy-page footer { color: #c2ae92; }
:root[data-theme="dark"] .privacy-page .destaque { background: var(--theme-soft); border-color: var(--theme-gold); }

.theme-controls {
  position: fixed;
  z-index: 2147483639;
  top: calc(50vh - 102px);
  right: 20px;
  width: 60px;
  height: 60px;
  transition: width .4s ease;
}
.theme-controls.is-open { width: 295px; }
.theme-controls button {
  border: 0;
  border-radius: 8px;
  font: 700 12px/1 Arial, sans-serif;
  cursor: pointer;
}
.theme-controls button:focus-visible,
.theme-panel:focus-visible { outline: 3px solid var(--theme-focus) !important; outline-offset: 2px; }
.theme-trigger {
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  color: #fff;
  background: #592b02;
  box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
  font-size: 27px !important;
}
.theme-trigger:hover { background: #813e03; }
.theme-panel {
  position: absolute;
  top: 0;
  right: 70px;
  box-sizing: border-box;
  width: 225px;
  height: 60px;
  border-radius: 8px;
  background: var(--theme-control-bg);
  color: var(--theme-control-text);
  box-shadow: 0 3px 12px rgb(0 0 0 / 20%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  clip-path: inset(0 0 0 100% round 8px);
  transition: opacity .4s ease, clip-path .4s ease, visibility 0s linear .4s;
}
.theme-controls.is-open .theme-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  clip-path: inset(0 0 0 0 round 8px);
  transition: opacity .4s ease, clip-path .4s ease, visibility 0s;
}
.theme-options { display: flex; align-items: center; justify-content: space-evenly; height: 100%; padding: 0 2px; }
.theme-options button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 2px 4px;
  color: var(--theme-control-text);
  background: transparent;
  gap: 2px;
}
.theme-options button span:first-child { font-size: 18px; }
.theme-options button:hover,
.theme-options button:focus-visible { background: var(--theme-control-hover); }
.theme-options button[aria-checked="true"] { box-shadow: inset 0 -3px var(--theme-control-text); }
.theme-announcement { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

:root[data-theme="dark"] .font-size-panel { background: var(--theme-control-bg); color: var(--theme-control-text); }
:root[data-theme="dark"] .font-size-actions button { color: var(--theme-control-text); }
:root[data-theme="dark"] .font-size-actions button:hover:not([aria-disabled="true"]),
:root[data-theme="dark"] .font-size-actions button:focus-visible { background: var(--theme-control-hover); }

@media (max-width: 768px), (max-height: 600px) {
  .theme-controls { top: calc(50vh - 85px); width: 44px; height: 50px; }
  .theme-controls.is-open { width: 242px; }
  .theme-trigger { top: 3px; width: 44px; height: 44px; font-size: 22px !important; }
  .theme-panel { right: 54px; width: 188px; height: 50px; }
  .theme-options button { font-size: 10px; padding: 2px; }
}
