/* ============================================================
   COMPONENTS — nav, botões, forms, badges, cards partilhados
   ============================================================ */

/* ── Reset global box-sizing (CANÓNICO, devia estar sempre aqui) ──
   Sem isto, padding soma-se a width:100%/width:Xpx em vez de ficar incluído
   nesse valor — qualquer elemento com padding + width percentual pode
   ficar mais largo do que o seu contentor. Foi exactamente isto que causou
   o input de URL a sobrepor-se ao botão de submeter em mobile (confirmado
   por medição: o input tinha 60px mais largura do que o seu wrapper,
   batendo certo com o padding horizontal do .rx-input). Reset padrão desde
   ~2012, praticamente universal — devia ter estado aqui desde o início. */
*, *::before, *::after {
  box-sizing: border-box;
}

/* ── Scrollbar customizada GLOBAL (todo o site) ──────────────────
   Fina e discreta, com as cores do tema, em vez do estilo nativo do SO.
   Aplica-se a QUALQUER elemento scrollável (página, modais, paineis) salvo
   onde uma regra mais específica decida escondê-la de propósito (ex.: as
   barras horizontais de pills de filtro, que usam scroll sem scrollbar
   visível como affordance — essas continuam a funcionar, esta regra não as
   sobrepõe porque elas já têm scrollbar-width:none/display:none próprios,
   que vencem por especificidade/ordem). */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--wire-2, #ffffff1e) transparent;
}
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--wire-2, #ffffff1e);
  border-radius: 99px;
}
*::-webkit-scrollbar-thumb:hover { background: var(--wire, #ffffff2e); }

/* ── NAV (landing) ── */
nav.landing-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, var(--ink) 60%, transparent);
}

/* ── NAV (app) ── */
nav.app-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--ink);
  border-bottom: 1px solid var(--wire);
  padding: 1rem 2rem;
}

/* Conteúdo da nav limitado a uma largura confortável e centrado — a barra
   (acima) continua a cobrir 100% da largura (fundo + borda), só o
   conteúdo (logo...menu) é que fica contido. Sem isto, em ecrãs muito
   largos (ex.: 4K) o logo e o menu ficavam encostados aos cantos com um
   vazio enorme no meio — left/right mantêm-se dentro deste limite. */
