/* Aparências globais da Emilia: Padrão, Escuro e Claro. */
html[data-emilia-theme="standard"] {
  color-scheme: dark;
  --bg-deep: #0c0a17;
  --bg: #0c0a17;
  --bg-panel: #161029;
  --bg-panel-2: #1d1638;
  --frost: #b9a6ff;
  --ice: #8fd3f4;
  --text: #f1eefb;
  --text-muted: #a99fc4;
  --line: rgba(185, 166, 255, .18);
  --panel: rgba(255, 255, 255, .045);
  --panel-2: rgba(255, 255, 255, .075);
  --muted: #a79ec4;
  --bg1: #0b0713;
  --bg2: #1a0b2e;
  --tx: #f5efff;
  --mut: #b9accf;
  --rosa: #ff5e93;
  --roxo: #a855f7;
  --ouro: #fbbf24;
  --em-bg: #0c0a17;
  --em-panel: #161029;
  --em-frost: #b9a6ff;
  --em-ice: #8fd3f4;
  --em-text: #f1eefb;
  --em-muted: #a99fc4;
  --em-line: rgba(185, 166, 255, .18);
  --fg: #f1eefb;
  --muted-fg: #a99fc4;
  --background: #0c0a17;
  --foreground: #f1eefb;
  --card: #161029;
  --card-foreground: #f1eefb;
  --muted-foreground: #a99fc4;
  --border: rgba(185, 166, 255, .18);
  --input: #161029;
  --primary: #b9a6ff;
  --primary-foreground: #171029;
  --accent: #8fd3f4;
  --accent-foreground: #101725;
  --ring: #b9a6ff;
  --theme-glow-a: rgba(185, 166, 255, .2);
  --theme-glow-b: rgba(143, 211, 244, .12);
}

html[data-emilia-theme="dark"] {
  color-scheme: dark;
  --bg-deep: #080c12;
  --bg: #080c12;
  --bg-panel: #101821;
  --bg-panel-2: #17232e;
  --frost: #73d5d9;
  --ice: #8fa9ff;
  --text: #edf4f7;
  --text-muted: #9eafba;
  --line: rgba(115, 213, 217, .17);
  --panel: rgba(232, 245, 250, .045);
  --panel-2: rgba(232, 245, 250, .075);
  --muted: #9eafba;
  --bg1: #070b10;
  --bg2: #111b24;
  --tx: #edf4f7;
  --mut: #9eafba;
  --rosa: #73d5d9;
  --roxo: #8fa9ff;
  --ouro: #c4d7df;
  --em-bg: #080c12;
  --em-panel: #101821;
  --em-frost: #73d5d9;
  --em-ice: #8fa9ff;
  --em-text: #edf4f7;
  --em-muted: #9eafba;
  --em-line: rgba(115, 213, 217, .17);
  --fg: #edf4f7;
  --muted-fg: #9eafba;
  --background: #080c12;
  --foreground: #edf4f7;
  --card: #101821;
  --card-foreground: #edf4f7;
  --muted-foreground: #9eafba;
  --border: rgba(115, 213, 217, .17);
  --input: #101821;
  --primary: #73d5d9;
  --primary-foreground: #071116;
  --accent: #8fa9ff;
  --accent-foreground: #0b1020;
  --ring: #73d5d9;
  --theme-glow-a: rgba(77, 190, 196, .13);
  --theme-glow-b: rgba(95, 126, 220, .11);
}

html[data-emilia-theme="light"] {
  color-scheme: light;
  --bg-deep: #f4f2f8;
  --bg: #f4f2f8;
  --bg-panel: #ffffff;
  --bg-panel-2: #eeeaf5;
  --frost: #6e51ca;
  --ice: #087f9e;
  --text: #241e30;
  --text-muted: #675f72;
  --line: rgba(65, 49, 91, .16);
  --panel: rgba(255, 255, 255, .84);
  --panel-2: rgba(255, 255, 255, .98);
  --muted: #675f72;
  --bg1: #f5f1fa;
  --bg2: #e9e3f2;
  --tx: #241e30;
  --mut: #675f72;
  --rosa: #8b5cf6;
  --roxo: #6e51ca;
  --ouro: #a46311;
  --em-bg: #f4f2f8;
  --em-panel: #ffffff;
  --em-frost: #6e51ca;
  --em-ice: #087f9e;
  --em-text: #241e30;
  --em-muted: #675f72;
  --em-line: rgba(65, 49, 91, .16);
  --fg: #241e30;
  --muted-fg: #675f72;
  --background: #f4f2f8;
  --foreground: #241e30;
  --card: #ffffff;
  --card-foreground: #241e30;
  --muted-foreground: #675f72;
  --border: rgba(65, 49, 91, .16);
  --input: #ffffff;
  --primary: #6e51ca;
  --primary-foreground: #ffffff;
  --accent: #087f9e;
  --accent-foreground: #ffffff;
  --ring: #6e51ca;
  --theme-glow-a: rgba(110, 81, 202, .12);
  --theme-glow-b: rgba(8, 127, 158, .09);
}

