:root {
  --primary: #7c3aed;
  --primary-dark: #6d28d9;
  --primary-light: #a78bfa;
  --secondary: #3b82f6;
  --gradient-primary: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
  --gradient-soft: linear-gradient(135deg, #ede9fe 0%, #dbeafe 100%);
  --gradient-dark: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-strong: #020617;
  --text-muted: #475569;
  --text-light: #94a3b8;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow-md: 0 4px 6px -1px rgba(15,23,42,0.06), 0 2px 4px -2px rgba(15,23,42,0.06);
  --shadow-xl: 0 20px 25px -5px rgba(15,23,42,0.10), 0 8px 10px -6px rgba(15,23,42,0.10);
  --shadow-2xl: 0 25px 50px -12px rgba(15,23,42,0.20);
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --t-fast: 150ms cubic-bezier(0.4,0,0.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
*:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

body {
  font-family: 'Inter', 'Inter Fallback', -apple-system, sans-serif;
  background: var(--gradient-dark);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  padding: 24px;
  position: relative;
  overflow-x: hidden;
}
body::before, body::after {
  content: '';
  position: fixed;
  width: 800px; height: 800px;
  border-radius: 50%;
  pointer-events: none;
}
body::before { background: radial-gradient(circle, rgba(124,58,237,0.3) 0%, transparent 70%); top: -300px; left: -300px; }
body::after { background: radial-gradient(circle, rgba(59,130,246,0.3) 0%, transparent 70%); bottom: -300px; right: -300px; }

.cadastro-wrap { max-width: 560px; margin: 32px auto; position: relative; z-index: 1; }

.brand-header { text-align: center; margin-bottom: 24px; }
.brand-header a { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 44px; height: 44px; border-radius: 12px; background: var(--gradient-primary); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 16px; letter-spacing: -0.02em; box-shadow: 0 8px 24px rgba(124,58,237,0.5); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.brand-name { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; color: #fff; }
.brand-tagline { font-size: 9px; text-transform: uppercase; letter-spacing: 0.18em; color: rgba(255,255,255,0.55); font-weight: 600; margin-top: 2px; }

.cadastro-card { background: var(--surface); padding: 40px; border-radius: var(--radius-xl); box-shadow: var(--shadow-2xl); border: 1px solid var(--border); }

.cadastro-card h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.025em; color: var(--text-strong); margin-bottom: 8px; }
.cadastro-card h1 .accent { background: var(--gradient-primary); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.cadastro-card .subtitle { color: var(--text-muted); font-size: 15px; margin-bottom: 32px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 6px; }
.field label .req { color: var(--danger); margin-left: 4px; }
.field label .hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-light); margin-left: 6px; font-size: 11px; }

.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  background: var(--surface);
  color: var(--text);
  transition: all var(--t-fast);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,58,237,0.12); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }

.field-feedback, .field small { font-size: 13px; margin-top: 6px; font-weight: 500; display: block; }
.field-feedback.success, .field small.ok { color: var(--success); }
.field-feedback.error, .field small.erro { color: var(--danger); }
.field-feedback.checking { color: var(--text-muted); }

.slug-row { display: flex; align-items: stretch; }
.slug-row input { border-radius: var(--radius-md) 0 0 var(--radius-md); border-right: none; }
.slug-row .suffix { background: var(--gradient-soft); padding: 12px 14px; border: 1.5px solid var(--border); border-left: none; border-radius: 0 var(--radius-md) var(--radius-md) 0; font-size: 13px; color: var(--primary-dark); font-weight: 600; display: flex; align-items: center; white-space: nowrap; font-family: monospace; }

.btn {
  width: 100%;
  padding: 14px;
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t-fast);
  box-shadow: 0 8px 24px rgba(124,58,237,0.35);
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(124,58,237,0.45); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.alerta { padding: 14px; border-radius: var(--radius-md); margin-bottom: 16px; font-size: 14px; }
.alerta.erro { background: rgba(239,68,68,0.1); color: #b91c1c; border: 1px solid rgba(239,68,68,0.2); }
.alerta.sucesso { background: rgba(16,185,129,0.1); color: #047857; border: 1px solid rgba(16,185,129,0.2); }

.sucesso-card { background: var(--surface); border: 2px solid var(--success); border-radius: var(--radius-lg); padding: 32px; text-align: center; }
.sucesso-card h2 { font-size: 24px; font-weight: 800; margin-bottom: 12px; color: var(--text-strong); background: var(--gradient-primary); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.sucesso-card a { color: var(--primary); font-weight: 600; display: inline-block; margin: 8px; text-decoration: none; word-break: break-all; padding: 8px 14px; background: var(--gradient-soft); border-radius: 8px; }

.cadastro-footer { text-align: center; margin-top: 24px; color: rgba(255,255,255,0.7); font-size: 13px; }
.cadastro-footer a { color: rgba(255,255,255,0.95); text-decoration: underline; }

.trust-badges { display: flex; justify-content: center; gap: 18px; margin-top: 20px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); }
.trust-badges span::before { content: '✓ '; color: var(--success); font-weight: 700; }

/* F1 CADASTRO MOBILE FIXES */
@media (max-width: 768px) {
  .cadastro-wrap { padding: 16px !important; min-height: 100vh; }
  .cadastro-card { padding: 24px 20px !important; max-width: 100% !important; margin: 0 !important; }
  .brand-header { margin-bottom: 20px; }
  .brand-header h1, .cadastro-card h1 { font-size: 22px; }
  .form-row, .field-row { flex-direction: column !important; gap: 12px !important; }
  .form-row > *, .field-row > * { width: 100% !important; }
  input, select, textarea { font-size: 16px !important; padding: 12px 14px !important; min-height: 44px; }
  .btn-submit, .btn { width: 100%; padding: 14px !important; font-size: 16px; }
  .trust-badges { flex-direction: column; gap: 8px; font-size: 12px; }
  .slug-row { flex-direction: column; }
  .slug-row .suffix { border-left: 1.5px solid var(--border); border-top: none; border-radius: 0 0 10px 10px; }
  .slug-row input { border-right: 1.5px solid var(--border); border-radius: 10px 10px 0 0; }
}

/* ═══════════════════════════════════════════════════════════
   Cadastro v2 — SPA 4 etapas (Frente 2)
   ═══════════════════════════════════════════════════════════ */

* { box-sizing: border-box; }
body {
  font-family: 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f8fafc;
  color: #0f172a;
  margin: 0;
  min-height: 100vh;
}

.topbar-cad {
  background: white;
  border-bottom: 1px solid #e2e8f0;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand-cad {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: #0f172a;
}
.brand-mark-cad {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  color: white; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
}
.brand-text-cad { font-weight: 800; font-size: 17px; }
.link-voltar {
  font-size: 13px; color: #64748b; text-decoration: none;
}

.cad-main {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.cad-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 720px;
  margin: 0 auto 32px;
  gap: 4px;
}
.cad-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.cad-step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  transition: all 0.2s;
}
.cad-step-label {
  font-size: 11px;
  /* LH.8: #94a3b8 = 3.18:1 (falha AA). Bumpado pra 5.3:1 sobre branco. */
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.cad-step.ativo .cad-step-num {
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  color: white;
}
/* LH.8: #7c3aed = 4.4:1 (borderline AA). Bumpado pra #6d28d9 = 6.0:1. */
.cad-step.ativo .cad-step-label { color: #6d28d9; }
.cad-step.completo .cad-step-num {
  background: #10b981; color: white;
}
.cad-step-line {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  margin: 0 4px;
  position: relative;
  top: -14px;
}

.cad-container { background: white; border-radius: 16px; padding: 32px; box-shadow: 0 4px 16px rgba(0,0,0,0.04); }

.cad-h1 {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 8px;
  color: #0f172a;
}
.cad-sub {
  color: #64748b;
  margin: 0 0 24px;
  font-size: 15px;
}
.cad-sub-aviso {
  color: #475569;
  font-size: 14px;
  margin: 0 0 16px;
}

.cad-skeleton, .cad-erro-global {
  text-align: center; padding: 40px;
  color: #64748b;
}
.cad-erro {
  background: #fee2e2; color: #991b1b;
  padding: 12px 16px; border-radius: 8px;
  margin: 12px 0;
  font-size: 14px;
}

/* ─── Etapa 1: Planos ─── */
.planos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.plano-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  display: flex; flex-direction: column;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.plano-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
  border-color: #c4b5fd;
}
.plano-popular {
  border-color: #7c3aed;
  box-shadow: 0 6px 20px rgba(124,58,237,0.15);
}
.plano-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  color: white;
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.plano-card h3 { font-size: 20px; margin: 0 0 4px; font-weight: 800; }
.plano-preco { margin: 8px 0; }
.plano-preco-valor { font-size: 32px; font-weight: 800; color: #7c3aed; }
.plano-preco-mes { color: #64748b; font-size: 14px; }
.plano-desc { color: #64748b; font-size: 13px; margin: 0 0 14px; min-height: 36px; }
.plano-feats { list-style: none; padding: 0; margin: 0 0 16px; flex: 1; }
.plano-feats li { padding: 5px 0; font-size: 13px; color: #334155; }
.plano-feats li.ft-off, .plano-feats .ft-off { color: #94a3b8; }

.btn-cad {
  border: none;
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.1s;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-cad:hover { transform: translateY(-1px); }
.btn-cad:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-plano { width: 100%; }
.btn-primario { background: linear-gradient(135deg, #7c3aed, #3b82f6); }
.btn-secundario { background: white; color: #7c3aed; border: 2px solid #7c3aed; }

/* ─── Etapa 2: Fluxo ─── */
.fluxo-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.fluxo-card:hover {
  border-color: #7c3aed;
  box-shadow: 0 6px 20px rgba(124,58,237,0.08);
}
.fluxo-trial {
  border-color: #10b981;
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
}
.fluxo-destaque {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
}
.fluxo-card-icon { font-size: 36px; flex-shrink: 0; }
.fluxo-card-body { flex: 1; }
.fluxo-card-body h3 { margin: 0 0 4px; font-size: 17px; }
.fluxo-card-body p { margin: 0; color: #475569; font-size: 13px; }
.fluxo-card-body small { color: #64748b; font-size: 12px; display: block; margin-top: 4px; }
.btn-fluxo { white-space: nowrap; flex-shrink: 0; }
.badge-desc {
  background: #10b981;
  color: white;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 700;
  margin-left: 4px;
}
.ou-divider {
  text-align: center;
  color: #94a3b8;
  margin: 20px 0;
  font-size: 13px;
}

.link-trocar {
  background: none; border: none;
  color: #7c3aed; cursor: pointer;
  font-size: 13px; font-weight: 600;
  text-decoration: underline;
  padding: 0 4px;
  font-family: inherit;
}

.link-voltar-step {
  background: none; border: none;
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 0;
  font-family: inherit;
}
.link-voltar-step:hover { color: #7c3aed; }

/* ─── Etapa 3: Form ─── */
fieldset {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin: 0 0 16px;
}
fieldset legend {
  font-weight: 700;
  font-size: 14px;
  color: #334155;
  padding: 0 8px;
}

.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 4px;
}
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  color: #0f172a;
}
.field input:focus, .field select:focus {
  outline: 2px solid #7c3aed;
  outline-offset: -1px;
  border-color: #7c3aed;
}
.field small {
  font-size: 12px;
  color: #64748b;
  display: block;
  margin-top: 4px;
}
.field small.ok { color: #10b981; }
.field small.erro { color: #ef4444; }

.row { display: flex; gap: 12px; }
.row .field { flex: 1; }
.row .f-cep { max-width: 140px; }
.row .f-numero { max-width: 100px; }
.row .f-estado { max-width: 80px; }

.slug-row {
  display: flex;
  align-items: stretch;
}
.slug-row input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.slug-suffix {
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  border-left: none;
  padding: 0 12px;
  display: flex; align-items: center;
  font-size: 13px; color: #475569;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  white-space: nowrap;
}

.field-radio {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.field-radio .radio {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px;
  cursor: pointer;
}
.field-radio input[type="radio"] {
  width: 18px; height: 18px;
  accent-color: #7c3aed;
}

.field-checkbox { margin: 16px 0; }
.field-checkbox .check {
  display: flex; align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
}
.field-checkbox input[type="checkbox"] {
  width: 20px; height: 20px;
  accent-color: #7c3aed;
  flex-shrink: 0;
}
.field-checkbox a { color: #7c3aed; }

.acoes-form {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  gap: 12px;
}

/* ─── Etapa 4: confirmação trial ─── */
.resumo-final {
  background: #f8fafc;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.resumo-final dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  margin: 0 0 16px;
}
.resumo-final dt { font-size: 13px; color: #64748b; font-weight: 600; }
.resumo-final dd { margin: 0; color: #0f172a; }
.aviso-trial {
  background: #fef3c7;
  color: #92400e;
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  margin: 0;
  border-left: 3px solid #f59e0b;
}

/* ─── Etapa 4: gateways ─── */
.gateways-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.gateway-card {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: all 0.15s;
}
.gateway-card:hover {
  border-color: #7c3aed;
  box-shadow: 0 4px 12px rgba(124,58,237,0.08);
}
.gateway-card h3 { margin: 0 0 8px; font-size: 17px; }
.gateway-feats { list-style: none; padding: 0; margin: 0 0 12px; }
.gateway-feats li { font-size: 13px; color: #475569; padding: 2px 0; }
.gateway-feats li::before { content: "✓ "; color: #10b981; font-weight: 700; }
.gateway-notas { font-size: 12px; color: #64748b; margin: 0 0 8px; }
.gateway-aviso { font-size: 12px; color: #92400e; margin: 0 0 8px; background: #fef3c7; padding: 4px 8px; border-radius: 6px; }
.btn-gateway { width: 100%; margin-top: auto; }
.gateway-desabilitado { opacity: 0.5; }

/* ─── Sucesso ─── */
.sucesso-card {
  text-align: center;
  padding: 40px 20px;
}
.sucesso-icon { font-size: 72px; margin-bottom: 16px; }
.sucesso-card h1 { font-size: 24px; margin: 0 0 12px; }
.sucesso-card p { color: #475569; margin: 0 0 24px; }
.sucesso-links {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 24px;
}
.sucesso-info {
  font-size: 13px;
  color: #94a3b8;
  background: #f8fafc;
  padding: 16px;
  border-radius: 8px;
  text-align: left;
  border-left: 3px solid #7c3aed;
}

/* ─── Footer ─── */
.footer-cad {
  text-align: center;
  padding: 20px;
  /* LH.9: #94a3b8 (3.18:1 falha AA). #475569 = 7.3:1 AAA. */
  color: #475569;
  font-size: 12px;
}
.footer-cad a { color: #475569; text-decoration: none; }
.footer-cad a:hover { color: #6d28d9; }

/* ─── Mobile ─── */
@media (max-width: 640px) {
  .cad-container { padding: 20px; }
  .cad-h1 { font-size: 22px; }
  .planos-grid { grid-template-columns: 1fr; }
  .gateways-grid { grid-template-columns: 1fr; }
  .fluxo-card { flex-direction: column; align-items: stretch; text-align: center; }
  .btn-fluxo { width: 100%; }
  .row { flex-direction: column; gap: 0; }
  .row .f-cep, .row .f-numero, .row .f-estado { max-width: 100%; }
  .cad-progress { gap: 0; }
  .cad-step-label { font-size: 10px; }
  .resumo-final dl { grid-template-columns: 1fr; }
  .resumo-final dt { font-size: 11px; text-transform: uppercase; }
  .acoes-form { flex-direction: column; align-items: stretch; }
  .acoes-form button { width: 100%; }
}
