/* ═══════════════════════════════════════════════════════════════
   Formulário Seguro Garantia — Lavoro Seguros
   Paleta e tipos derivados da identidade da marca.
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* cor — paleta corporativo clássico: azul-escuro, grafite, gelo.
     o ciano do logo permanece só nos afetos interativos (foco, seleção). */
  --ink:        #14405c;  /* cor de lavoroseguros.com.br — títulos, botão primário, ênfase */
  --ink-hover:  #0e2e42;  /* a mesma cor, mais fundo, só para :hover */
  --ink-2:      #1e293b;  /* grafite — texto do corpo */
  --ink-soft:   #334155;  /* grafite mais claro — rótulos e notas */
  --brand:      #00b7f0;
  --brand-deep: #0089b8;
  --brand-wash: #e6f7fd;
  --paper:      #ffffff;
  --field:      #f8fafc;  /* gelo */
  --field-flat: #eef2f6;
  --rule:       #dae5ec;
  --rule-soft:  #eaf1f5;
  --muted:      #5c7183;
  --muted-2:    #83959f;
  --amber:      #9a5b06;
  --amber-wash: #fdf4e6;
  --verified:   #0b6e55;
  --alert:      #a8302a;

  /* tipo — uma família sem serifa em todo o formulário, do título ao número */
  --display: 'Open Sans', Arial, 'Helvetica Neue', sans-serif;
  --sans:    'Open Sans', Arial, 'Helvetica Neue', sans-serif;
  --mono:    'Open Sans', Arial, 'Helvetica Neue', sans-serif;

  /* estrutura */
  --sheet-w: 1440px;
  --r:       10px;
  --r-sm:    6px;
  --shadow:  0 1px 2px rgba(14,44,64,.06), 0 24px 60px -20px rgba(14,44,64,.22);
}

* { box-sizing: border-box; }

/* vem antes de tudo: display explícito nas classes não pode vencer o hidden */
[hidden] { display: none !important; }

/* o navegador dá min-width:min-content a fieldset e largura intrínseca a
   input/textarea; em grid isso trava o encolhimento e o conteúdo sai da folha */
fieldset, input, textarea, select { min-width: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-2);
  background: #dfe8ee;
  -webkit-font-smoothing: antialiased;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  /* sem prefixo de pasta: no build, dist/ tem styles.css e a imagem
     lado a lado (scripts/build.mjs achata html/, css/, js/, assets/) */
  background:
    linear-gradient(180deg, rgba(223,232,238,0) 55%, rgba(223,232,238,.9) 100%),
    url('Fundo%204.png') center / cover no-repeat;
}

.skip {
  position: absolute; left: -9999px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  border-radius: 0 0 var(--r-sm) 0;
  font-size: 13px;
}
.skip:focus { left: 0; top: 0; }

/* ── a folha ─────────────────────────────────────────────────── */

.sheet {
  position: relative;
  z-index: 1;
  max-width: var(--sheet-w);
  margin: 18px auto 40px;
  padding: 0 12px;
}

@media (min-width: 760px) { .sheet { margin: 40px auto 64px; padding: 0 20px; } }

/* ── tela 1 · identificação do responsável ──────────────────── */
/* folha estreita e centralizada: sem índice lateral, então a largura
   cheia de --sheet-w deixaria quatro campos perdidos na tela */
.sheet-gate { max-width: 620px; }

.body-gate {
  background: var(--paper);
  border-radius: 0 0 var(--r) var(--r);
  box-shadow: var(--shadow);
  overflow: clip;
}
.body-gate .block { border-bottom: 0; }
.body-gate .actions { border-radius: 0 0 var(--r) var(--r); }

/* ── masthead ────────────────────────────────────────────────── */

.masthead {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px 28px;
  padding: 22px 22px;
  /* cor do cabeçalho de lavoroseguros.com.br (.header_bottom, rgba(20,64,92,1)) */
  background: #14405c;
  border-radius: var(--r) var(--r) 0 0;
}

@media (min-width: 760px) { .masthead { padding: 26px 36px; } }

.masthead-logo {
  width: 132px;
  height: auto;
  flex: none;
}

@media (min-width: 760px) { .masthead-logo { width: 152px; } }

.masthead-title {
  flex: 1 1 260px;
  min-width: 0;
}

@media (min-width: 760px) {
  .masthead-title {
    padding-left: 28px;
    border-left: 1px solid rgba(255,255,255,.18);
  }
}

.masthead-title h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.005em;
  color: #fff;
}

.masthead-title p {
  margin: 2px 0 0;
  font-size: 12.5px;
  letter-spacing: .04em;
  color: rgba(255,255,255,.66);
}


