/* ======================================================
   CADASTRO DE EMPRESA EM ETAPAS
   Mesmo visual da tela de login: painel branco + lateral
   escura com a marca e o progresso.
   ====================================================== */

:root {
  --fundo-1: #0b1120;
  --fundo-2: #111827;
  --lateral: #0f172a;
  --painel: #ffffff;
  --texto: #0f172a;
  --texto-suave: #64748b;
  --rotulo: #334155;
  --linha: #d8e0ea;
  --campo: #f8fafc;
  --laranja: #f97316;
  --laranja-escuro: #ea580c;
  --azul: #0ea5e9;
  --verde: #16a34a;
  --vermelho: #dc2626;
  --raio: 12px;
}

* {
  box-sizing: border-box;
}

/* O atributo hidden sempre vence (classes com display não o anulam). */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--texto);
  background:
    radial-gradient(circle at 14% 16%, rgba(14, 165, 233, 0.22), transparent 30%),
    radial-gradient(circle at 86% 20%, rgba(249, 115, 22, 0.2), transparent 28%),
    linear-gradient(135deg, var(--fundo-1) 0%, var(--fundo-2) 50%, var(--lateral) 100%);
}

a {
  color: var(--laranja-escuro);
  font-weight: 700;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input {
  font: inherit;
}

/* ---------- Estrutura ---------- */

.cadastro-shell {
  width: min(1060px, 100%);
  min-height: 640px;
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 20px;
  background: var(--painel);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  animation: surgir 0.5s ease both;
}

@keyframes surgir {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Lateral ---------- */

.cadastro-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 40px 36px;
  overflow: hidden;
  color: #f8fafc;
  background:
    radial-gradient(circle at 0% 0%, rgba(249, 115, 22, 0.28), transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(14, 165, 233, 0.22), transparent 45%),
    var(--lateral);
}

.cadastro-logo img {
  display: block;
  width: 150px;
}

.selo {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 11px;
  border: 1px solid rgba(226, 232, 240, 0.25);
  border-radius: 999px;
  color: #fed7aa;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.selo.teste {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.14);
  color: #bbf7d0;
}

.cadastro-aside h1 {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.15;
}

.cadastro-aside-texto p {
  margin: 0;
  color: #cbd5e1;
  font-size: 15px;
  line-height: 1.6;
}

/* Lista de etapas com linha ligando os números */
.etapas {
  position: relative;
  display: grid;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.etapa {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #94a3b8;
  transition: color 0.25s ease;
}

.etapa:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 38px;
  width: 2px;
  height: 22px;
  border-radius: 2px;
  background: rgba(148, 163, 184, 0.3);
  transition: background 0.3s ease;
}

.etapa strong,
.etapa small {
  display: block;
}

.etapa strong {
  font-size: 15px;
}

.etapa small {
  margin-top: 2px;
  font-size: 13px;
  opacity: 0.85;
}

.etapa-num {
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 2px solid rgba(148, 163, 184, 0.45);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 800;
  transition: all 0.25s ease;
}

.etapa.atual {
  color: #ffffff;
}

.etapa.atual .etapa-num {
  border-color: var(--laranja);
  background: var(--laranja);
  color: #ffffff;
  box-shadow: 0 0 0 5px rgba(249, 115, 22, 0.22);
}

.etapa.feita {
  color: #e2e8f0;
}

/* Etapa concluída: o número dá lugar a um check centralizado. */
.etapa.feita .etapa-num {
  border-color: var(--verde);
  background: var(--verde) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 16px no-repeat;
  font-size: 0;
}

.etapa.feita::after {
  background: var(--verde);
}

.cadastro-aside-rodape {
  margin: auto 0 0;
  color: #cbd5e1;
  font-size: 14px;
}

.cadastro-aside-rodape a {
  color: #fdba74;
}

/* ---------- Painel do formulário ---------- */

.cadastro-painel {
  display: flex;
  flex-direction: column;
  padding: 44px 52px;
}

.progresso {
  display: none;
  margin-bottom: 26px;
}

.progresso-topo {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--texto-suave);
  font-size: 13px;
  font-weight: 700;
}

#progressoNome {
  color: var(--laranja-escuro);
}

.progresso-trilho {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.progresso-barra {
  width: 25%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--laranja), var(--azul));
  transition: width 0.35s ease;
}

