/* Cabeçalho compartilhado das páginas públicas: links de navegação + menu da
   conta logada. Reutilizado em home.html, pricing.html e config.html. */

/* Garante que o atributo `hidden` funcione mesmo em elementos com `display`
   definido abaixo (ex.: .account-menu = inline-flex). */
[hidden] { display: none !important; }

/* Marca clicável: logo + nome levam de volta para a raiz do site. */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a.brand { color: inherit; text-decoration: none; }
a.brand .brand-mark { transition: filter .15s; }
a.brand:hover .brand-mark { filter: brightness(1.08); }
a.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 14px; }
.brand > div:last-child { display: grid; line-height: 1.05; }
.brand strong { font-size: .96rem; }
.brand span { margin-top: 4px; color: var(--muted); font-size: .75rem; }

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: white;
  background: linear-gradient(145deg, #ef3838, #a80e18);
  box-shadow: 0 12px 32px rgba(224, 36, 36, .24);
  font-size: 1rem;
  font-weight: 900;
  flex: none;
}
.brand-mark.small { width: 38px; height: 38px; border-radius: 11px; font-size: 1rem; }

header.header {
  position: sticky;
  z-index: 20;
  top: 0;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(21, 22, 26, .92);
  backdrop-filter: blur(18px);
}

.mainnav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}

.navlink {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  transition: color .15s, background .15s;
}
.navlink:hover { color: var(--text); background: rgba(255,255,255,.05); }
.navlink.is-active { color: var(--text); }

.auth-actions { display: inline-flex; align-items: center; gap: 8px; }

/* Menu da conta logada */
.account-menu {
  position: relative;
  display: inline-flex;
  z-index: 50;
  margin-left: auto;
}
.account-menu { position: relative; }
.account-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 5px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: border-color .15s;
}
.account-trigger:hover { border-color: #3f4149; }
.account-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 999px;
  background: linear-gradient(145deg, #ef3838, #a80e18);
  color: white;
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
}
.account-meta { display: grid; line-height: 1.15; text-align: left; }
.account-meta strong {
  max-width: 150px;
  overflow: hidden;
  color: var(--text);
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-plan { color: var(--muted); font-size: .68rem; font-weight: 750; }
.account-plan.is-active { color: #34d399; }
.account-chevron { width: 15px; height: 15px; color: var(--muted); flex: none; }
@media (max-width: 768px) {
  .account-meta { display: none; }
  .account-trigger { padding: 4px 6px; }
}

.account-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 100;
  width: 254px;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .45);
}
.account-panel[hidden] { display: none; }
.account-head {
  display: grid;
  gap: 3px;
  padding: 4px 8px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}
.account-head strong {
  overflow: hidden;
  font-size: .82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-usage { margin: 6px 8px; color: var(--muted); font-size: .74rem; line-height: 1.4; }
.account-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--text);
  padding: 9px 10px;
  border-radius: 9px;
  font: inherit;
  font-size: .82rem;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}
.account-item:hover { background: rgba(255, 255, 255, .06); }

