/* =====================================================
   CONTACT MODAL — modal "Falar com consultor" da home
   - Overlay + dialog centralizado
   - Form idêntico ao /contato (mesmo backend api/contato-save.asp)
   - Auto-redireciona pro WhatsApp após salvar (com nome no texto)
   ===================================================== */

.cm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(8, 14, 26, 0.55);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease-out, ease);
}
.cm-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
@media (min-width: 720px) {
  .cm-backdrop { align-items: center; padding: 40px 20px; }
}

.cm-dialog {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(8, 14, 26, .25), 0 8px 24px rgba(8, 14, 26, .12);
  padding: 32px 28px 28px;
  transform: translateY(-8px) scale(.985);
  transition: transform .25s var(--ease-out, ease);
}
.cm-backdrop.is-open .cm-dialog {
  transform: translateY(0) scale(1);
}
@media (max-width: 520px) {
  .cm-dialog { padding: 28px 20px 24px; border-radius: 14px; }
}

.cm-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 0;
  background: #F1F5F9;
  color: #475569;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.cm-close:hover { background: #E2E8F0; color: #0F172A; }
.cm-close:active { transform: scale(.94); }

.cm-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--blue, #1558D6);
  background: var(--blue-light, #EBF1FF);
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.cm-title {
  font-family: var(--font-display, inherit);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  color: #0F172A;
  margin: 0 0 6px;
  letter-spacing: -.01em;
}
.cm-desc {
  font-size: 14.5px;
  line-height: 1.55;
  color: #475569;
  margin: 0 0 22px;
}

/* ===== FORM ===== */
.cm-form .cm-row {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}
.cm-form .cm-row--2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 540px) {
  .cm-form .cm-row--2 { grid-template-columns: 1fr; }
}

.cm-field { display: flex; flex-direction: column; gap: 6px; }
.cm-field label {
  font-size: 13px;
  font-weight: 600;
  color: #0F172A;
  letter-spacing: -.005em;
}
.cm-field label span { color: var(--blue, #1558D6); }

.cm-field input,
.cm-field textarea {
  font-family: inherit;
  font-size: 15px;
  color: #0F172A;
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  padding: 11px 14px;
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
  box-sizing: border-box;
}
.cm-field input::placeholder,
.cm-field textarea::placeholder { color: #94A3B8; }
.cm-field input:focus,
.cm-field textarea:focus {
  outline: none;
  border-color: var(--blue, #1558D6);
  box-shadow: 0 0 0 3px rgba(21, 88, 214, .14);
}
.cm-field textarea { resize: vertical; min-height: 110px; line-height: 1.5; }

.cm-counter {
  font-size: 12px;
  color: #94A3B8;
  text-align: right;
  margin-top: 3px;
}

/* Honeypot — fora da viewport */
.cm-hp {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px; height: 1px;
  opacity: 0;
}

.cm-consent {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12.5px;
  line-height: 1.5;
  color: #475569;
  margin: 4px 0 16px;
  cursor: pointer;
}
.cm-consent input[type="checkbox"] {
  margin-top: 2px;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  accent-color: var(--blue, #1558D6);
  cursor: pointer;
}
.cm-consent a { color: var(--blue, #1558D6); text-decoration: underline; }
.cm-consent a:hover { text-decoration: none; }

.cm-turnstile { min-height: 0; margin: 0 0 14px; }
.cm-turnstile:not(:empty) { min-height: 65px; margin-bottom: 14px; }
.cm-turnstile iframe { max-width: 100% !important; }

.cm-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cm-actions .cm-submit {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  background: #25D366;
  color: #FFFFFF;
  border: 0;
  border-radius: 12px;
  padding: 14px 24px;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease, box-shadow .2s ease;
  box-shadow: 0 6px 20px rgba(37, 211, 102, .28);
}
.cm-actions .cm-submit:hover { background: #1FBE5C; transform: translateY(-1px); box-shadow: 0 10px 26px rgba(37, 211, 102, .35); }
.cm-actions .cm-submit:active { transform: translateY(0) scale(.98); }
.cm-actions .cm-submit:disabled { opacity: .65; cursor: not-allowed; transform: none; box-shadow: none; }

.cm-disclaimer {
  font-size: 11.5px;
  color: #94A3B8;
  text-align: center;
  margin: 0;
}

.cm-error {
  margin-top: 14px;
  padding: 11px 14px;
  background: #FEE2E2;
  border: 1px solid #FCA5A5;
  border-radius: 10px;
  color: #B91C1C;
  font-size: 13.5px;
  line-height: 1.45;
}

.cm-loading {
  margin-top: 18px;
  text-align: center;
  font-size: 13.5px;
  color: #475569;
}
.cm-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid #CBD5E1;
  border-top-color: var(--blue, #1558D6);
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 8px;
  animation: cm-spin .8s linear infinite;
}
@keyframes cm-spin { to { transform: rotate(360deg); } }

/* Quando aberto trava o scroll do body */
body.cm-locked { overflow: hidden; }
