/* ═══════════════════════════════════════════════════════════════
   ERPAvel — Criar conta (assistente de cadastro)
   Complementa auth.css e mantém os nomes de classe que o JavaScript da página usa.
   ═══════════════════════════════════════════════════════════════ */

/* Layout: marca mais estreita, para dar espaço aos cartões de plano e ao pagamento */
@media (min-width: 1025px) {
  .lg-page.cc-page { grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr); }
  .cc-page .lg-brand { padding: 3rem 3rem 2.25rem; }
  .cc-page .lg-lead { max-width: 420px; }
}

.cc-side { align-items: flex-start; }
@media (min-width: 1025px) { .cc-side { align-items: center; } }
.cc-inner { max-width: 420px; transition: max-width .3s ease; }
.cc-inner.wide { max-width: min(100%, 820px); }

/* Variáveis lidas pelo formulário de pagamento compartilhado (partials/payment-form) */
.cc-side {
  --text-primary: var(--lg-ink);
  --text-muted: var(--lg-muted);
  --bg-surface: var(--lg-surface-2);
  --bg-surface-2: var(--lg-surface-2);
  --bg-hover: var(--lg-surface-2);
  --border-color-light: var(--lg-hairline);
}

/* ── Progresso ───────────────────────────────────────────────── */
.wiz-progress { display: flex; align-items: center; margin: 0 0 2rem; }
.prog-step { display: flex; flex-direction: column; align-items: center; gap: .4rem; flex: 0 0 auto; }
.prog-circle {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700;
  color: var(--lg-muted); background: var(--lg-surface); border: 1.5px solid var(--lg-line);
  transition: background .25s, border-color .25s, color .25s;
}
.prog-circle.active { color: #fff; background: var(--lg-blue); border-color: var(--lg-blue); }
.prog-circle.done   { color: #fff; background: #1b8a4b; border-color: #1b8a4b; }
.prog-step + .prog-step { margin-left: .75rem; }
.prog-label { font-size: .68rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--lg-muted); white-space: nowrap; }
.prog-label.active { color: var(--lg-blue); }
.prog-label.done   { color: #1b8a4b; }
.prog-connector { flex: 1; height: 1.5px; margin: 0 .5rem 1.2rem; background: var(--lg-line); transition: background .3s; }
.prog-connector.done { background: #1b8a4b; }

/* ── Passos do assistente ────────────────────────────────────── */
.wizard-wrap { position: relative; }
.wizard-step { display: none; animation: ccStepIn .3s ease both; }
.wizard-step.active { display: block; }
.wizard-step.leaving { display: block; animation: ccStepOut .2s ease both; }
@keyframes ccStepIn  { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes ccStepOut { from { opacity: 1; } to { opacity: 0; transform: translateX(-14px); } }

.step-heading { margin: 0 0 1.5rem; }
.step-heading h2 { margin: 0 0 .35rem; font-family: 'Montserrat', 'Inter', sans-serif; font-weight: 700; font-size: 1.45rem; letter-spacing: -.01em; color: var(--lg-ink); }
.step-heading p  { margin: 0; font-size: .9rem; line-height: 1.5; color: var(--lg-muted); }

/* ── Campos ──────────────────────────────────────────────────── */
.field-group { margin-bottom: 1.1rem; }
.field-group label { display: block; margin-bottom: .4rem; font-size: .8rem; font-weight: 600; color: var(--lg-ink); }
.input-wrap { position: relative; }
.input-icon { display: none; }
.cc-input {
  display: block; width: 100%; height: 46px; padding: 0 .95rem;
  font-family: inherit; font-size: .95rem; color: var(--lg-ink);
  background: var(--lg-surface); border: 1px solid var(--lg-line); border-radius: 8px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.cc-input::placeholder { color: var(--lg-placeholder); }
.cc-input:hover { border-color: var(--lg-line-strong); }
.cc-input:focus { border-color: var(--lg-blue); box-shadow: 0 0 0 3px rgba(10, 104, 248, .16); }
.cc-input.error   { border-color: var(--lg-danger); box-shadow: 0 0 0 3px rgba(198, 40, 40, .12); }
.cc-input.success { border-color: #1b8a4b; box-shadow: 0 0 0 3px rgba(27, 138, 75, .12); }

.cnpj-row { display: flex; gap: .65rem; align-items: flex-end; }
.cnpj-row .field-group { flex: 1; margin-bottom: 0; }
.btn-buscar {
  display: flex; align-items: center; gap: .45rem; flex-shrink: 0;
  height: 46px; padding: 0 1.1rem;
  font-family: inherit; font-size: .88rem; font-weight: 600; white-space: nowrap;
  color: #fff; background: var(--lg-blue); border: 0; border-radius: 8px; cursor: pointer;
  transition: background .15s;
}
.btn-buscar:hover { background: var(--lg-blue-deep); }
.btn-buscar:disabled { opacity: .5; cursor: not-allowed; }
.btn-buscar .spin { display: none; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: lg-spin .6s linear infinite; }
.btn-buscar.loading .spin { display: inline-block; }
.btn-buscar.loading .btn-buscar-icon { display: none; }

/* ── Cartão da empresa encontrada ────────────────────────────── */
.company-card { display: none; margin-top: .9rem; padding: 1rem 1.1rem; background: var(--lg-surface-2); border: 1px solid var(--lg-tint-line); border-radius: 10px; }
.company-card.visible { display: block; animation: ccStepIn .3s ease both; }
.company-card-top { display: flex; align-items: flex-start; gap: .8rem; margin-bottom: .85rem; }
.company-badge { width: 38px; height: 38px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--lg-blue); color: #fff; }
.company-info { flex: 1; min-width: 0; }
.company-name { font-size: .95rem; font-weight: 700; color: var(--lg-ink); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-cnpj { margin-top: 2px; font-family: 'Consolas', 'Courier New', monospace; font-size: .78rem; color: var(--lg-muted); }
.company-status { display: inline-flex; align-items: center; gap: .4rem; margin-top: .35rem; font-size: .75rem; font-weight: 600; color: #1b8a4b; }
.company-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #1b8a4b; }
.company-meta { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.meta-label { margin-bottom: 2px; font-size: .66rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--lg-muted); }
.meta-value { font-size: .82rem; line-height: 1.35; color: var(--lg-text); }

/* ── Mensagens ───────────────────────────────────────────────── */
.inline-msg { display: none; align-items: flex-start; gap: .55rem; margin-top: .8rem; padding: .7rem .85rem; font-size: .83rem; line-height: 1.45; border-radius: 6px; }
.inline-msg.show { display: flex; }
.inline-msg i { margin-top: .12rem; }
.inline-msg.error { color: var(--lg-danger); background: var(--lg-danger-bg); border: 1px solid var(--lg-danger-line); border-left: 3px solid var(--lg-danger); }
.inline-msg.info  { color: var(--lg-text);  background: var(--lg-tint); border: 1px solid var(--lg-tint-line); border-left: 3px solid var(--lg-blue); }
.inline-msg.info i { color: var(--lg-blue); }
.inline-msg.warn  { color: var(--lg-warn-text); background: var(--lg-warn-bg); border: 1px solid var(--lg-warn-line); border-left: 3px solid #d99a00; }

/* ── Confirmação ─────────────────────────────────────────────── */
.confirm-card { margin-bottom: .8rem; padding: 1rem 1.1rem; background: var(--lg-surface); border: 1px solid var(--lg-line); border-radius: 10px; }
.confirm-card-header { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; }
.confirm-card-icon { width: 30px; height: 30px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--lg-icon-bg); color: var(--lg-blue); font-size: .9rem; }
.confirm-card-icon.green  { background: var(--lg-ok-bg); color: #1b8a4b; }
.confirm-card-icon.violet { background: var(--lg-icon-bg); color: var(--lg-blue); }
.confirm-card-title { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--lg-muted); }
.confirm-row { display: flex; gap: .6rem; margin-bottom: .5rem; }
.confirm-row:last-child { margin-bottom: 0; }
.confirm-key { width: 92px; flex-shrink: 0; font-size: .8rem; color: var(--lg-muted); }
.confirm-val { flex: 1; min-width: 0; font-size: .86rem; font-weight: 600; color: var(--lg-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.confirm-notice { margin: 0 0 1rem; padding: .75rem .9rem; font-size: .82rem; line-height: 1.5; color: var(--lg-warn-text); background: var(--lg-warn-bg); border: 1px solid var(--lg-warn-line); border-radius: 6px; }

/* ── Botões de ação ──────────────────────────────────────────── */
.btn-row { display: flex; align-items: center; gap: .65rem; margin-top: 1.25rem; }
.btn-back {
  display: flex; align-items: center; gap: .45rem; flex-shrink: 0;
  height: 46px; padding: 0 1.1rem;
  font-family: inherit; font-size: .9rem; font-weight: 600;
  color: var(--lg-ink); background: var(--lg-surface); border: 1px solid var(--lg-line); border-radius: 8px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.btn-back:hover { border-color: var(--lg-line-strong); background: var(--lg-surface-2); }
.btn-next, .btn-submit {
  position: relative; flex: 1;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  height: 46px; padding: 0 1rem;
  font-family: inherit; font-size: .93rem; font-weight: 600;
  color: #fff; background: var(--lg-blue); border: 0; border-radius: 8px; cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn-next:hover, .btn-submit:hover { background: var(--lg-blue-deep); }
.btn-next:active, .btn-submit:active { transform: translateY(1px); }
.btn-next:disabled, .btn-submit:disabled { opacity: .5; cursor: not-allowed; transform: none; background: var(--lg-blue); }
.btn-submit .spin { display: none; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: lg-spin .6s linear infinite; flex-shrink: 0; }
.btn-submit.loading .spin { display: inline-block; }
.btn-submit.loading .btn-icon-submit { display: none; }

.back-login { margin-top: 1.4rem; text-align: center; font-size: .86rem; color: var(--lg-muted); }
.back-login a { font-weight: 600; color: var(--lg-blue); text-decoration: none; }
.back-login a:hover { color: var(--lg-blue-deep); text-decoration: underline; }

/* ── Sucesso ─────────────────────────────────────────────────── */
.success-state { display: none; padding: .5rem 0; }
.success-state.show { display: block; }
.check-circle { width: 60px; height: 60px; margin: 0 0 1.4rem; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #1b8a4b; }
.check-svg { width: 30px; height: 30px; }
.success-title { margin-bottom: .5rem; font-family: 'Montserrat', 'Inter', sans-serif; font-weight: 700; font-size: 1.6rem; letter-spacing: -.01em; color: var(--lg-ink); }
.success-sub { font-size: .92rem; line-height: 1.6; color: var(--lg-muted); }
.success-email { margin-top: .15rem; font-size: .95rem; font-weight: 700; color: var(--lg-ink); word-break: break-all; }
.success-hint { margin: 1.1rem 0 1.6rem; font-size: .84rem; line-height: 1.6; color: var(--lg-muted); }
.btn-go-login {
  display: inline-flex; align-items: center; gap: .5rem; padding: .8rem 1.5rem;
  font-size: .93rem; font-weight: 600; text-decoration: none;
  color: #fff; background: var(--lg-blue); border-radius: 8px; transition: background .15s;
}
.btn-go-login:hover { background: var(--lg-blue-deep); color: #fff; }


/* ── Pagamento (formulário compartilhado, em Bootstrap) ──────── */
.cc-side .btn-primary {
  --bs-btn-bg: var(--lg-blue); --bs-btn-border-color: var(--lg-blue);
  --bs-btn-hover-bg: var(--lg-blue-deep); --bs-btn-hover-border-color: var(--lg-blue-deep);
  --bs-btn-active-bg: #004dcc; --bs-btn-active-border-color: #004dcc;
  --bs-btn-disabled-bg: var(--lg-blue); --bs-btn-disabled-border-color: var(--lg-blue);
  border-radius: 8px;
}
.cc-side .btn-success { border-radius: 8px; }
.cc-side .pay-mod .text-primary { color: var(--lg-blue) !important; }
.cc-side .pay-mod .nav-tabs .nav-link.active { color: var(--lg-blue); border-bottom-color: var(--lg-blue); }
.cc-side .pay-mod .form-control { min-height: 44px; border-color: var(--lg-line); border-radius: 8px; }
.cc-side .pay-mod .form-control:focus { border-color: var(--lg-blue); box-shadow: 0 0 0 3px rgba(10, 104, 248, .16); }
.cc-side .pay-mod .plano-resumo { border-radius: 10px; }
/* O passo já tem título ("Pagamento"): esconde o cabeçalho repetido do parcial */
.cc-side .pay-mod .col-lg-7 > h4, .cc-side .pay-mod .col-lg-7 > h4 + p { display: none; }

@media (max-width: 575px) {
  .company-meta { grid-template-columns: 1fr; }
  .cnpj-row { flex-direction: column; align-items: stretch; }
  .btn-buscar { width: 100%; justify-content: center; }
  .prog-label { font-size: .6rem; }
}
