/* ══════════════════════════════════════════════════════════════════════════
   ACMFacil Website — Base styles (reset + globais + @font-face)
   ══════════════════════════════════════════════════════════════════════════ */

/* ──────────── FONTS — Geist self-hosted ──────────── */
/* Baixe os .woff2 em https://vercel.com/font ou https://github.com/vercel/geist-font
   e coloque em /assets/fonts/. Fallbacks cobrem caso o user baixe a página
   antes da fonte. */
@font-face {
  font-family: 'Geist';
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/Geist-Variable.woff2') format('woff2-variations'),
       url('/assets/fonts/Geist-Variable.woff2') format('woff2');
}
@font-face {
  font-family: 'Geist Mono';
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/GeistMono-Variable.woff2') format('woff2-variations'),
       url('/assets/fonts/GeistMono-Variable.woff2') format('woff2');
}

/* ──────────── RESET ──────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html, body {
  width: 100%;
  min-height: 100%;
  /* `overflow-x: clip` previne overflow horizontal SEM criar scroll container,
     então position: sticky (da topbar) continua funcionando. */
  overflow-x: clip;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  line-height: var(--leading-normal);
  min-height: 100vh;
}

/* #app vira o flex-container principal pra que #topbar-root (sticky) tenha
   um containing block com altura total — isso é o que faz o sticky funcionar
   durante o scroll inteiro da página. */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#topbar-root {
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
  /* Safe-area (notch / barra de status) quando instalado como PWA standalone.
     env() = 0 no navegador normal, então não afeta desktop/mobile-web. */
  padding-top: env(safe-area-inset-top, 0);
  background: var(--bg);
}

#page-content {
  flex: 1 0 auto;
  min-width: 0;
}

main { min-width: 0; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}
button { cursor: pointer; }

[hidden] { display: none !important; }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease);
}

img, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Previne quebras de layout em flex/grid children com conteúdo longo
   (textos sem espaço quebrável, links grandes, etc) */
main, section, article, header, footer, nav, div {
  min-width: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}

p { line-height: var(--leading-normal); }

ul, ol { list-style: none; }

::selection {
  background: var(--neutral-900);
  color: var(--neutral-0);
}
html[data-theme="dark"] ::selection {
  background: var(--gold);
  color: var(--neutral-950);
}

/* ──────────── SCROLLBAR ──────────── */
::-webkit-scrollbar            { width: 10px; height: 10px; }
::-webkit-scrollbar-track      { background: var(--bg-subtle); }
::-webkit-scrollbar-thumb      { background: var(--neutral-300); border-radius: var(--radius-full); border: 2px solid var(--bg-subtle); }
::-webkit-scrollbar-thumb:hover{ background: var(--neutral-400); }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--neutral-700); border-color: var(--bg-subtle); }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: var(--neutral-600); }

/* ──────────── TRANSIÇÕES SUAVES (dark mode) ──────────── */
html, body, .topbar, .card, .btn, .field__input, .feature, .plan, .site-footer {
  transition: background-color var(--duration) var(--ease),
              border-color var(--duration) var(--ease),
              color var(--duration) var(--ease);
}

/* ──────────── UTILITÁRIOS ──────────── */
.icon      { width: 16px; height: 16px; flex-shrink: 0; }
.icon-sm   { width: 14px; height: 14px; flex-shrink: 0; }
.icon-lg   { width: 20px; height: 20px; flex-shrink: 0; }
.icon-xl   { width: 24px; height: 24px; flex-shrink: 0; }

.u-hidden  { display: none !important; }
.u-visible { display: block !important; }
.u-center  { text-align: center; }
.u-mono    { font-family: var(--font-mono); }

/* No-flash de tema antes do JS rodar */
html:not([data-theme]) { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
