/* Reset básico das telas de acesso. */
html, body { margin: 0; }
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
/* Alto contraste com o mesmo filtro do pretium_front (classe aplicada por tema.js). */
html.contrast { filter: contrast(1.3) saturate(1.1); }
/* Texto de ajuda fixo abaixo do campo (padrão infoMessage do PretiumFrame) e link com ícone. */
.field-info { font-size: 12px; font-weight: 500; color: var(--muted); }
.link-icon { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.link-icon svg { width: 16px; height: 16px; }
a.brand { text-decoration: none; }
/* Layout: tela dividida, formulário enxuto à esquerda e vitrine animada do produto à direita (Folha, eSocial, DP). */
:root {
  --brand: #046a96;
  --link: #046a96;
  --lime: #d8df16;
  --bg: #ffffff;
  --field: #ffffff;
  --field-line: #d4d4d4;
  --field-hover: #a1a1a1;
  --placeholder: #71717a;
  --fg: #262626;
  --muted: #737373;
  --line: #d4d4d4;
  --focus: #046a96;
  --btn: #046a96;
  --btn-hover: #035a80;
  --btn-ink: #ffffff;
  --ghost-bg: #ffffff;
  --ghost-line: #d4d4d4;
  --ghost-hover: #fafafa;
  --ghost-ink: #4b5563;
  --check-line: #d4d4d8;
  --check-bg: #ffffff;
  --logo-ink: #046a96;
  --logo-grey: #504d4d;
  --panel: #046a96;
  --panel-2: #02506f;
  --panel-ink: #ffffff;
  --panel-muted: rgba(255, 255, 255, .8);
  --panel-line: rgba(255, 255, 255, .18);
  --panel-chip: rgba(255, 255, 255, .12);
  --card: #ffffff;
  --card-ink: #262626;
  --card-muted: #737373;
  --card-line: #d4d4d4;
  --card-soft: #f5f5f5;
  --ok: #15803d;
  --ok-bg: #f0fdf4;
  --ok-line: #4ade80;
  --ok-solid: #16a34a;
  --info: #1d4ed8;
  --info-bg: #eff6ff;
  --info-line: #60a5fa;
  --warn: #c2410c;
  --warn-bg: #fff7ed;
  --warn-line: #fb923c;
  --soft: #404040;
  --soft-bg: #fafafa;
  --soft-line: #a1a1a1;
  --err: #ef4444;
  --invalid: #f87171;
  --money-in: #16a34a;
  --money-out: #dc2626;
  --money-net: #2563eb;
  --progress: #5db6da;
  --danger: #dc2626;
  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Sora", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Sora", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #94cee9;
    --link: #d5ecf7;
    --bg: #171717;
    --field: #262626;
    --field-line: #525252;
    --field-hover: #737373;
    --placeholder: #a1a1aa;
    --fg: #e5e5e5;
    --muted: #a1a1a1;
    --line: #404040;
    --focus: #5db6da;
    --btn: #046a96;
    --btn-hover: #035a80;
    --btn-ink: #ffffff;
    --ghost-bg: #262626;
    --ghost-line: #525252;
    --ghost-hover: #404040;
    --ghost-ink: #e5e5e5;
    --check-line: #3f3f46;
    --check-bg: #09090b;
    --logo-ink: #5db6da;
    --logo-grey: #a1a1a1;
    --panel: #022d40;
    --panel-2: #011f2c;
    --panel-ink: #f5f5f5;
    --panel-muted: rgba(229, 229, 229, .75);
    --panel-line: rgba(148, 206, 233, .14);
    --panel-chip: rgba(93, 182, 218, .1);
    --card: #262626;
    --card-ink: #e5e5e5;
    --card-muted: #a1a1a1;
    --card-line: #404040;
    --card-soft: #1f1f1f;
    --ok: #86efac;
    --ok-bg: rgba(20, 83, 45, .5);
    --ok-line: #4ade80;
    --ok-solid: #22c55e;
    --info: #93c5fd;
    --info-bg: rgba(30, 58, 138, .5);
    --info-line: #60a5fa;
    --warn: #fdba74;
    --warn-bg: rgba(124, 45, 18, .5);
    --warn-line: #fb923c;
    --soft: #d4d4d4;
    --soft-bg: rgba(23, 23, 23, .5);
    --soft-line: #a1a1a1;
    --err: #ef4444;
    --invalid: #fca5a5;
    --money-in: #4ade80;
    --money-out: #f87171;
    --money-net: #60a5fa;
    --progress: #5db6da;
    --danger: #f87171;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #94cee9;
  --link: #d5ecf7;
  --bg: #171717;
  --field: #262626;
  --field-line: #525252;
  --field-hover: #737373;
  --placeholder: #a1a1aa;
  --fg: #e5e5e5;
  --muted: #a1a1a1;
  --line: #404040;
  --focus: #5db6da;
  --btn: #046a96;
  --btn-hover: #035a80;
  --btn-ink: #ffffff;
  --ghost-bg: #262626;
  --ghost-line: #525252;
  --ghost-hover: #404040;
  --ghost-ink: #e5e5e5;
  --check-line: #3f3f46;
  --check-bg: #09090b;
  --logo-ink: #5db6da;
  --logo-grey: #a1a1a1;
  --panel: #022d40;
  --panel-2: #011f2c;
  --panel-ink: #f5f5f5;
  --panel-muted: rgba(229, 229, 229, .75);
  --panel-line: rgba(148, 206, 233, .14);
  --panel-chip: rgba(93, 182, 218, .1);
  --card: #262626;
  --card-ink: #e5e5e5;
  --card-muted: #a1a1a1;
  --card-line: #404040;
  --card-soft: #1f1f1f;
  --ok: #86efac;
  --ok-bg: rgba(20, 83, 45, .5);
  --ok-line: #4ade80;
  --ok-solid: #22c55e;
  --info: #93c5fd;
  --info-bg: rgba(30, 58, 138, .5);
  --info-line: #60a5fa;
  --warn: #fdba74;
  --warn-bg: rgba(124, 45, 18, .5);
  --warn-line: #fb923c;
  --soft: #d4d4d4;
  --soft-bg: rgba(23, 23, 23, .5);
  --soft-line: #a1a1a1;
  --err: #ef4444;
  --invalid: #fca5a5;
  --money-in: #4ade80;
  --money-out: #f87171;
  --money-net: #60a5fa;
  --progress: #5db6da;
  --danger: #f87171;
  color-scheme: dark;
}

html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .35s ease, color .35s ease;
}
* { box-sizing: border-box; }
button, input { font: inherit; color: inherit; }
/* Foco igual ao do sistema: contorno fino na cor primária, sem anel de sombra. */
:focus-visible { outline: 1px solid var(--focus); outline-offset: 2px; }

