:root {
  --bg: #0a0e1a;
  --bg-soft: #111726;
  --card: #161d30;
  --card-2: #1d2740;
  --border: #26314f;
  --txt: #e7ecf6;
  --txt-dim: #8a96b3;
  --accent: #3b82f6;
  --accent-2: #2563eb;
  --accent-glow: rgba(59, 130, 246, .35);
  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #ef4444;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(59,130,246,.10), transparent),
    radial-gradient(900px 500px at -10% 110%, rgba(37,99,235,.08), transparent),
    var(--bg);
  min-height: 100vh;
}

.wrap { max-width: 760px; margin: 0 auto; padding: 18px; }

.brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
}
.brand .logo {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-weight: 800; color: #fff;
  box-shadow: 0 6px 20px var(--accent-glow);
}
.brand h1 { font-size: 18px; margin: 0; letter-spacing: .2px; }
.brand .sub { color: var(--txt-dim); font-size: 12px; margin: 0; }

.card {
  background: linear-gradient(180deg, var(--card), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; color: var(--txt-dim); font-weight: 600; }

label { display: block; font-size: 13px; color: var(--txt-dim); margin: 10px 0 6px; }

input, textarea, select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--txt);
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
textarea { min-height: 140px; resize: vertical; line-height: 1.55; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border: none; border-radius: 12px;
  padding: 14px 18px; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: transform .08s, box-shadow .15s, opacity .15s;
  box-shadow: 0 8px 24px var(--accent-glow);
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn.secondary {
  background: var(--card-2); color: var(--txt);
  box-shadow: none; border: 1px solid var(--border);
}
.btn.ghost { background: transparent; box-shadow: none; border: 1px solid var(--border); color: var(--txt-dim); }
.btn.danger { background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 8px 24px rgba(239,68,68,.3); }
.btn.sm { width: auto; padding: 8px 14px; font-size: 13px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
}
.badge.ok { background: rgba(34,197,94,.15); color: #4ade80; }
.badge.pend { background: rgba(245,158,11,.15); color: #fbbf24; }

.muted { color: var(--txt-dim); font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120%);
  background: var(--card-2); border: 1px solid var(--border);
  color: var(--txt); padding: 12px 18px; border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5); z-index: 999;
  transition: transform .25s ease; max-width: 90vw; font-size: 14px;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { border-color: var(--err); }
.toast.ok { border-color: var(--ok); }

.list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg); margin-bottom: 10px;
}
.list-item .meta { min-width: 0; }
.list-item .meta .title { font-weight: 700; font-size: 15px; }
.list-item .meta .sub { color: var(--txt-dim); font-size: 12px; }

.divider { height: 1px; background: var(--border); margin: 16px 0; border: 0; }

.center { text-align: center; }
.hidden { display: none !important; }

.contrato-body {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; max-height: 45vh; overflow-y: auto;
  white-space: pre-wrap; font-size: 14px; line-height: 1.6; color: var(--txt);
}

.pdf-thumb {
  display: block; position: relative; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); background: #fff; cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.3); text-decoration: none;
  transition: transform .12s, box-shadow .15s;
}
.pdf-thumb:active { transform: scale(.99); }
.pdf-thumb img {
  display: block; width: 100%; height: auto; max-height: 52vh;
  object-fit: cover; object-position: top center; background: #fff;
}
.pdf-thumb-overlay {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(10,14,26,.92), rgba(10,14,26,0));
  color: #fff; text-align: center; padding: 22px 12px 12px;
  font-size: 13px; font-weight: 700;
}
.pdf-thumb-overlay span {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-2); padding: 8px 14px; border-radius: 999px;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.step { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.step .num {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 28px;
  display: grid; place-items: center; font-weight: 800; font-size: 13px;
  background: var(--card-2); color: var(--txt-dim); border: 1px solid var(--border);
}
.step.active .num { background: var(--accent); color: #fff; border-color: var(--accent); }
.step.done .num { background: var(--ok); color: #fff; border-color: var(--ok); }
.step .lbl { font-size: 13px; color: var(--txt-dim); }
.step.active .lbl, .step.done .lbl { color: var(--txt); }

video, .preview-img {
  width: 100%; border-radius: 12px; border: 1px solid var(--border);
  background: #000; display: block;
}

.gps-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  padding: 6px 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border);
  color: var(--txt-dim);
}
.gps-pill.ok { color: #4ade80; border-color: rgba(34,197,94,.4); }

.otp-inputs { display: flex; gap: 8px; justify-content: center; }
.otp-inputs input {
  width: 44px; text-align: center; font-size: 22px; font-weight: 700; padding: 12px 0;
}

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; text-align: center;
}
.stat .n { font-size: 24px; font-weight: 800; }
.stat .l { font-size: 11px; color: var(--txt-dim); text-transform: uppercase; letter-spacing: .5px; }

.sample-box {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg); border: 1px dashed var(--border);
  border-radius: 12px; padding: 14px; margin-bottom: 14px;
}
.sample-illu { flex: 0 0 auto; display: grid; place-items: center; }
.sample-txt { font-size: 12.5px; line-height: 1.5; }
.sample-ok { color: #4ade80; margin-bottom: 4px; }
.sample-bad { color: #f87171; }
