/* --- RESET E VARIÁVEIS --- */
:root {
  --w-primary-green: #25d366;
  --w-header-bg: #075e54; /* Azul escuro do print */
  --w-btn-blue: #084b43; /* Azul do botão de ação */
  --w-bg-gray: #ffffff;
  --w-input-border: #095e54;
  --w-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --- BOTÃO FLUTUANTE (Verde) --- */
#whatsapp-button {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background-color: var(--w-primary-green);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#whatsapp-button:hover {
  transform: scale(1.05);
}

/* --- CONTAINER DO MODAL (OVERLAY) --- */
#whatsapp-form-modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4); /* Fundo escuro atrás */
  z-index: 10000;
  display: flex;
  align-items: flex-end; /* Desktop: alinha embaixo */
  justify-content: flex-end; /* Desktop: alinha direita */
  pointer-events: none; /* Deixa clicar através quando fechado */
  opacity: 0;
  transition: opacity 0.3s ease;
}

#whatsapp-form-modal.active {
  pointer-events: auto;
  opacity: 1;
}

/* --- CONTEÚDO DO MODAL (CARD) --- */
.w-modal-content {
  width: 380px;
  max-width: 100%;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  margin-right: 25px;
  margin-bottom: 100px; /* Acima do botão */
  font-family: var(--w-font);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
}

#whatsapp-form-modal.active .w-modal-content {
  transform: translateY(0);
}

/* --- HEADER (Azul Escuro) --- */
.w-modal-header {
  background-color: var(--w-header-bg);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
}

.w-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.w-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid #fff;
  overflow: hidden;
  background: #ccc;
  flex-shrink: 0;
}

.w-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.w-text-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.w-text-info strong {
  font-size: 16px;
  font-weight: 500;
}

.w-status {
  font-size: 12px;
  color: #b9ecb8; /* Verde claro texto */
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.w-dot {
  width: 8px;
  height: 8px;
  background-color: #4dc247;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
}

/* Botão Fechar */
#close-modal {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
}
#close-modal:hover { background: rgba(255,255,255,0.3); }

/* --- BODY (Branco) --- */
.w-modal-body {
  padding: 24px;
  padding-top: 18px;
  background: #eae5e0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.w-welcome-text h3 {
  color: #141414;
  font-size: 17px;
  font-weight: 400;
  text-align: center;
  margin: 0px 0 0px 0;
  line-height: 1.4;
}

/* --- INPUTS --- */
.w-form-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.w-input-wrapper input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--w-input-border);
  border-radius: 12px;
  font-size: 15px;
  color: #095e54;
  outline: none;
  background-color: #095e542e;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.w-input-wrapper input:focus {
  border-color: var(--w-btn-blue);
  background-color: #095e542e;
}

.w-input-wrapper input::placeholder {
  color: #141414;
}

/* --- BOTÃO DE AÇÃO (Azul) --- */
button#enviar-lead {
  width: 100%;
  padding: 16px;
  background-color: var(--w-btn-blue);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

button#enviar-lead:hover {
  background-color: var(--w-btn-blue);
}

button#enviar-lead:active {
  transform: translateY(1px);
}

/* ==========================================================================
   RESPONSIVIDADE (TELA CHEIA NO MOBILE)
   ========================================================================== */
@media (max-width: 600px) {
  #whatsapp-button {
    bottom: 20px;
    right: 20px;
  }

  /* Modal ocupa a tela inteira */
  #whatsapp-form-modal {
    align-items: flex-end; /* Garante que a animação venha de baixo */
  }

  .w-modal-content {
    width: 100%;
    max-width: 100%;
    height: 100%; /* Ocupa altura total */
    margin: 0;
    border-radius: 0; /* Sem bordas arredondadas no mobile */
    display: flex;
    flex-direction: column;
  }

  .w-modal-header {
    padding: 15px 20px;
    padding-top: max(15px, env(safe-area-inset-top)); /* Respeita o notch do iPhone */
  }

  .w-modal-body {
    flex: 1; /* Ocupa o resto do espaço */
    justify-content: center; /* Centraliza o formulário verticalmente */
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .w-welcome-text h3 {
    font-size: 22px;
    font-weight: 400;
  }

  /* Ajuste para teclado virtual não esconder o botão */
  @media (max-height: 600px) {
    .w-modal-body {
      justify-content: flex-start;
      padding-top: 20px;
    }
  }
}