.login {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
}

/* ---------- Lado do formulário ---------- */
.auth {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-block: 36px 28px;
  padding-left: max(28px, env(safe-area-inset-left, 0px));
  padding-right: max(28px, env(safe-area-inset-right, 0px));
  background: var(--bg);
  transition: background .35s ease;
}
.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1000px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { flex: none; width: 112px; height: auto; display: block; }
.logo path[fill="#046a96"] { fill: var(--logo-ink); transition: fill .35s ease; }
.logo path[fill="#504D4D"] { fill: var(--logo-grey); }
/* Logo vivo: os quadradinhos flutuam cada um no seu ritmo e o pingo do i pula. Unidades no sistema do viewBox (1000 x 280). */
.logo .px { transform-box: fill-box; transform-origin: center; animation: pxfloat var(--d, 3.4s) ease-in-out var(--delay, 0s) infinite; }
.logo .px.burst { animation: pxburst 1s cubic-bezier(.2, .8, .3, 1) var(--bd, 0s) both; }
@keyframes pxburst {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  35% { transform: translate(var(--bx), var(--by)) rotate(var(--br)) scale(1.15); }
  70% { transform: translate(calc(var(--bx) * -.15), calc(var(--by) * -.15)) rotate(calc(var(--br) * -.25)) scale(.95); }
  100% { transform: translate(0, 0) rotate(0deg) scale(1); }
}
@keyframes pxfloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  30% { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); }
  65% { transform: translate(calc(var(--dx) * -.6), calc(var(--dy) * -.8)) rotate(calc(var(--r) * -1)); }
}
.logo .letter { transform-box: fill-box; transform-origin: 50% 100%; }
.logo .letter.wiggle { animation: letterjelly .75s cubic-bezier(.3, .7, .4, 1); }
@keyframes letterjelly {
  0%, 100% { transform: none; }
  18% { transform: translateY(-16px) scale(1.06, .94) rotate(-5deg); }
  38% { transform: translateY(0) scale(.94, 1.06) rotate(4deg); }
  58% { transform: translateY(-6px) rotate(-2deg); }
  78% { transform: translateY(0) rotate(1deg); }
}
.logo .idot.dotburst { transform-origin: 50% 50%; animation: dotburst 1.1s cubic-bezier(.25, .8, .3, 1) both; }
@keyframes dotburst {
  0% { transform: translateY(0) rotate(0deg) scale(1); }
  12% { transform: translateY(6px) rotate(0deg) scale(1.25, .7); }
  45% { transform: translateY(-110px) rotate(360deg) scale(1.2); }
  75% { transform: translateY(0) rotate(720deg) scale(1.2, .8); }
  88% { transform: translateY(-14px) rotate(720deg) scale(1); }
  100% { transform: translateY(0) rotate(720deg) scale(1); }
}
.logo .idot { transform-box: fill-box; transform-origin: 50% 100%; animation: idot 1.9s cubic-bezier(.3, 0, .4, 1) infinite; }
@keyframes idot {
  0%, 52%, 100% { transform: translateY(0) scale(1, 1); }
  8% { transform: translateY(0) scale(1.18, .78); }
  24% { transform: translateY(-38px) scale(.92, 1.1); }
  40% { transform: translateY(0) scale(1.15, .82); }
  46% { transform: translateY(-6px) scale(1, 1); }
}