/* ── corpo: índice + formulário ──────────────────────────────── */

.body {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--paper);
  border-radius: 0 0 var(--r) var(--r);
  box-shadow: var(--shadow);
  /* "hidden" cria um contexto de rolagem que quebra o position:sticky do
     índice lateral (bug conhecido de Grid + overflow no Chromium); "clip"
     recorta os cantos do mesmo jeito, sem esse efeito colateral */
  overflow: clip;
}

@media (min-width: 1000px) {
  .body {
    grid-template-columns: 264px 1fr;
    /* pinta a calha do índice de ponta a ponta: o rail é sticky e não estica */
    background:
      linear-gradient(90deg,
        var(--field-flat) 0 263px,
        var(--rule) 263px 264px,
        var(--paper) 264px);
  }
}

/* ── índice ──────────────────────────────────────────────────── */

.index {
  min-width: 0;
  padding: 28px 24px;
  background: var(--field-flat);
  border-bottom: 1px solid var(--rule);
}

.index ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

.index a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--muted);
  white-space: nowrap;
  transition: background .16s ease, color .16s ease;
}
.index a:hover { background: rgba(255,255,255,.7); color: var(--ink); }

.index a.is-active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--rule);
}

.ix-n {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-2);
}
.index a.is-active .ix-n { color: var(--ink); }
.index a.is-done .ix-n  { color: var(--verified); }

.ix-t { font-size: 13.5px; font-weight: 500; }

.index-note { display: none; }

@media (min-width: 1000px) {
  .index {
    position: sticky;
    top: 0;
    align-self: start;
    max-height: 100vh;
    padding: 34px 22px;
    background: none;
    border-bottom: 0;
  }
  .index ol { flex-direction: column; gap: 2px; overflow: visible; }
  .index-note {
    display: block;
    margin: 26px 0 0;
    padding-top: 20px;
    border-top: 1px solid var(--rule);
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--muted-2);
  }
}

/* ── blocos ──────────────────────────────────────────────────── */

.form { padding: 6px 0 0; min-width: 0; }

.block {
  padding: 22px 20px 26px;
  border-bottom: 1px solid var(--rule-soft);
}

@media (min-width: 700px) { .block { padding: 28px 36px 32px; } }

.block-head { margin-bottom: 18px; }

.eyebrow {
  display: block;
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
}
.eyebrow-warn { color: var(--amber); }

.block-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -.008em;
  color: var(--ink);
}

.block-sub {
  margin: 8px 0 0;
  max-width: 60ch;
  font-size: 14px;
  color: var(--muted);
}

/* ── partes ──────────────────────────────────────────────────── */
/* autor e réu lado a lado numa folha larga — a mesma informação,
   metade da rolagem */

.parties { display: grid; gap: 16px; }

@media (min-width: 900px) {
  .parties { grid-template-columns: 1fr 1fr; align-items: start; }
}

.party {
  padding: 18px 16px 20px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--field);
}

.party legend {
  padding: 0 9px;
  margin-left: -3px;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--field);
}
.party legend em {
  font-style: normal;
  font-weight: 500;
  letter-spacing: .05em;
  color: var(--muted-2);
}

.fieldset-note {
  margin: 0 0 18px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ── grades ──────────────────────────────────────────────────── */

.row { display: grid; gap: 16px; margin-bottom: 16px; }
.row:last-child { margin-bottom: 0; }

@media (min-width: 700px) {
  .row-2 { grid-template-columns: 1fr 1fr; }
  .row-3 { grid-template-columns: 1fr 1fr 1fr; }
  .field-grow { grid-column: span 1; }
  .row-3 .field-grow { grid-column: span 1; }
}

/* o cartão de autor/réu fica com metade da folha a partir daqui — natureza e
   CNPJ lado a lado só cabem bem quando o cartão ainda tem a largura cheia */
@media (min-width: 700px) and (max-width: 899px) {
  .party > .row:first-of-type { grid-template-columns: auto 1fr; align-items: start; }
}

@media (min-width: 860px) {
  .row-3:has(.field-grow) { grid-template-columns: 2fr 1fr .7fr; }
}

.field { display: block; margin-bottom: 16px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.row .field { margin-bottom: 0; }

/* campo que vem logo depois de uma grade de escolhas: nem .choices nem .hint
   deixam margem embaixo, então o respiro precisa vir daqui */
.field-apart { margin-top: 26px; }

.label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--ink-soft);
}

