/* ═══ base: reset, tipografia, movimento, primitivas (herdada do Farol) ═══ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--bg); color: var(--txt);
  font: 400 var(--t-17)/1.45 var(--f-texto);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3, .display { font-family: var(--f-display); letter-spacing: -.02em; text-wrap: balance; }
h1 { font-size: var(--t-28); font-weight: 700; line-height: 1.15; }
h2 { font-size: var(--t-22); font-weight: 600; line-height: 1.2; }
h3 { font-size: var(--t-17); font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.n { font-family: var(--f-display); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.t-15 { font-size: var(--t-15); }
.t-13 { font-size: var(--t-13); }
.t-2 { color: var(--txt-2); }
.t-3 { color: var(--txt-3); }
.rotulo {
  font-size: var(--t-11); font-weight: 600; color: var(--txt-3);
  text-transform: var(--rotulo-transform, uppercase); letter-spacing: var(--rotulo-espaco, .06em);
  font-variant-caps: var(--rotulo-variante, normal);
}
[data-carreira="juridico"] .rotulo { font-size: var(--t-13); }
a { color: var(--acc); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:where(button, a, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; border-radius: var(--r-s); }

.ic { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-20 { width: 20px; height: 20px; }
.ic-16 { width: 16px; height: 16px; }

/* ── telas ── */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.tela { display: none; flex: 1; width: 100%; max-width: var(--col); margin: 0 auto; padding: calc(var(--s-8) + var(--sa-t)) var(--s-4) calc(var(--aba-h) + var(--sa-b) + var(--s-6)); }
.tela.ativa { display: block; animation: entra var(--d-tela) var(--mola) both; }
.tela.sem-abas { padding-bottom: calc(var(--sa-b) + var(--s-6)); }
@keyframes entra { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.tela > * + * { margin-top: var(--s-6); }
.bloco > * + * { margin-top: var(--s-3); }

/* ── botões: um primário por tela ── */
.bt {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 52px; padding: 0 var(--s-5); border-radius: var(--r-pill);
  font-weight: 600; font-size: var(--t-17);
  background: var(--acc); color: var(--acc-txt);
  transition: transform var(--d-toque) var(--mola), opacity var(--d-toque), background var(--d-tela);
}
.bt:active { transform: scale(.97); }
.bt:disabled { opacity: .4; cursor: default; }
.bt-largo { width: 100%; }
.bt-2 { background: var(--sup-2); color: var(--txt); }
.bt-3 { background: transparent; color: var(--acc); min-height: 44px; padding: 0 var(--s-3); }
.bt-ic { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; background: var(--sup-2); color: var(--txt); display: inline-grid; place-items: center; transition: transform var(--d-toque) var(--mola); }
.bt-ic:active { transform: scale(.94); }
@media (hover: hover) { .bt:hover { filter: brightness(1.06); } .bt-2:hover, .bt-ic:hover { filter: brightness(.97); } }

/* ── campos ── */
.busca { position: relative; }
.busca .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--txt-3); }
.busca input { width: 100%; min-height: 52px; padding: 0 var(--s-4) 0 46px; background: var(--sup); border: 1px solid var(--sep); border-radius: var(--r); }
.busca input:focus-visible { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.busca input::placeholder { color: var(--txt-3); }

/* ── lista agrupada ── */
.lista { background: var(--sup); border-radius: var(--r); overflow: hidden; }
.item {
  display: flex; align-items: center; gap: var(--s-3); min-height: 60px;
  padding: var(--s-3) var(--s-4); width: 100%; text-align: left;
  border-bottom: 1px solid var(--sep); transition: background var(--d-toque);
}
.item:last-child { border-bottom: 0; }
button.item:active { background: var(--sup-2); }
@media (hover: hover) { button.item:hover { background: color-mix(in srgb, var(--sup-2) 55%, var(--sup)); } }
.item-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.item-txt b { font-weight: 500; font-size: var(--t-17); }
.item-txt span { font-size: var(--t-13); color: var(--txt-2); }
.item-dir { flex: none; font-size: var(--t-15); color: var(--txt-2); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: var(--s-2); }
.item-dir .ic { color: var(--txt-3); }
.item-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--acc-soft); color: var(--acc); flex: none; }

/* ── segmentado, chips, selos ── */
.seg { display: flex; padding: 3px; background: var(--sup-2); border-radius: var(--r-s); }
.seg button { flex: 1; min-height: 40px; border-radius: 8px; font-size: var(--t-15); font-weight: 500; color: var(--txt-2); transition: background var(--d-toque), color var(--d-toque); }
.seg button[aria-pressed="true"] { background: var(--sup); color: var(--txt); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip { min-height: 40px; padding: 0 var(--s-4); border-radius: var(--r-pill); background: var(--sup); border: 1px solid var(--sep); font-size: var(--t-15); font-weight: 500; transition: border-color var(--d-toque), background var(--d-toque), color var(--d-toque); }
.chip[aria-pressed="true"] { background: var(--acc-soft); border-color: var(--acc); color: var(--acc); }
.selo { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 10px; border-radius: var(--r-pill); background: var(--sup-2); font-size: var(--t-13); font-weight: 500; color: var(--txt-2); white-space: nowrap; }
.selo.exemplo { background: color-mix(in srgb, var(--aten) 14%, transparent); color: var(--aten); }

/* ── barra de abas (vidro) ── */
.abas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: center; padding-bottom: var(--sa-b);
  background: var(--vidro); border-top: 1px solid var(--vidro-borda);
  box-shadow: inset 0 1px 0 var(--vidro-brilho);
  -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6);
}
.abas-in { position: relative; display: flex; width: 100%; max-width: var(--col); height: var(--aba-h); }
.aba { position: relative; z-index: 1; flex: 1; display: grid; justify-items: center; align-content: center; gap: 3px; color: var(--txt-3); font-size: var(--t-11); font-weight: 500; transition: color var(--d-toque); }
.aba[aria-current="page"] { color: var(--acc); }
.aba .ic { width: 25px; height: 25px; }
.abas-ind { position: absolute; left: 0; top: 8px; width: calc(100% / 6); height: calc(var(--aba-h) - 16px); border-radius: var(--r); pointer-events: none; background: var(--acc-soft); transform: translateX(calc(var(--aba-i, 0) * 100%)); transition: transform var(--d-volta) var(--retorno); }
body.sem-abas .abas { display: none; }