/* Botão de tema no padrão PretiumButton "light" só com ícone: mostra o ícone do modo para o qual vai trocar. */
.theme-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--ghost-line);
  border-radius: 6px;
  background: var(--ghost-bg);
  color: var(--ghost-ink);
  cursor: pointer;
  transition: background-color .3s ease, border-color .3s ease;
}
.theme-toggle:hover { background: var(--ghost-hover); }
.theme-toggle svg { width: 18px; height: 18px; }
:root[data-mode="light"] .theme-toggle .sun,
:root[data-mode="dark"] .theme-toggle .moon { display: none; }

.auth-main {
  flex: 1;
  display: grid;
  place-items: center;
}
.form-wrap { width: 100%; max-width: 440px; display: grid; gap: 28px; }
.greeting { display: grid; gap: 10px; }
h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 2.6vw, 36px);
  line-height: 1.1;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.greeting { text-align: center; }
.greeting h1 { white-space: nowrap; }
.greeting p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* Campos no padrão PretiumFrame + PretiumInputText (tamanho large): rótulo semibold, borda cinza 1px,
   foco só troca a cor da borda para a primária, erro em text-xs vermelho. Sem sombra. */
form { display: grid; gap: 16px; }
.field { display: grid; gap: 4px; }
.field label { font-weight: 600; font-size: 14px; color: var(--fg); }
.control {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--field-line);
  border-radius: 6px;
  background: var(--field);
  transition: border-color .2s ease, background-color .35s ease;
}
.control:hover { border-color: var(--field-hover); }
.control:focus-within { border-color: var(--btn); }
.control[data-invalid="true"] { border-color: var(--invalid); }
.control input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: .625rem .875rem;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg);
  outline: none;
}
.control input::placeholder { color: var(--placeholder); }
.control[data-invalid="true"] input::placeholder { color: var(--err); }
/* Preenchimento automático do navegador: mantém o fundo e a cor do campo em vez do cinza-azulado padrão. */
.control input:-webkit-autofill,
.control input:-webkit-autofill:hover,
.control input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--fg);
  caret-color: var(--fg);
  -webkit-box-shadow: 0 0 0 1000px var(--field) inset;
  box-shadow: 0 0 0 1000px var(--field) inset;
  border-radius: 6px;
  transition: background-color 600000s 0s, color 600000s 0s;
}
.control input:autofill { filter: none; box-shadow: 0 0 0 1000px var(--field) inset; }
.peek {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-right: 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.peek:hover { color: var(--fg); }
.peek svg { width: 18px; height: 18px; }
.hint { min-height: 16px; font-size: 12px; color: var(--err); }
.hint:empty { min-height: 0; }
.hint.caps { color: var(--warn); }

.row-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 16px;
}
/* Link no padrão PretiumButton "transparent-primary". */
.link {
  color: var(--link);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Botão no padrão PretiumButton "primary": fundo primary-500 nos dois temas, borda da mesma cor, cantos de 6px, font-medium. */
.btn-primary {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  border: 1px solid var(--btn);
  border-radius: 6px;
  background: var(--btn);
  color: var(--btn-ink);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all .3s ease;
}
.btn-primary:hover { background: var(--btn-hover); }
/* Ao passar o mouse, um bando de quadradinhos verde-limão (os pixels do logo) atravessa o botão por trás do texto. */
.btn-primary > *, .btn-cancel > * { position: relative; z-index: 1; }
.btn-primary::after, .btn-cancel::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -140px;
  width: 130px;
  pointer-events: none;
  opacity: .9;
  background:
    linear-gradient(var(--px-c, var(--lime)), var(--px-c, var(--lime))) 4px 27px / 4px 4px no-repeat,
    linear-gradient(var(--px-c, var(--lime)), var(--px-c, var(--lime))) 14px 11px / 5px 5px no-repeat,
    linear-gradient(var(--px-c, var(--lime)), var(--px-c, var(--lime))) 26px 30px / 6px 6px no-repeat,
    linear-gradient(var(--px-c, var(--lime)), var(--px-c, var(--lime))) 38px 6px / 6px 6px no-repeat,
    linear-gradient(var(--px-c, var(--lime)), var(--px-c, var(--lime))) 50px 20px / 8px 8px no-repeat,
    linear-gradient(var(--px-c, var(--lime)), var(--px-c, var(--lime))) 66px 33px / 5px 5px no-repeat,
    linear-gradient(var(--px-c, var(--lime)), var(--px-c, var(--lime))) 72px 9px / 9px 9px no-repeat,
    linear-gradient(var(--px-c, var(--lime)), var(--px-c, var(--lime))) 90px 24px / 7px 7px no-repeat,
    linear-gradient(var(--px-c, var(--lime)), var(--px-c, var(--lime))) 104px 5px / 6px 6px no-repeat,
    linear-gradient(var(--px-c, var(--lime)), var(--px-c, var(--lime))) 112px 17px / 10px 10px no-repeat,
    linear-gradient(var(--px-c, var(--lime)), var(--px-c, var(--lime))) 118px 33px / 5px 5px no-repeat;
}
.btn-primary:hover::after, .btn-cancel:hover::after { animation: pxrun .95s cubic-bezier(.45, .1, .3, 1) forwards; }
@keyframes pxrun {
  0% { left: -140px; opacity: .95; }
  80% { opacity: .95; }
  100% { left: calc(100% + 10px); opacity: 0; }
}
.btn-primary svg { width: 1.2rem; height: 1.2rem; transition: transform .2s ease; }
.btn-primary:hover svg.arrow { transform: translateX(4px); }
.btn-primary .spin { display: none; width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn-primary:disabled { cursor: not-allowed; }
.btn-primary[data-state="loading"] .spin { display: block; }
.btn-primary[data-state="loading"] svg.arrow { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.divider { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 12.8px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Botão secundário no padrão PretiumButton "light". */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  border: 1px solid var(--ghost-line);
  border-radius: 6px;
  background: var(--ghost-bg);
  color: var(--ghost-ink);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: all .3s ease;
}
.btn-ghost:hover { background: var(--ghost-hover); }
.btn-ghost svg { width: 1.2rem; height: 1.2rem; }

.auth-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.rise { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.rise.d1 { animation-delay: .05s; } .rise.d2 { animation-delay: .12s; } .rise.d3 { animation-delay: .19s; } .rise.d4 { animation-delay: .26s; }
@keyframes rise { from { transform: translateY(14px); opacity: .001; } to { transform: none; opacity: 1; } }

/* ---------- Vitrine ---------- */
.show {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  padding-block: 56px;
  padding-left: max(40px, env(safe-area-inset-left, 0px));
  padding-right: max(40px, env(safe-area-inset-right, 0px));
  color: var(--panel-ink);
  background: linear-gradient(155deg, var(--panel) 0%, var(--panel-2) 100%);
  transition: background .35s ease;
}
.show::before, .show::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  border: 1px solid var(--panel-line);
  pointer-events: none;
}
.show::before { width: 760px; height: 760px; right: -330px; top: -360px; background: radial-gradient(closest-side, rgba(255,255,255,.07), transparent); }
.show::after { width: 620px; height: 620px; left: -260px; bottom: -380px; background: radial-gradient(closest-side, rgba(216,223,22,.08), transparent); }
#pixels { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }

.show-inner { width: 100%; max-width: 600px; margin-inline: auto; display: grid; gap: 22px; }
.show h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 2.3vw, 34px);
  line-height: 1.12;
  letter-spacing: -.03em;
  text-wrap: balance;
}