.req, .opt {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  vertical-align: 1px;
}
.req { color: #7f96a6; }
.opt { color: #9aabb6; }

/* ── campos ──────────────────────────────────────────────────── */

.input {
  width: 100%;
  padding: 11px 13px;
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.input::placeholder { color: #a9bac4; }

.input:hover:not(:focus) { border-color: #c2d2dc; }

.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0,183,240,.16);
}

.input.mono {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}

.textarea { resize: vertical; line-height: 1.45; min-height: 78px; }

.select {
  appearance: none;
  padding-right: 38px;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' fill='none' stroke='%235c7183' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

.input.is-filled { background-color: #fdfeff; }

.input.is-invalid {
  border-color: var(--alert);
  box-shadow: 0 0 0 3px rgba(168,48,42,.1);
}

.input:read-only { color: var(--muted); background-color: var(--field-flat); }

.readout {
  display: block;
  padding: 11px 13px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  background: var(--field-flat);
  border: 1px dashed var(--rule);
  border-radius: var(--r-sm);
}
.readout.is-set { border-style: solid; background: var(--brand-wash); color: var(--ink); }

.hint {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted-2);
}
.hint.is-ok    { color: var(--verified); }
.hint.is-warn  { color: var(--amber); }
.hint.is-error { color: var(--alert); }
.hint.is-load  { color: var(--brand-deep); }

.hint-suggest {
  margin-top: 14px;
  padding: 10px 13px;
  background: var(--brand-wash);
  border-left: 2px solid var(--brand);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--ink-soft);
  font-size: 12.5px;
}

/* ── busca em base pública ───────────────────────────────────── */

.lookup { display: flex; gap: 8px; }
.lookup .input { flex: 1 1 auto; min-width: 0; }

.btn-lookup {
  flex: none;
  padding: 0 15px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--ink-soft);
  background: var(--field-flat);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn-lookup:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-lookup:disabled { opacity: .5; cursor: progress; }

/* ── controle segmentado ─────────────────────────────────────── */

.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--field-flat);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
}

.segmented label { position: relative; }

.segmented input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.segmented span {
  display: block;
  padding: 8px 15px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--muted);
  border-radius: 4px;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.segmented input:checked + span {
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 1px 3px rgba(14,44,64,.12);
}

.segmented input:focus-visible + span {
  box-shadow: 0 0 0 2px var(--brand);
}

/* ── identificação do processo ─────────────────────────────── */

.process-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin: -4px 0 24px;
  padding: 16px 0 16px 16px;
  border-left: 2px solid var(--rule);
}
.process-context-details { min-width: 0; }
.process-tribunal {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
}
.process-origin {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.process-validation {
  font-size: 12px;
  line-height: 1.5;
}
.process-validation.is-ok { color: var(--verified); }
.process-validation.is-warn { color: var(--amber); }
@media (max-width: 600px) {
  .process-context { gap: 8px; }
}

/* ── escolhas ────────────────────────────────────────────────── */

.choices { display: grid; gap: 10px; }

@media (min-width: 640px) {
  .choices { grid-template-columns: 1fr 1fr; }
  .choices-3 { grid-template-columns: 1fr 1fr 1fr; }
  .choice-wide { grid-column: 1 / -1; }
}

/* seis recursos cabem em duas fileiras de três, em vez de três de dois */
@media (min-width: 860px) {
  .choices-tight { grid-template-columns: repeat(3, 1fr); }
}

.choice { position: relative; display: block; cursor: pointer; }

.choice input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}