.nav-inner {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nav-logo {
  font-family: var(--rx-font-display);
  font-weight: 800;
  font-size: 1.625rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.nav-logo span { color: var(--rx-accent-text); }

.nav-cta {
  font-family: var(--rx-font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--rx-accent-contrast);
  background: var(--amber);
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1.125rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}

.nav-cta:hover {
  background: var(--amber-2);
  transform: translateY(-1px);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-balance {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--amber);
  border: none;
  border-radius: 8px;
  padding: 0.4rem 0.875rem;
  font-family: var(--rx-font-mono);
  font-size: 0.8125rem;
  color: var(--rx-accent-contrast);
  transition: background 0.15s, transform 0.15s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* Hover apenas em dispositivos com hover real (rato). Em touch, o :hover
   ficava "preso" após o toque (o browser mantém o último elemento tocado em
   hover até se tocar noutro sítio), deixando o botão com a cor --amber-2 como
   se continuasse clicado. Com @media (hover: hover) isto não acontece no mobile. */
@media (hover: hover) {
  .nav-balance:hover { background: var(--amber-2); transform: translateY(-1px); }
}
/* Feedback ao premir, válido em qualquer dispositivo. */
.nav-balance:active { background: var(--amber-2); }
/* Foco: sem outline nativo ao clicar; anel visível só em navegação por teclado. */
.nav-balance:focus { outline: none; }
.nav-balance:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.nav-balance-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--rx-accent-contrast);
  opacity: 0.6;
}

.nav-balance-link {
  color: var(--rx-accent-contrast);
  text-decoration: none;
  font-family: var(--rx-font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
}
.nav-balance-link:visited { color: var(--rx-accent-contrast); }
.nav-balance-link:hover { color: var(--rx-accent-contrast); }

/* Saldo a zero (Aug 2026) — borda a animar, mesma técnica de "brilho a
   deslizar" já usada na barra de progresso (background-position sobre
   um gradiente, não translateX fixo — varre a largura toda). Anel
   gerado via ::before + mask (duplo mask, composite exclude) para dar
   um efeito de BORDA (não um preenchimento), por cima do fundo amber
   sólido do botão já existente — sem alterar esse fundo. */
.nav-balance.nav-balance-zero {
  position: relative;
}
.nav-balance.nav-balance-zero::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 10px;
  padding: 2px;
  background: linear-gradient(90deg, var(--ink) 25%, color-mix(in srgb, var(--ink) 40%, white) 50%, var(--ink) 75%);
  background-size: 200% 100%;
  animation: rx-balance-border-shimmer 1.5s infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
@keyframes rx-balance-border-shimmer {
  to { background-position: -200% 0; }
}

.nav-logout {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--ghost-2);
  border: 1px solid var(--wire-2);
  border-radius: 8px;
  cursor: pointer;
  padding: 0.4375rem 1rem;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: var(--rx-font-display);
  text-decoration: none;
}

.nav-logout:hover {
  color: var(--text);
  background: var(--ghost-3);
  border-color: var(--wire);
}

/* ── NAV pública (sem sessão; só com publicNav no RXNav.init) ──
   Logótipo à esquerda; links de texto, "Entrar" e UM botão de destaque à
   direita. Abaixo de 960px os links passam a um painel aberto pelo ☰. */
.nav-inner--public { flex-wrap: nowrap; }

.nav-public {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-public-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-public-link,
.nav-public-login {
  font-family: var(--rx-font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--rx-text-2);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}
.nav-public-link:hover,
.nav-public-login:hover { color: var(--rx-text-1); }

.nav-public-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-left: 1.75rem;
  border-left: 1px solid var(--rx-border);
}

.nav-public-cta {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5625rem 1.125rem;
  white-space: nowrap;
}

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  padding: 0 10px;
  background: none;
  border: 1px solid var(--rx-border);
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nav-burger span {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: var(--rx-text-1);
  transition: transform 0.2s, opacity 0.2s;
}
.nav-menu-open .nav-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-menu-open .nav-burger span:nth-child(2) { opacity: 0; }
.nav-menu-open .nav-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 960px) {
  .nav-burger { display: inline-flex; }
  .nav-public {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1.25rem 1.25rem;
    background: var(--rx-surface-0);
    border-bottom: 1px solid var(--rx-border);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
  }
  .nav-menu-open .nav-public { display: flex; }
  .nav-public-links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-public-link,
  .nav-public-login {
    display: block;
    padding: 0.875rem 0.25rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--rx-border);
  }
  .nav-public-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-left: 0;
    border-left: none;
  }
  .nav-public-cta {
    margin-top: 1rem;
    padding: 0.8125rem 1rem;
    font-size: 0.9375rem;
    text-align: center;
  }
}

/* ── BUTTONS ── */
.btn-primary {
  background: var(--amber);
  color: var(--rx-accent-contrast);
  border: none;
  border-radius: 8px;
  padding: 0.9375rem 1.75rem;
  font-family: var(--rx-font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--amber-2);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── FORM INPUTS ── */
/* ── STATUS BADGES ── */
/* ── CHIP/PILL (CANÓNICO) ──
   Base partilhada para qualquer botão tipo "pill" clicável (filtros,
   ordenação, etc.). Usa junto de uma classe própria do contexto para
   comportamento extra específico (ex.: .facet-pill, .sort-btn) — ver
   rx-core/dashboard-layout.css e transactions-view.css. */
.rx-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.375rem 0.875rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--wire-2);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--rx-font-body);
  white-space: nowrap;
}
.rx-chip:hover { border-color: var(--ghost-3); color: var(--text-2); }
.rx-chip.active {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--rx-accent-contrast);
  font-weight: 600;
}
.rx-chip.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
/* Botão de ordenação com seta rotativa — partilhado (dashboard + transações). */
.sort-btn .sort-arrow { transition: transform 0.18s ease; }
.sort-btn.active.asc .sort-arrow { transform: rotate(180deg); }

/* Estado vazio simples (texto centrado) — para listas com menos peso visual
   que o .empty-state do dashboard (esse tem ícone+título+corpo, estrutura
   própria, não vale a pena forçar a partilhar). */
.rx-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-3);
  font-size: 0.875rem;
}

.status-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.7rem;
  border-radius: 99px;
  font-family: var(--rx-font-mono);
}

.status-badge.done {
  background: rgba(34,197,94,0.1);
  color: var(--green);
  border: 1px solid rgba(34,197,94,0.2);
}

.status-badge.processing,
.status-badge.pending {
  background: rgba(245,166,35,0.1);
  color: var(--amber-2);
  border: 1px solid rgba(245,166,35,0.2);
}

.status-badge.error,
.status-badge.failed {
  background: rgba(239,68,68,0.1);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.2);
}