form {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.passo {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  animation: entrarPasso 0.35s ease both;
}

.passo.voltando {
  animation-name: entrarPassoVoltando;
}

@keyframes entrarPasso {
  from { opacity: 0; transform: translateX(22px); }
  to { opacity: 1; transform: none; }
}

@keyframes entrarPassoVoltando {
  from { opacity: 0; transform: translateX(-22px); }
  to { opacity: 1; transform: none; }
}

legend {
  display: block;
  padding: 0;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
}

.passo-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--laranja-escuro);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.passo-descricao {
  margin: 10px 0 26px;
  color: var(--texto-suave);
  font-size: 15px;
  line-height: 1.55;
}

/* ---------- Campos ---------- */

.campo {
  margin-bottom: 18px;
}

.campo > label,
.rotulo {
  display: block;
  margin-bottom: 7px;
  color: var(--rotulo);
  font-size: 13px;
  font-weight: 700;
}

.opcional {
  color: var(--texto-suave);
  font-weight: 500;
}

.campo input[type="email"],
.campo input[type="password"],
.campo input[type="text"],
.campo input[type="tel"] {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--linha);
  border-radius: var(--raio);
  outline: none;
  background: var(--campo);
  color: var(--texto);
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.campo input::placeholder {
  color: #94a3b8;
}

.campo input:focus {
  border-color: var(--azul);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
}

.campo input[readonly] {
  border-style: dashed;
  background: #f1f5f9;
  color: var(--texto-suave);
}

.campo.erro input {
  border-color: var(--vermelho);
  background: #fef2f2;
}

.campo.erro input:focus {
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.14);
}

.campo.ok input:not(:focus) {
  border-color: #86efac;
}

.campo-dica {
  display: block;
  margin-top: 6px;
  color: var(--texto-suave);
  font-size: 13px;
}

.campo-erro {
  min-height: 0;
  margin: 6px 0 0;
  color: var(--vermelho);
  font-size: 13px;
  font-weight: 600;
}

.campo-erro:empty {
  display: none;
}

/* Senha com botão mostrar/ocultar */
.campo-senha {
  position: relative;
}

.campo-senha input {
  padding-right: 86px !important;
}

.ver-senha {
  position: absolute;
  top: 50%;
  right: 8px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #0369a1;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transform: translateY(-50%);
}

.ver-senha:hover,
.ver-senha:focus-visible {
  background: #e0f2fe;
  outline: none;
}