.choice-body {
  display: block;
  padding: 14px 16px 14px 42px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.choice-body::before {
  content: '';
  position: absolute;
  left: 16px; top: 17px;
  width: 14px; height: 14px;
  border: 1.5px solid #b8c9d4;
  border-radius: 50%;
  background: var(--paper);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.choice:hover .choice-body { border-color: #bed2dd; background: var(--field); }

.choice input:checked + .choice-body {
  border-color: var(--brand);
  background: var(--brand-wash);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.choice input:checked + .choice-body::before {
  border-color: var(--brand-deep);
  border-width: 4px;
  box-shadow: 0 0 0 1px var(--brand-deep);
}

.choice input:focus-visible + .choice-body {
  box-shadow: 0 0 0 3px rgba(0,183,240,.3);
}

.choice-body b {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.005em;
  color: var(--ink);
}

.choice-body em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--muted);
}

.choice.is-suggested .choice-body {
  border-color: var(--brand);
  border-style: dashed;
}
.choice.is-suggested input:checked + .choice-body { border-style: solid; }

.choices-tight .choice-body { padding: 12px 14px 12px 40px; }
.choices-tight .choice-body::before { top: 15px; }

/* preço na etiqueta do recurso */
.choice-price {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.choice-price.is-free { color: var(--verified); }

/* ── interruptor 30% ─────────────────────────────────────────── */

.switch {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin: 20px 0;
  padding: 15px 17px;
  background: var(--field);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.switch:hover { border-color: #bed2dd; }
.switch:has(input:checked) { border-color: var(--brand); background: var(--brand-wash); }

.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.switch-track {
  flex: none;
  position: relative;
  width: 40px; height: 22px;
  margin-top: 2px;
  background: #c4d3dd;
  border-radius: 20px;
  transition: background .2s ease;
}
.switch-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(14,44,64,.28);
  transition: transform .2s cubic-bezier(.3,.9,.3,1);
}
.switch input:checked + .switch-track { background: var(--brand-deep); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(0,183,240,.35); }

.switch-text b {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.switch-text em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

.switch-flat {
  margin: 14px 0 0;
  padding: 12px 14px;
  background: var(--paper);
}

/* ── subformulário dependente ────────────────────────────────── */

.subform {
  margin: 18px 0 20px;
  padding: 18px 20px 20px;
  background: var(--field);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--brand);
  border-radius: 0 var(--r) var(--r) 0;
  animation: reveal .3s cubic-bezier(.2,.8,.3,1) both;
}

.subform-head {
  margin: 0 0 15px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink);
}

/* ── razão · os dois valores sempre à vista ──────────────────── */

.ledger {
  margin: 20px 0;
  padding: 6px 20px 16px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--r);
}

.ledger-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px dotted var(--rule);
}

.ledger-k {
  font-size: 13px;
  color: var(--muted);
}

.ledger-v {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ledger-v.is-muted { color: var(--muted-2); font-weight: 400; }

.ledger-total {
  margin-top: 2px;
  padding-top: 14px;
  border-bottom: 0;
  border-top: 2px solid var(--ink);
}
.ledger-total .ledger-k {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
}
.ledger-total .ledger-v { font-size: 23px; letter-spacing: -.01em; }

.ledger-foot {
  margin: 12px 0 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted-2);
}

/* ── ramos condicionais ──────────────────────────────────────── */

.branch { animation: reveal .34s cubic-bezier(.2,.8,.3,1) both; }
.branch + .branch { margin-top: 20px; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

.branch-note {
  margin: 0 0 22px;
  padding: 11px 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  background: var(--amber-wash);
  border-left: 2px solid var(--amber);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.branch-note b { font-weight: 600; }

.branch-note.branch-note-ok {
  color: var(--ink-soft);
  background: var(--field);
  border-left-color: var(--brand);
}
.branch-note a { color: var(--ink); }

.empty {
  margin: 0;
  padding: 26px 22px;
  font-size: 13.5px;
  color: var(--muted-2);
  text-align: center;
  background: var(--field);
  border: 1px dashed var(--rule);
  border-radius: var(--r);
}

/* ── ações ───────────────────────────────────────────────────── */

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 24px 20px 28px;
  background: var(--field-flat);
}

.signature-field {
  position: relative; width: 100%; height: 190px; overflow: hidden;
  background: #fff; border: 1px solid var(--rule); border-radius: var(--r-sm); touch-action: none;
}
.signature-field.is-invalid { border-color: #b84a46; box-shadow: 0 0 0 2px rgba(184,74,70,.12); }
.signature-field canvas {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
  overscroll-behavior: contain;
  -webkit-user-select: none;
  user-select: none;
}
.signature-line { position: absolute; z-index: 1; left: 9%; right: 9%; bottom: 42px; border-top: 1px solid #9dafba; }
.signature-placeholder { position: absolute; z-index: 1; left: 0; right: 0; bottom: 17px; text-align: center; font-size: 11px; color: var(--muted-2); }
.signature-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.signature-actions .hint { margin: 8px 0 0; }
.review-signature { display: block; max-width: 260px; max-height: 90px; margin-top: 8px; border-bottom: 1px solid var(--rule); }

@media (min-width: 700px) { .actions { padding: 26px 44px 30px; } }

.actions-note {
  margin: 0;
  flex: 1 1 220px;
  font-size: 12.5px;
  color: var(--muted);
}
.actions-note.is-ready { color: var(--verified); }

.actions-btns { display: flex; align-items: center; gap: 12px; }

.btn {
  padding: 13px 26px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #fff;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .16s ease, box-shadow .16s ease, transform .1s ease;
}
.btn:hover { background: var(--ink-hover); box-shadow: 0 6px 18px -6px rgba(14,44,64,.5); }
.btn:active { transform: translateY(1px); }
.btn:disabled {
  background: #b6c6d1;
  border-color: #b6c6d1;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-quiet {
  padding: 13px 18px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.btn-quiet:hover { color: var(--ink); background: rgba(14,44,64,.06); }

:focus-visible { outline: 2px solid var(--brand-deep); outline-offset: 2px; }

/* ── colofão ─────────────────────────────────────────────────── */

.colophon {
  margin: 20px 0 0;
  font-size: 11.5px;
  letter-spacing: .05em;
  text-align: center;
  color: rgba(14,44,64,.5);
}
.colophon-sep { margin: 0 6px; color: rgba(14,44,64,.3); }

/* ── conferência ─────────────────────────────────────────────── */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(9,28,41,.6);
  backdrop-filter: blur(3px);
  animation: fade .2s ease both;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 620px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: var(--r);
  box-shadow: 0 40px 90px -20px rgba(9,28,41,.6);
  animation: rise .28s cubic-bezier(.2,.85,.3,1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(.99); }
  to   { opacity: 1; transform: none; }
}

.modal-head {
  padding: 26px 28px 20px;
  border-bottom: 1px solid var(--rule);
}
.modal-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.008em;
  color: var(--ink);
}
.modal-head p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.modal-ok .modal-head {
  border-top: 4px solid var(--brand);
  background: linear-gradient(180deg, var(--brand-wash), var(--paper));
}
.modal-head .success-message {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
}
.success-message strong { color: var(--ink); font-weight: 700; }

.modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 28px 20px;
  /* sombras de rolagem: avisam que a conferência continua fora da vista */
  background:
    linear-gradient(var(--paper) 30%, rgba(255,255,255,0)) top / 100% 26px no-repeat local,
    linear-gradient(rgba(255,255,255,0), var(--paper) 70%) bottom / 100% 26px no-repeat local,
    radial-gradient(farthest-side at 50% 0, rgba(14,44,64,.14), rgba(0,0,0,0)) top / 100% 11px no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, rgba(14,44,64,.14), rgba(0,0,0,0)) bottom / 100% 11px no-repeat scroll;
}
.modal-body:focus { outline: none; }

.modal-ok .modal-body { padding-top: 22px; }
.modal-ok .ledger { margin-top: 0; }

.review-group { margin-top: 20px; }

.review-group h3 {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
}

.review-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px 18px;
  padding: 8px 0;
  border-bottom: 1px dotted var(--rule);
}