/* ── ERROR / SUCCESS BANNERS ── */
.error-banner {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 10px;
  padding: 0.875rem 1.25rem;
  font-size: 0.875rem;
  color: #fca5a5;
  display: none;
}

.error-msg {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  color: #fca5a5;
  display: none;
}

/* ── SKELETON ── */
.skeleton {
  background: linear-gradient(90deg, var(--ghost) 25%, var(--ghost-2) 50%, var(--ghost) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

.skeleton-card {
  background: var(--ink-2);
  border: 1px solid var(--wire-2);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ── SECTION COMMON ── */
.section-label {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--rx-accent-text);
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--rx-font-display);
  font-weight: 800;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.section-body {
  font-size: 1.0625rem;
  color: var(--text-2);
  line-height: 1.7;
  font-weight: 300;
  max-width: 800px;
  display: block;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--wire);
  padding: 2.5rem 1.5rem;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ── Cabeçalho da página de relatório ──────────────────── */
/* .report-page-header: container do botão voltar no relatório (estático,
   sem fundo — mostra o fundo da página). O botão usa .rx-back (rx-core). */
.report-page-header {
  position: static !important;
  max-width: var(--page-max-width, 860px);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0.25rem;
  background: transparent;
}

.report-page-title {
  font-family: var(--rx-font-display);
  font-weight: 800;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.report-page-subtitle {
  font-size: 0.9375rem;
  color: var(--text-2);
  line-height: 1.6;
  margin: 0;
  max-width: 680px;
}

/* ============================================================
   rx-core — Shell de página partilhado (canónico)
   Container + botão voltar + título + subtítulo. Usado por
   qualquer ecrã com layout "voltar → título → conteúdo"
   (transações, e futuros). O dashboard é a home e não usa.
   Tudo via variáveis do tokens.css → tema funciona sozinho.
   ============================================================ */
.rx-page {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
}

/* Ecrã "não foi possível carregar" (RXPageShell.loadErrorHtml, Out 2026):
   dentro de um .rx-page, com a mesma largura e margens das outras páginas. */
.rx-load-error-body {
  margin: 3rem auto 0;
  max-width: 34rem;
  text-align: center;
  color: var(--rx-text-2);
}
.rx-load-error-body p { margin: 0 0 1.25rem; line-height: 1.6; }

/* Botão voltar — circular, âmbar, só ícone (mesmo estilo do RXScrollNav,
   rx-core/scroll-nav.css), mas estático/in-flow em vez de flutuante. Usado
   em qualquer ecrã com um "voltar" no topo do conteúdo (transações,
   relatório, páginas estáticas). Texto removido de propósito — o ícone
   já é suficientemente claro, e mantém consistência visual com os botões
   de scroll. */
.rx-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--rx-accent-contrast);
  border: none;
  text-decoration: none;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: background 0.15s ease;
}
.rx-back svg { width: 18px; height: 18px; }
/* :hover só em dispositivos com rato real (media query hover:hover) — em
   touch/SPA, o :hover normal do CSS fica "preso" depois de um clique
   até o rato se mexer de facto, porque não há mouseleave real. Sem
   isto, o botão ficava com a cor de hover permanentemente após o
   primeiro clique. */
@media (hover: hover) and (pointer: fine) {
  .rx-back:hover { background: var(--amber-2); }
}

/* Cabeçalho com seta à esquerda + título centrado no container — a seta
   fica fixa à esquerda (posição normal no fluxo), o título é centrado a
   sério via position:absolute (um flex simples com justify-content:
   space-between NÃO centra de verdade quando os dois lados têm larguras
   diferentes — o título ficava deslocado para o lado da seta). */
.rx-page-header {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 40px;
  margin-bottom: 1rem;
}
.rx-page-header .rx-back {
  margin-bottom: 0;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.rx-page-header .rx-page-title {
  position: absolute;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: fit-content;
  max-width: calc(100% - 6rem);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 480px) {
  .rx-page-header .rx-page-title {
    font-size: 1.125rem;
    max-width: calc(100% - 4.5rem);
  }
}

/* Título de página canónico: fonte de destaque (--rx-font-display) 800, 1.5rem. Entrada com fade-up —
   transversal a TODAS as páginas que usam este componente partilhado
   (dashboard, transações, comprar créditos, relatório, etc.), nunca no
   título específico de cada relatório (esse é outra classe, própria de
   cada produto — ex.: .cr-title no CommunityRX). @keyframes definido
   aqui mesmo, não só em landing.css, para funcionar em qualquer página
   que carregue components.css, mesmo sem landing.css. */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.rx-page-title {
  font-family: var(--rx-font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 0.375rem;
  line-height: 1.2;
  animation: fadeUp 0.6s 0.1s ease both;
}

.rx-page-subtitle {
  font-size: 0.9375rem;
  color: var(--text-3);
  line-height: 1.6;
  margin: 0;
  max-width: 680px;
}
/* Segue o título quando este está centrado (.rx-page-header) — por
   coerência visual, evita a leitura desalinhada de um título centrado
   com uma descrição à esquerda logo por baixo. */
.rx-page-header + .rx-page-subtitle {
  margin: 0 auto;
  text-align: center;
}

/* Botões flutuantes (FAB): voltar ao topo / voltar às análises.
   Empilháveis via .rx-fab--lower (em baixo) e .rx-fab--upper. */
.rx-fab {
  position: fixed;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--amber);
  color: var(--rx-accent-contrast);
  border: none;
  cursor: pointer;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, background 0.15s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.rx-fab.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.rx-fab:hover { background: var(--amber-2); }
.rx-fab--lower { bottom: 1.5rem; }
.rx-fab--upper { bottom: 5rem; }
/* Terceiro nível empilhado — usado por botões sempre visíveis (não
   dependentes de scroll, ao contrário de --lower/--upper que só aparecem
   depois de scrollar), ex.: abrir o lightbox da imagem-resumo. */
.rx-fab--poster { bottom: 8.5rem; }

.footer-logo {
  font-family: var(--rx-font-display);
  font-weight: 800;
  font-size: 1.3125rem;
  color: var(--text);
  text-decoration: none;
}

.footer-logo span { color: var(--rx-accent-text); }

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.8125rem;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover { color: var(--text-2); }

.footer-copy {
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  nav.app-nav {
    padding: 0.75rem 1rem;
  }
  .nav-right {
    gap: 0.625rem;
  }
  .nav-balance {
    font-size: 0.75rem;
    padding: 0.35rem 0.625rem;
  }
}

/* ── FOOTER (persistente, fora do #app) ──
   Escondido por padrão. Só aparece nas páginas públicas/de conteúdo
   (landing, FAQ, Termos, Privacidade), que adicionam body.show-footer ao
   renderizar — ver static-pages.js e landing.js. NÃO aparece nos ecrãs de
   trabalho (dashboard, relatório, transações): é o padrão usado por
   produtos SaaS (Notion, Linear, Stripe dashboard, etc.) — footers com
   links de baixa frequência (legal/ajuda) competem mal com scroll
   infinito e conteúdo de trabalho; esses links vivem no menu de ajuda da
   nav (botão "?") em vez de um footer sempre presente.
   Reutiliza a estrutura partilhada footer/.footer-inner/.footer-logo/
   .footer-links/.footer-copy (a mesma que a landing já usa) — só controla
   aqui a visibilidade condicional; o layout vem todo da base. */
footer.app-footer { display: none; }
body.show-footer footer.app-footer { display: block; }

/* ── ÍCONES DE LINHA NAS GRELHAS DA PÁGINA INICIAL (.dim-icon--line) ──
   SVG de traço (os mesmos desenhos dos relatórios) numa caixa discreta,
   em vez de emojis. Cor neutra do tema — a cor de destaque fica só para
   acções e estados activos. */
.dim-icon--line {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--rx-border);
  border-radius: 10px;
  background: var(--rx-tint-1);
  color: var(--rx-text-1);
}
.dim-icon--line svg { width: 1.25rem; height: 1.25rem; }

/* ── RODAPÉ DO SITE EM COLUNAS (.site-footer) ──
   Marca + colunas de links + linha de ©. Markup no index.html de cada
   produto (#app-footer, classes app-footer site-footer); cores no tema
   de cada produto (--rx-footer-*, contrato em tokens.css). Classes
   próprias para não herdar nada de footer/.footer-* acima. */
footer.site-footer {
  padding: 4.5rem 1.5rem 2rem;
  background: var(--rx-footer-bg);
  border-top: 1px solid var(--rx-footer-border);
  color: var(--rx-footer-text-2);
}
.site-footer-inner {
  max-width: var(--page-max-width, 980px);
  margin: 0 auto;
}
.site-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
}
.site-footer-logo {
  font-family: var(--rx-font-display);
  font-weight: 800;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
  color: var(--rx-footer-text);
  text-decoration: none;
}
.site-footer-logo span { color: var(--rx-footer-brand); }
.site-footer-brand p {
  max-width: 32ch;
  margin: 0.875rem 0 1.125rem;
  font-size: 0.9375rem;
  line-height: 1.6;
}
.site-footer-email {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--rx-footer-text);
  text-decoration: none;
}
.site-footer-head {
  display: block;
  margin-bottom: 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rx-footer-text);
}
.site-footer-col a {
  display: block;
  padding: 0.3125rem 0;
  font-size: 0.9375rem;
  color: var(--rx-footer-text-2);
  text-decoration: none;
  transition: color 0.15s;
}
.site-footer-col a:hover,
.site-footer-email:hover { color: var(--rx-footer-brand); }
.site-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rx-footer-rule);
  font-size: 0.8125rem;
  color: var(--rx-footer-muted);
}
/* "Um produto RXSpot" nos rodapés dos produtos (Out 2026). */
.site-footer-bottom a {
  font-weight: 500;
  color: var(--rx-footer-text-2);
  text-decoration: none;
  transition: color 0.15s;
}
.site-footer-bottom a:hover { color: var(--rx-footer-brand); }
@media (max-width: 768px) {
  footer.site-footer { padding: 3.5rem 1.5rem 1.75rem; }
  .site-footer-grid { grid-template-columns: 1fr 1fr; gap: 2.25rem 1.5rem; }
  .site-footer-brand { grid-column: 1 / -1; }
  .site-footer-bottom { margin-top: 2.5rem; }
}
/* ── MENU DE CONTA (consolidado: páginas + tema + sair) ──
   Substitui os três elementos separados que existiam antes (seletor de
   tema, menu de ajuda, botão de logout) por um único ponto de entrada na
   nav — padrão usado por produtos como a Railway (menu de conta, ao
   clicar no avatar/ícone). Reutiliza .theme-option (já existe, tem a
   lógica de estado activo) para os 3 itens de tema; .menu-link é o
   equivalente genérico para os restantes itens (páginas, sair). */
