:root {
  --navy: #0b2346;
  --navy-2: #123b70;
  --navy-3: #1c528f;
  --orange: #e0742f;
  --orange-hover: #c96220;
  --orange-soft: #fff2e8;
  --bg: #eef1f6;
  --surface: #ffffff;
  --ink: #0f1b2e;
  --muted: #5c6b82;
  --line: #dde4ee;
  --ok: #1c7a4d;
  --ok-soft: #e7f6ee;
  --warn: #8b5b12;
  --warn-soft: #fdf2dc;
  --err: #b33a3a;
  --err-soft: #fdeeee;
  --radius: 16px;
  --shadow: 0 4px 18px rgba(11, 35, 70, 0.06);
  --shadow-lg: 0 14px 36px rgba(11, 35, 70, 0.14);
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
}

a { color: var(--navy-2); }

/* Offline banner */
.offline-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--warn);
  color: #fff;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
}

/* Header */
.head {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, var(--navy) 0%, var(--navy-2) 58%, var(--navy-3) 100%);
  color: #fff;
  padding: calc(16px + env(safe-area-inset-top)) 18px 28px;
}
.head::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -70px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.head::before {
  content: "";
  position: absolute;
  right: -20px;
  top: -30px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.06);
  pointer-events: none;
}
.head-inner {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
}
.admin-banner {
  position: relative;
  z-index: 2;
  background: var(--orange);
  color: #1b1b1b;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 600;
  text-align: center;
  padding: 9px 14px;
  margin: calc(-16px - env(safe-area-inset-top)) -18px 16px;
}
.admin-banner strong { letter-spacing: 0.04em; }
.admin-banner a {
  color: #1b1b1b;
  text-decoration: underline;
  white-space: nowrap;
}
body.mode-staff .head-inner,
body.mode-staff .shell {
  max-width: 960px;
}

.toprow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--orange);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  display: grid;
  place-items: center;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(224, 116, 47, 0.35);
}
.brand-txt {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-txt strong {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.brand-txt span {
  font-size: 11px;
  opacity: 0.8;
  font-weight: 500;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.icon-btn:active { transform: scale(0.95); }

.head-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.head-pill:hover { background: rgba(255, 255, 255, 0.2); }

.head-hero {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.head-hero h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.head-sub {
  margin: 4px 0 0;
  font-size: 12.5px;
  opacity: 0.84;
  font-weight: 500;
}

/* Main shell */
.shell {
  max-width: 680px;
  margin: -14px auto 0;
  padding: 0 14px calc(92px + env(safe-area-inset-bottom));
  position: relative;
  z-index: 2;
}
body.mode-staff .shell,
body.mode-login .shell {
  padding-bottom: calc(36px + env(safe-area-inset-bottom));
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.18s ease-out; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.card h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--navy);
}
.card-title-lg {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 800;
  color: var(--navy);
}

/* Badges & pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: #edf1f7;
  color: var(--navy);
  white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.orange { background: var(--orange-soft); color: var(--orange-hover); }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 12.5px; border-radius: 10px; }

.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-hover); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-2); }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { background: #f5f7fb; border-color: #c2cde0; }
.btn-soft-ok { background: var(--ok-soft); color: var(--ok); border-color: #bfe4cf; }
.btn-soft-err { background: var(--err-soft); color: var(--err); border-color: #f3c4c4; }
.btn-danger { background: var(--err); color: #fff; }
.btn-danger:hover { background: #9c2f2f; }
.btn-whatsapp { background: #1c7a4d; color: #fff; }
.btn-whatsapp:hover { background: #15623d; }

.danger-zone { border: 1px solid #f0cccc; }
.danger-zone .card-head h2 { color: var(--err); }
.danger-zone .btn + .btn { margin-top: 10px; }

.data-section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.data-section-row:first-of-type { border-top: 0; padding-top: 0; }
.data-section-main { min-width: 0; }
.data-section-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.data-section-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.data-section-row .btn { flex-shrink: 0; }

.stage2-intro { border: 1px solid #f3d7a5; background: #fffdf8; }
.stage2-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange-hover);
}
.stage2-intro h2 { margin: 4px 0 6px; }
.advance-bottom { margin: 18px 0 8px; }
.advance-hint {
  text-align: center;
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.advance-details {
  margin: 10px auto 0;
  max-width: 520px;
  font-size: 12.5px;
  color: var(--muted);
}
.advance-details summary { cursor: pointer; text-align: center; font-weight: 700; }
.advance-details ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.5; }
.phase-form-back { margin: 0 0 12px; }
.form-section {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}
.form-section:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}
.form-section h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 800;
  color: var(--navy);
}
.is-hidden { display: none !important; }
.btn-advance {
  min-height: 58px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 800;
  margin-top: 4px;
}

.danger-warning {
  background: var(--err-soft);
  color: var(--err);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 14px;
}

/* Progress bar */
.prog-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12.5px;
  color: var(--muted);
  margin: 10px 0 6px;
}
.prog-meta strong { color: var(--navy); font-weight: 800; }
.prog-track {
  height: 9px;
  border-radius: 999px;
  background: #e6ecf4;
  overflow: hidden;
}
.prog-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--orange) 0%, #f0924e 100%);
  transition: width 0.35s ease;
}

