:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #174a7c;
  --primary-2: #0e7490;
  --danger: #b91c1c;
  --success: #166534;
  --shadow: 0 24px 70px rgba(15, 23, 42, .10);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(circle at top left, #dbeafe 0, transparent 35%), var(--bg);
  color: var(--text);
}
.page-shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0; }
.hero { text-align: center; margin-bottom: 28px; }
.brand-logo { width: min(325px, 70vw); height: auto; transform: scale(.5); transform-origin: center; margin: -22px auto -12px; display: block; }
.eyebrow { display: inline-flex; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--primary); background: rgba(255,255,255,.7); font-weight: 700; font-size: 13px; }
h1 { font-size: clamp(30px, 4vw, 52px); line-height: 1.05; margin: 18px auto 14px; max-width: 850px; letter-spacing: -1px; }
p { color: var(--muted); }
.hero p { max-width: 780px; margin: 0 auto; font-size: 17px; line-height: 1.6; }
.wizard-card { background: rgba(255,255,255,.92); border: 1px solid rgba(226,232,240,.9); border-radius: 28px; box-shadow: var(--shadow); padding: 28px; backdrop-filter: blur(10px); }
.progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 26px; }
.progress-step { border: 1px solid var(--line); border-radius: 16px; padding: 13px 10px; color: var(--muted); font-weight: 700; text-align: center; background: #f8fafc; }
.progress-step.active { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border-color: transparent; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 25px; font-weight: 800; margin-bottom: 22px; }
.step { display: none; animation: enter .25s ease; }
.step.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
label { display: grid; gap: 7px; font-weight: 700; color: #334155; }
small { color: var(--muted); font-weight: 500; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 14px 14px;
  font: inherit; color: var(--text); background: #fff; outline: none; transition: border .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary-2); box-shadow: 0 0 0 4px rgba(14,116,144,.12); }
.cnpj-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.checkbox-card { margin: 20px 0; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: #f8fafc; }
.checkbox-card p { margin-top: 0; color: var(--text); font-weight: 800; }
.checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.checks label, .consent { display: flex; align-items: center; gap: 10px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.checks input, .consent input { width: auto; }
.consent { margin-top: 20px; align-items: flex-start; line-height: 1.5; }
.actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.btn { border: 0; border-radius: 14px; padding: 13px 18px; cursor: pointer; font-weight: 800; transition: transform .15s, opacity .15s; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.primary { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.btn.ghost { color: var(--primary); background: #eef6ff; border: 1px solid #cfe6ff; }
.message { min-height: 24px; margin-top: 16px; font-weight: 700; }
.message.error { color: var(--danger); }
.message.success { color: var(--success); }
.message.info { color: var(--primary); }
.hidden, .hp { display: none !important; }
.uppercase { text-transform: uppercase; }
@media (max-width: 780px) {
  .page-shell { width: min(100% - 20px, 1120px); padding: 18px 0 28px; }
  .brand-logo { width: min(310px, 88vw); margin: -18px auto -8px; }
  .hero { margin-bottom: 18px; }
  h1 { font-size: clamp(25px, 8vw, 34px); }
  .hero p { font-size: 15px; }
  .wizard-card { padding: 16px; border-radius: 20px; }
  .progress, .grid.two, .grid.three, .checks { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .cnpj-row { grid-template-columns: 1fr; }
  .progress-step { font-size: 13px; padding: 11px 8px; }
  input, select, textarea { font-size: 16px; }
  .actions { flex-direction: column; }
  .btn { width: 100%; }
}

@media (min-width: 781px) {
  .step.active { min-height: 420px; }
}


.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(15, 23, 42, .58);
  backdrop-filter: blur(6px);
}
.modal-card {
  width: min(520px, 100%);
  background: #fff;
  border: 1px solid rgba(226,232,240,.95);
  border-radius: 26px;
  box-shadow: 0 28px 90px rgba(15, 23, 42, .28);
  padding: 34px 28px;
  text-align: center;
  animation: modalEnter .22s ease;
}
.modal-icon {
  width: 74px;
  height: 74px;
  margin: 0 auto 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #dcfce7;
  color: var(--success);
  font-size: 42px;
  font-weight: 900;
}
.modal-card h2 {
  margin: 0 0 12px;
  font-size: clamp(24px, 4vw, 32px);
  color: var(--text);
}
.modal-card p {
  margin: 0 auto 24px;
  max-width: 430px;
  font-size: 16px;
  line-height: 1.65;
}
.modal-card .btn {
  min-width: 180px;
}
@keyframes modalEnter {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
body.modal-open {
  overflow: hidden;
}

@media (max-width: 780px) {
  .modal-overlay { padding: 14px; }
  .modal-card { padding: 28px 18px; border-radius: 22px; }
  .modal-icon { width: 66px; height: 66px; font-size: 36px; }
  .modal-card .btn { width: 100%; }
}
