/* Site da Nia. Tokens espelham lib/design/tokens.dart (céu, tinta, superfície).
   Layout: faixas de largura total; conteúdo em coluna de até 1120px; telas do app
   sempre dentro de uma moldura de celular. */
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/assets/fonts/PlusJakartaSans-Variable.ttf') format('truetype');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --bg: #F3F4F6;
  --surface: #FFFFFF;
  --ink: #111111;
  --muted: #5B6270;
  --line: #E5E7EB;
  --sky: #CFE8F7;
  --sky-soft: #DCEEF9;
  --sky-strong: #7CC4EA;
  --income: #1E7B4B;
  --expense: #B3261E;
  --on-ink: #FFFFFF;
  --band: #111111;
  --on-band: #FFFFFF;
  --on-band-muted: #B8BEC8;
  --frame: #111111;

  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r-sm: 12px;
  --r-card: 20px;
  --r-hero: 28px;
  --max: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1013; --surface: #171A1F; --ink: #F2F4F7; --muted: #A3AAB6; --line: #2A2F37;
    --sky: #1D3A4D; --sky-soft: #172C3A; --sky-strong: #7CC4EA;
    --income: #5CC48D; --expense: #F08A82; --on-ink: #111111;
    --band: #CFE8F7; --on-band: #111111; --on-band-muted: #3E4A55; --frame: #2B3038;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1013; --surface: #171A1F; --ink: #F2F4F7; --muted: #A3AAB6; --line: #2A2F37;
  --sky: #1D3A4D; --sky-soft: #172C3A; --sky-strong: #7CC4EA;
  --income: #5CC48D; --expense: #F08A82; --on-ink: #111111;
  --band: #CFE8F7; --on-band: #111111; --on-band-muted: #3E4A55; --frame: #2B3038;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--sky-strong); outline-offset: 3px; border-radius: 6px; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  font: 700 15px/1 var(--font); text-decoration: none; white-space: nowrap;
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--dark { background: var(--ink); color: var(--on-ink); }
.btn--ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--light { background: var(--on-band); color: var(--band); }
.btn--lg { min-height: 56px; padding: 0 28px; font-size: 16px; }