/* Seletor de idioma e utilitário de acessibilidade das páginas públicas. */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.lang-switch { display: inline-flex; align-items: center; }
.lang-switch select {
  appearance: none;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: .85rem;
  cursor: pointer;
}
.lang-switch select:hover { border-color: #3f4149; }

/* ---------- Footer compartilhado em colunas (estilo Google) ---------- */
footer.footer-site {
  position: relative;
  z-index: 10;
  border-top: 1px solid var(--border, #2a2c33);
  background: var(--surface, #17181c);
  color: var(--muted, #9ca3af);
  padding: 44px 0 28px;
  margin-top: auto;
  font-size: 0.9rem;
}
footer.footer-site .footer-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}
footer.footer-site .footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 880px;
  margin: 0 auto;
  gap: 48px;
}
footer.footer-site .footer-col {
  display: flex;
  flex-direction: column;
}
footer.footer-site .footer-heading {
  color: var(--text, #f4f4f5);
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}
footer.footer-site .footer-links,
footer.footer-site .footer-links li {
  list-style: none !important;
  list-style-type: none !important;
}
footer.footer-site .footer-links {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
footer.footer-site .footer-links li {
  margin: 0;
  padding: 0;
  line-height: 1.4;
}
footer.footer-site .footer-links a {
  color: var(--muted, #9ca3af);
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-block;
}
footer.footer-site .footer-links a:hover {
  color: var(--text, #f4f4f5);
}
footer.footer-site .footer-links span {
  color: var(--muted, #9ca3af);
}
footer.footer-site .footer-divider {
  height: 1px;
  background: var(--border, #2a2c33);
  margin: 32px 0 20px;
}
footer.footer-site .footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--muted, #9ca3af);
}
@media (max-width: 768px) {
  footer.footer-site .footer-grid {
    grid-template-columns: 1fr;
    max-width: 320px;
    margin: 0 auto;
    gap: 28px;
  }
}

/* Layout da aplicação com barra lateral compartilhada */
.app-body {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - 66px);
  width: 100%;
}
.app-main {
  flex: 1;
  min-width: 0;
}

.side-panel {
  position: sticky;
  z-index: 15;
  top: 66px;
  width: 232px;
  flex: 0 0 232px;
  height: calc(100vh - 66px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px 13px;
  border-right: 1px solid var(--border, #2a2c33);
  background: rgba(23, 24, 29, .94);
  backdrop-filter: blur(18px);
  transition: width .18s ease, flex-basis .18s ease;
}
.side-panel.compact { width: 68px; flex: 0 0 68px; padding: 15px 10px; }

.side-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; }
.side-panel-title { color: var(--muted, #747780); font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.side-panel.compact .side-panel-title { display: none; }

.side-toggle {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--border, #2a2c33);
  border-radius: 8px;
  color: var(--muted, #9ca3af);
  background: transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.side-toggle:hover { color: var(--text, #f4f4f5); border-color: #3f4149; background: var(--surface-2, #1f2127); }
/* Mesmo traço dos ícones do menu; desenho troca com o estado (CSS puro). */
.side-toggle svg { width: 19px; height: 19px; stroke-width: 1.7; }
.side-toggle .icon-expand { display: none; }
.side-panel.compact .side-toggle .icon-collapse { display: none; }
.side-panel.compact .side-toggle .icon-expand { display: block; }

/* No modo compacto o botão centraliza com os ícones do menu. */
.side-panel.compact .side-panel-head { justify-content: center; }
.side-panel.compact .side-toggle { margin-left: 0; }

.side-menu { display: grid; gap: 6px; align-content: start; }
.side-menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted, #9ca3af);
  background: transparent;
  text-align: left;
  font-size: .82rem;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
  transition: color .15s, background .15s, border-color .15s;
}
.side-menu-item:hover { color: var(--text, #f4f4f5); background: var(--surface-2, #1f2127); }
.side-menu-item.active { color: white; border-color: #3f4149; background: var(--surface-2, #1f2127); box-shadow: inset 3px 0 var(--accent, #e11d48); }
.side-menu-item svg { width: 19px; height: 19px; flex: 0 0 19px; stroke-width: 1.7; }
/* Entrelinha fixa: o rótulo quebra igual em <button> (SPA) e <a> (páginas). */
.side-menu-label { line-height: 1.4; }
.side-panel.compact .side-menu-item { justify-content: center; padding: 9px 0; box-shadow: none; }
.side-panel.compact .side-menu-label { display: none; }

.side-panel-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border, #2a2c33); }
.side-panel-foot span { display: block; overflow: hidden; color: var(--muted, #9ca3af); font-size: .72rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) {
  .side-panel { width: 190px; flex-basis: 190px; }
}
@media (max-width: 768px) {
  .app-body { flex-direction: column; }
  .side-panel, .side-panel.compact {
    position: static;
    width: 100%;
    flex: none;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border, #2a2c33);
    padding: 10px 14px;
  }
  .side-panel-head, .side-panel-foot { display: none; }
  .side-menu { display: flex; flex-wrap: wrap; gap: 6px; }
  .side-menu-item, .side-panel.compact .side-menu-item { width: auto; min-height: 36px; padding: 7px 12px; }
  .side-panel .side-menu-label, .side-panel.compact .side-menu-label { display: inline; }
}

