/* static/style.css — Portal NF do Vendedor */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/poppins-700.woff2") format("woff2"); }
:root {
  --navy: #303e6d;          /* navy institucional RB (extraído do logo) */
  --navy-2: #3a4a82;
  --brand: #303e6d;
  --brand-dark: #26315a;
  --brand-grad: linear-gradient(155deg, #3a4a82 0%, #2a3760 100%);
  --teal: #303e6d;          /* acento decorativo → navy institucional */
  --coral: #c98a2e;         /* alerta de pendência → âmbar (atenção) */
  --display: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ink: #1b2533;
  --muted: #5b6878;
  --line: #e6e9ef;
  --line-2: #eef1f6;
  --bg: #eef2f7;
  --card: #ffffff;
  --ok: #137a52;
  --ok-bg: #e3f5ec;
  --warn: #9a6b00;
  --warn-bg: #fff3d6;
  --danger: #b3261e;
  --danger-bg: #fdeceb;
  --gray: #455160;
  --gray-bg: #eceff3;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16,36,64,.06), 0 8px 24px rgba(16,36,64,.08);
  --shadow-sm: 0 1px 2px rgba(16,36,64,.06), 0 2px 8px rgba(16,36,64,.05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font);
  margin: 0;
  background: linear-gradient(180deg, #f6f8fb 0%, var(--bg) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Cartão / container ---------- */
.container {
  max-width: 560px;
  margin: 2.5rem auto;
  padding: 1.75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- Tipografia ---------- */
h1 { font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; margin: 0 0 1.25rem; color: var(--navy); }
h2 {
  font-size: 1.05rem; font-weight: 700; color: var(--navy); margin: 1.6rem 0 .7rem;
  padding-left: .6rem; border-left: 3px solid var(--brand);
}
h3 { font-size: .9rem; font-weight: 700; color: var(--gray); text-transform: uppercase;
     letter-spacing: .04em; margin: 1.1rem 0 .45rem; }
p { margin: 0 0 1rem; }
strong { color: var(--ink); }

/* ---------- Formulários ---------- */
label { display: block; margin-bottom: .35rem; font-size: .85rem; font-weight: 600; color: var(--gray); }
input[type=text], input[type=date], input[type=file], input[type=password], select {
  width: 100%;
  padding: .65rem .8rem;
  border: 1px solid #d3d9e3;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  margin-bottom: 1rem;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47,111,237,.15);
}
input[type=file] { padding: .5rem .6rem; background: #fafbfd; cursor: pointer; }
input::placeholder { color: #9aa6b4; }

/* ---------- Botões ---------- */
.btn {
  display: block; width: 100%; padding: .75rem 1rem;
  background: var(--brand); color: #fff;
  border: 1px solid var(--brand); border-radius: var(--radius-sm);
  font-size: .95rem; font-weight: 600; font-family: inherit;
  cursor: pointer; text-align: center; text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn-outline { background: #fff; color: var(--navy); border: 1px solid #cdd5e0; box-shadow: none; }
.btn-outline:hover { background: var(--line-2); border-color: #b9c3d2; }
/* Micro-interação de press: feedback tátil instantâneo (transform → GPU). */
.btn:active, .sair:active, .chip:active, .btn-filtro:active { transform: scale(.97); }

/* ---------- Mensagens ---------- */
.erro {
  color: var(--danger); font-size: .9rem; margin-bottom: 1rem;
  padding: .7rem .9rem; background: var(--danger-bg);
  border: 1px solid #f3cbc8; border-left: 3px solid var(--danger); border-radius: var(--radius-sm);
}

/* ---------- Cabeçalho de página (título + ações) ---------- */
.topo { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.topo h1 { margin: 0; }
.sair {
  font-size: .85rem; font-weight: 600; color: var(--gray);
  background: #fff; border: 1px solid #cdd5e0; border-radius: 999px;
  padding: .4rem .9rem; cursor: pointer; text-decoration: none; font-family: inherit;
  transition: background .15s, border-color .15s;
}
.sair:hover { background: var(--line-2); border-color: #b9c3d2; }

/* ---------- Cards de cobrança (RCA) ---------- */
.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem; margin-bottom: 1rem; background: #fff; box-shadow: var(--shadow-sm);
}
.valor { font-size: 1.4rem; font-weight: 800; letter-spacing: -.01em; color: var(--navy); }
.info-box {
  background: var(--line-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 1rem; font-size: .9rem; margin-bottom: 1.25rem;
}
.cob-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.cob-comp { font-size: .8rem; color: var(--muted); font-weight: 600; margin-bottom: .15rem; }
.cob-warn { font-size: .85rem; color: var(--danger); margin: .6rem 0 0; }
.hint { font-size: .9rem; color: var(--muted); margin-bottom: 1.25rem; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: .25rem .65rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  border: 1px solid transparent; white-space: nowrap;
}
.badge-aberta     { background: var(--warn-bg); color: var(--warn); border-color: #f0dca8; }
.badge-divergente { background: var(--danger-bg); color: var(--danger); border-color: #f3cbc8; }
.badge-enviada    { background: var(--ok-bg); color: var(--ok); border-color: #bfe6d2; }
.badge-cancelada,
.badge-substituida { background: var(--gray-bg); color: var(--gray); border-color: #d8dee6; }

/* ---------- Tela de login (auth) ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.auth-card {
  width: 100%; max-width: 410px; background: #fff;
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  overflow: hidden;
}
.auth-top { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; padding: 1.6rem 1.6rem 1.4rem; }
.auth-logo {
  width: 46px; height: 46px; border-radius: 11px; background: rgba(255,255,255,.14);
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: .8rem;
}
.auth-title { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; }
.auth-sub { font-size: .85rem; color: #b9c6da; margin-top: .15rem; }
.auth-body { padding: 1.6rem; }
.auth-body h1 { display: none; }
.auth-hint { font-size: .85rem; color: var(--muted); margin: 0 0 1.25rem; }
.auth-foot { font-size: .8rem; color: var(--muted); text-align: center; margin: 1.1rem 0 0; }
/* Animações da tela de login — CSS puro (sem dependência de JS). */
@keyframes authIn { from { opacity: 0; transform: translateY(40px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes authUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  15%, 75% { transform: translateX(-9px); }
  30%, 60% { transform: translateX(9px); }
  45%      { transform: translateX(-5px); }
}
@keyframes authFade { from { opacity: 0; } to { opacity: 1; } }
.auth-card { animation: authIn .7s cubic-bezier(.16,1,.3,1) both; }
/* Conteúdo interno entra em sequência (mais perceptível). */
.auth-top { animation: authUp .55s .12s cubic-bezier(.16,1,.3,1) both; }
.auth-body { animation: authUp .55s .22s cubic-bezier(.16,1,.3,1) both; }
/* Com erro: entra e, ao terminar, dá um shake chamando atenção à falha. */
.auth-card.is-erro { animation: authIn .5s cubic-bezier(.16,1,.3,1) both, authShake .55s .55s both; }
/* Acessibilidade: com "reduzir movimento", trocamos deslize/escala/shake por um
   fade suave (opacity não dispara desconforto vestibular), mas ainda visível. */
@media (prefers-reduced-motion: reduce) {
  .auth-card, .auth-card.is-erro { animation: authFade .6s ease both; }
  .auth-top, .auth-body { animation: none; }
}

/* ---------- KPIs / cards resumo ---------- */
.cards-row { display: flex; flex-wrap: wrap; gap: .8rem; }
.card.mini {
  flex: 1; min-width: 158px; margin-bottom: 0; padding: .9rem 1rem;
  border-radius: var(--radius-sm);
}
.mini-label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.mini-num { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; color: var(--navy); line-height: 1.15; }
.mini-when { font-size: 1rem; font-weight: 700; color: var(--ink); }
.mini-sub { font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.vazio { color: var(--muted); font-size: .88rem; padding: .35rem 0 .8rem; }

/* ---------- Tabelas ---------- */
table.grid {
  width: 100%; border-collapse: separate; border-spacing: 0; font-size: .83rem;
  margin-bottom: 1rem; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
}
table.grid th, table.grid td { padding: .6rem .7rem; text-align: left; border-bottom: 1px solid var(--line-2); }
table.grid th {
  background: #f4f6fa; color: var(--gray); font-weight: 700;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
table.grid tbody tr:last-child td { border-bottom: none; }
table.grid tbody tr:hover td { background: #f7f9fc; }

/* ---------- Filtro ---------- */
.filtro {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: .8rem;
  margin: .5rem 0 .25rem; padding: 1rem; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.filtro label { font-size: .78rem; color: var(--gray); margin: 0; }
.filtro select { margin: .25rem 0 0; min-width: 120px; }
.btn-filtro { display: inline-block; width: auto; padding: .6rem 1.2rem; }
.competencia { font-size: .9rem; color: var(--ink); margin: .5rem 0 0; }

/* ---------- Acompanhamento de notas (vendedor) ---------- */
.topo-acoes { display: flex; align-items: center; gap: .6rem; }
.kpi-pend .mini-num { color: var(--warn); }   /* pendente "salta aos olhos" */
.nf-toolbar { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center;
              justify-content: space-between; margin: 1.25rem 0 1rem; }
.chips { display: inline-flex; gap: .4rem; flex-wrap: wrap; }
.chip {
  font-size: .85rem; font-weight: 600; color: var(--gray);
  background: #fff; border: 1px solid #cdd5e0; border-radius: 999px;
  padding: .4rem .9rem; cursor: pointer; font-family: inherit;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { background: var(--line-2); }
.chip.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.nf-busca { flex: 1; min-width: 200px; max-width: 320px; margin: 0; }
.nf-list { display: flex; flex-direction: column; gap: .6rem; }
.nf-card {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: .9rem 1.1rem;
}
.nf-main { flex: 1 1 200px; min-width: 0; }
.nf-num { font-size: .78rem; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.nf-cli { font-weight: 600; color: var(--ink); }
.nf-meta { text-align: right; }
.nf-valor { font-weight: 800; color: var(--navy); }
.nf-data { font-size: .8rem; color: var(--muted); }
.badge-pendente { background: var(--warn-bg); color: var(--warn); border-color: #f0dca8; }
.nf-acao { width: auto; flex: none; padding: .5rem 1rem; font-size: .85rem; white-space: nowrap; }
.nf-vazio {
  text-align: center; color: var(--muted); font-size: .92rem;
  padding: 2rem 1rem; background: #fff; border: 1px dashed var(--line);
  border-radius: var(--radius); margin: 0;
}
@media (max-width: 560px) {
  .nf-meta { text-align: left; }
  .nf-card .badge { order: 3; }
}

/* ---------- Trilha de desenvolvimento (estilo Netflix/xperiun) ---------- */
.trail-hero { display: flex; gap: 1.4rem; background: var(--brand-grad); color: #fff;
              border-radius: 18px; padding: 1.4rem; box-shadow: var(--shadow); }
.trail-hero-thumb { width: 120px; height: 120px; border-radius: 14px; background: rgba(255,255,255,.14);
                    display: grid; place-items: center; font-size: 3rem; flex: none; }
.trail-hero-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.trail-eyebrow { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.72); }
.trail-hero-title { font-family: var(--display); font-size: 1.5rem; margin: .2rem 0 .7rem; color: #fff; }
.trail-progress { height: 8px; border-radius: 999px; background: rgba(255,255,255,.22); overflow: hidden; max-width: 420px; }
.trail-progress-bar { height: 100%; background: #fff; border-radius: 999px; }
.trail-progress-label { font-size: .8rem; color: rgba(255,255,255,.85); margin-top: .4rem; }
.trail-hero .btn { width: auto; display: inline-block; margin-top: .9rem; background: #fff; color: var(--navy); border-color: #fff; }
.trail-hero .btn:hover { background: #eef1f6; }
.trail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.trail-card { display: block; text-decoration: none; color: inherit; background: #fff; border: 1px solid var(--line);
              border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; }
.trail-card:hover { transform: translateY(-4px) scale(1.02); box-shadow: var(--shadow); }
.trail-thumb { position: relative; height: 120px; background: linear-gradient(140deg, var(--navy-2), var(--navy));
               display: grid; place-items: center; }
.trail-emoji { font-size: 2.7rem; }
.trail-num { position: absolute; top: .5rem; left: .65rem; font-family: var(--display); font-weight: 700;
             font-size: .85rem; color: rgba(255,255,255,.6); }
.trail-play { position: absolute; right: .6rem; bottom: .6rem; width: 30px; height: 30px; border-radius: 50%;
              background: rgba(255,255,255,.92); color: var(--navy); display: grid; place-items: center;
              font-size: .75rem; opacity: 0; transition: opacity .15s; }
.trail-card:hover .trail-play { opacity: 1; }
.trail-card-body { padding: .8rem .9rem; }
.trail-card-title { font-weight: 600; font-size: .92rem; color: var(--ink); line-height: 1.25; }
.trail-card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: .5rem;
                   font-size: .75rem; color: var(--muted); }
.trail-status { font-weight: 600; }
.trail-status.ok { color: var(--ok); }
.trail-status.now { color: var(--brand); }
.trail-card.is-concluido .trail-thumb { background: linear-gradient(140deg, #1f7a66, #0f5132); }
.trail-card.is-andamento .trail-thumb { box-shadow: inset 0 0 0 3px var(--brand); }
@media (max-width: 560px) { .trail-hero { flex-direction: column; } }

/* ---------- Trilha — modo imersivo (xperiun) ---------- */
.main.trail-page { background: radial-gradient(1100px 560px at 85% -15%, #20305f 0, #0e1730 55%, #0c1428 100%); }
.trail-page .topbar h1 { color: #fff; }
.trail-page .topbar-date, .trail-page .hint { color: #9aa6c4; }
.trail-page .tag-ex { background: rgba(255,255,255,.1); color: #c7d0e6; }
.xp-hero { position: relative; overflow: hidden; border-radius: 22px; padding: 2.2rem 2.4rem;
  background: linear-gradient(120deg, #283879 0%, #161f3e 70%); border: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 26px 70px rgba(0,0,0,.45); display: flex; align-items: center; gap: 1.5rem; }
.xp-hero-glow { position: absolute; inset: -45% -12% auto auto; width: 440px; height: 440px; border-radius: 50%;
  background: radial-gradient(circle, rgba(91,120,255,.45), transparent 62%); pointer-events: none; }
.xp-hero-inner { position: relative; z-index: 1; flex: 1; min-width: 0; }
.xp-hero-emoji { position: relative; z-index: 1; font-size: 5rem; flex: none; filter: drop-shadow(0 12px 22px rgba(0,0,0,.45)); }
.xp-hero-poster { position: relative; z-index: 1; width: 160px; height: 160px; flex: none; border-radius: 16px;
  object-fit: cover; box-shadow: 0 14px 30px rgba(0,0,0,.45); }
@media (max-width: 560px) { .xp-hero-poster { width: 100%; height: 180px; } }
.xp-eyebrow { font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #8aa0ff; }
.xp-hero-title { font-family: var(--display); font-weight: 700; font-size: 2.1rem; line-height: 1.1; color: #fff; margin: .4rem 0 .35rem; }
.xp-hero-sub { color: #aeb8d6; font-size: .9rem; }
.xp-progress { height: 9px; border-radius: 999px; background: rgba(255,255,255,.14); overflow: hidden; max-width: 460px; margin: 1.1rem 0 .45rem; }
.xp-progress-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #5b78ff, #8aa0ff); }
.xp-progress-label { font-size: .8rem; color: #aeb8d6; }
.xp-cta { width: auto; display: inline-block; margin-top: 1.1rem; background: #5b78ff; border-color: #5b78ff; box-shadow: 0 12px 26px rgba(91,120,255,.4); }
.xp-cta:hover { background: #4a67f0; border-color: #4a67f0; }
.xp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.3rem 0; }
.xp-stat { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); border-radius: 14px; padding: 1rem 1.2rem; }
.xp-stat-num { font-family: var(--display); font-weight: 800; font-size: 1.6rem; color: #fff; }
.xp-stat-label { font-size: .8rem; color: #9aa6c4; }
.xp-row-head { display: flex; align-items: baseline; justify-content: space-between; margin: 1.5rem 0 .9rem; }
.xp-row-head h2 { color: #fff; margin: 0; }
.xp-row-sub { color: #8896b8; font-size: .85rem; }
.xp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.1rem; }
.xp-card { display: block; text-decoration: none; color: inherit; border-radius: 16px; overflow: hidden;
  background: #18223f; border: 1px solid rgba(255,255,255,.07); transition: transform .18s, box-shadow .18s, border-color .18s; }
.xp-card:hover { transform: translateY(-6px); box-shadow: 0 22px 44px rgba(0,0,0,.5); border-color: rgba(91,120,255,.5); }
.xp-card:focus-visible { outline: 2px solid #8aa0ff; outline-offset: 2px; }
.xp-thumb { position: relative; aspect-ratio: 1 / 1; background: #141d3a; overflow: hidden; }
.xp-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.xp-emoji { font-size: 2.9rem; filter: drop-shadow(0 6px 12px rgba(0,0,0,.4)); transition: opacity .18s; }
.xp-num { position: absolute; top: .55rem; left: .7rem; font-family: var(--display); font-weight: 800; font-size: 1rem; color: rgba(255,255,255,.45); }
.xp-dur { position: absolute; top: .55rem; right: .7rem; font-size: .68rem; font-weight: 600; color: #dfe5f5;
  background: rgba(0,0,0,.4); padding: .12rem .45rem; border-radius: 999px; }
.xp-check { position: absolute; top: .5rem; right: .6rem; width: 26px; height: 26px; border-radius: 50%;
  background: var(--ok); color: #fff; display: grid; place-items: center; font-size: .8rem; font-weight: 700; }
.xp-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.7); width: 46px; height: 46px;
  border-radius: 50%; background: rgba(91,120,255,.95); color: #fff; display: grid; place-items: center; font-size: 1rem;
  opacity: 0; transition: opacity .18s, transform .18s; }
.xp-card:hover .xp-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.xp-card:hover .xp-emoji { opacity: .25; }
.xp-card-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.15); }
.xp-card-progress i { display: block; height: 100%; background: #5b78ff; }
.xp-card-body { padding: .85rem .95rem 1rem; }
.xp-card-title { font-weight: 600; font-size: .95rem; color: #eef2fb; line-height: 1.25; }
.xp-card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: .55rem; font-size: .76rem; color: #8896b8; }
.xp-tag { font-weight: 700; }
.xp-tag.ok { color: #4ad7a0; }
.xp-tag.now { color: #8aa0ff; }
.xp-card.is-andamento { border-color: rgba(91,120,255,.55); box-shadow: 0 0 0 1px rgba(91,120,255,.25), 0 18px 40px rgba(91,120,255,.18); }
.xp-card.is-concluido .xp-thumb { background: linear-gradient(145deg, #1f5f50, #0f2a26); }
@media (max-width: 560px) { .xp-hero { flex-direction: column; } .xp-stats { grid-template-columns: 1fr; } }

/* ---------- Tela de sucesso (NF enviada) ---------- */
.success-head { text-align: center; padding: .5rem 0 1rem; }
.checkmark {
  width: 92px; height: 92px; display: block; margin: 0 auto 1.1rem;
  border-radius: 50%; stroke-width: 3; stroke: var(--ok); stroke-miterlimit: 10;
  box-shadow: inset 0 0 0 0 var(--ok-bg);
  animation: ck-fill .5s ease-in-out .5s forwards, ck-scale .35s ease-in-out .95s both;
}
.checkmark-circle {
  stroke-dasharray: 166; stroke-dashoffset: 166; stroke-width: 3;
  stroke: var(--ok); fill: none;
  animation: ck-stroke .7s cubic-bezier(.65,0,.45,1) forwards;
}
.checkmark-check {
  stroke-dasharray: 48; stroke-dashoffset: 48; stroke: var(--ok);
  transform-origin: 50% 50%;
  animation: ck-stroke .35s cubic-bezier(.65,0,.45,1) .9s forwards;
}
@keyframes ck-stroke { 100% { stroke-dashoffset: 0; } }
@keyframes ck-scale { 0%, 100% { transform: none; } 50% { transform: scale(1.1); } }
@keyframes ck-fill { 100% { box-shadow: inset 0 0 0 48px var(--ok-bg); } }
.success-title {
  font-size: 1.3rem; color: var(--navy); margin: 0 0 .35rem;
  opacity: 0; animation: fadeUp .5s ease .7s forwards;
}
.success-sub { color: var(--muted); font-size: .92rem; margin: 0;
  opacity: 0; animation: fadeUp .5s ease .85s forwards; }

.summary {
  margin-top: 1.3rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; box-shadow: var(--shadow-sm); overflow: hidden;
}
.sum-row {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .7rem 1rem; border-bottom: 1px solid var(--line-2);
  opacity: 0; animation: fadeUp .45s ease forwards;
}
.sum-row:last-child { border-bottom: none; }
.sum-k { color: var(--muted); font-size: .85rem; }
.sum-v { font-weight: 600; text-align: right; word-break: break-word; }
.sum-valor { color: var(--ok); font-size: 1.05rem; font-weight: 800; }
.sum-chave { font-size: .8rem; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.sum-row:nth-child(1) { animation-delay: 1.0s; }
.sum-row:nth-child(2) { animation-delay: 1.08s; }
.sum-row:nth-child(3) { animation-delay: 1.16s; }
.sum-row:nth-child(4) { animation-delay: 1.24s; }
.sum-row:nth-child(5) { animation-delay: 1.32s; }
.sum-row:nth-child(6) { animation-delay: 1.40s; }
.sum-row:nth-child(7) { animation-delay: 1.48s; }
.sum-row:nth-child(8) { animation-delay: 1.56s; }
.sum-row:nth-child(9) { animation-delay: 1.64s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .checkmark, .checkmark-circle, .checkmark-check,
  .success-title, .success-sub, .sum-row { animation: none !important; opacity: 1 !important; }
  .checkmark-circle, .checkmark-check { stroke-dashoffset: 0; }
}

@media (max-width: 600px) {
  .container { margin: 1rem; padding: 1.25rem; }
  .mini-num { font-size: 1.45rem; }
}

/* ===== Display type (geométrica) nos títulos/números ===== */
h1, h2, h3, .valor, .mini-num, .nf-valor, .sum-valor,
.auth-title, .authx-title, .authx-brand-name, .authx-welcome { font-family: var(--display); }

/* ===== Login redesenhado — card dividido com divisor ondulado (ref) ===== */
.authx {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  background: radial-gradient(1200px 600px at 15% -10%, #dbe7fb 0%, #eef3fb 45%, #e9f0fa 100%);
}
.authx-card {
  width: 100%; max-width: 940px; display: grid; grid-template-columns: 1.05fr 1fr;
  background: #fff; border-radius: 26px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(18, 42, 88, .20);
}
.authx-brand {
  position: relative; background: var(--brand-grad); color: #fff;
  padding: 2.8rem 2.6rem; display: flex; flex-direction: column; min-height: 540px;
}
.authx-wave { position: absolute; top: 0; right: -1px; height: 100%; width: 74px; display: block; }
.authx-brand-in { position: relative; z-index: 2; display: flex; flex-direction: column; height: 100%; max-width: 30ch; }
.authx-logo {
  width: 96px; height: 96px; object-fit: contain; display: block;
}
.authx-brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: .03em; margin-top: 1rem; }
.authx-welcome { font-weight: 700; font-size: 1.75rem; line-height: 1.15; margin: .5rem 0 0; color: #fff; }
.authx-lead { font-size: .92rem; line-height: 1.6; color: rgba(255,255,255,.84); margin-top: .9rem; }
.authx-foot { margin-top: auto; font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: rgba(255,255,255,.66); }
.authx-motiv { margin-top: 1.3rem; }
.authx-motiv-label { display: block; font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: rgba(255,255,255,.5); }
.authx-motiv-text { display: inline-block; font-family: var(--display); font-weight: 600; font-size: 1.2rem; color: #fff; margin-top: .25rem; min-height: 1.5em; }
.authx-form { padding: 2.9rem 2.8rem; display: flex; flex-direction: column; justify-content: center; }
.authx-title { font-weight: 700; font-size: 1.85rem; color: var(--navy); margin: 0; }
.authx-sub { color: var(--muted); margin: .3rem 0 1.6rem; font-size: .95rem; }
.authx-form label { margin-top: .2rem; }
.authx-form input { background: #f3f6fc; border-color: #e4eaf4; }
.authx-form input:focus { background: #fff; }
.authx-form .btn { margin-top: .4rem; }
.authx-help { font-size: .8rem; color: var(--muted); text-align: center; margin: 1.3rem 0 0; }
/* Tablet: empilha o card mantendo o formato de cartão centralizado */
@media (max-width: 760px) {
  .authx-card { grid-template-columns: 1fr; max-width: 440px; }
  .authx-brand { min-height: 0; padding: 2.2rem; text-align: center; align-items: center; }
  .authx-brand-in { max-width: none; align-items: center; }
  .authx-wave { display: none; }
  .authx-logo { margin-left: auto; margin-right: auto; }
  .authx-welcome { font-size: 1.45rem; }
  .authx-form { padding: 2.2rem; }
}

/* Celular: layout app — header de marca enxuto + formulário curvo por cima (eco da onda) */
@media (max-width: 560px) {
  .authx { padding: 0; align-items: stretch; background: var(--brand-grad); }
  .authx-card {
    max-width: none; border-radius: 0; box-shadow: none;
    min-height: 100vh; min-height: 100dvh;
    grid-template-rows: auto 1fr;
  }
  .authx-brand {
    padding: 2.4rem 1.5rem 3.4rem;
    padding-top: max(2.4rem, env(safe-area-inset-top));
  }
  .authx-logo { width: 68px; height: 68px; }
  .authx-brand-name { margin-top: .7rem; }
  .authx-welcome { font-size: 1.3rem; margin-top: .15rem; }
  /* tira o marketing que empurra o login pra baixo no celular */
  .authx-lead, .authx-motiv, .authx-foot { display: none; }
  /* o formulário sobe sobre o header com o topo curvado — a "onda" no mobile */
  .authx-form {
    position: relative; z-index: 2; margin-top: -2.2rem;
    background: #fff; border-radius: 24px 24px 0 0;
    padding: 2rem 1.4rem;
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
    box-shadow: 0 -14px 34px rgba(18, 42, 88, .16);
  }
  .authx-title { font-size: 1.6rem; }
  .authx-sub { margin-bottom: 1.25rem; }
  /* inputs 16px = sem zoom automático no iOS; alvos de toque confortáveis */
  .authx-form input, .authx-form select { font-size: 16px; padding: .85rem .9rem; }
  .authx-form .btn { min-height: 50px; font-size: 1rem; }
  .authx-help { font-size: .9rem; margin-top: 1rem; }
  .authx-help a { display: inline-block; padding: .35rem .2rem; }
}

/* ===== App shell — portal com menu lateral ===== */
.app { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }
.side { background: var(--brand-grad); color: #fff; display: flex; flex-direction: column;
        padding: 1.4rem 1rem; gap: .3rem; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: .6rem; padding: .2rem .5rem 1rem; }
.side-logo { width: 54px; height: 54px; object-fit: contain; flex: none; }
.side-brand-name { font-family: var(--display); font-weight: 700; font-size: 1rem; line-height: 1.1; }
.side-user { display: flex; align-items: center; gap: .6rem; padding: .7rem; margin-bottom: .6rem;
             background: rgba(255,255,255,.10); border-radius: 14px; }
.side-avatar { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.22);
               display: grid; place-items: center; font-weight: 700; flex: none; }
.side-user-name { font-size: .85rem; font-weight: 600; }
.side-user-sub { font-size: .72rem; color: rgba(255,255,255,.7); }
.side-user-link { display: inline-block; margin-top: .25rem; font-size: .72rem; color: #cdd7ee;
                  text-decoration: none; border-bottom: 1px solid transparent; }
.side-user-link:hover, .side-user-link.is-active { color: #fff; border-bottom-color: rgba(255,255,255,.5); }
.nav { display: flex; flex-direction: column; gap: .2rem; }
.nav-item { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border-radius: 12px;
            color: rgba(255,255,255,.85); text-decoration: none; font-size: .9rem; font-weight: 500;
            transition: background .15s, color .15s; }
.nav-item .i { width: 1.3rem; text-align: center; }
.nav-item:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-item.is-active { background: #fff; color: var(--brand-dark); font-weight: 600; }
.nav-soon { margin-left: auto; font-size: .6rem; background: rgba(255,255,255,.2); color: #fff;
            padding: .1rem .45rem; border-radius: 999px; letter-spacing: .03em; }
.side-foot { margin-top: auto; }
.side-logout { width: 100%; display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem;
               border-radius: 12px; background: transparent; border: 1px solid rgba(255,255,255,.28);
               color: #fff; font: inherit; font-size: .85rem; cursor: pointer; }
.side-logout:hover { background: rgba(255,255,255,.12); }
.side-toggle { width: 100%; margin-bottom: .5rem; padding: .5rem .75rem; border-radius: 12px;
               background: transparent; border: 1px dashed rgba(255,255,255,.3); color: rgba(255,255,255,.85);
               font: inherit; font-size: .78rem; cursor: pointer; }
.side-toggle:hover { background: rgba(255,255,255,.1); }

/* Barra superior + overlay do drawer — só aparecem no mobile (ver @media) */
.topnav { display: none; }
.side-overlay { display: none; }

.main { padding: 1.8rem 2rem; background: radial-gradient(900px 500px at 100% -10%, #dde9fc 0, #eef3fb 55%); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; }
.topbar h1 { margin: 0; font-size: 1.5rem; }
.topbar-date { font-size: .88rem; color: var(--muted); }

.pending { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1.1rem 1.3rem;
           border-radius: 16px; margin-bottom: 1.4rem; background: linear-gradient(120deg, #fff7e8, #ffefcf);
           border: 1px solid #f0dca8; }
.pending-ico { width: 46px; height: 46px; border-radius: 12px; background: var(--coral); color: #fff;
               display: grid; place-items: center; font-size: 1.35rem; flex: none; }
.pending-txt { flex: 1; min-width: 220px; }
.pending-txt strong { color: #8a5a12; }
.pending .btn { width: auto; padding: .6rem 1.3rem; }
.ok-banner { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.3rem; border-radius: 16px;
             margin-bottom: 1.4rem; background: var(--ok-bg); border: 1px solid #bfe6d2; color: var(--ok); font-weight: 600; }

.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.6rem; }
.quick .card { margin: 0; }
.q-num { font-family: var(--display); font-size: 1.7rem; font-weight: 800; color: var(--navy); line-height: 1.1; }
.q-num.coral { color: #b9781f; }
.q-label { font-size: .82rem; color: var(--muted); }

.feed-h { display: flex; align-items: center; gap: .5rem; margin: .4rem 0 .8rem; }
.posts { display: flex; flex-direction: column; gap: .9rem; }
.post { display: flex; gap: 1rem; background: #fff; border: 1px solid var(--line); border-radius: 16px;
        padding: 1rem; box-shadow: var(--shadow-sm); }
.post-thumb { width: 92px; height: 70px; border-radius: 10px; flex: none; display: grid; place-items: center;
              font-size: 1.6rem; background: linear-gradient(135deg, #e0e4f1, #b9c2de); }
.post-body { flex: 1; min-width: 0; }
.post-meta { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.post-title { font-weight: 700; color: var(--ink); margin: .15rem 0; }
.post-excerpt { font-size: .86rem; color: var(--muted); }
.tag-ex { font-size: .6rem; background: var(--gray-bg); color: var(--gray); padding: .1rem .45rem;
          border-radius: 999px; letter-spacing: .02em; }
.post-feature { border-left: 4px solid var(--teal); }
.post-list { margin: .5rem 0 0; padding-left: 1.1rem; }
.post-list li { font-size: .87rem; color: var(--ink); margin-bottom: .3rem; line-height: 1.45; }
.post-list li strong { color: var(--navy); }

.cob-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.cob-grid .card { margin: 0; }
.form-card { max-width: 600px; background: #fff; border: 1px solid var(--line);
             border-radius: 18px; box-shadow: var(--shadow-sm); padding: 1.7rem; }
.form-card .info-box { margin-bottom: 1.2rem; }

/* ===== Mascote RB (sempre sobre cartão branco — PNG tem fundo branco) ===== */
.hero { display: flex; align-items: center; gap: 1.3rem; background: #fff; border: 1px solid var(--line);
        border-radius: 18px; padding: 1.1rem 1.4rem; margin-bottom: 1.5rem; box-shadow: var(--shadow-sm); }
.hero-char { width: 118px; height: 118px; object-fit: contain; flex: none; }
.hero-h { margin: 0; font-size: 1.3rem; color: var(--navy); }
.hero-p { margin: .35rem 0 0; color: var(--muted); font-size: .92rem; }
.empty-char { display: flex; align-items: center; gap: 1.2rem; background: #fff; border: 1px solid var(--line);
              border-radius: 18px; padding: 1.4rem; box-shadow: var(--shadow-sm); max-width: 660px; }
.empty-char img { width: 120px; height: 120px; object-fit: contain; flex: none; }
.empty-char strong { color: var(--navy); font-size: 1.05rem; }
.empty-char p { margin: .3rem 0 0; color: var(--muted); font-size: .9rem; }
.enviar-layout { display: flex; gap: 1.4rem; align-items: flex-start; flex-wrap: wrap; }
.enviar-help { flex: 1; min-width: 220px; max-width: 300px; text-align: center; background: #fff;
               border: 1px solid var(--line); border-radius: 18px; padding: 1.3rem; box-shadow: var(--shadow-sm); }
.enviar-help img { width: 150px; height: 150px; object-fit: contain; }
.enviar-help p { margin: .3rem 0 0; font-size: .88rem; color: var(--muted); }
.enviar-help strong { color: var(--navy); }
.success-char { width: 168px; height: 168px; object-fit: contain; display: block; margin: 0 auto .4rem;
                animation: charPop .5s cubic-bezier(.2, .8, .2, 1.2) both; }
@keyframes charPop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) {
  .hero, .empty-char { flex-direction: column; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .success-char { animation: none; } }
.teasers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.6rem; }
.teaser { display: block; text-decoration: none; color: inherit; background: #fff; border: 1px solid var(--line);
          border-radius: 16px; padding: 1.2rem; box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .15s; }
.teaser:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.teaser-ico { font-size: 1.7rem; }
.teaser-t { font-weight: 700; margin: .5rem 0 .2rem; }
.teaser-d { font-size: .82rem; color: var(--muted); }

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }

  /* Barra superior fixa: logo + botão de menu (hambúrguer) */
  .topnav {
    display: flex; align-items: center; gap: .7rem;
    position: sticky; top: 0; z-index: 30;
    background: var(--brand-grad); color: #fff;
    padding: .7rem 1rem;
    padding-top: max(.7rem, env(safe-area-inset-top));
    box-shadow: 0 2px 12px rgba(18,42,88,.18);
  }
  .topnav-logo { width: 34px; height: 34px; object-fit: contain; }
  .topnav-title { font-family: var(--display); font-weight: 700; font-size: 1rem; }
  .topnav-burger {
    width: 42px; height: 42px; flex: none; display: grid; align-content: center; gap: 5px;
    padding: 0 10px; background: transparent; border: 0; cursor: pointer;
  }
  .topnav-burger span { display: block; height: 2px; border-radius: 2px; background: #fff; transition: transform .2s, opacity .2s; }
  body.drawer-open .topnav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.drawer-open .topnav-burger span:nth-child(2) { opacity: 0; }
  body.drawer-open .topnav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Menu lateral vira drawer deslizante (fora da tela até abrir) */
  .side {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
    width: 82%; max-width: 320px; height: 100vh; height: 100dvh;
    padding: 1.4rem 1rem; overflow-y: auto;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.35);
  }
  body.drawer-open .side { transform: translateX(0); }

  /* Overlay que escurece o conteúdo com o menu aberto */
  .side-overlay {
    display: block; position: fixed; inset: 0; z-index: 40;
    background: rgba(12,20,40,.5);
    opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
  }
  body.drawer-open .side-overlay { opacity: 1; visibility: visible; }
  body.drawer-open { overflow: hidden; }   /* trava o scroll do fundo */

  .nav-soon { display: inline-block; }     /* no drawer há espaço; mostra "em breve" */
  .quick, .teasers { grid-template-columns: 1fr; }
  .main { padding: 1.2rem; }
}
