/* ============================================================
   Modal "Fale com a Clippay" — formulário de contato (nativo do tema)
   Fiel ao design de referência.
   ============================================================ */

:root {
  --clp-roxo-1: #8b7bf0;
  --clp-roxo-2: #7d6df0;
  --clp-roxo-grad: linear-gradient(180deg, #9587f5 0%, #7e6ef0 100%);
  --clp-titulo: #2b2f55;
  --clp-label: #4a3f8f;          /* azul-roxo das labels */
  --clp-sub: #9aa0bb;
  --clp-aster: #8b7bf0;          /* asterisco lilás */
  --clp-campo-bg: #f6f7fc;
  --clp-campo-bd: #ececf6;
  --clp-radius: 13px;
}

/* ---- Overlay ---- */
.clp-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(30, 28, 60, 0.50);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility .28s ease;
}
/* #id + classe para vencer a regra inline #clp-overlay:not(.is-open)
   (o <style> inline no HTML oculta o modal antes deste arquivo carregar). */
#clp-overlay.clp-overlay.is-open { opacity: 1; visibility: visible; pointer-events: auto; }

/* ---- Caixa do modal ---- */
.clp-modal {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 40px 90px rgba(24, 22, 55, .42);
  padding: 24px 28px 22px;
  transform: translateY(18px) scale(.97);
  transition: transform .32s cubic-bezier(.2,.85,.25,1);
  -webkit-overflow-scrolling: touch;
}
.clp-overlay.is-open .clp-modal { transform: translateY(0) scale(1); }

/* scrollbar discreta */
.clp-modal::-webkit-scrollbar { width: 8px; }
.clp-modal::-webkit-scrollbar-thumb { background: #e3e4f0; border-radius: 8px; }

/* ---- Cabeçalho ---- */
.clp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #f0f0f7;
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.clp-head h3 {
  margin: 0 0 6px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--clp-titulo);
  line-height: 1.15;
}
.clp-head p {
  margin: 0;
  font-size: 14.5px;
  color: var(--clp-sub);
  line-height: 1.4;
}
.clp-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: #eeecfb;
  color: #6a5fd0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, color .15s ease, transform .15s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.clp-close:focus,
.clp-close:focus-visible { outline: none; box-shadow: none; }
.clp-close:hover { background: #e3def9; color: #4a3f8f; transform: rotate(90deg); }
.clp-close svg { width: 19px; height: 19px; stroke-width: 2.4; }

/* ============================================================
   Campos do Contact Form 7 dentro do modal
   ============================================================ */
.clp-modal .clippay-form { font-size: 14px; }

.clp-modal .cf-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 470px) {
  .clp-modal { padding: 26px 22px 24px; }
  .clp-modal .cf-row-2 { grid-template-columns: 1fr; gap: 0; }
}

.clp-modal .cf-field { margin: 0 0 19px; }

.clp-modal .cf-field > label {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
  font-weight: 700;
  color: var(--clp-label);
  letter-spacing: -.01em;
}
.clp-modal .cf-req { color: var(--clp-aster); font-weight: 800; margin-left: 1px; }
.clp-modal .cf-opt { color: var(--clp-hint, #8a8fa3); font-weight: 500; }

.clp-modal input[type="text"],
.clp-modal input[type="email"],
.clp-modal input[type="tel"],
.clp-modal select,
.clp-modal textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--clp-campo-bg);
  border: 1.5px solid var(--clp-campo-bd);
  border-radius: var(--clp-radius);
  padding: 11px 15px;
  font-size: 15px;
  color: #2b2f55;
  font-family: inherit;
  line-height: 1.3;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
  outline: none;
}
.clp-modal textarea { min-height: 104px; resize: vertical; }

.clp-modal input::placeholder,
.clp-modal textarea::placeholder { color: #b3b8cf; }

.clp-modal input:focus,
.clp-modal select:focus,
.clp-modal textarea:focus {
  border-color: var(--clp-roxo-1);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(139, 123, 240, .16);
}

/* select com seta custom */
.clp-modal select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%237d6df0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}

