/* Identidade — câmera e captura (carregado só nesta página) */
.capture {
  border-radius: 18px; border: 2px dashed rgba(0,98,255,.2);
  aspect-ratio: 4/3; background: #f0f3fa;
  position: relative; overflow: hidden; cursor: pointer;
}
.capture.done { border-style: solid; border-color: rgba(29,178,78,.4) }
.capture img { width: 100%; height: 100%; object-fit: cover }
.capture.capture-selfie { aspect-ratio: 1 / 1; max-height: 340px; margin: 0 auto }
.capture-ph {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 12px 14px 14px; text-align: center; color: var(--muted); font-size: .88rem; gap: 8px;
}
.capture-exemplo {
  width: 100%; max-height: calc(100% - 44px); flex: 1 1 auto;
  object-fit: contain; border-radius: 10px;
  box-shadow: 0 4px 16px rgba(20,16,84,.08);
}
.capture-ph-lbl { font-size: .78rem; line-height: 1.35 }
.capture-ph strong { display: block; color: var(--blue-dark); margin-bottom: 2px; font-size: .84rem }
.capture-ok {
  position: absolute; top: 10px; right: 10px;
  padding: 5px 10px 5px 28px; border-radius: 999px;
  color: #fff; font-size: .72rem; font-weight: 800; display: none;
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") 8px center / 14px no-repeat;
}
.capture.done .capture-ok { display: block }
.tip {
  display: flex; gap: 10px; padding: 12px 14px; margin: 14px 0;
  border-radius: 14px; background: rgba(0,98,255,.05);
  border: 1px solid rgba(0,98,255,.08);
  font-size: .86rem; color: var(--muted); line-height: 1.5;
}
.tip b { display: block; color: var(--blue-dark); margin-bottom: 2px }
.capture-actions { margin-top: 12px }
.capture-pick,
.capture-review {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.capture-pick[hidden],
.capture-review[hidden] { display: none !important }
.capture-pick label.btn {
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; margin: 0;
}
.capture-review .btn-green::before {
  content: "";
  display: inline-block;
  width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/contain no-repeat;
}
@media (max-width: 480px) {
  .capture-pick,
  .capture-review { grid-template-columns: 1fr }
}
.checklist { display: grid; gap: 8px; margin: 16px 0; padding: 14px; border-radius: 14px; background: var(--bg) }
.check-item { display: flex; gap: 10px; align-items: center; font-size: .86rem; color: var(--muted) }
.check-item.done { color: var(--green); font-weight: 700 }
.check-dot {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--line); display: grid; place-items: center;
  font-size: .7rem; font-weight: 900; flex-shrink: 0;
}
.check-item.done .check-dot {
  background: var(--green); border-color: var(--green); color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 12px;
  font-size: 0;
}
.steps-pills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px }
.pill {
  text-align: center; padding: 7px 4px; border-radius: 10px;
  font-size: .7rem; font-weight: 800; color: var(--muted);
  background: rgba(0,98,255,.05); border: 1px solid var(--line);
}
.pill.on { background: rgba(248,195,44,.2); color: #6a5000 }
.pill.ok { background: #dafbe5; color: var(--green) }
.autosave {
  display: none; align-items: center; gap: 8px; margin-bottom: 12px;
  padding: 9px 12px; border-radius: 12px;
  background: #dafbe5; color: var(--green);
  font-size: .82rem; font-weight: 700;
}
.autosave::before {
  content: "";
  width: 16px; height: 16px; flex-shrink: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231db24e' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/contain no-repeat;
}
.autosave.show { display: flex }

/* Camera overlay */
.cam {
  position: fixed; inset: 0; z-index: 200;
  background: #000; display: none; flex-direction: column;
}
.cam.open { display: flex }
.cam-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; color: #fff; z-index: 2;
  background: linear-gradient(180deg, rgba(0,0,0,.7), transparent);
  position: absolute; top: 0; left: 0; right: 0;
}
.cam-top h3 { margin: 0; font-size: .95rem }
.cam-close {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,.15); color: #fff; font-size: 1.1rem;
}
.cam-view { flex: 1; position: relative; overflow: hidden }
.cam-view video { width: 100%; height: 100%; object-fit: cover }
.cam-view.selfie video { transform: scaleX(-1) }
.cam-guide {
  position: absolute; inset: 0; pointer-events: none;
  display: grid; place-items: center;
}
.guide-doc,
.guide-selfie { display: none }
.cam-view.doc .guide-doc { display: block }
.cam-view.selfie .guide-selfie { display: flex }
.guide-doc {
  width: 86%; max-width: 320px; aspect-ratio: 1.586;
  border: 3px solid var(--gold); border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.45);
}
/* Selfie: documento à esquerda, rosto à direita (como foto de exemplo) */
.guide-selfie {
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 3.5vw, 18px);
  width: min(92vw, 400px);
  padding: 6px 4px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.48);
  border-radius: 14px;
}
.g-face {
  order: 2;
  width: 58%;
  max-width: 220px;
  aspect-ratio: 3 / 4;
  border: 3px solid var(--gold);
  border-radius: 50%;
  flex-shrink: 0;
}
.g-doc {
  order: 1;
  width: 34%;
  max-width: 118px;
  aspect-ratio: 3 / 4.15;
  border: 3px solid rgba(255,255,255,.9);
  border-radius: 10px;
  flex-shrink: 0;
}
.g-label { display: none }
.cam-view.selfie .g-label,
.cam-view.doc .g-label { display: block }
.cam-view.selfie .g-label { bottom: 22% }
.cam-view.doc .g-label { bottom: 28% }
.g-label {
  position: absolute; left: 50%; transform: translateX(-50%);
  padding: 7px 12px; border-radius: 999px;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: .78rem; font-weight: 700; white-space: nowrap;
}
.cam-foot {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
  padding: 16px 20px calc(18px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  background: linear-gradient(0deg, rgba(0,0,0,.85), transparent);
}
.cam-foot p { margin: 0; color: rgba(255,255,255,.8); font-size: .82rem }
.shutter {
  width: 68px; height: 68px; border-radius: 50%;
  border: 4px solid #fff; position: relative; padding: 0;
}
.shutter::after {
  content: ""; position: absolute; inset: 6px;
  border-radius: 50%; background: #fff; transition: transform .12s;
}
.shutter:active::after { transform: scale(.88); background: var(--gold) }
.flash {
  position: fixed; inset: 0; background: #fff; opacity: 0;
  pointer-events: none; z-index: 300; transition: opacity .07s;
}
.flash.on { opacity: .8 }
@media (max-width: 480px) {
  .capture-pick,
  .capture-review { grid-template-columns: 1fr }
}