html[data-emilia-theme] {
  background:
    radial-gradient(ellipse 68% 44% at 8% 0%, var(--theme-glow-a), transparent 58%),
    radial-gradient(ellipse 58% 42% at 96% 12%, var(--theme-glow-b), transparent 58%),
    radial-gradient(ellipse 58% 44% at 50% 105%, var(--theme-glow-a), transparent 62%),
    var(--bg-deep) !important;
  background-attachment: fixed !important;
}

html[data-emilia-theme] body {
  color: var(--text);
}
html[data-emilia-theme] header {
  background: color-mix(in srgb, var(--bg-deep) 86%, transparent) !important;
  border-color: var(--line) !important;
}
html[data-emilia-theme] .site-menu {
  background: linear-gradient(180deg, var(--bg-panel-2), var(--bg-panel)) !important;
  border-color: var(--line) !important;
}
html[data-emilia-theme] .site-menu-list a:hover,
html[data-emilia-theme] .menu-btn:hover {
  background: color-mix(in srgb, var(--frost) 12%, transparent) !important;
  border-color: var(--line) !important;
}



/* Painel React: acabamento padrão nos temas disponíveis. */
html[data-emilia-theme] .emilia-panel-v3 {
  background:
    radial-gradient(ellipse at 85% 0%, color-mix(in srgb, var(--em-ice) 9%, transparent), transparent 34rem),
    linear-gradient(150deg, var(--em-panel), var(--em-bg) 68%) !important;
html[data-emilia-theme] .emilia-side,
html[data-emilia-theme] .emilia-side-top {
  background: color-mix(in srgb, var(--em-panel) 94%, transparent) !important;
  border-color: var(--em-line) !important;
}
html[data-emilia-theme] .emilia-nav-item:hover {
  background: color-mix(in srgb, var(--em-frost) 10%, transparent) !important;
}
html[data-emilia-theme] .emilia-nav-item.is-active {
  background: linear-gradient(110deg,
    color-mix(in srgb, var(--em-frost) 19%, transparent),
    color-mix(in srgb, var(--em-ice) 14%, transparent)) !important;
  border-color: var(--em-line) !important;
}
html[data-emilia-theme] .emilia-hamb {
  background: var(--em-panel) !important;
  color: var(--em-text) !important;
  border-color: var(--em-line) !important;
}
html[data-emilia-theme] .emilia-nav-badge {
  background: color-mix(in srgb, var(--em-frost) 17%, var(--em-panel)) !important;
  color: var(--em-frost) !important;
  border-color: var(--em-line) !important;
}
html[data-emilia-theme] .emilia-main {
  background: color-mix(in srgb, var(--em-bg) 72%, transparent) !important;
}
html[data-emilia-theme] .emilia-panel-head { border-color: var(--em-line) !important; }
html[data-emilia-theme] .emilia-config-card,
html[data-emilia-theme] .emilia-card,
html[data-emilia-theme] .emilia-section-card,
html[data-emilia-theme] .emilia-mod-block {
  background: linear-gradient(155deg,
    color-mix(in srgb, var(--em-frost) 7%, var(--em-panel)),
    var(--em-panel) 58%, var(--em-bg)) !important;
  border-color: var(--em-line) !important;
  color: var(--em-text) !important;
}
html[data-emilia-theme] .emilia-field,
html[data-emilia-theme] .emilia-sub,
html[data-emilia-theme] .emilia-nav-item,
html[data-emilia-theme] .emilia-brand strong,
html[data-emilia-theme] .emilia-card-title h2,
html[data-emilia-theme] .emilia-field > span { color: var(--em-text) !important; }
html[data-emilia-theme] .emilia-brand small,
html[data-emilia-theme] .emilia-card-title p,
html[data-emilia-theme] .emilia-hint,
html[data-emilia-theme] .emilia-head-desc,
html[data-emilia-theme] .emilia-info-list,
html[data-emilia-theme] .emilia-nav-icon { color: var(--em-muted) !important; }
html[data-emilia-theme] .emilia-input,
html[data-emilia-theme] .emilia-select,
html[data-emilia-theme] .emilia-textarea,
html[data-emilia-theme] .emilia-multiselect {
  background-color: var(--em-bg) !important;
  color: var(--em-text) !important;
  border-color: var(--em-line) !important;
}
html[data-emilia-theme] .emilia-select option,
html[data-emilia-theme] .emilia-select optgroup {
  background: var(--em-panel) !important;
  color: var(--em-text) !important;
}
html[data-emilia-theme] .emilia-head-title {
  background: linear-gradient(90deg, var(--em-frost), var(--em-ice)) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
}
html[data-emilia-theme] .emilia-back,
html[data-emilia-theme] .emilia-crumb.is-current { border-color: var(--em-line) !important; }
html[data-emilia-theme] .emilia-back:hover,
html[data-emilia-theme] .emilia-crumb:hover {
  background: color-mix(in srgb, var(--em-frost) 9%, transparent) !important;
}
html[data-emilia-theme] .emilia-select,
html[data-emilia-theme] .emilia-select-search,
html[data-emilia-theme] .emilia-dual-chan input,
html[data-emilia-theme] .emilia-dual-chan select {
  border-color: var(--em-line) !important;
}
html[data-emilia-theme] .emilia-select:focus,
html[data-emilia-theme] .emilia-select-search:focus,
html[data-emilia-theme] .emilia-dual-chan input:focus,
html[data-emilia-theme] .emilia-dual-chan select:focus {
  border-color: var(--em-frost) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--em-frost) 18%, transparent) !important;
}
html[data-emilia-theme] .rounded-xl.border.bg-card,
html[data-emilia-theme] [class*="rounded-xl"][class*="border"][class*="bg-card"] {
  background: linear-gradient(155deg,
    color-mix(in srgb, var(--em-frost) 10%, var(--em-panel)),
    var(--em-panel) 58%, var(--em-bg)) !important;
  border-color: var(--em-line) !important;
}

