/* Smart Pages: base (reset, tipografia, layout e utilitários). Só variáveis de tokens.css.
   Identidade EcomSmart v4 (ADR 0051): títulos finos (500 a 600), rótulo em caixa normal com fio curto, fio e
   tipografia no lugar de caixa e sombra. Site público em tema claro forçado; escuro só em [data-area="app"]. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--topo-h) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--es-fonte);
  font-size: var(--fs-corpo);
  line-height: var(--lh-base);
  color: var(--es-texto);
  background: var(--es-pagina);
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

h1, h2, h3, h4 { margin: 0 0 var(--esp-4); color: var(--es-texto); line-height: var(--lh-titulo); letter-spacing: var(--ls-titulo);
  text-wrap: balance; }
h1 { font-size: var(--fs-h1); font-weight: var(--peso-titulo); line-height: 1.06; letter-spacing: -0.035em; }
h2 { font-size: var(--fs-h2); font-weight: var(--peso-titulo); }
h3 { font-size: var(--fs-h3); font-weight: var(--peso-h3); line-height: 1.3; letter-spacing: -0.01em; }
p { margin: 0 0 var(--esp-4); text-wrap: pretty; }
p, li { max-width: 72ch; }
a { color: var(--es-destaque); text-underline-offset: 3px; }
a:hover { color: var(--es-destaque-hover); }
strong { font-weight: var(--peso-ui); }
small, .peq { font-size: var(--fs-peq); }
.lead { font-size: var(--fs-lead); color: var(--es-texto-2); line-height: 1.6; }
/* Rótulo de seção (tema ecomsmart v5): frase em caixa normal, na cor da marca, com um fio curto antes. Caixa alta
   com espaçamento largo em toda seção era a marca de "template". */
.rotulo, .rot { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 var(--esp-3); font-size: var(--fs-rot);
  font-weight: var(--peso-ui); letter-spacing: -0.005em; color: var(--es-primaria); }
.rotulo::before, .rot::before { content: ""; flex: none; width: 20px; height: 2px; border-radius: 2px; background: currentColor; }
.texto-2 { color: var(--es-texto-2); }
.texto-3 { color: var(--es-texto-3); }
.enf { color: var(--es-primaria); }
.num { font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; color: var(--es-dado); }
::selection { background: var(--es-primaria); color: var(--es-primaria-texto); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--es-foco); outline-offset: 3px; border-radius: 4px; }
/* Campos de data e hora: o foco fica nos segmentos internos e o :focus-visible não chega ao campo (conferência v2.1) */
input[type="time"]:focus, input[type="date"]:focus, input[type="month"]:focus, input[type="datetime-local"]:focus {
  outline: 2px solid var(--es-foco); outline-offset: 3px; }