.next-step-box {
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 12px;
  background: var(--orange-soft);
  border: 1px solid #f8d2b8;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.next-step-box.ok {
  background: var(--ok-soft);
  border-color: #bfe4cf;
}
.next-step-box.err {
  background: var(--err-soft);
  border-color: #f3c4c4;
}
.next-step-box p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
}

/* Timeline */
.timeline {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}
.tl-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding-bottom: 18px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 28px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}
.tl-item.done:not(:last-child)::before { background: var(--ok); }
.tl-item.current:not(:last-child)::before { background: linear-gradient(var(--orange), var(--line)); }

.tl-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 800;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--muted);
  position: relative;
  z-index: 1;
}
.tl-item.done .tl-dot {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.tl-item.current .tl-dot {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(224, 116, 47, 0.2);
}
.tl-body {
  padding-top: 2px;
  flex: 1;
  min-width: 0;
}
.tl-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.tl-item.pending .tl-title { color: var(--muted); font-weight: 600; }
.tl-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* Install banner */
.install-banner {
  background: linear-gradient(135deg, #0b2346 0%, #163f76 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 15px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
}
.install-banner-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--orange);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.install-banner-txt {
  flex: 1;
  min-width: 0;
}
.install-banner-txt strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
}
.install-banner-txt span {
  display: block;
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
}
.install-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.install-close {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 18px;
  line-height: 1;
  padding: 6px;
  cursor: pointer;
}

/* Documents list */
.docs-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: #f5f8fc;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 14px;
}
.docs-summary strong { font-size: 14px; color: var(--navy); }
.docs-summary span { font-size: 12px; color: var(--muted); display: block; margin-top: 2px; }

.doc-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  margin-bottom: 10px;
  transition: border-color 0.15s ease;
}
.doc-card.required-missing {
  border: 1.5px solid var(--orange);
  background: #fffaf6;
}
.doc-card.rejected {
  border: 1.5px solid #e79c9c;
  background: #fffafa;
}
.doc-card.approved {
  border-color: #c2e3d0;
}

.doc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.doc-info { flex: 1; min-width: 0; }
.doc-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.doc-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--orange-hover);
}
.doc-tag.opt { background: #edf1f7; color: var(--muted); }
.doc-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  word-break: break-word;
}
.doc-reject-note {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--err-soft);
  color: var(--err);
  font-size: 12.5px;
  line-height: 1.4;
  font-weight: 600;
}
.doc-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.doc-actions.two > .btn {
  flex: 1 1 130px;
}
.doc-match-ok {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 12.5px;
  line-height: 1.4;
  font-weight: 600;
}

.tip-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f5f8fc;
  border: 1px dashed #c5d2e3;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

/* Profile / key-value */
.kv-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}
@media (max-width: 520px) {
  .kv-list { grid-template-columns: 1fr; }
}
.kv-item {
  padding-bottom: 10px;
  border-bottom: 1px solid #eef2f7;
}
.kv-item:last-child { border-bottom: 0; padding-bottom: 0; }
.kv-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 3px;
}
.kv-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 520px) {
  .form-grid { grid-template-columns: 1fr; }
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
}
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--navy-2);
  box-shadow: 0 0 0 3px rgba(18, 59, 112, 0.12);
}
.cep-row {
  display: flex;
  gap: 8px;
}
.cep-row input { flex: 1; }
.form-actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Term card */
.term-card-box {
  padding: 14px;
  border-radius: 12px;
  background: #f6f9fd;
  border: 1px solid var(--line);
}
.term-hash {
  margin-top: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
  word-break: break-all;
}