/* Contorno do card: o traço de 3px corre centralizado sobre a borda (metade dentro, metade fora) e a bolinha fica no centro dele. */
.card-progress { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 2; }
.card-progress rect { fill: none; stroke-width: 3; }
.card-progress .cp-track { stroke: none; }
.card-progress .cp-bar { stroke: var(--progress); stroke-dasharray: 0 100; }
.card-progress .cp-dot { fill: var(--progress); opacity: 0; transition: opacity .2s ease; }
.card-heading {
  display: grid;
  gap: 3px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--card-line);
}
.tab-label { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; font-size: 16px; color: var(--card-ink); }
.tab-label svg { flex: none; width: 26px; height: 26px; color: var(--brand); }
.tab-sub { font-size: 13px; color: var(--card-muted); padding-left: 36px; }

/* Cenas empilhadas na mesma célula: a área fica com a altura da maior e não muda ao trocar de cena. */

.stage { display: grid; }
.scene { display: flex; flex-direction: column; }
.scene > .card { position: relative; overflow: visible; flex: 1; display: flex; flex-direction: column; padding-top: 24px; }
.card-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
/* Carrossel: um card por vez; o card inclina de leve seguindo o mouse. */
.stage {
  transform: perspective(1100px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform .45s ease-out;
}
.scene {
  grid-area: 1 / 1;
  pointer-events: none;
}
.scene[data-pos="0"] { z-index: 3; transform: none; opacity: 1; pointer-events: auto; cursor: grab; touch-action: pan-y; }
.scene[data-pos="1"] { z-index: 2; }
.scene[data-pos="2"] { z-index: 1; }
.scene.dragging { transition: none; cursor: grabbing; }
.scene.snap { transition: none !important; }

/* Troca deslizante (carrossel clássico): só o card da vez aparece; o próximo entra por um lado
   enquanto o atual sai pelo outro. --odir é o lado da saída e --idir o lado de onde o próximo espera. */
.stage { padding-bottom: 0; }
.scene { transition: transform .5s cubic-bezier(.4, 0, .2, 1), opacity .5s ease; }
.scene[data-pos="1"],
.scene[data-pos="2"] { transform: translateX(calc(var(--idir, 1) * 110%)); opacity: 0; pointer-events: none; }
.scene[data-pos="out"] { z-index: 4; transform: translateX(calc(var(--odir, -1) * 110%)); opacity: 0; }

/* Card no padrão PretiumCard: borda 1px neutral-300 (escuro neutral-700), cantos de 6px, sem sombra. */
.card {
  background: var(--card);
  color: var(--card-ink);
  border: 1px solid var(--card-line);
  border-radius: 6px;
  padding: 16px;
  transition: background-color .35s ease, color .35s ease, border-color .35s ease;
}
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.card-title { display: grid; gap: 2px; min-width: 0; }
.card-title strong { font-size: 15px; }
.card-title span { font-size: 12.5px; color: var(--card-muted); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Situação no padrão PretiumTag / useFolhaStatusStyle: borda colorida 1px, fundo 50 (escuro 900/50), texto 700 (escuro 300), font-medium. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--soft-line);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--soft);
  background: var(--soft-bg);
  /* Sem transição de cor: a troca de situação é imediata, sem passar por tons intermediários. */
  transition: none;
}
.pill[data-tone="info"] { color: var(--info); background: var(--info-bg); border-color: var(--info-line); }
.pill[data-tone="ok"] { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.pill[data-tone="warn"] { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill[data-tone="info"] .dot { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* Folha */
.folha-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px; }
.speed { display: grid; gap: 14px; align-content: start; }
.metric small { display: block; font-size: .8rem; color: var(--card-muted); font-weight: 500; }
.metric .big { font-family: var(--font-display); font-weight: 700; font-size: clamp(36px, 4vw, 52px); letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.metric .big .unit { font-size: .42em; font-weight: 700; color: var(--card-muted); margin-left: 6px; letter-spacing: 0; }
.track { height: 10px; border-radius: 99px; background: var(--card-soft); overflow: hidden; }
.track span { position: relative; display: block; height: 100%; width: 0; border-radius: inherit; overflow: hidden; background: var(--btn); }
.bolt { justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--card-line); background: var(--card-soft); font-size: 13.5px; font-weight: 500; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.steps li { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 10px; font-size: 13.5px; color: var(--card-muted); transition: color .2s ease; }
.steps li .st { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--card-line); display: grid; place-items: center; transition: all .2s ease; }
.steps li .st svg { width: 12px; height: 12px; opacity: 0; color: #fff; }
.totals b.scramble { font-family: var(--font-display); font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }
.totals .prov b { color: var(--money-in); }
.totals .desc b { color: var(--money-out); }
.totals .liq b { color: var(--money-net); }
.steps li[data-state="run"] { color: var(--card-ink); font-weight: 600; }
.steps li[data-state="run"] .st { border-color: var(--brand); border-top-color: transparent; animation: spin .8s linear infinite; }
.steps li[data-state="done"] { color: var(--card-ink); }
.steps li[data-state="done"] .st { background: var(--ok-solid); border-color: var(--ok-solid); }
.steps li[data-state="done"] .st svg { opacity: 1; }
.totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--card-line); transition: opacity .4s ease; }
.totals div { display: grid; gap: 2px; min-width: 0; }
.totals small { font-size: .8rem; color: var(--card-muted); font-weight: 500; }
.totals b { font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* eSocial */
.flow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 8px; border: 1px solid var(--card-line); background: var(--card-soft); margin-bottom: 14px; }
.node { display: grid; justify-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: var(--card-muted); }
.node b { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 6px; background: var(--card); border: 1px solid var(--card-line); color: var(--brand); transition: background-color .4s ease, border-color .4s ease, color .4s ease; }
.node b svg { width: 22px; height: 22px; }
.node.lit b { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok); }
.wire { position: relative; height: 2px; background: repeating-linear-gradient(90deg, var(--card-line) 0 6px, transparent 6px 11px); }
.wire i { position: absolute; top: -3px; left: 0; width: 8px; height: 8px; border-radius: 2px; background: var(--lime); opacity: 0; }
.wire.active i { animation: travel 1.1s linear infinite; }
.wire.active i:nth-child(2) { animation-delay: .37s; }
.wire.active i:nth-child(3) { animation-delay: .74s; }
@keyframes travel { 0% { left: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: calc(100% - 8px); opacity: 0; } }
/* Situação de cada evento como ícone: Criado (tracejado), Aguardando envio (relógio), Enviado (avião), Processado com sucesso (check). */
.ev-st { display: grid; place-items: center; width: 20px; height: 20px; }
.ev-st svg { grid-area: 1 / 1; display: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ev-st[data-state="criado"] { color: var(--card-muted); }
.ev-st[data-state="aguardando"] { color: var(--warn); }
.ev-st[data-state="enviado"] { color: var(--info); }
.ev-st[data-state="processado"] { color: var(--ok-solid); }
.ev-st[data-state="criado"] .i-criado,
.ev-st[data-state="aguardando"] .i-aguardando,
.ev-st[data-state="enviado"] .i-enviado,
.ev-st[data-state="processado"] .i-processado { display: block; animation: stpop .3s ease; }
@keyframes stpop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.events { list-style: none; margin: 0; padding: 0; display: grid; }
.events li { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--card-line); font-size: 13.5px; }
.events li:last-child { border-bottom: 0; }
/* Código do evento como selo de duas partes: o S num quadradinho azul e o número em azul sobre fundo azul claro. */
.code { --c: #046a96; display: inline-flex; align-items: center; justify-self: start; gap: 6px; padding: 2px 8px 2px 2px; border-radius: 6px; background: color-mix(in srgb, var(--c) 13%, transparent); color: var(--c); font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.code b { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; background: var(--c); color: #ffffff; font-size: 12px; font-weight: 700; }
/* No modo escuro o número clareia para manter o contraste sobre o card cinza. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .code { color: color-mix(in srgb, var(--c) 55%, #ffffff); background: color-mix(in srgb, var(--c) 22%, transparent); } }
:root[data-theme="dark"] .code { color: color-mix(in srgb, var(--c) 55%, #ffffff); background: color-mix(in srgb, var(--c) 22%, transparent); }
.ev-name { min-width: 0; display: grid; text-align: center; }
.ev-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* DP */
.dp-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 22px; }
.person { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.avatar { flex: none; width: 44px; height: 44px; border-radius: 6px; border: 1px solid var(--card-line); background: var(--card-soft); color: var(--brand); display: grid; place-items: center; }
.avatar svg { width: 22px; height: 22px; }
.person div { min-width: 0; display: grid; gap: 2px; }
.person strong { font-size: 14.5px; font-weight: 600; }
.person span { font-size: 12.5px; color: var(--card-muted); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; display: grid; gap: 10px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--card-line); }
/* Cada etapa aparece com a bolinha vazada; quando a próxima aparece, a anterior é pintada. */
.timeline li { position: relative; display: grid; grid-template-columns: 12px minmax(0, 1fr); align-items: center; gap: 12px; font-size: 13.5px; opacity: .001; transform: translateX(-8px); transition: opacity .4s ease, transform .4s ease; }
.timeline li.shown { opacity: 1; transform: none; }
.timeline li i { width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 3px solid var(--brand); transition: background-color .3s ease; }
.timeline li.on i { background: var(--brand); animation: dotpop .35s ease; }
.timeline li.now i { border-color: var(--danger); }
.timeline li.now i { width: 16px; height: 16px; margin-left: -2px; border-width: 2px; }
.timeline li.now.on i { background: var(--danger) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7 7 17'/%3E%3C/svg%3E") center / 9px no-repeat; }
@keyframes dotpop { 50% { transform: scale(1.35); } }
.timeline li span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* A etapa que acabou de ser pintada fica em negrito, como nas etapas da folha. */
.timeline li.cur span { font-weight: 600; }
.timeline li time { font-family: var(--font-mono); font-size: 12px; color: var(--card-muted); }
.gauge { display: grid; justify-items: center; align-content: start; gap: 14px; padding: 14px; border-radius: 8px; border: 1px solid var(--card-line); background: var(--card-soft); }
.gauge h4 { margin: 0; font-size: 13px; font-weight: 600; justify-self: start; }
.gauge svg { width: 100%; max-width: 160px; height: auto; }
.gauge .ring-bg { fill: none; stroke: var(--card-line); stroke-width: 12; }
.gauge .seg { fill: none; stroke-width: 12; stroke-linecap: butt; }
.gauge .g-total { font-family: var(--font-display); font-weight: 700; font-size: 19px; fill: var(--card-ink); }
.gauge .g-cap { font-size: 12px; fill: var(--card-muted); font-weight: 500; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; width: 100%; font-size: 12.5px; }
.legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend b { font-variant-numeric: tabular-nums; }

/* Destaque da frase da vitrine: opção 5, a última palavra troca no lugar entre moderna, integrada e transparente.
   As três ficam empilhadas na mesma célula, então a largura é a da maior e a frase não pula. */
/* Junto com a opção 2: o começo da frase fica fino e em branco suave, e a palavra que troca em peso forte. */
.show h2 { font-weight: 300; color: var(--panel-muted); }
.show h2 .rot { display: inline-grid; vertical-align: bottom; overflow: hidden; font-weight: 800; }
.show h2 .rot-w {
  grid-area: 1 / 1;
  justify-self: start;
  color: var(--lime);  opacity: 0;
  transform: translateY(.7em);
  transition: opacity .45s ease, transform .5s cubic-bezier(.2, .8, .3, 1);
}
.show h2 .rot-w.on { opacity: 1; transform: none; }
.show h2 .rot-w.off { opacity: 0; transform: translateY(-.7em); }

/* ---------- Vitrine compacta ---------- */
.show-inner { max-width: 440px; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.show h2 { font-size: clamp(19px, 1.8vw, 26px); line-height: 1.15; }
.stage, .scene { min-width: 0; }
.stage { width: 100%; }
.scene > .card { padding: 14px 12px 10px; border-radius: 12px; }
.card-heading { margin-bottom: 10px; padding-bottom: 9px; gap: 2px; }
.tab-label { font-size: 13.5px; gap: 8px; }
.tab-label svg { width: 24px; height: 24px; }
.tab-sub { font-size: 12px; padding-left: 32px; }
.card-head { margin-bottom: 9px; }
.card-title strong { font-size: 13px; }
.pill { font-size: 12px; padding: 1px 7px; }
.folha-grid, .dp-grid { gap: 12px; }
.speed { gap: 10px; }
.metric small { font-size: 12px; }
.metric .big { font-size: clamp(26px, 2.5vw, 34px); }
.track { height: 8px; }
.bolt { font-size: 12px; padding: 6px 10px; }
.steps { gap: 5px; }
.steps li { font-size: 12px; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; }
.steps li .st { width: 18px; height: 18px; }
.steps li .st svg { width: 10px; height: 10px; }
.totals { margin-top: 10px; padding-top: 9px; gap: 8px; }
.totals small { font-size: 12px; }
.totals b.scramble { font-size: 13px; }
.flow { padding: 8px 12px; margin-bottom: 6px; gap: 10px; }
.node { font-size: 12px; }
.node b { width: 32px; height: 32px; border-radius: 8px; }
.node b svg { width: 17px; height: 17px; }
.events li { padding: 5px 2px; font-size: 12px; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; }
.code { font-size: 12px; padding: 2px 7px 2px 2px; gap: 5px; }
.code b { width: 18px; height: 18px; font-size: 12px; }
.person { margin-bottom: 9px; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 8px; }
.avatar svg { width: 18px; height: 18px; }
.person strong { font-size: 13px; }
.person span { font-size: 12px; }
.timeline { gap: 6px; }
.timeline li { font-size: 12px; }
.gauge { padding: 10px; gap: 8px; }
.gauge h4 { font-size: 12px; }
.gauge svg { max-width: 108px; }
.legend { font-size: 12px; gap: 4px; }

/* ---------- Avisos, acessibilidade e controles ---------- */
/* Aviso acima do formulário no padrão PretiumTag: borda 400, fundo 50 (escuro 900/50), texto 700 (escuro 300). */
.alert {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--soft-bg);
  color: var(--soft);
  font-size: 13px;
  line-height: 1.45;
}
.alert strong { font-weight: 600; }
.alert[data-tone="err"] { border-color: var(--invalid); background: color-mix(in srgb, var(--err) 10%, transparent); color: var(--err); }
.alert[data-tone="warn"] { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn); }
.alert[data-tone="info"] { border-color: var(--info-line); background: var(--info-bg); color: var(--info); }
.alert[data-tone="ok"] { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok); }

