/* =========================================================
   TOKENS E BASE
   ========================================================= */
:root {
  color-scheme: light; /* força tema claro */
  --max-w: 1200px;
  --pad-x: clamp(10px, 4vw, 16px); /* lateral fluida para evitar overflow */
  --radius: 14px;

  --header-h: 72px;
  --logo-h: 60px; /* reduzido no mobile no @media */
  --gap: 14px;

  --bg: #ffffff;
  --bd: #e5e7eb;
  --fg: #0f172a;
  --fg-dim: #334155;

  --btn-red: #dc2626;
  --btn-red-hover: #b91c1c;

  --btn-green: #22c55e;
  --btn-green-hover: #16a34a;

  --focus: #93c5fd;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font: 500 16px/1.45 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Ubuntu, Cantarell, 'Helvetica Neue', Arial;
  color: var(--fg);
  background: #ffffff !important;
  overflow-x: hidden; /* trava qualquer scroll lateral acidental */
}
img,
video,
svg,
canvas {
  display: block;
  max-width: 100%; /* mídias nunca estouram a largura */
  height: auto;
}
a {
  color: inherit;
  text-decoration: none;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
h1,
h2,
h3,
p,
.section-title,
.hero-title {
  overflow-wrap: anywhere; /* quebras seguras em telas estreitas */
}

/* Skip link (acessibilidade) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  left: 16px;
  top: 16px;
  padding: 10px 12px;
  background: #fff;
  border: 2px solid var(--fg);
  border-radius: 8px;
  z-index: 9999;
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  border-bottom: 1px solid var(--bd);
}
.header-inner {
  height: var(--header-h);
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--pad-x); /* usa padding fluido */
  display: grid;
  grid-template-columns: 1fr auto; /* marca | meta */
  align-items: center;
  gap: var(--gap);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--gap);
  min-width: 0;
}
.logo {
  height: var(--logo-h);
  width: auto;
  object-fit: contain;
}
.divider {
  width: 1px;
  height: calc(var(--logo-h) * 0.9);
  background: var(--bd);
}
.doc-meta {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border: 1px solid var(--bd);
  background: #f8fafc;
  border-radius: var(--radius);
  font-size: 14px;
}
.doc-meta b {
  font-weight: 700;
}
.doc-meta .sep {
  opacity: 0.5;
}

/* Mobile: header empilha, logos centralizadas */
@media (max-width: 720px) {
  :root {
    --header-h: auto;
    --logo-h: 44px;
  } /* logos menores no mobile */
  .header-inner {
    grid-template-columns: 1fr;
    padding-block: 10px;
    row-gap: 10px;
  }
  .brand {
    justify-self: center;
  }
  .doc-meta {
    justify-self: start;
  } /* troque para center se preferir */
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  border-bottom: 1px solid var(--bd);
  background: #fff;
}
.hero-inner {
  max-width: var(--max-w);
  margin-inline: auto;
  padding: 28px var(--pad-x) 34px; /* padding lateral fluido */
}
.hero-title {
  font-size: clamp(22px, 3vw, 38px);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 6px;
}
.hero-sub {
  color: var(--fg-dim);
  margin: 0 0 16px;
}

/* =========================================================
   Grade de botões (cards)
   ========================================================= */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 960px) {
  .menu-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .menu-grid {
    grid-template-columns: 1fr;
  }
}

.menu-card {
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  padding: 16px 14px;
  background: #fff;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 6px;
  align-items: center;
  transition: box-shadow 0.18s ease, transform 0.18s ease,
    border-color 0.18s ease;
  min-width: 0; /* evita overflow dentro de grids */
}
.menu-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.08);
  transform: translateY(-1px);
}
.menu-emoji {
  grid-row: 1 / span 2;
  font-size: 1.8rem;
  line-height: 1;
}
.menu-title {
  font-weight: 800;
  font-size: clamp(16px, 2vw, 18px);
}
.menu-desc {
  color: var(--fg-dim);
  font-size: 14px;
}

/* =========================================================
   Ergonomia — Passo numerado com duas imagens
   ========================================================= */
.erg-step .step-row {
  display: grid;
  grid-template-columns: auto 1fr; /* número | conteúdo */
  gap: 12px;
  align-items: start;
}
.erg-step .step-num {
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  background: var(--fg);
  margin-top: 4px;
  flex: 0 0 34px;
}
.erg-step .step-text {
  color: var(--fg-dim);
  margin: 6px 0 10px;
  line-height: 1.45;
}

/* Imagens lado a lado que viram coluna no mobile */
.step-media {
  display: grid;
  margin-top: 8px;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.step-media-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 8px;
  justify-content: center;
  align-items: center;
  text-align: center;
}


.m-fig {
  margin: 0;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 100%;
  align-items: center;
  text-align: center;
}
.m-fig img {
  width: 100%;
  height: auto;
  object-fit: cover;
  align-items: center;
  text-align: center;
  justify-content: center;
}
.m-fig figcaption {
  margin: 0;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--fg-dim);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  text-align: center;
  background: #fff;
  align-items: center;
  justify-content: center;
}
@media (max-width: 720px) {
  .step-media, .step-media-2 {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 380px) {
  .step-media {
    gap: 8px;
  }
}

/* ===== Container reutilizável (padding fluido p/ mobile) ===== */
.container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding: 24px var(--pad-x);
}

/* ===== Seção do botão de voltar ===== */
.back-section {
  border-bottom: 1px solid var(--bd);
  background: #fff;
}
.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--bd);
  font-weight: 700;
  white-space: nowrap;
}
.btn-back:hover {
  background: #f8fafc;
}
.btn-back:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ===== Proteções extras de mobile ===== */
html,
body {
  overflow-x: hidden;
}
.container,
.hero-inner,
.section-inner {
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}
img {
  max-width: 100%;
  height: auto;
}
h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

/* (Opcional) deixa o bloco do main um pouco mais compacto no mobile */
@media (max-width: 560px) {
  .container {
    padding-top: 20px;
    padding-bottom: 22px;
  }
}



/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--bd);
  background: #fff;
}
.footer-inner {
  max-width: var(--max-w);
  margin-inline: auto;
  padding: 18px var(--pad-x); /* padding fluido */
  display: grid;
  grid-template-columns: 1.2fr auto;
  gap: 16px;
  align-items: center;
}
.footer-left {
  color: var(--fg);
  font-size: 14px;
  line-height: 1.35;
}
.footer-tagline {
  color: var(--fg-dim);
  font-size: 13px;
  margin-top: 4px;
}
.footer-right {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  justify-self: end;
}
.footer-metric .metric-label {
  color: var(--fg-dim);
  margin-right: 6px;
}
.back-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--bd);
  font-weight: 700;
}
.back-top:hover {
  background: #f8fafc;
}

@media (max-width: 720px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
  .footer-right {
    justify-self: start;
  }
}