/* dica abaixo do telefone */
.clp-modal .cf-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  font-size: 13px;
  color: #9aa0bb;
}
.clp-modal .cf-hint svg { width: 15px; height: 15px; color: #b9bdd4; flex: 0 0 auto; }

/* checkbox "Quero adicionar uma mensagem" */
.clp-modal .cf-checkbox { margin: 2px 0 0; }
.clp-modal .cf-checkbox .wpcf7-list-item { margin: 0; display: block; }
.clp-modal .cf-checkbox label {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 14.5px;
  font-weight: 600;
  color: #3f4468;
  cursor: pointer;
}
.clp-modal .cf-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  accent-color: var(--clp-roxo-2);
  cursor: pointer;
  flex: 0 0 auto;
}

/* área da mensagem (escondida até marcar o checkbox) */
.clp-modal .cf-message {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  margin: 0;
  transition: max-height .32s ease, opacity .25s ease, margin .32s ease;
}
.clp-modal .cf-message.is-visible {
  max-height: 280px;
  opacity: 1;
  margin: 16px 0 0;
}

/* botão enviar */
.clp-modal .cf-submit { margin: 12px 0 0; position: relative; }
.clp-modal .wpcf7-submit {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 14px 22px;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: .01em;
  color: #fff;
  background: var(--brand, #2b76e5);
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(43, 118, 229, .35);
  transition: transform .12s ease, box-shadow .18s ease, filter .15s ease;
}
.clp-modal .wpcf7-submit:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 18px 36px rgba(43, 118, 229, .45); }
.clp-modal .wpcf7-submit:active { transform: translateY(0); }

/* ícone de avião dentro do botão (injetado por JS) */
.clp-modal .wpcf7-submit.has-ico { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.clp-modal .wpcf7-submit .clp-send-ico { width: 19px; height: 19px; flex: 0 0 auto; }

/* botão secundário: falar direto pelo WhatsApp */
.clp-modal .clp-wa-btn {
  width: 100%;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  border-radius: 14px;
  padding: 14px 22px;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: .01em;
  color: #fff;
  text-decoration: none;
  background: #25d366;
  box-shadow: 0 14px 30px rgba(37, 211, 102, .35);
  transition: transform .12s ease, box-shadow .18s ease, filter .15s ease;
}
.clp-modal .clp-wa-btn:hover { filter: brightness(1.04); transform: translateY(-1px); box-shadow: 0 18px 36px rgba(37, 211, 102, .45); }
.clp-modal .clp-wa-btn:active { transform: translateY(0); }
.clp-modal .clp-wa-btn .clp-wa-ico { width: 19px; height: 19px; flex: 0 0 auto; }

/* rodapé de segurança */
.clp-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: #a2a8c2;
  text-align: center;
  line-height: 1.4;
}
.clp-foot svg { width: 15px; height: 15px; color: #c8a86a; flex: 0 0 auto; }

/* spinner do CF7 */
/* Spinner: fora do fluxo quando inativo (não ocupa espaço); aparece só ao enviar */
.clp-modal .wpcf7-spinner {
  display: none;
  margin: 0;
}
.clp-modal .wpcf7-form.submitting .wpcf7-spinner {
  display: block;
  margin: 14px auto 0;
}

/* mensagem de resposta (erro) do envio próprio do tema */
.clp-modal .clp-response {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.4;
  border-radius: 12px;
  overflow: hidden;
  max-height: 0;
  padding: 0 15px;
  opacity: 0;
  transition: max-height .25s ease, opacity .2s ease, padding .25s ease, margin .25s ease;
}
.clp-modal .clp-response.is-error {
  margin-top: 16px;
  max-height: 200px;
  padding: 13px 15px;
  opacity: 1;
  color: #b02a45;
  background: #fdeef1;
  border: 1.5px solid #f0a6b5;
}

/* estado "enviando": botão desabilitado */
.clp-modal .wpcf7-submit:disabled {
  filter: none;
  opacity: .7;
  cursor: default;
  transform: none;
  box-shadow: 0 8px 18px rgba(43, 118, 229, .22);
}