/* Alinhamento: saudação centralizada, então o rodapé e o "Voltar para o login" também ficam no centro. "Esqueci minha senha" fica à direita, junto do campo de senha. */
.row-end { justify-content: center; }
#loginForm .row-end { justify-content: flex-end; }
.auth-foot { justify-content: center; text-align: center; flex-direction: column; gap: 6px; }

/* Botão de pausar animações, fixo no canto inferior direito da tela, sobre o painel azul. */
.motion-btn {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  background: var(--panel-chip);
  color: var(--panel-ink);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .2s ease;
}
.motion-btn:hover { background: rgba(255, 255, 255, .22); }
/* Sem a vitrine (celular e tablet em pé), o botão fica sobre o fundo claro do login e entra no fluxo,
   abaixo do rodapé, para não cobrir o texto do rodapé nem os campos quando a página rola. */
@media (max-width: 960px) {
  .motion-btn { position: static; justify-self: center; margin-bottom: max(16px, env(safe-area-inset-bottom, 0px)); border-color: var(--ghost-line); background: var(--ghost-bg); color: var(--muted); }
  .motion-btn:hover { background: var(--ghost-hover); color: var(--fg); }
}
.motion-btn svg { width: 12px; height: 12px; }
:root.motion-paused *, :root.motion-paused *::before, :root.motion-paused *::after { animation-play-state: paused !important; }