/* Login screen (Mockup 4) */
.login-card {
  margin-top: -6px;
  padding: 22px 20px;
}
.login-title {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 800;
  color: var(--navy);
}
.login-desc {
  margin: 0 0 18px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}
.otp-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 14px 0 10px;
}
.otp-digit {
  width: 56px;
  height: 60px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: #f8fafd;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  outline: none;
}
.otp-digit:focus {
  border-color: var(--orange);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(224, 116, 47, 0.15);
}
.otp-helper {
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  margin: 8px 0 14px;
}
.form-msg {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}
.form-msg.err { background: var(--err-soft); color: var(--err); }
.form-msg.ok { background: var(--ok-soft); color: var(--ok); }

/* FAQ accordion */
.faq-item {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.faq-item:last-child { border-bottom: 0; padding-bottom: 0; }
.faq-item summary {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 18px;
  font-weight: 700;
  color: var(--orange);
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(11, 35, 70, 0.06);
}
.bottom-nav-inner {
  max-width: 680px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.nav-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  touch-action: manipulation;
}
.nav-tab svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }
.nav-tab.active {
  color: var(--orange);
  background: var(--orange-soft);
}
.nav-badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 20px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
}

/* Modals / Bottom Sheets */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(11, 35, 70, 0.56);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}
@media (min-width: 600px) {
  .modal-backdrop { align-items: center; }
}
.modal-backdrop.open { display: flex; }
.modal-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow-lg);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.modal-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
}
.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}
.preview-img {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  border-radius: 12px;
  background: #0f1b2e;
  border: 1px solid var(--line);
  display: block;
}
.ios-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 12px;
  background: #f5f8fc;
  margin-bottom: 10px;
}
.ios-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.ios-step p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink);
}

/* Staff extras */
.staff-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.reason-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.reason-chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f6f8fc;
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.reason-chip:hover { border-color: var(--orange); background: var(--orange-soft); }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%) scale(0.96);
  z-index: 9999;
  background: linear-gradient(150deg, var(--navy) 0%, var(--navy-2) 58%, var(--navy-3) 100%);
  color: #fff;
  padding: 16px 22px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 16.25px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: calc(100vw - 48px);
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.toast.ok,
.toast.err { background: linear-gradient(150deg, var(--navy) 0%, var(--navy-2) 58%, var(--navy-3) 100%); }

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
.loading-card {
  text-align: center;
  padding: 42px 20px;
  color: var(--muted);
  font-size: 14px;
}
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #dde4ee;
  border-top-color: var(--orange);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Auth mode switcher (login vs new candidate) & draft checklist --- */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--bg);
  padding: 5px;
  border-radius: 14px;
  margin-bottom: 16px;
}
.auth-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.auth-tab.active {
  background: #ffffff;
  color: var(--navy);
  box-shadow: 0 2px 8px rgba(11, 35, 70, .10);
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  cursor: pointer;
}
.check-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  flex-shrink: 0;
  accent-color: var(--orange);
}
.check-row a { color: var(--navy-3); font-weight: 700; }

.draft-checklist {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.draft-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fafbfd;
}
.draft-item.done {
  background: var(--ok-bg);
  border-color: rgba(20, 128, 74, .22);
}
.draft-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.draft-num {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #ffffff;
  border: 2px solid var(--orange);
  color: var(--orange-dk);
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.draft-item.done .draft-num {
  background: var(--ok);
  border-color: var(--ok);
  color: #ffffff;
}
.draft-item-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  flex: 1;
}
.draft-item-sub {
  margin: 6px 0 0 36px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
}
.draft-item-actions {
  margin: 10px 0 0 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.draft-phone-inline {
  margin: 10px 0 0 36px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.draft-phone-inline input {
  width: 112px;
  text-align: center;
  letter-spacing: 0.25em;
  font-size: 16px;
  font-weight: 800;
  padding: 10px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.brand-mark { overflow: hidden; padding: 0; background: #E8A33A; }
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }

/* Indique e Ganhe (programa de afiliados) */
.ref-code-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--orange-soft);
  border: 1.5px dashed var(--orange);
  border-radius: 12px;
  padding: 12px 14px;
}
.ref-code-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange-hover);
}
.ref-code {
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--navy);
}
.ref-link-url {
  margin-top: 10px;
  padding: 10px 12px;
  background: #f5f7fb;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 11.5px;
  line-height: 1.55;
  word-break: break-all;
  color: var(--muted);
  max-height: 84px;
  overflow-y: auto;
}
.ref-link-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-top: 10px;
}
.ref-link-row .ref-link-url { flex: 1; margin-top: 0; }
.ref-copy-btn { flex: none; align-self: center; white-space: nowrap; }
.ref-actions {
  display: grid;
  gap: 8px;
}
.ref-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.ref-stats > div {
  background: #f5f7fb;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 8px;
  display: grid;
  gap: 3px;
  text-align: center;
}
.ref-stats strong { font-size: 15px; color: var(--navy); }
.ref-stats span { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.ref-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-top: 8px;
}
.ref-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.ref-item-head strong { font-size: 14px; color: var(--navy); }
.ref-item-sub { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.5; }