/* Menus, campos e texto do seletor acompanham o tema em todas as páginas. */
#langBtn,
#themeBtn {
  color: var(--text) !important;
  border-color: var(--line) !important;
  background: color-mix(in srgb, var(--bg-panel) 88%, transparent) !important;
  backdrop-filter: blur(12px) saturate(1.2);
}
#langBtn:hover,
#themeBtn:hover { border-color: var(--frost) !important; }
#themeBtn {
  position: fixed;
  left: 146px;
  bottom: 14px;
  z-index: 10001;
  min-width: 78px;
  height: 38px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font: 800 12px 'Manrope', system-ui, sans-serif;
  letter-spacing: .02em;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .24);
  transition: transform .18s, border-color .18s, background .18s;
}
#themeBtn:hover { transform: translateY(-2px); }
#themeBtn:focus-visible,
#emiliaThemeMenu button:focus-visible {
  outline: 2px solid var(--frost);
  outline-offset: 3px;
}
#emiliaThemeMenu[hidden] { display: none !important; }
#emiliaThemeMenu {
  position: fixed;
  left: 14px;
  bottom: 62px;
  z-index: 10002;
  width: min(310px, calc(100vw - 28px));
  padding: 15px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(155deg, var(--bg-panel-2), var(--bg-panel));
  box-shadow: 0 20px 55px rgba(0, 0, 0, .38);
  backdrop-filter: blur(18px) saturate(1.25);
  font: 500 13px 'Manrope', system-ui, sans-serif;
}
.em-theme-head {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.em-theme-head strong { color: var(--text); font-size: 14px; font-weight: 800; }
.em-theme-close {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.em-theme-close::before { content: "×"; }
.em-theme-options { display: grid; gap: 6px; }
.em-theme-options button,
.em-theme-sound {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: background .16s, border-color .16s, transform .16s;
}
.em-theme-options button:hover,
.em-theme-sound:hover {
  background: var(--panel);
  border-color: var(--line);
}
.em-theme-options button.selected {
  background: color-mix(in srgb, var(--frost) 13%, transparent);
  border-color: color-mix(in srgb, var(--frost) 48%, transparent);
}
.em-theme-icon,
.em-theme-sound-icon { width: 24px; flex: none; text-align: center; font-size: 17px; }
.em-theme-name,
.em-theme-sound-name { flex: 1; font-weight: 700; }
.em-theme-check { width: 18px; color: var(--frost); font-weight: 900; text-align: center; }
.em-theme-separator { height: 1px; margin: 10px 2px; background: var(--line); }
.em-theme-sound-state {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
}
.em-theme-sound[aria-pressed="true"] .em-theme-sound-state {
  color: var(--frost);
  border-color: color-mix(in srgb, var(--frost) 45%, transparent);
  background: color-mix(in srgb, var(--frost) 12%, transparent);
}
#langOverlay {
  background: color-mix(in srgb, var(--bg-deep) 82%, transparent) !important;
}
#langOverlay .lang-box {
  color: var(--text) !important;
  border-color: var(--line) !important;
  background: linear-gradient(155deg, var(--bg-panel-2), var(--bg-panel)) !important;
}
#langOverlay .lang-box h2,
#langOverlay .lang-opt { color: var(--text) !important; }
#langOverlay .lang-box h2 span + span,
#langOverlay .lang-opt small { color: var(--text-muted) !important; }
#langOverlay .lang-opt { background: var(--panel) !important; border-color: var(--line) !important; }
#langOverlay .lang-opt:hover,
#langOverlay .lang-opt:focus-visible { border-color: var(--frost) !important; }
#langOverlay .lang-opt.sel { border-color: var(--frost) !important; }
#langOverlay .lang-opt.sel::after { color: var(--frost) !important; }