.account-menu-wrap { position: relative; display: inline-flex; }

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 200;
  display: none;
  flex-direction: column;
  gap: 2px;
  min-width: 230px;
  max-width: 280px;
  padding: 6px;
  background: var(--ink-2);
  border: 2px solid var(--wire-2);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.account-menu.open { display: flex; }

.account-menu-divider {
  height: 1px;
  background: var(--wire);
  margin: 4px 2px;
}

/* Linha de perfil no topo do menu — avatar (inicial do email) + email.
   Substitui um simples cabeçalho de texto por algo com mais identidade,
   sem precisar de foto de perfil real. */
.account-menu-profile {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem 0.625rem;
}
.account-menu-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--rx-accent-contrast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--rx-font-display);
  font-weight: 800;
  font-size: 0.875rem;
}
.account-menu-email {
  font-size: 0.8125rem;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.5rem 0.625rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  font-family: var(--rx-font-body);
  font-size: 0.8125rem;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}
.menu-link svg { flex-shrink: 0; color: var(--text-3); }
.menu-link:hover { background: var(--ghost-2); color: var(--text); }

/* Última linha do menu: tema (controlo segmentado, 3 estados, não parece
   um botão tradicional) + Sair (ícone power, vermelho) lado a lado. */
.account-menu-bottom-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 4px 2px 2px;
}
.account-menu-toggles-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
}
/* Separador entre os dois grupos de definições (tema / idioma) — em vez
   de um espaço vazio a meio (justify-content:space-between esticava os
   dois grupos para os extremos, deixando um "buraco" no meio), uma linha
   fina comunica que são dois grupos distintos, deliberadamente juntos. */
.account-menu-toggle-divider {
  width: 1px;
  align-self: stretch;
  background: var(--wire-2);
}

.theme-segmented {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--ghost-2);
  border-radius: 8px;
  padding: 3px;
}
.theme-seg-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.theme-seg-btn:hover { color: var(--text); }
.theme-seg-btn.active { background: var(--amber); color: var(--rx-accent-contrast); }

/* Toggle de idioma (PT/EN) — mesmo visual do theme-seg-btn (pill
   segmentado, destaque âmbar no activo), mas com texto em vez de ícone,
   por isso largura automática em vez do width fixo do original. */
.lang-seg-btn {
  width: auto;
  padding: 0 0.5rem;
  font-family: var(--rx-font-display);
  font-size: 0.6875rem;
  font-weight: 700;
}

.menu-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.4375rem 0.625rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--red);
  font-family: var(--rx-font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  width: 100%;
}
.menu-logout-btn:hover { background: color-mix(in srgb, var(--red) 12%, transparent); }