/* Dica do botão de tema ao passar o mouse ou focar. */
.theme-toggle { position: relative; }
.theme-toggle::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--fg);
  color: var(--bg);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
  z-index: 10;
}
.theme-toggle:hover::after, .theme-toggle:focus-visible::after { opacity: 1; }

/* Indicadores dos cards: o da vez é mais largo e enche junto com o tempo do card. */
.dots { display: flex; justify-content: center; gap: 8px; }
.dot-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: width .3s ease;
}
.dot-btn::before { content: ""; grid-area: 1 / 1; width: 100%; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .3); }
.dot-btn span { grid-area: 1 / 1; justify-self: start; width: 100%; height: 4px; border-radius: 99px; background: var(--lime); transform-origin: left; transform: scaleX(0); }
.dot-btn[aria-current="true"] { width: 44px; }
.dot-btn:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; border-radius: 4px; }

/* Pingo do i pulando com pausa entre os pulos (mais calmo). */
.logo .idot { animation: idotslow 3.8s cubic-bezier(.3, 0, .4, 1) infinite; }
@keyframes idotslow {
  0%, 26%, 100% { transform: translateY(0) scale(1, 1); }
  4% { transform: translateY(0) scale(1.18, .78); }
  12% { transform: translateY(-38px) scale(.92, 1.1); }
  20% { transform: translateY(0) scale(1.15, .82); }
  23% { transform: translateY(-6px) scale(1, 1); }
}