html[data-emilia-theme="light"] body::before { opacity: .035 !important; }
html[data-emilia-theme="light"] .menu-backdrop { background: rgba(38, 31, 52, .22) !important; }
html[data-emilia-theme="light"] .card,
html[data-emilia-theme="light"] .change-card,
html[data-emilia-theme="light"] .feature,
html[data-emilia-theme="light"] .stat,
html[data-emilia-theme="light"] .panel,
html[data-emilia-theme="light"] .ia-card,
html[data-emilia-theme="light"] .suporte-box,
html[data-emilia-theme="light"] .contact,
html[data-emilia-theme="light"] .info-card,
html[data-emilia-theme="light"] .resgatar-card {
  color: var(--text) !important;
  background: var(--panel-2) !important;
  border-color: var(--line) !important;
  box-shadow: 0 12px 34px rgba(39, 29, 57, .07);
}
html[data-emilia-theme="light"] .bg-mesh {
  background:
    radial-gradient(ellipse 80% 60% at 10% -10%, rgba(110, 81, 202, .12), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 10%, rgba(8, 127, 158, .09), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(110, 81, 202, .07), transparent 55%),
    var(--bg-deep) !important;
}
html[data-emilia-theme="light"] .bg-grid { opacity: .18; }
html[data-emilia-theme="light"] input,
html[data-emilia-theme="light"] select,
html[data-emilia-theme="light"] textarea {
  color: var(--text) !important;
  background-color: #fff !important;
  border-color: var(--line) !important;
}
html[data-emilia-theme="light"] input::placeholder,
html[data-emilia-theme="light"] textarea::placeholder { color: #82798d !important; }
html[data-emilia-theme="light"] .emilia-panel-v3,
html[data-emilia-theme="light"] .emilia-main { color: var(--em-text) !important; }
html[data-emilia-theme="light"] h1.text-3xl.font-bold,
html[data-emilia-theme="light"] h1.text-3xl {
  background: linear-gradient(110deg, var(--em-text) 15%, var(--em-frost) 65%, var(--em-ice)) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
}
html[data-emilia-theme="light"] .emilia-panel-v3 button,
html[data-emilia-theme="light"] .emilia-panel-v3 [role="button"] { color: inherit; }
html[data-emilia-theme="light"] .emilia-config-card,
html[data-emilia-theme="light"] .emilia-card,
html[data-emilia-theme="light"] .emilia-section-card,
html[data-emilia-theme="light"] .emilia-mod-block {
  box-shadow: 0 12px 30px rgba(41, 30, 64, .08) !important;
}

@media (prefers-reduced-motion: reduce) {
  html[data-emilia-theme] *,
  html[data-emilia-theme] *::before,
  html[data-emilia-theme] *::after { scroll-behavior: auto !important; }
}

@media (max-width: 420px) {
  #themeBtn { left: 142px; }
  #emiliaThemeMenu { bottom: 60px; }
}