/* Cabeçalho */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--sky); }
.header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--sky) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
}
.header__row { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; min-width: 44px; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.brand img { width: 34px; height: 34px; border-radius: 50%; }
.nav { display: flex; gap: 22px; margin-left: 24px; }
.nav a { text-decoration: none; font-weight: 600; font-size: 15px; color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.header__cta { display: flex; gap: 8px; margin-left: auto; }
@media (max-width: 760px) { .nav { display: none; } }
@media (max-width: 420px) {
  .header__cta .btn { padding: 0 14px; font-size: 14px; }
  .brand span { display: none; }
}

/* Hero */
.hero { background: var(--sky); overflow: hidden; }
.hero__grid {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center;
  padding-block: 56px 0;
}
.hero__copy { min-width: 0; padding-bottom: 64px; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hero h1 { font-size: clamp(40px, 6.4vw, 72px); font-weight: 800; letter-spacing: -0.035em; margin-top: 14px; }
.hero h1 em { font-style: normal; background: linear-gradient(transparent 62%, var(--sky-strong) 62%); }
.hero__lead { font-size: 19px; color: var(--muted); margin-top: 20px; max-width: 34ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero__visual { position: relative; display: flex; justify-content: center; align-self: end; min-width: 0; }
/* O celular sai do banner: a parte de baixo fica cortada de propósito. */
.hero__visual .phone { margin-bottom: -160px; }
@media (max-width: 860px) { .hero__visual { max-height: 420px; overflow: hidden; } .hero__visual .phone { margin-bottom: 0; } }
.rings { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.rings span { position: absolute; border: 1.5px solid color-mix(in srgb, var(--surface) 70%, transparent); border-radius: 50%; }
.rings span:nth-child(1) { width: 340px; height: 340px; }
.rings span:nth-child(2) { width: 480px; height: 480px; }
.rings span:nth-child(3) { width: 620px; height: 620px; }
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; gap: 8px; padding-top: 40px; }
  .hero__copy { padding-bottom: 32px; }
}

/* Selos de loja (em breve) */
.stores { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.store {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 12px;
  border-radius: 12px; border: 1.5px solid color-mix(in srgb, var(--ink) 25%, transparent);
  color: var(--muted); font-size: 12px; line-height: 1.2; opacity: .85;
}
.store svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
.store b { display: block; color: var(--ink); font-size: 14px; }
.store small { display: block; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 10px; }

/* Moldura de celular */
.phone {
  width: min(300px, 78vw); aspect-ratio: 390 / 844; max-width: 100%;
  border-radius: 44px; padding: 10px; background: var(--frame);
  box-shadow: 0 30px 60px -20px rgba(17, 17, 17, .35);
  flex: none;
}
.phone__screen { width: 100%; height: 100%; border-radius: 34px; overflow: hidden; background: var(--sky-soft); position: relative; }
.phone__screen img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.phone--sm { width: min(250px, 70vw); border-radius: 38px; padding: 8px; }
.phone--sm .phone__screen { border-radius: 30px; }

/* Faixa de números/provas */
.strip { background: var(--surface); border-bottom: 1px solid var(--line); }
.strip__row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding-block: 36px; }
.strip__item { min-width: 0; }
.strip__item b { display: block; font-size: 17px; font-weight: 800; }
.strip__item span { color: var(--muted); font-size: 15px; }
@media (max-width: 860px) { .strip__row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .strip__row { grid-template-columns: 1fr; } }

/* Seções */
.section { padding-block: 96px; }
.section__head { max-width: 640px; margin-bottom: 56px; }
.section__head h2 { font-size: clamp(30px, 4.2vw, 46px); font-weight: 800; margin-top: 10px; }
.section__head p { color: var(--muted); font-size: 18px; margin-top: 14px; }

/* Feature com GIF, alternando os lados */
.feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center;
  padding-block: 40px;
}
.feature + .feature { border-top: 1px solid var(--line); }
.feature:nth-of-type(even) .feature__media { order: -1; }
.feature__copy { min-width: 0; max-width: 480px; }
.feature__tag {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: var(--sky); font-size: 13px; font-weight: 700;
}
.feature h3 { font-size: clamp(26px, 3vw, 34px); font-weight: 800; margin-top: 16px; }
.feature__copy > p { color: var(--muted); margin-top: 14px; font-size: 17px; }
.checks { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.checks li { position: relative; padding-left: 32px; font-size: 16px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat;
}
.feature__media { display: flex; justify-content: center; min-width: 0; position: relative; }
.feature__media::before {
  content: ""; position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%;
  background: var(--sky); top: 50%; left: 50%; transform: translate(-50%, -50%);
}
.feature__media .phone { position: relative; }
.money { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.money--in { color: var(--income); }
.money--out { color: var(--expense); }
@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; gap: 36px; padding-block: 48px; }
  .feature:nth-of-type(even) .feature__media { order: 0; }
  .feature__copy { max-width: none; }
}

/* Banner escuro (persona) */
.band { background: var(--band); color: var(--on-band); }
.band .eyebrow { color: var(--on-band-muted); }
.band__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; padding-block: 88px; }
.band h2 { font-size: clamp(30px, 4.2vw, 46px); font-weight: 800; margin-top: 10px; }
.band__grid > div { min-width: 0; }
.band p.lead { color: var(--on-band-muted); font-size: 18px; margin-top: 14px; }
.levels { display: grid; gap: 12px; }
.bubble {
  background: var(--surface); color: var(--ink); border-radius: 20px 20px 20px 6px;
  padding: 16px 18px; max-width: 460px;
}
.bubble small { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.bubble:nth-child(2) { margin-left: 28px; }
.bubble:nth-child(3) { margin-left: 56px; }
@media (max-width: 860px) {
  .band__grid { grid-template-columns: 1fr; gap: 36px; }
  .bubble:nth-child(n) { margin-left: 0; }
}

/* Grade de outras features */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tile { background: var(--surface); border-radius: var(--r-card); padding: 24px; min-width: 0; }
.tile__icon { width: 40px; height: 40px; border-radius: 12px; background: var(--sky); display: grid; place-items: center; }
.tile__icon svg { width: 20px; height: 20px; stroke: var(--ink); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tile h3 { font-size: 18px; font-weight: 800; margin-top: 16px; letter-spacing: -0.01em; }
.tile p { color: var(--muted); font-size: 15px; margin-top: 6px; }
.more { display: flex; justify-content: center; margin-top: 40px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

/* Passos */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.step { min-width: 0; border-top: 2px solid var(--ink); padding-top: 18px; }
.step::before { counter-increment: step; content: "Passo " counter(step); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.step h3 { font-size: 20px; font-weight: 800; margin-top: 8px; }
.step p { color: var(--muted); font-size: 15px; margin-top: 6px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* CTA final */
.cta { background: var(--sky); border-radius: var(--r-hero); padding: 56px 40px; text-align: center; position: relative; overflow: hidden; }
.cta h2 { font-size: clamp(30px, 4.6vw, 52px); font-weight: 800; }
.cta p { color: var(--muted); font-size: 18px; margin: 14px auto 0; max-width: 40ch; }
.cta .hero__actions { justify-content: center; }
.cta .stores { justify-content: center; }
@media (max-width: 560px) { .cta { padding: 40px 20px; } }

/* Página de recursos */
.page-hero { background: var(--sky); padding-block: 64px 56px; }
.page-hero h1 { font-size: clamp(36px, 5.4vw, 60px); font-weight: 800; margin-top: 12px; }
.page-hero p { color: var(--muted); font-size: 19px; margin-top: 16px; max-width: 46ch; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.toc a { text-decoration: none; padding: 8px 14px; border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 600; }
.group { padding-block: 64px; scroll-margin-top: 80px; }
.group + .group { border-top: 1px solid var(--line); }
.group__head { display: grid; grid-template-columns: 1fr 1.4fr; gap: 40px; margin-bottom: 32px; }
.group__head > * { min-width: 0; }
.group__head h2 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; }
.group__head p { color: var(--muted); font-size: 17px; }
.group__body { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: start; }
.group__body > .grid { grid-template-columns: repeat(2, 1fr); }
.group__body--solo { grid-template-columns: 1fr; }
.group__body--solo > .grid { grid-template-columns: repeat(3, 1fr); }
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--sky); color: var(--ink); margin-left: 6px; vertical-align: 2px; }
@media (max-width: 900px) {
  .group__head { grid-template-columns: 1fr; gap: 10px; }
  .group__body { grid-template-columns: 1fr; }
  .group__body .phone { margin: 0 auto; }
  .group__body--solo > .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) { .group__body > .grid, .group__body--solo > .grid { grid-template-columns: 1fr; } }

/* Rodapé */
.footer { padding-block: 56px 40px; margin-top: 96px; border-top: 1px solid var(--line); }
.footer__row { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; }
.footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.footer a { text-decoration: none; color: var(--muted); font-size: 15px; }
.footer a:hover { color: var(--ink); }
.footer small { color: var(--muted); font-size: 14px; }

/* 404 */
.notfound { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 16px; text-align: center; padding-inline: max(20px, env(safe-area-inset-left, 0px)) max(20px, env(safe-area-inset-right, 0px)); }
.notfound img { border-radius: 50%; }
.notfound h1 { font-size: 34px; font-weight: 800; }
.notfound p { color: var(--muted); }
.notfound__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }

/* ---------- Celular ---------- */
/* Barra de assuntos da página de funções: fica presa embaixo do cabeçalho. */
.toc-bar {
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + 68px); z-index: 15;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.toc-bar .toc { margin: 0; padding-block: 10px; }
.toc a { min-height: 44px; display: inline-flex; align-items: center; }
.footer nav a { min-height: 44px; display: inline-flex; align-items: center; }

@media (max-width: 860px) {
  .section { padding-block: 64px; }
  .section__head { margin-bottom: 32px; }
  .section__head p { font-size: 17px; }
  .band__grid { padding-block: 64px; }
  .group { padding-block: 44px; scroll-margin-top: 140px; }

  /* Recurso: título, depois a animação, depois o texto. */
  .feature { gap: 0; padding-block: 36px; }
  .feature__copy { display: contents; }
  .feature__tag { order: 1; justify-self: start; }
  .feature h3 { order: 2; margin-top: 12px; }
  .feature__media { order: 3; margin-block: 24px 20px; }
  .feature:nth-of-type(even) .feature__media { order: 3; }
  .feature__copy > p { order: 4; margin-top: 0; }
  .feature .checks { order: 5; }
  .feature__media::before { width: 92%; }

  /* Funções: a animação vem logo depois do título do assunto. */
  .group__body { gap: 24px; }
  .group__body > .phone { order: -1; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .header__row { min-height: 60px; gap: 10px; }
  .toc-bar { top: calc(env(safe-area-inset-top, 0px) + 60px); }
  .hero__grid { padding-top: 28px; }
  .hero__lead { font-size: 17px; margin-top: 14px; }
  .hero__actions { margin-top: 24px; }
  .hero__actions .btn { flex: 1 1 100%; }
  .stores { margin-top: 16px; }
  .store { flex: 1 1 0; }
  .hero__visual { max-height: 360px; }

  .strip__row { grid-template-columns: repeat(2, 1fr); gap: 18px 16px; padding-block: 24px; }
  .strip__item b { font-size: 15px; line-height: 1.3; }
  .strip__item span { font-size: 13px; line-height: 1.4; display: block; margin-top: 4px; }

  .phone--sm { width: min(220px, 62vw); }
  .feature h3 { font-size: 26px; }
  .feature__copy > p { font-size: 16px; }
  .checks { gap: 10px; margin-top: 16px; }
  .checks li { font-size: 15px; }

  .bubble { padding: 14px 16px; }

  /* Listas de funções viram um cartão só, com linhas, em vez de dezenas de cartões. */
  .grid { gap: 0; background: var(--surface); border-radius: var(--r-card); overflow: hidden; }
  .tile { background: none; border-radius: 0; padding: 16px 18px; }
  .tile + .tile { border-top: 1px solid var(--line); }
  .tile h3 { font-size: 16px; margin-top: 0; }
  .tile p { font-size: 14px; margin-top: 4px; }
  .tile__icon { display: none; }

  .steps { gap: 24px; }
  .cta { padding: 36px 20px; border-radius: 22px; }
  .cta .hero__actions .btn { flex: 1 1 100%; }
  .page-hero { padding-block: 36px 28px; }
  .page-hero p { font-size: 17px; }
  .group__head { margin-bottom: 20px; }
  .group__head p { font-size: 16px; }
  .footer { margin-top: 64px; padding-block: 32px; }
  .footer nav { gap: 4px 18px; }
}

/* A barra de assuntos rola de lado no celular, sem quebrar em várias linhas. */
@media (max-width: 760px) {
  .toc-bar .toc { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
  .toc-bar .toc::-webkit-scrollbar { display: none; }
  .toc-bar .toc a { flex: none; scroll-snap-align: start; }
}