/* layout */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.estreito { max-width: 560px; }
.secao { padding: var(--sec) 0; }
.pilha > * + * { margin-top: var(--esp-4); }
.pilha-p > * + * { margin-top: var(--esp-2); }
.linha { display: flex; flex-wrap: wrap; gap: var(--esp-3); align-items: center; }
.grade { display: grid; gap: var(--esp-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.centro { text-align: center; }

/* acessibilidade */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.pular {
  position: absolute; left: var(--esp-4); top: -100px; z-index: 100; padding: var(--esp-3) var(--esp-4);
  background: var(--es-fundo); color: var(--es-texto); border-radius: var(--raio-btn); box-shadow: var(--es-sombra-forte);
}
.pular:focus { top: var(--esp-4); }

/* marca: assinatura em SVG (smart-pages.svg) nas páginas claras; símbolo e nome em texto na área logada, onde o tema
   escuro troca a cor do nome */
.marca { display: inline-flex; align-items: center; gap: 10px; min-height: var(--alvo); color: var(--es-texto); text-decoration: none;
  font-weight: var(--peso-ui); font-size: 17px; letter-spacing: -0.01em; }
.marca:hover { color: var(--es-texto); }
.marca img { width: 24px; height: 26px; }
.marca img.assinatura { width: auto; height: 26px; }
.marca .marca-area { padding-left: 10px; border-left: 1px solid var(--es-linha); font-size: var(--fs-peq); font-weight: 500;
  color: var(--es-texto-2); letter-spacing: 0; }

/* topo e rodapé das páginas do núcleo (entrar, erros, convite) */
.topo-publico { background: var(--es-fundo); border-bottom: 1px solid var(--es-linha); }
.topo-publico .container { display: flex; align-items: center; justify-content: space-between; min-height: var(--topo-h); gap: var(--esp-4); }
.rodape { margin-top: var(--esp-8); padding: var(--esp-5) 0; border-top: 1px solid var(--es-linha); background: var(--es-fundo-2);
  color: var(--es-texto-2); }
.rodape p { margin: 0; font-size: var(--fs-peq); }
.endosso { margin: var(--esp-5) 0; text-align: center; font-size: var(--fs-peq); color: var(--es-texto-2); }
.conteudo-publico { padding-block: var(--esp-7); }   /* só vertical: com .container a margem lateral fica (pedido 20 do P01 v2) */

/* ------------------------------------------------------------ casca pública (v2.2, revisão de design)
   Topo e rodapé do site de vendas (nucleo/_casca-topo.html e _casca-rodape.html), também nas páginas que ficam no app
   (diagnóstico, relatório, prévia, assinar, textos legais, erro): topo fixo em vidro claro, "Como funciona" com as três
   páginas, Entrar em botão contornado, diagnóstico em botão primário; abaixo de 1024 px, o botão redondo de três
   traços (.burger do tema ecomsmart). Rodapé num bloco Papel com o endosso. */
.topo-site { position: sticky; top: 0; z-index: 40; background: var(--es-topo-vidro); border-bottom: 1px solid var(--es-linha);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); }
.topo-linha { display: flex; align-items: center; gap: var(--esp-4); min-height: var(--topo-h); }
.topo-linha .marca { min-height: var(--alvo); margin-right: auto; }
.topo-linha .marca img.assinatura { height: 24px; }
@media (min-width: 768px) { .topo-linha .marca img.assinatura { height: 26px; } }
.nav-larga { display: none; }
.nav-larga ul, .menu-movel-painel ul { list-style: none; margin: 0; padding: 0; }
.nav-larga li, .menu-movel-painel li { max-width: none; }
.nav-larga a, .menu-sub > summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--alvo); padding: 0 var(--esp-3); border-radius: var(--raio-pilula);
  color: var(--es-texto-2); text-decoration: none; font-weight: 500; cursor: pointer;
  transition: color var(--es-dur-1), background-color var(--es-dur-1);
}
.nav-larga a:hover, .menu-sub > summary:hover, .menu-sub[open] > summary { background: var(--es-suave); color: var(--es-texto); }
.nav-larga a[aria-current="page"], .menu-sub > summary.atual { background: var(--es-suave); color: var(--es-destaque); }
.menu-sub { position: relative; }
.menu-sub > summary { list-style: none; }
.menu-sub > summary::-webkit-details-marker { display: none; }
.menu-sub > summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform var(--es-dur-2) var(--es-ease); }
.menu-sub[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.menu-sub .sub { position: absolute; top: calc(100% + 8px); left: -12px; z-index: 50; display: grid; gap: 2px; min-width: 320px;
  padding: var(--esp-2); background: var(--es-fundo); border: 1px solid var(--es-linha); border-radius: var(--raio-lg); box-shadow: var(--es-sombra); }
.menu-sub .sub a { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; min-height: 56px;
  padding: var(--esp-2) var(--esp-3); border-radius: var(--raio-md); color: var(--es-texto); font-weight: var(--peso-ui); }
.menu-sub .sub a:hover, .menu-sub .sub a[aria-current="page"] { background: var(--es-suave); }
.menu-sub .sub small { font-size: var(--fs-peq); font-weight: 400; color: var(--es-texto-2); }
.topo-acoes { display: flex; align-items: center; gap: var(--esp-2); }
.btn-topo { min-height: var(--alvo); padding: 0 18px; font-size: 15px; }
.topo-acoes .entrar, .topo-acoes .principal { display: none; }
.burger { display: inline-grid; place-items: center; width: var(--alvo); height: var(--alvo); border-radius: 50%; list-style: none;
  border: 1px solid var(--es-linha-media); background: var(--es-fundo); color: var(--es-texto); cursor: pointer;
  transition: border-color var(--es-dur-1), background-color var(--es-dur-1); }
.burger::-webkit-details-marker { display: none; }
.burger:hover { border-color: var(--es-texto); }
.burger svg { width: 20px; height: 20px; }
.burger .x, .menu-movel[open] .burger .tres { display: none; }
.menu-movel[open] .burger .x { display: block; }
.menu-movel-painel { position: absolute; top: 100%; left: 0; right: 0; max-height: calc(100vh - var(--topo-h)); overflow-y: auto;
  padding: var(--esp-3) var(--gutter) var(--esp-4); background: var(--es-fundo); border-bottom: 1px solid var(--es-linha);
  box-shadow: var(--es-sombra); }
.menu-movel-painel ul { display: grid; gap: 2px; }
.menu-movel-painel li a { display: flex; align-items: center; min-height: 48px; padding: 0 var(--esp-3); border-radius: var(--raio-md);
  color: var(--es-texto); text-decoration: none; font-weight: 500; }
.menu-movel-painel li a:hover, .menu-movel-painel li a[aria-current="page"] { background: var(--es-suave); color: var(--es-destaque); }
.so-menu { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--esp-3); padding-top: var(--esp-4); border-top: 1px solid var(--es-linha); }
.so-menu .btn { flex: 1 1 40%; min-height: var(--alvo-g); padding: 0 var(--esp-4); }
.so-menu .btn-primario { flex-basis: 100%; }
@media (min-width: 1024px) {
  .nav-larga { display: block; }
  .nav-larga ul { display: flex; align-items: center; gap: var(--esp-1); }
  .topo-acoes .entrar, .topo-acoes .principal { display: inline-flex; }
  .menu-movel { display: none; }
}