/* Força da senha */
.forca {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.forca span {
  height: 5px;
  border-radius: 999px;
  background: #e2e8f0;
  transition: background 0.25s ease;
}

.forca[data-nivel="1"] span:nth-child(-n + 1) { background: #ef4444; }
.forca[data-nivel="2"] span:nth-child(-n + 2) { background: #f59e0b; }
.forca[data-nivel="3"] span:nth-child(-n + 3) { background: #84cc16; }
.forca[data-nivel="4"] span:nth-child(-n + 4) { background: var(--verde); }

.forca-rotulo {
  min-height: 18px;
  margin: 6px 0 4px;
  color: var(--texto-suave);
  font-size: 12px;
  font-weight: 700;
}

.requisitos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--texto-suave);
  font-size: 12.5px;
}

.requisitos li {
  position: relative;
  padding-left: 18px;
  transition: color 0.2s ease;
}

.requisitos li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 5px;
  width: 8px;
  height: 8px;
  border: 1.5px solid #cbd5e1;
  border-radius: 50%;
}

.requisitos li.ok {
  color: var(--verde);
}

.requisitos li.ok::before {
  top: 3px;
  width: 9px;
  height: 5px;
  border: 0;
  border-left: 2px solid var(--verde);
  border-bottom: 2px solid var(--verde);
  border-radius: 0;
  transform: rotate(-45deg);
}

/* Cartões de segmento (radio) */
.segmentos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.segmento {
  position: relative;
  cursor: pointer;
}

.segmento input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmento-cartao {
  position: relative;
  display: block;
  height: 100%;
  padding: 16px;
  border: 1.5px solid var(--linha);
  border-radius: var(--raio);
  background: var(--campo);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.segmento:hover .segmento-cartao {
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.segmento input:focus-visible + .segmento-cartao {
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.2);
}

.segmento input:checked + .segmento-cartao {
  border-color: var(--laranja);
  background: #fff7ed;
  box-shadow: 0 10px 24px rgba(249, 115, 22, 0.14);
}

/* Selo de check no canto do cartão escolhido */
.segmento input:checked + .segmento-cartao::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--laranja) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.segmento-icone {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.segmento-icone svg {
  width: 22px;
  height: 22px;
  fill: var(--laranja-escuro);
}

/* H Announcer TV: produto a parte, ocupa a linha inteira embaixo dos dois segmentos. */
.segmento-tv { grid-column: 1 / -1; }
.segmento-tv .segmento-icone { background: linear-gradient(135deg, #ff7a1a, #ff3d6e); }
.segmento-tv .segmento-icone svg { fill: #fff; }

.segmento-cartao strong,
.segmento-cartao small {
  display: block;
}

.segmento-cartao strong {
  margin-bottom: 4px;
  font-size: 15px;
}

.segmento-cartao small {
  color: var(--texto-suave);
  font-size: 13px;
  line-height: 1.45;
}

.campo.erro .segmento-cartao {
  border-color: #fca5a5;
}

/* ---------- Revisão ---------- */

.revisao {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.revisao-bloco {
  padding: 16px 18px;
  border: 1px solid #e2e8f0;
  border-radius: var(--raio);
  background: var(--campo);
}

.revisao-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.revisao-topo h3 {
  margin: 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--texto-suave);
}

.revisao-editar {
  padding: 4px 10px;
  border: 0;
  border-radius: 8px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.revisao-editar:hover {
  background: #bae6fd;
}

.revisao dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 16px;
  margin: 0;
  font-size: 14px;
}

.revisao dt {
  color: var(--texto-suave);
}

.revisao dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.termos {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--rotulo);
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
}

.termos input {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--laranja);
  cursor: pointer;
}

/* ---------- Ações ---------- */

.aviso-geral {
  margin: 4px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 14px;
  font-weight: 600;
}

.aviso-geral:empty {
  display: none;
}

.acoes {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding-top: 24px;
}

.botao {
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--raio);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.botao:focus-visible {
  outline: 3px solid rgba(14, 165, 233, 0.45);
  outline-offset: 2px;
}

.botao-primario {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--laranja), var(--laranja-escuro));
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(249, 115, 22, 0.26);
}

.botao-primario:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(249, 115, 22, 0.32);
}

.botao-secundario {
  background: #f1f5f9;
  color: var(--rotulo);
}

.botao-secundario:hover {
  background: #e2e8f0;
}

.botao:disabled {
  cursor: wait;
  opacity: 0.75;
}

.carregando::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: girar 0.7s linear infinite;
}

@keyframes girar {
  to { transform: rotate(360deg); }
}

.cadastro-rodape-mobile {
  display: none;
  margin: 20px 0 0;
  text-align: center;
  color: var(--texto-suave);
  font-size: 14px;
}

/* ---------- Responsivo ---------- */

@media (max-width: 900px) {
  body {
    align-items: flex-start;
    padding: 0;
    background: var(--painel);
  }

  .cadastro-shell {
    min-height: 100vh;
    grid-template-columns: 1fr;
    /* overflow visível: senão os botões "sticky" do rodapé não grudam */
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  /* Cabeçalho compacto: logo e selo numa linha só */
  .cadastro-aside {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
  }

  .cadastro-logo img {
    width: 104px;
  }

  .selo {
    margin: 0;
    font-size: 11px;
  }

  .cadastro-aside h1,
  .cadastro-aside-texto p,
  .etapas,
  .cadastro-aside-rodape {
    display: none;
  }

  .cadastro-painel {
    padding: 24px 20px 28px;
  }

  .progresso,
  .cadastro-rodape-mobile {
    display: block;
  }

  legend {
    font-size: 23px;
  }

  /* Botões fixos no rodapé no celular: sempre à mão */
  .acoes {
    position: sticky;
    bottom: 0;
    margin: 0 -20px;
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
  }
}

@media (max-width: 520px) {
  .segmentos,
  .requisitos {
    grid-template-columns: 1fr;
  }

  .revisao dl {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .revisao dd {
    margin-bottom: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