@media (min-width: 520px) {
  .review-item { grid-template-columns: 168px 1fr; }
}

.review-k { font-size: 12.5px; color: var(--muted); }
.review-v { font-size: 13.5px; color: var(--ink); word-break: break-word; }
.review-v.mono { font-family: var(--mono); font-size: 13px; }
.review-v.is-empty { color: var(--muted-2); font-style: italic; }
.review-v.is-money { font-family: var(--mono); font-weight: 500; }

.review-warn {
  margin: 20px 0 0;
  padding: 13px 15px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--amber);
  background: var(--amber-wash);
  border-left: 2px solid var(--amber);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.review-warn ul { margin: 7px 0 0; padding-left: 18px; }
.review-warn li { margin-bottom: 3px; }

.modal-foot {
  flex: none;
  padding: 18px 28px 22px;
  background: var(--field-flat);
  border-top: 1px solid var(--rule);
  border-radius: 0 0 var(--r) var(--r);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
}
.check input {
  flex: none;
  width: 17px; height: 17px;
  margin: 2px 0 0;
  accent-color: var(--brand-deep);
  cursor: pointer;
}

.modal-btns {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── entrada na tela ─────────────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
  .masthead, .index, .block { animation: enter .5s cubic-bezier(.2,.8,.3,1) both; }
  .masthead { animation-delay: .02s; }
  .index    { animation-delay: .08s; }
  .block:nth-of-type(1) { animation-delay: .12s; }
  .block:nth-of-type(2) { animation-delay: .17s; }
  .block:nth-of-type(3) { animation-delay: .21s; }
  .block:nth-of-type(4) { animation-delay: .24s; }
  .block:nth-of-type(5) { animation-delay: .27s; }
  .block:nth-of-type(6) { animation-delay: .3s; }
  .block:nth-of-type(7) { animation-delay: .33s; }
}

@keyframes enter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ── impressão ───────────────────────────────────────────────── */

@media print {
  .backdrop, .index, .actions, .scrim, .skip { display: none; }
  body { background: #fff; }
  .sheet { margin: 0; padding: 0; max-width: none; }
  .body { box-shadow: none; grid-template-columns: 1fr; }
  .block { break-inside: avoid; }
}

.turnstile-area {
  display: grid;
  gap: 8px;
  justify-items: start;
  min-height: 72px;
}

.turnstile-area .hint:empty {
  display: none;
}
