:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --primary: #2c5f4f;
  --primary-dark: #1f4638;
  --text: #1e2430;
  --muted: #6b7280;
  --border: #e2e5ea;
  --success: #1f8a4c;
  --pending: #b8860b;
  --danger: #c0392b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px;
}

.topbar {
  background: var(--primary);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar a { color: white; text-decoration: none; font-weight: 600; }
.topbar .logo { font-size: 18px; }
.topbar nav a { margin-left: 16px; opacity: 0.9; font-weight: 400; font-size: 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
}

h1 { font-size: 24px; margin: 0 0 8px; }
h2 { font-size: 18px; margin: 0 0 16px; }
p.muted, .muted { color: var(--muted); font-size: 14px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 16px 0 6px;
  color: var(--text);
}

input[type="text"], input[type="email"], input[type="password"], input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: white;
}

.btn {
  display: inline-block;
  background: var(--primary);
  color: white;
  border: none;
  padding: 11px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--primary-dark); }
.btn.secondary { background: white; color: var(--primary); border: 1px solid var(--primary); }
.btn.small { padding: 6px 12px; font-size: 13px; }

.signer-row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}
.signer-row input { flex: 1; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge.pendente { background: #fdf1d6; color: var(--pending); }
.badge.assinado { background: #e2f4e8; color: var(--success); }
.badge.concluido { background: #e2f4e8; color: var(--success); }

.doc-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.doc-list-item:last-child { border-bottom: none; }

.doc-list-item .info { display: flex; flex-direction: column; gap: 4px; }
.doc-list-item .info a { color: var(--text); font-weight: 600; text-decoration: none; font-size: 15px; }

.error-box {
  background: #fdecea;
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.topbar .logo-img { height: 30px; display: block; }
.login-logo { height: 56px; display: block; margin: 0 auto 20px; }

.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}
.step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.step-dot span {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--border);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.step-dot small { font-size: 11px; color: var(--muted); }
.step-dot.active span { border-color: var(--primary); color: var(--primary); background: white; }
.step-dot.active small { color: var(--primary); font-weight: 600; }
.step-dot.done span { border-color: var(--primary); background: var(--primary); color: white; }
.step-line {
  width: 40px;
  height: 2px;
  background: var(--border);
  margin: 0 6px;
  margin-bottom: 18px;
}

#camera-wrap {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 4 / 3;
  background: #111;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
#camera-video, #photo-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

#signature-pad {
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  touch-action: none;
  background: white;
  width: 100%;
  height: 180px;
}

.pdf-frame {
  width: 100%;
  height: 500px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 16px 0;
}
.checkbox-row input {
  width: 26px;
  height: 26px;
  min-width: 26px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.checkbox-row label { margin: 0; font-weight: 400; font-size: 14px; padding-top: 3px; }

footer.notice {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 30px;
}
