/* ============================================================
   FIBONACCI CONTABILIDADE — FORMULÁRIO CONDICIONAL DE LEADS
   Agência PHN | 2026
   ============================================================ */

/* ---- OVERLAY / BACKDROP ---- */
.cf-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(1, 27, 64, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cf-overlay.ativo {
  opacity: 1;
  visibility: visible;
}

/* ---- MODAL ---- */
.cf-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: 9999;
  width: 94vw;
  max-width: 540px;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(1, 27, 64, 0.3);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.cf-modal.ativo {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* ---- BARRA DE PROGRESSO ---- */
.cf-progresso {
  height: 4px;
  background: #d9dde8;
  flex-shrink: 0;
}

.cf-progresso-barra {
  height: 100%;
  background: linear-gradient(90deg, #bcb28c, #957861);
  border-radius: 0 4px 4px 0;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

/* ---- HEADER DO MODAL ---- */
.cf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 0.75rem;
  flex-shrink: 0;
}

.cf-header-logo img {
  height: 40px;
  width: auto;
}

.cf-fechar {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: #f4f6f9;
  color: #2b3d58;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.cf-fechar:hover {
  background: #011b40;
  color: #ffffff;
}

.cf-fechar svg {
  width: 18px;
  height: 18px;
}

/* ---- CORPO / STEPS ---- */
.cf-corpo {
  padding: 0.5rem 1.5rem 1.5rem;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.cf-step {
  display: none;
  animation: cfFadeIn 0.35s ease forwards;
}

.cf-step.ativo {
  display: block;
}

@keyframes cfFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cf-step-titulo {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #011b40;
  margin-bottom: 0.35rem;
  line-height: 1.25;
}

.cf-step-desc {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  color: #2b3d58;
  opacity: 0.7;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

/* ---- CARDS DE OPÇÃO ---- */
.cf-opcoes {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.cf-opcao {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  border: 1.5px solid #d9dde8;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #ffffff;
  user-select: none;
}

.cf-opcao:hover {
  border-color: #bcb28c;
  background: rgba(188, 178, 140, 0.06);
  transform: translateX(4px);
}

.cf-opcao.selecionado {
  border-color: #011b40;
  background: rgba(1, 27, 64, 0.04);
  box-shadow: 0 0 0 1px #011b40;
}

.cf-opcao-emoji {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
  line-height: 1;
}

.cf-opcao-texto {
  flex: 1;
  min-width: 0;
}

.cf-opcao-titulo {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #011b40;
  line-height: 1.3;
}

.cf-opcao-detalhe {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  color: #2b3d58;
  opacity: 0.6;
  line-height: 1.4;
  margin-top: 0.15rem;
}

.cf-opcao-check {
  width: 22px;
  height: 22px;
  border: 2px solid #d9dde8;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.cf-opcao.selecionado .cf-opcao-check {
  border-color: #011b40;
  background: #011b40;
}

.cf-opcao.selecionado .cf-opcao-check::after {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #bcb28c;
}

/* ---- FORMULÁRIO DE CONTATO (último step) ---- */
.cf-form-grupo {
  margin-bottom: 1rem;
}

.cf-form-label {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: #011b40;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cf-form-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1.5px solid #d9dde8;
  border-radius: 10px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  color: #2b3d58;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.cf-form-input:focus {
  border-color: #bcb28c;
  box-shadow: 0 0 0 3px rgba(188, 178, 140, 0.18);
}

.cf-form-input::placeholder {
  color: rgba(43, 61, 88, 0.4);
}

.cf-form-input.erro {
  border-color: #e74c3c;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.12);
}

.cf-form-erro {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  color: #e74c3c;
  margin-top: 0.25rem;
  display: none;
}

.cf-form-erro.visivel {
  display: block;
}

/* ---- BOTÕES DE AÇÃO ---- */
.cf-acoes {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  gap: 0.75rem;
}

.cf-btn-voltar {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: #2b3d58;
  opacity: 0.6;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem 0;
  transition: opacity 0.2s ease;
}

.cf-btn-voltar:hover {
  opacity: 1;
}

.cf-btn-voltar svg {
  width: 16px;
  height: 16px;
}

.cf-btn-enviar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  border-radius: 12px;
  border: none;
  background: #bcb28c;
  color: #011b40;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s ease;
  flex: 1;
  max-width: 280px;
}

.cf-btn-enviar:hover {
  background: #957861;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(149, 120, 97, 0.35);
}

.cf-btn-enviar:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.cf-btn-enviar .cf-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(1, 27, 64, 0.2);
  border-top-color: #011b40;
  border-radius: 50%;
  animation: cfSpin 0.6s linear infinite;
}

.cf-btn-enviar.enviando .cf-spinner {
  display: block;
}

.cf-btn-enviar.enviando .cf-btn-texto {
  display: none;
}

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

/* ---- TELA FINAL (dentro do modal) ---- */
.cf-final {
  text-align: center;
  padding: 2rem 0 1rem;
}

.cf-final-icone {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  background: rgba(188, 178, 140, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cf-final-icone svg {
  width: 32px;
  height: 32px;
  color: #bcb28c;
}

.cf-final h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #011b40;
  margin-bottom: 0.5rem;
}

.cf-final p {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  color: #2b3d58;
  opacity: 0.75;
  line-height: 1.6;
  max-width: 380px;
  margin: 0 auto 1.5rem;
}

.cf-final-redirect {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  color: #957861;
  opacity: 0.8;
}

/* ---- STEP INDICATOR (numeração sutil) ---- */
.cf-step-num {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #957861;
  margin-bottom: 0.5rem;
}

/* ---- RESPONSIVO ---- */
@media (max-width: 600px) {
  .cf-modal {
    width: 100vw;
    max-width: 100vw;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    top: 0;
    left: 0;
    transform: translateY(100%);
  }

  .cf-modal.ativo {
    transform: translateY(0);
  }

  .cf-corpo {
    padding: 0.5rem 1.25rem 1.25rem;
  }

  .cf-step-titulo {
    font-size: 1.1rem;
  }

  .cf-opcao {
    padding: 0.75rem 0.875rem;
  }

  .cf-opcao-emoji {
    font-size: 1.3rem;
    width: 30px;
  }

  .cf-opcao-titulo {
    font-size: 0.85rem;
  }

  .cf-btn-enviar {
    max-width: none;
    width: 100%;
  }

  .cf-acoes {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .cf-btn-voltar {
    justify-content: center;
  }
}

/* ---- LGPD ---- */
.cf-lgpd {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.68rem;
  color: #2b3d58;
  opacity: 0.5;
  text-align: center;
  margin-top: 0.75rem;
  line-height: 1.45;
}

.cf-lgpd a {
  color: #957861;
  text-decoration: underline;
}
