/* Widget flutuante de WhatsApp — botão + modal com formulário.
   Estilos isolados (prefixo .wa-) para funcionar em qualquer página
   sem depender das classes globais de cada layout. */

:root {
  --wa-green:        #25D366;
  --wa-green-dark:   #128C7E;
  --wa-green-active: #075E54;
}

/* ============================================
   FAB — botão flutuante
   ============================================ */
.wa-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--wa-green);
  color: #fff;
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18), 0 2px 4px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.wa-fab:hover {
  background: var(--wa-green-dark);
  transform: scale(1.06);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22), 0 3px 6px rgba(0, 0, 0, 0.14);
}

.wa-fab:active {
  transform: scale(0.96);
}

.wa-fab:focus-visible {
  outline: 3px solid var(--wa-green-active);
  outline-offset: 3px;
}

.wa-fab svg {
  width: 32px;
  height: 32px;
}

.wa-fab__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--wa-green);
  opacity: 0.6;
  animation: waPulse 2.4s ease-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes waPulse {
  0%   { transform: scale(1);   opacity: 0.5; }
  70%  { transform: scale(1.6); opacity: 0;   }
  100% { transform: scale(1.6); opacity: 0;   }
}

@media (max-width: 640px) {
  .wa-fab {
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 56px;
  }
  .wa-fab svg { width: 28px; height: 28px; }
}

/* ============================================
   Modal
   ============================================ */
.wa-modal[hidden] { display: none; }

.wa-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: 'Poppins', sans-serif;
  animation: waFadeIn 0.2s ease;
}

@keyframes waFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.wa-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.wa-modal__dialog {
  position: relative;
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  padding: 28px;
  animation: waSlideUp 0.28s ease;
}

@keyframes waSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.wa-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #6F7985;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
}

.wa-modal__close:hover {
  background: #F5F7F9;
  color: #272A2F;
}

.wa-modal__header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-right: 36px;
}

.wa-modal__icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--wa-green);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wa-modal__icon svg {
  width: 28px;
  height: 28px;
}

.wa-modal__title {
  font-size: 20px;
  font-weight: 700;
  color: #272A2F;
  margin: 0 0 4px;
  line-height: 1.25;
}

.wa-modal__sub {
  font-size: 14px;
  color: #6F7985;
  margin: 0;
  line-height: 1.4;
}

/* ============================================
   Formulário
   ============================================ */
.wa-form[hidden] { display: none; }

.wa-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.wa-form__group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.wa-form__row .wa-form__group {
  margin-bottom: 0;
}

.wa-form__group label {
  font-size: 13px;
  font-weight: 600;
  color: #404A4E;
}

.wa-form__group label span {
  color: #931F1F;
  margin-left: 2px;
}

.wa-form__group input,
.wa-form__group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  background: #F5F7F9;
  font-family: inherit;
  font-size: 14px;
  color: #272A2F;
  transition: border-color 0.2s, background-color 0.2s;
}

.wa-form__group input:focus,
.wa-form__group textarea:focus {
  outline: none;
  border-color: var(--wa-green);
  background: #fff;
}

.wa-form__group textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.wa-form .cf-turnstile {
  margin: 4px 0 12px;
}

.wa-form__error {
  display: none;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  color: #dc2626;
  font-size: 13px;
  line-height: 1.4;
}

.wa-form__error.is-visible {
  display: block;
  animation: waErrorIn 0.25s ease;
}

@keyframes waErrorIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wa-form__submit {
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-radius: 8px;
  background: var(--wa-green);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color 0.2s;
}

.wa-form__submit:hover:not(:disabled) {
  background: var(--wa-green-dark);
}

.wa-form__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.wa-form__submit svg {
  width: 20px;
  height: 20px;
}

/* ============================================
   Resultado (sucesso/erro)
   ============================================ */
.wa-form__result[hidden] { display: none; }

.wa-form__result {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 8px 8px;
  gap: 14px;
  animation: waSlideUp 0.3s ease;
}

.wa-form__result-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wa-green);
  color: #fff;
}

.wa-form__result.is-error .wa-form__result-icon {
  background: #931F1F;
}

.wa-form__result-icon svg {
  width: 32px;
  height: 32px;
}

.wa-form__result-title {
  font-size: 18px;
  font-weight: 700;
  color: #272A2F;
  margin: 0;
}

.wa-form__result-text {
  font-size: 14px;
  color: #404A4E;
  margin: 0;
  max-width: 360px;
  line-height: 1.5;
}

.wa-form__result-btn {
  margin-top: 4px;
  padding: 10px 24px;
  border: 2px solid #931F1F;
  background: transparent;
  color: #931F1F;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.wa-form__result-btn:hover {
  background: #931F1F;
  color: #fff;
}

/* ============================================
   Mobile
   ============================================ */
@media (max-width: 640px) {
  .wa-modal { padding: 12px; }
  .wa-modal__dialog { padding: 20px; border-radius: 12px; }
  .wa-modal__title { font-size: 18px; }
  .wa-form__row {
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: 0;
  }
  .wa-form__row .wa-form__group {
    margin-bottom: 12px;
  }
}