/* Vídeos e informações (aba Início) */
.learn-kicker {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange-hover);
}
.learn-card h1 {
  margin: 6px 0 6px;
  font-size: 22px;
  letter-spacing: -0.035em;
  color: var(--navy);
}
.learn-lead {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}
.learn-video-item {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #eef2f7;
}
.learn-video-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.learn-number {
  font: 11px ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  color: var(--orange-hover);
  background: var(--orange-soft);
  border-radius: 999px;
  padding: 2px 8px;
}
.learn-duration {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.learn-video-item h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--navy);
}
.learn-video-item p {
  margin: 4px 0 10px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}
.home-video {
  width: 100%;
  border-radius: 12px;
  background: #0b1220;
  aspect-ratio: 16 / 9;
  display: block;
}
.home-video.portrait { aspect-ratio: 4 / 5; }
.learn-cta { margin-top: 16px; }
.learn-note {
  margin: 10px 0 0;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

/* Destaque ao abrir documentos pela aba Candidatura */
.docs-highlight { animation: docsPulse 1.1s ease 2; }
@keyframes docsPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 116, 47, 0); }
  50% { box-shadow: 0 0 0 6px rgba(224, 116, 47, 0.2); }
}

/* Assessment Hayway (SIS TRANS) */
.as-card .card-head {
  align-items: flex-start;
  margin-bottom: 14px;
}
.as-subtitle {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}
.as-sec-title {
  margin: 18px 0 8px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--navy);
}
.as-sec-title:first-of-type { margin-top: 4px; }

.as-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
  padding: 13px 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.as-detail {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  line-height: 1.4;
}
.as-detail-label {
  flex: none;
  color: var(--muted);
  font-weight: 600;
}
.as-detail-value {
  color: var(--ink);
  font-weight: 600;
  word-break: break-word;
}

.as-table {
  border: 1px solid #d8e1ec;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.as-thead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: #f1f5f9;
  border-bottom: 1px solid #d8e1ec;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
}
.as-thead-yn {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 116px;
  flex-shrink: 0;
  text-align: center;
}
.as-row {
  padding: 9px 14px;
  border-top: 1px solid #e7edf5;
  background: #fff;
}
.as-table > .as-row:first-child,
.as-thead + .as-row {
  border-top: 0;
}
.as-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.as-row-label {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
  font-weight: 500;
}
.as-row.as-red {
  background: #fef2f2;
  box-shadow: inset 3px 0 0 #dc2626;
}
.as-row.as-red .as-row-label {
  color: #991b1b;
  font-weight: 700;
}
.as-elim-tag {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  vertical-align: middle;
  white-space: nowrap;
}

.as-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  width: 116px;
  flex-shrink: 0;
  padding: 2px;
  gap: 2px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
}
.as-opt {
  position: relative;
  display: block;
  margin: 0;
  cursor: pointer;
}
.as-opt input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}
.as-opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.14s ease, color 0.14s ease;
  user-select: none;
}
.as-opt:hover span { color: var(--navy); }
.as-opt input[value="yes"]:checked + span {
  background: var(--ok);
  color: #fff;
  font-weight: 700;
}
.as-opt input[value="no"]:checked + span {
  background: #526074;
  color: #fff;
  font-weight: 700;
}
.as-row.as-red .as-opt input[value="no"]:checked + span {
  background: #b91c1c;
}
.as-opt input:focus-visible + span {
  outline: 2px solid var(--navy-2);
  outline-offset: 1px;
}

.as-subrow {
  margin-top: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
}
.as-subrow[hidden] { display: none; }
.as-subgrid {
  display: grid;
  gap: 10px;
}
.as-subgrid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.as-subgrid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.as-subfield {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.as-subfield label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}
.as-subfield input,
.as-subfield textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.as-subfield textarea {
  min-height: 56px;
  resize: vertical;
}
.as-subfield input:focus,
.as-subfield textarea:focus {
  border-color: var(--navy-2);
  box-shadow: 0 0 0 3px rgba(18, 59, 112, 0.1);
}

