/*
  Tokens da DescomplicaPay: azul de marca #1E3AE8 e papel frio.
  Public Sans para tudo; IBM Plex Mono só para dado técnico (hash, IP, protocolo).
*/
@font-face {
  font-family: 'Public Sans';
  src: url('/assets/fonts/public-sans/public-sans-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/assets/fonts/plex-mono/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  --ink: #142230;
  --ink-2: #4a5866;
  --ink-3: #6b7885;
  --paper: #ffffff;
  --desk: #eef1f3;
  --line: #d3dae1;
  --line-2: #e6eaee;
  --petrol: #1e3ae8;
  --petrol-dark: #172cb5;
  --petrol-tint: #e8ecff;
  --ok: #12895c;
  --ok-tint: #e2f2e9;
  --warn: #9a5b00;
  --warn-tint: #fbefd9;
  --err: #b3261e;
  --err-tint: #fbe7e5;
  --radius-s: 6px;
  --radius-m: 16px;
  --font: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--desk);
  font-feature-settings: 'tnum' 1;
}
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0; }
a { color: var(--petrol); text-underline-offset: 2px; }
a:hover { color: var(--petrol-dark); }
:focus-visible { outline: 2px solid var(--petrol); outline-offset: 2px; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-size: 0.86em; letter-spacing: 0; }
.muted { color: var(--ink-3); }
.sub { display: block; color: var(--ink-3); font-size: 13px; }
.strong { font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fineprint { font-size: 13px; color: var(--ink-3); }
.empty { color: var(--ink-3); padding: 20px 0; }

/* ---------- Botões e campos ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  font: 600 14px/1 var(--font);
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--petrol); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--petrol-dark); color: #fff; }
.btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--ink-3); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--desk); color: var(--ink); }
.btn-ghost.danger { color: var(--err); }
.btn-small { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--petrol); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.icon-btn { background: none; border: 0; font-size: 24px; line-height: 1; color: var(--ink-3); cursor: pointer; padding: 4px 8px; border-radius: var(--radius-s); }
.icon-btn:hover { background: var(--desk); color: var(--ink); }

.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
.field > span, .field > legend { font-weight: 600; font-size: 13px; color: var(--ink-2); padding: 0; }
.field em { font-style: normal; font-weight: 400; color: var(--ink-3); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
input[type='text'], input[type='email'], input[type='tel'], input[type='password'], input[type='search'], input[type='date'], input:not([type]), select {
  font: inherit; color: var(--ink);
  height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--paper);
  width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--petrol); outline-offset: -1px; border-color: var(--petrol); }
input[type='file'] { font: inherit; }
.form-error { color: var(--err); background: var(--err-tint); padding: 10px 12px; border-radius: var(--radius-s); margin-bottom: 16px; font-size: 14px; }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px 2px 7px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; vertical-align: middle;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { color: var(--ok); background: var(--ok-tint); }
.badge-warn { color: var(--warn); background: var(--warn-tint); }
.badge-error { color: var(--err); background: var(--err-tint); }
.badge-pending { color: var(--ink-2); background: var(--desk); }
.badge-neutral { color: var(--ink-3); background: var(--desk); }

/* =========================================================
   Página do destinatário
   ========================================================= */

.employee { background: radial-gradient(circle at 15% 12%, #e0e6ff, transparent 31%), var(--desk); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px max(20px, calc((100vw - 600px) / 2));
  background: var(--petrol); color: #fff;
}
.topbar-logo { width: 170px; height: auto; max-height: 36px; }
.topbar-context { color: #fff; font-size: 13px; opacity: .86; text-align: right; }

.sheet {
  width: min(600px, 100% - 24px);
  margin: 36px auto 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: 0 20px 60px rgba(20, 34, 48, .08);
  padding: clamp(22px, 5vw, 40px);
}
.sheet-eyebrow { font: 600 11px var(--mono); letter-spacing: .08em; color: var(--petrol); margin-bottom: 16px; }
.sheet-title { font-size: clamp(26px, 5vw, 34px); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 12px; text-wrap: balance; }
.sheet-lead { color: var(--ink-2); margin-bottom: 24px; max-width: 60ch; }

.doclist { list-style: none; margin: 0 0 24px; padding: 0; border-top: 1px solid var(--line); }
.doclist li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 14px 0 14px 28px; border-bottom: 1px solid var(--line-2);
  position: relative;
}
/* Ícone de folha desenhado em CSS: dobra no canto superior direito. */
.doclist li::before {
  content: ''; position: absolute; left: 0; top: 15px;
  width: 14px; height: 18px; border: 1.5px solid var(--ink-3); border-radius: 2px;
  clip-path: polygon(0 0, 65% 0, 100% 30%, 100% 100%, 0 100%);
}
.doclist-title { font-weight: 600; }
.doclist-meta { color: var(--ink-3); font-size: 13px; white-space: nowrap; }

.notice { border-radius: var(--radius-m); padding: 16px 18px; margin-bottom: 20px; border-left: 4px solid; }
.notice h2 { font-size: 16px; margin-bottom: 6px; }
.notice p { font-size: 14.5px; }
.notice-error { background: var(--err-tint); border-color: var(--err); color: #5c140f; }
.notice-steps { margin: 10px 0 0; padding-left: 20px; font-size: 14.5px; }
.notice-steps li + li { margin-top: 4px; }

.employee .btn-primary.btn-block { min-height: 52px; font-size: 16px; }
.fineprint[data-bind='previous'] { margin-top: 12px; }

.disclosure { margin-top: 24px; border-top: 1px solid var(--line-2); padding-top: 14px; font-size: 14px; color: var(--ink-2); }
.disclosure summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.disclosure p { margin-top: 8px; }

.steps { list-style: none; margin: 0 auto; padding: 0; display: inline-flex; flex-direction: column; gap: 10px; text-align: left; }
.steps li { position: relative; padding-left: 30px; color: var(--ink-3); font-size: 15px; }
.steps li::before {
  content: ''; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; box-sizing: border-box;
  border: 2px solid var(--line); border-radius: 50%;
}
.steps li[data-status='active'] { color: var(--ink); font-weight: 600; }
.steps li[data-status='active']::before { border-color: var(--petrol-tint); border-top-color: var(--petrol); animation: spin .8s linear infinite; }
.steps li[data-status='done'] { color: var(--ink-2); }
.steps li[data-status='done']::before { border-color: var(--ok); background: var(--ok); }
.steps li[data-status='done']::after {
  content: ''; position: absolute; left: 6px; top: 6px; width: 5px; height: 8px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
@keyframes spin { to { transform: rotate(360deg); } }
.offscreen-video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Comprovante: o elemento de assinatura da página. Borda serrilhada de canhoto. */
.receipt {
  background: #f7f8ff;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 22px 22px 18px;
  margin-bottom: 20px;
  position: relative;
}
.receipt-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-3); }
.receipt-head span:first-child { color: var(--ok); font-weight: 700; }
.receipt-protocol { font-size: clamp(24px, 6vw, 32px); font-weight: 400; margin: 10px 0 16px; letter-spacing: .04em; color: var(--ink); }
.receipt-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 14px; }
.receipt-meta dt { font-size: 12.5px; color: var(--ink-3); }
.receipt-meta dd { margin: 2px 0 0; font-weight: 600; font-size: 14px; }
.receipt-docs { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line-2); }
.receipt-docs li { display: flex; flex-direction: column; padding: 6px 0; }
.receipt-docs a { font-weight: 600; }
.receipt-docs .mono { color: var(--ink-3); font-size: 12px; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.receipt-hash {
  display: flex; flex-direction: column; gap: 4px;
  margin: 26px -22px 0; padding: 14px 22px 0;
  border-top: 2px dashed var(--line);
  font-size: 12.5px; color: var(--ink-3);
  position: relative;
}
/* Recortes laterais na linha picotada, como no canhoto de um protocolo. */
.receipt-hash::before, .receipt-hash::after {
  content: ''; position: absolute; top: -9px; width: 16px; height: 16px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 50%;
}
.receipt-hash::before { left: -9px; clip-path: inset(0 0 0 50%); }
.receipt-hash::after { right: -9px; clip-path: inset(0 50% 0 0); }
.receipt-hash .mono { word-break: break-all; color: var(--ink-2); font-size: 11.5px; }

.pagefoot { text-align: center; padding: 0 20px 28px; font-size: 13px; margin-top: auto; }
.pagefoot a { color: var(--ink-3); }

.prose h2 { font-size: 17px; margin: 24px 0 6px; }
.prose p { color: var(--ink-2); max-width: 68ch; }

/* =========================================================
   Painel administrativo
   ========================================================= */

.admin { background: var(--desk); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 85% 15%, #5c70ff, transparent 28%), var(--petrol); }
.login-box { width: min(400px, 100%); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 36px; box-shadow: 0 20px 60px rgba(10, 25, 80, .2); }
.login-logo { width: 205px; height: auto; display: block; margin-bottom: 28px; }
.login-company { font: 600 12px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--petrol); margin-bottom: 6px; }
.login-box h1 { font-size: 20px; font-weight: 600; color: var(--ink-2); margin-bottom: 24px; }
.password-intro { margin: -12px 0 20px; }

.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--petrol) 250px, var(--desk) 250px); }
.rail {
  background: var(--petrol); color: #fff;
  display: flex; flex-direction: column; gap: 2px;
  padding: 20px 12px; position: sticky; top: 0; height: 100vh;
}
.rail-brand { padding: 8px 10px 28px; display: flex; flex-direction: column; gap: 10px; }
.rail-logo { display: block; width: 190px; max-width: 100%; height: auto; }
.rail-company { color: #fff; font-weight: 700; font-size: 16px; }
.rail-product { font-size: 12px; color: #fff; opacity: .78; }
.rail a { color: #fff; text-decoration: none; padding: 10px 12px; border-radius: var(--radius-s); font-weight: 600; font-size: 14px; }
.rail a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.rail a[aria-current] { background: #fff; color: var(--petrol); }
.rail-soon { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; margin-top: 2px; border: 1px solid rgba(255,255,255,.4); border-radius: var(--radius-s); background: transparent; color: #fff; font: 600 14px var(--font); text-align: left; cursor: default; opacity: .8; }
.rail-soon span { font: 600 10px var(--mono); white-space: nowrap; }
.rail-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.rail-user { color: #fff; opacity: .75; overflow: hidden; text-overflow: ellipsis; }
.rail .linklike { color: #fff; align-self: flex-start; }
.rail :focus-visible { outline-color: #fff; }

.content { padding: 28px clamp(16px, 3vw, 40px) 60px; max-width: 1280px; width: 100%; outline: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head .sub { margin-top: 4px; font-size: 14px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-block; font-size: 14px; margin-bottom: 10px; color: var(--ink-3); text-decoration: none; }
.back::before { content: '‹ '; }
.back:hover { color: var(--ink); }

.toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.filters { display: inline-flex; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 3px; gap: 2px; flex-wrap: wrap; }
.filters button {
  font: 500 13.5px var(--font); color: var(--ink-2);
  background: none; border: 0; border-radius: 3px; padding: 6px 10px; cursor: pointer;
  display: inline-flex; gap: 6px; align-items: center;
}
.filters button[aria-pressed='true'] { background: var(--petrol-tint); color: var(--petrol-dark); font-weight: 600; }
.count { font-size: 12px; color: var(--ink-3); font-weight: 600; }
h2 .count { margin-left: 8px; }
.search { max-width: 320px; }

.table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #f8f9fb; }
table.list td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover td { background: #fafbfc; }
table.list .num { text-align: right; }
table.list .empty { text-align: center; padding: 40px 14px; }
table.list a.strong { color: var(--ink); text-decoration: none; }
table.list a.strong:hover { color: var(--petrol); text-decoration: underline; }
.actions-cell { text-align: right; white-space: nowrap; }
.hash-short { color: var(--ink-2); }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px 20px; margin-bottom: 16px; }
.panel > h2 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.link-field { display: flex; gap: 8px; margin-bottom: 8px; }
.link-field input { font-family: var(--mono); font-size: 13px; color: var(--ink-2); background: #f8f9fb; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.side .panel { margin-bottom: 16px; }

.evidence { display: grid; grid-template-columns: 112px 1fr; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line-2); }
.evidence:first-of-type { border-top: 0; padding-top: 0; }
.evidence-photo img { width: 112px; height: 140px; object-fit: cover; border-radius: var(--radius-s); display: block; background: var(--desk); }
.evidence-body header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.evidence-body h3 { font-size: 15px; font-weight: 600; }
.protocol { color: var(--petrol); background: var(--petrol-tint); padding: 2px 8px; border-radius: var(--radius-s); }
.facts { display: grid; grid-template-columns: 1fr; gap: 6px; margin: 0 0 12px; font-size: 14px; }
.facts div { display: grid; grid-template-columns: 96px 1fr; gap: 8px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.evidence-map {
  grid-column: 1 / -1; height: 240px; margin-top: 4px;
  border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--desk);
  z-index: 0; /* mantém os controles do Leaflet abaixo do drawer e do toast */
}
.evidence-map .leaflet-control-attribution { font-size: 11px; }
.map-legend { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 12.5px; color: var(--ink-3); margin: 6px 0 0; }
.map-legend .key { width: 10px; height: 10px; border-radius: 50%; display: inline-block; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.map-legend .key-gps { background: var(--petrol); }
.map-legend .key-ip { background: var(--warn); margin-left: 10px; }

/* Verificação do IP: faixa com a cor do veredito à esquerda. */
.ipcheck { grid-column: 1 / -1; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius-s); padding: 12px 14px; margin-top: 4px; background: #fbfcfd; }
.ipcheck-consistent { border-left-color: var(--ok); }
.ipcheck-attention { border-left-color: var(--warn); }
.ipcheck-divergent { border-left-color: var(--err); background: #fffafa; }
.ipcheck-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ipcheck-head h4 { margin: 0; font-size: 14px; }
.ipcheck-head .linklike { margin-left: auto; font-size: 13px; }
.ipcheck-signals { list-style: none; margin: 0 0 10px; padding: 0; font-size: 13.5px; }
.ipcheck-signals li { position: relative; padding-left: 16px; margin-top: 3px; }
.ipcheck-signals li::before { content: ''; position: absolute; left: 2px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.ipcheck-signals .sig-medium::before { background: var(--warn); }
.ipcheck-signals .sig-high::before { background: var(--err); }
.ipcheck .facts { margin-bottom: 6px; }
.ipcheck .facts div { grid-template-columns: 110px 1fr; }
.ipcheck-foot { margin-top: 4px; }
.report-map { height: 280px; margin: 12px 0 6px; break-inside: avoid; }

.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 8px 0; border-top: 1px solid var(--line-2); }
.plain-list li:first-child { border-top: 0; padding-top: 0; }

.timeline { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow-y: auto; }
.timeline li { position: relative; padding: 0 0 14px 18px; display: flex; flex-direction: column; font-size: 13.5px; }
.timeline li::before { content: ''; position: absolute; left: 0; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.timeline li::after { content: ''; position: absolute; left: 3.5px; top: 16px; bottom: 2px; width: 1px; background: var(--line-2); }
.timeline li:last-child::after { display: none; }
.timeline .tl-evidence::before, .timeline .tl-download::before { background: var(--ok); }
.timeline .tl-blocked::before { background: var(--err); }
.tl-what { font-weight: 600; }
.tl-when { color: var(--ink-3); font-size: 12.5px; }
.tl-detail { color: var(--ink-2); font-size: 12.5px; }
.tl-ip { display: flex; flex-direction: column; color: var(--ink-2); font-size: 12.5px; }
.tl-alert { color: var(--err); }

.drawer {
  border: 0; padding: 0; margin: 0 0 0 auto;
  width: min(520px, 100vw); height: 100vh; max-height: 100vh;
  background: var(--paper); color: var(--ink);
  box-shadow: -12px 0 40px rgba(27, 39, 51, .18);
}
.drawer::backdrop { background: rgba(27, 39, 51, .4); }
.drawer[open] { animation: drawer-in 180ms ease-out; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: .6; } }
.drawer-body { display: flex; flex-direction: column; height: 100%; padding: 0 24px; overflow-y: auto; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 0 16px; position: sticky; top: 0; background: var(--paper); z-index: 1; }
.drawer-head h2 { font-size: 18px; }
.drawer-intro { margin: 4px 0 20px; }
.drawer-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 0 20px; margin-top: auto; position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--line-2); }

.secret-dialog { width: min(460px, calc(100% - 24px)); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 28px; box-shadow: 0 20px 60px rgba(20, 34, 48, .2); }
.secret-dialog::backdrop { background: rgba(20, 34, 48, .55); }
.secret-dialog h2 { font-size: 21px; margin-bottom: 10px; }
.secret-dialog p { color: var(--ink-2); margin-bottom: 18px; }
.secret-dialog input { font-family: var(--mono); font-size: 13px; margin-bottom: 18px; }
.secret-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.checklist { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-s); max-height: 280px; overflow-y: auto; }
.check { display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line-2); cursor: pointer; font-size: 14px; }
.check:first-child { border-top: 0; }
.check input { width: 16px; height: 16px; accent-color: var(--petrol); margin: 0; }
.check .sub { font-size: 12.5px; }
.checklist .empty { padding: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-s);
  font-size: 14px; z-index: 50; box-shadow: 0 6px 24px rgba(27, 39, 51, .25);
}

@media (max-width: 960px) {
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; background: var(--desk); }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; }
  .rail-brand { padding: 0 10px 0 4px; flex: 1 0 100%; }
  .rail-foot { margin: 0 0 0 auto; border: 0; padding: 0 4px; flex-direction: row; gap: 12px; }
  .rail-user { display: none; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .search { max-width: none; flex: 1 1 100%; }
  .evidence { grid-template-columns: 80px 1fr; }
  .evidence-photo img { width: 80px; height: 100px; }
  .facts div, .ipcheck .facts div { grid-template-columns: 1fr; gap: 0; }
  .link-field { flex-direction: column; }
}

@media (max-width: 480px) {
  .receipt-head { flex-direction: column; gap: 2px; }
  .receipt-meta { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* =========================================================
   Relatório de evidências (tela e impressão)
   ========================================================= */

.report { background: var(--desk); padding: 24px 12px; }
.report-sheet { max-width: 860px; margin: 0 auto; background: var(--paper); border: 1px solid var(--line); padding: 40px 44px; }
.report-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding-bottom: 20px; border-bottom: 2px solid var(--ink); margin-bottom: 8px; }
.report-company { font-weight: 700; color: var(--ink-3); margin-bottom: 4px; }
.report-logo { width: 188px; height: auto; display: block; margin-bottom: 12px; }
.report-head h1 { font-size: 24px; }
.report-protocol { text-align: right; }
.report-protocol span { display: block; font-size: 12.5px; color: var(--ink-3); }
.report-protocol strong { font-size: 20px; font-weight: 400; }
.report section { padding: 18px 0; border-bottom: 1px solid var(--line-2); }
.report h2 { font-size: 14px; margin-bottom: 10px; color: var(--ink-2); }
.report-grid { display: grid; grid-template-columns: 1fr 200px; gap: 24px; }
.report-photo { margin: 0; }
.report-photo img { width: 200px; border: 1px solid var(--line); display: block; }
.photo-missing, .evidence-photo .photo-missing {
  display: grid; place-items: center; text-align: center;
  background: var(--desk); color: var(--ink-3); border: 1px dashed var(--line);
  font-size: 13px; font-weight: 600; aspect-ratio: 4 / 5; border-radius: var(--radius-s);
}
.report-photo figcaption { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.report-photo figcaption .mono { word-break: break-all; font-size: 10.5px; }
table.kv { border-collapse: collapse; width: 100%; font-size: 14px; }
table.kv th { text-align: left; font-weight: 500; color: var(--ink-3); width: 210px; padding: 5px 12px 5px 0; vertical-align: top; }
table.kv td { padding: 5px 0; overflow-wrap: anywhere; }
.report table.list th { background: none; padding: 6px 10px 6px 0; }
.report table.list td { padding: 8px 10px 8px 0; font-size: 13px; }
.hash { word-break: break-all; font-size: 11.5px; }
.report-ipcheck .ipcheck-signals { margin-bottom: 10px; }
.report-ipcheck-divergent h2 { color: var(--err); }
.report-ipcheck-attention h2 { color: var(--warn); }
.report-ipcheck-consistent h2 { color: var(--ok); }
.report-integrity p { font-size: 13px; color: var(--ink-2); max-width: 75ch; }
.report-integrity p + p { margin-top: 8px; color: var(--ink); }
.report-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 18px; font-size: 12.5px; color: var(--ink-3); }

@media print {
  .report { background: none; padding: 0; }
  .report-sheet { border: 0; padding: 0; max-width: none; }
  .no-print { display: none; }
  a { color: inherit; text-decoration: none; }
  @page { margin: 16mm; }
}
@media (max-width: 640px) {
  .report-sheet { padding: 24px 18px; }
  .report-grid { grid-template-columns: 1fr; }
  table.kv th { width: 40%; }
}

/* Logos levam à landing page da DescomplicaPay. */
.brand-link { display: inline-flex; line-height: 0; }
.brand-link:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* Validação do boleto/chave Pix. */
.verify-form { display: grid; gap: 14px; margin-top: 8px; }
.verify-form input { font-size: 16px; }
.timeline .tl-verified::before { background: var(--ok); }
.timeline .tl-verify_failed::before { background: var(--err); }
.field-row-key { grid-template-columns: minmax(150px, 0.8fr) 1.6fr; }
.field-row-key + .fineprint, .field-amount + .fineprint { margin: -6px 0 18px; }

/* Valor a receber no cadastro: prefixo R$ dentro do campo. */
.amount-input { position: relative; display: block; }
.amount-input > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 600; font-size: 14px; pointer-events: none; }
.amount-input input { padding-left: 40px; width: 100%; }
.field-amount { max-width: 260px; }

/* =========================================================
   Tíquete de autorização: o elemento de assinatura da página.
   Faixa azul de cabeçalho, valor em destaque e canhoto picotado com a chave.
   ========================================================= */
.ticket {
  position: relative; margin: 0 0 18px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 1px 0 rgba(20, 34, 48, .04), 0 14px 34px -18px rgba(30, 58, 232, .35);
  overflow: hidden;
  animation: ticket-in .5s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes ticket-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.ticket-head {
  display: flex; justify-content: space-between; gap: 12px;
  background: var(--petrol); color: #fff; padding: 12px 20px; font-size: 13px;
}
.ticket-head span:first-child { font-weight: 700; }
.ticket-head span:last-child { opacity: .8; }
.ticket-body { padding: 20px 20px 22px; }
.ticket-to { color: var(--ink-2); font-size: 14px; margin-bottom: 14px; }
.ticket-to:has(+ .ticket-from:not([hidden])) { margin-bottom: 2px; }
.ticket-to strong { color: var(--ink); }
.ticket-line { color: var(--ink-2); font-size: 15px; }
.ticket-amount {
  font-size: clamp(36px, 10vw, 48px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05;
  color: var(--ink); margin: 2px 0 4px; font-variant-numeric: tabular-nums;
}
.ticket-stub {
  position: relative; padding: 16px 20px 18px;
  background: #f7f8ff; border-top: 2px dashed var(--line);
}
/* Recortes do picote nas laterais. */
.ticket-stub::before, .ticket-stub::after {
  content: ''; position: absolute; top: -10px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--line);
}
.ticket-stub::before { left: -10px; }
.ticket-stub::after { right: -10px; }
.ticket-stub-label { font-size: 12.5px; color: var(--ink-3); margin-bottom: 2px; }
.ticket-key { font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.ticket-question { font-size: 16px; font-weight: 600; margin: 0 0 18px; text-wrap: pretty; }

/* Envio: arco girando em volta de um escudo, com ondas suaves. */
[data-state='working'] { text-align: center; padding: 12px 0 4px; }
.sending { position: relative; width: 120px; height: 120px; margin: 4px auto 20px; }
.sending svg { width: 100%; height: 100%; }
.sending-track { fill: none; stroke: var(--petrol-tint); stroke-width: 6; }
.sending-arc {
  fill: none; stroke: var(--petrol); stroke-width: 6; stroke-linecap: round;
  stroke-dasharray: 90 237; transform-origin: 60px 60px; animation: spin 1.1s linear infinite;
}
.sending-core {
  position: absolute; inset: 26px; border-radius: 50%; background: var(--petrol-tint);
  display: grid; place-items: center; animation: core-pulse 1.6s ease-in-out infinite;
}
.sending-core::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--petrol);
  opacity: 0; animation: ripple 1.6s ease-out infinite;
}
.sending-core svg { width: 34px; height: 34px; fill: none; stroke: var(--petrol); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@keyframes core-pulse { 50% { transform: scale(1.06); } }
@keyframes ripple { 0% { opacity: .5; transform: scale(1); } 100% { opacity: 0; transform: scale(1.7); } }
.working-title { margin-bottom: 6px; }
.dots span { animation: dot 1.4s infinite; opacity: .2; }
.dots span:nth-child(2) { animation-delay: .2s; }
.dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 30% { opacity: 1; } 60%, 100% { opacity: .2; } }
.working-sub { color: var(--ink-2); margin: 0 auto 22px; max-width: 40ch; }

/* Conclusão: anel e check desenhados em sequência. Estado final é o default
   (com movimento reduzido, a regra global desliga a animação e o check já aparece). */
[data-state='done'] .success { width: 112px; height: 112px; margin: 0 auto 16px; }
.success svg { width: 100%; height: 100%; overflow: visible; }
.success-ring {
  fill: var(--ok-tint); stroke: var(--ok); stroke-width: 5;
  stroke-dasharray: 327; stroke-dashoffset: 0; transform: rotate(-90deg); transform-origin: 60px 60px;
  animation: draw-ring .7s cubic-bezier(.65, 0, .35, 1) both;
}
.success-check {
  fill: none; stroke: var(--ok); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 70; stroke-dashoffset: 0;
  animation: draw-check .45s .6s cubic-bezier(.65, 0, .35, 1) both;
}
.success { animation: success-pop .35s 1s ease-out both; }
@keyframes draw-ring { from { stroke-dashoffset: 327; fill-opacity: 0; } }
@keyframes draw-check { from { stroke-dashoffset: 70; } }
@keyframes success-pop { 50% { transform: scale(1.06); } }
.done-title, .done-lead { text-align: center; }
.done-lead { margin-left: auto; margin-right: auto; }
[data-state='done'] > .btn-primary { margin-bottom: 22px; min-height: 52px; font-size: 16px; }

/* Dados do pagador no cadastro: bloco próprio, separado do destinatário. */
.payer-fields { border-top: 1px solid var(--line-2); padding-top: 14px; margin-top: 4px; }
.payer-fields > legend { margin-bottom: 10px; }

/* Relatório: mapa do aparelho e mapa da estimativa pelo IP lado a lado (empilhados em telas estreitas). */
.report-maps { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 14px 0 6px; break-inside: avoid; }
.report-map-item { margin: 0; min-width: 0; }
.report-map-item figcaption { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.report-map-item .report-map { margin: 0 0 4px; height: 240px; }
.report-map-item .key { width: 10px; height: 10px; border-radius: 50%; flex: none; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.report-map-item .key-gps { background: var(--petrol); }
.report-map-item .key-ip { background: var(--warn); }
.report-map-empty p { height: 240px; display: grid; place-items: center; text-align: center; padding: 16px; border: 1px dashed var(--line); color: var(--ink-3); font-size: 13px; }
@media (max-width: 640px) { .report-maps { grid-template-columns: 1fr; } }