/* ── folha modal (vidro) ── */
.veu { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity var(--d-folha); }
.veu.aberto { opacity: 1; pointer-events: auto; }
.folha {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  margin: 0 auto; max-width: var(--col);
  background: var(--vidro); border: 1px solid var(--vidro-borda); border-bottom: 0;
  box-shadow: inset 0 1px 0 var(--vidro-brilho), 0 -12px 40px -16px var(--vidro-sombra);
  -webkit-backdrop-filter: blur(28px) saturate(1.6); backdrop-filter: blur(28px) saturate(1.6);
  border-radius: var(--r-l) var(--r-l) 0 0;
  padding: var(--s-3) var(--s-5) calc(var(--s-6) + var(--sa-b));
  max-height: 88dvh; overflow-y: auto;
  transform: translateY(102%); transition: transform var(--d-folha) var(--mola), visibility 0s linear var(--d-folha);
  visibility: hidden;   /* fechada: fora do Tab e do leitor de tela (some depois da animação) */
}
.folha.aberta { transform: none; visibility: visible; transition: transform var(--d-folha) var(--mola), visibility 0s; }
.folha.arrastando { transition: none; }
.folha::before { content: ""; display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--txt-3); opacity: .4; margin: 0 auto var(--s-4); }
.folha > * + * { margin-top: var(--s-4); }

/* ── vidro genérico: só no que flutua ── */
.vidro {
  position: relative; background: var(--vidro); border: 1px solid var(--vidro-borda);
  box-shadow: inset 0 1px 0 var(--vidro-brilho), 0 10px 30px -12px var(--vidro-sombra);
  -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5);
}
.vidro::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(140px 70px at var(--bx, 30%) var(--by, -10%), var(--vidro-brilho), transparent 70%); opacity: .35; }
:root.sobrio .vidro, :root.sobrio .abas, :root.sobrio .folha { -webkit-backdrop-filter: none; backdrop-filter: none; background: color-mix(in srgb, var(--sup) 97%, transparent); }
:root.sobrio .vidro::before { display: none; }

/* ── aviso ── */
.aviso { position: fixed; left: 50%; bottom: calc(var(--aba-h) + var(--sa-b) + var(--s-4)); transform: translate(-50%, 12px); z-index: 50; padding: var(--s-3) var(--s-5); border-radius: var(--r-pill); background: var(--txt); color: var(--bg); font-size: var(--t-15); font-weight: 500; opacity: 0; pointer-events: none; transition: opacity var(--d-tela), transform var(--d-tela) var(--mola); white-space: nowrap; }
.aviso.mostra { opacity: 1; transform: translate(-50%, 0); }

/* ── claro/escuro: sol ↔ lua ── */
.tema { position: fixed; top: calc(var(--s-3) + var(--sa-t)); right: max(var(--s-4), calc(50% - var(--col) / 2 + var(--s-4))); z-index: 35; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--txt-2); transition: transform var(--d-volta) var(--retorno), color 250ms, opacity 200ms; }
.tema:active { transform: scale(.9); transition-duration: var(--d-toque); }
.tema svg { width: 22px; height: 22px; overflow: visible; }
.tema .nucleo { fill: currentColor; r: 5px; transition: r var(--d-volta) var(--retorno); }
.tema .raios { stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; transform-origin: 12px 12px; transition: transform var(--d-volta) var(--retorno), opacity 180ms; }
.tema .mascara-c { cx: 30px; cy: -4px; transition: cx 260ms var(--mola), cy 260ms var(--mola); }
[data-modo="escuro"] .tema .nucleo { r: 8.5px; }
[data-modo="escuro"] .tema .raios { transform: scale(0) rotate(45deg); opacity: 0; }
[data-modo="escuro"] .tema .mascara-c { cx: 17px; cy: 7px; }
.rolado .tema { opacity: 0; pointer-events: none; transform: translateY(-8px); }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

@media (min-width: 720px) { .tela { padding-inline: var(--s-6); } }
@media (prefers-reduced-motion: reduce) { .tela.ativa { animation: none; } }
/* aberto pelo ícone da tela de início: some o que só faz sentido no navegador */
@media (display-mode: standalone) { .so-navegador { display: none !important; } }
a.item { color: inherit; }