.as-note {
  margin: 7px 2px 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}

.as-recruiter {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.as-decision-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.as-decision-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy);
  min-width: 78px;
}
.as-decision-group {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 3px;
  gap: 3px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
}
.as-dec-opt {
  position: relative;
  margin: 0;
  cursor: pointer;
}
.as-dec-opt input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}
.as-dec-opt span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.14s ease, color 0.14s ease;
  user-select: none;
}
.as-dec-opt:hover span { color: var(--navy); background: #f1f5f9; }
.as-dec-opt input[value="proceed"]:checked + span {
  background: var(--ok);
  color: #fff;
  font-weight: 700;
}
.as-dec-opt input[value="clarification"]:checked + span {
  background: #b45309;
  color: #fff;
  font-weight: 700;
}
.as-dec-opt input[value="reject"]:checked + span {
  background: #b91c1c;
  color: #fff;
  font-weight: 700;
}
.as-dec-opt input:focus-visible + span {
  outline: 2px solid var(--navy-2);
  outline-offset: 1px;
}

.as-recruiter-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 12px;
}
.as-recruiter .as-subfield label {
  font-size: 12px;
  color: var(--navy);
}
.as-recruiter .as-subfield input,
.as-recruiter .as-subfield textarea {
  min-height: 40px;
  font-size: 13.5px;
}
.as-recruiter .as-subfield textarea { min-height: 76px; }

.as-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.as-footer-meta {
  margin-right: auto;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .as-details,
  .as-subgrid-3,
  .as-subgrid-2,
  .as-recruiter-grid {
    grid-template-columns: 1fr;
  }
  .as-row-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .as-thead-yn { display: none; }
  .as-footer { justify-content: stretch; }
  .as-footer .btn { flex: 1 1 auto; }
}

/* Visualizador modal de imagens e PDFs */
.modal-sheet.modal-viewer {
  max-width: min(920px, 95vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.viewer-stage {
  min-height: 220px;
  max-height: 70vh;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f1b2e;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.modal-viewer .preview-img {
  width: auto;
  max-width: 100%;
  max-height: 68vh;
  border: 0;
  border-radius: 8px;
  background: transparent;
}
.preview-pdf {
  width: 100%;
  height: 68vh;
  border: 0;
  border-radius: 10px;
  background: #fff;
  display: block;
}
.viewer-fallback {
  padding: 28px 20px;
  text-align: center;
  color: #cbd5e1;
  font-size: 13.5px;
  line-height: 1.55;
}
.viewer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
@media (max-width: 640px) {
  .viewer-stage { max-height: 62vh; }
  .modal-viewer .preview-img { max-height: 60vh; }
  .preview-pdf { height: 60vh; }
  .viewer-actions { justify-content: stretch; }
  .viewer-actions .btn { flex: 1 1 auto; }
}

/* Campos obrigatórios: asterisco */
label:has(+ input[required])::after,
label:has(+ select[required])::after,
label:has(+ textarea[required])::after,
label:has(input[required])::after {
  content: " *";
  color: #d64545;
  font-weight: 700;
}

/* Campos obrigatórios marcados visualmente (sem validação nativa) */
.field[data-req] > label::after {
  content: " *";
  color: #d64545;
  font-weight: 700;
}

.blockers-list { margin: 0; padding: 0 0 0 18px; line-height: 1.6; }
.blockers-list li { margin: 5px 0; }

/* Documentos que a Truck Club envia (candidato vê, mas não faz upload) */
.doc-card.doc-staff {
  border-left: 3px solid #e8a33d;
  background: #fdf6ea;
}
.doc-card.doc-staff .doc-name { color: #7a4a00; }
.doc-tag.staff-tag { background: #f8e7c8; color: #8a5a00; }

.docs-subgroup {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed #e2cfa6;
}
.docs-subgroup-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.docs-subgroup-head strong { color: #7a4a00; }
.docs-subgroup-head span { color: var(--muted-foreground); font-size: 13px; line-height: 1.45; }

/* Offscreen layout/paint optimization on low-RAM mobile WebViews */
.doc-card,
.ref-item,
.learn-video-item,
.as-row {
  content-visibility: auto;
  contain-intrinsic-size: auto 120px;
}