/* ---------- Modal de definir ou recuperar senha ---------- */
.modal {
  width: min(520px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--fg);
}
.modal[open] { animation: modalin .22s cubic-bezier(.2, .8, .3, 1); }
@keyframes modalin { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal::backdrop { background: rgba(10, 20, 27, .5); }
.modal-in { display: grid; gap: 16px; padding: 20px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-ic { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.modal-ic svg { width: 24px; height: 24px; }
.modal-x { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.modal-x:hover { background: var(--ghost-hover); color: var(--fg); }
.modal-x svg { width: 18px; height: 18px; }
.modal-text { display: grid; gap: 6px; }
.modal-text h3 { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.modal-text p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.req { margin-left: 4px; color: #ff0a0a; }
.modal-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 8px; }
/* Cancelar: botão "light" do sistema com os quadradinhos passando em vermelho. */
.btn-cancel { --px-c: var(--danger); position: relative; overflow: hidden; cursor: pointer; font-family: inherit; }
/* No Cancelar os quadradinhos atravessam da direita para a esquerda (desenho espelhado para a frente do grupo ir na direção do movimento). */
.btn-cancel::after { left: calc(100% + 10px); transform: scaleX(-1); }
.btn-cancel:hover::after { animation: pxrunback .95s cubic-bezier(.45, .1, .3, 1) forwards; }
@keyframes pxrunback {
  0% { left: calc(100% + 10px); opacity: .95; }
  80% { opacity: .95; }
  100% { left: -140px; opacity: 0; }
}
@media (max-width: 420px) { .modal-actions { grid-template-columns: minmax(0, 1fr); } }

/* No celular e no tablet em pé, a vitrine sai e fica só o login. */
@media (max-width: 960px) { .show { display: none; } }

/* ---------- Tela cheia no desktop: tudo cabe na janela, sem rolagem ---------- */
@media (min-width: 961px) {
  .login { height: 100%; min-height: 0; }
  .auth, .show { height: 100%; min-height: 0; overflow: hidden; }
  .auth { padding-block: clamp(16px, 3.6vh, 36px) clamp(12px, 2.6vh, 28px); gap: clamp(10px, 2.4vh, 32px); }
  .auth-main { min-height: 0; overflow: visible; }
  .show { padding-block: clamp(20px, 4.5vh, 56px); }
  .show-inner { gap: clamp(14px, 2.6vh, 26px); }
  .form-wrap { gap: clamp(16px, 2.8vh, 28px); }
  .fit { transform-origin: 50% 50%; will-change: transform; }
}

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .folha-grid, .dp-grid { grid-template-columns: minmax(0, 1fr); }
  .gauge { grid-template-columns: auto minmax(0, 1fr); justify-items: start; align-items: center; }
  .gauge h4 { grid-column: 1 / -1; }
  .gauge svg { width: 120px; }
}
@media (max-width: 960px) {
  .login { grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr auto; }
  .auth { min-height: auto; gap: 28px; }
  .auth-main { padding-block: 12px 8px; }
  .show { padding-block: 44px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
}
@media (max-width: 520px) {
  .auth { padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); padding-block: 22px; }
  .logo { width: 96px; }
  .brand { gap: 8px; }
  .card { padding: 16px; }
  .events li { grid-template-columns: 58px minmax(0, 1fr); }
  .events li .pill { grid-column: 2; justify-self: start; }
  .totals { grid-template-columns: minmax(0, 1fr); }
  .gauge { grid-template-columns: minmax(0, 1fr); justify-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