.rodape-site { margin-top: 0; padding: var(--esp-6) 0 var(--esp-5); color: var(--es-texto-2); }
.rodape-bloco { display: grid; gap: var(--esp-6) var(--esp-5); grid-template-columns: repeat(2, minmax(0, 1fr)); padding: var(--esp-6) var(--esp-5);
  background: var(--es-fundo-2); border-radius: var(--raio-xl); }
@media (min-width: 768px) { .rodape-bloco { padding: var(--esp-7); } }
@media (min-width: 1024px) { .rodape-bloco { grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); } }
.rodape-bloco > * { min-width: 0; }
.rodape-marca { grid-column: 1 / -1; }
@media (min-width: 1024px) { .rodape-marca { grid-column: auto; } }
.rodape-site a { color: var(--es-texto-2); display: inline-flex; align-items: center; min-height: var(--alvo); text-decoration: none; }
.rodape-site a:hover { color: var(--es-destaque); text-decoration: underline; }
.rodape-bloco ul { list-style: none; padding: 0; margin: 0; }
.rodape-bloco p { font-size: var(--fs-peq); margin-bottom: var(--esp-2); }
.rodape-nome { display: block; margin-bottom: var(--esp-4); }
.rodape-nome img { width: auto; height: 26px; }
.rodape-slogan { font-size: 17px; font-weight: var(--peso-ui); line-height: 1.35; letter-spacing: -0.01em; color: var(--es-texto); max-width: 32ch; }
.rodape-titulo { font-size: var(--fs-peq); font-weight: var(--peso-ui); color: var(--es-texto); }
.rodape-base { display: grid; gap: var(--esp-2); margin-top: var(--esp-5); padding: 0 var(--esp-2); }
@media (min-width: 900px) { .rodape-base { grid-template-columns: auto minmax(0, 1fr); gap: var(--esp-6); } }
.rodape-base p { margin: 0; font-size: var(--fs-peq); color: var(--es-texto-3); }
.rodape-base .endosso-rodape { color: var(--es-texto); font-weight: var(--peso-ui); }
/* o símbolo da EcomSmart só aqui, logo depois do nome dela no endosso (o do Smart Pages fica na assinatura); o texto
   continua inteiro ("Smart Pages · by EcomSmart") para quem lê e para o leitor de tela */
.endosso-rodape::after { content: ""; display: inline-block; width: 13px; height: 14px; margin-left: 6px; vertical-align: -1px;
  background: url("/static/logo/ecomsmart-simbolo-tinta.svg") no-repeat center / contain; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
