/* ───────────────────────────────────────────────────────────
   GP Leads — formulário de qualificação
   Paleta alinhada ao tema GP Vendas
   ─────────────────────────────────────────────────────────── */

.gpl-form-wrap {
  --gpl-bg: #fff;
  --gpl-text: #2a2a28;
  --gpl-muted: #6b6b68;
  --gpl-border: #e8e8e4;
  --gpl-surface: #f4f4f0;
  --gpl-accent: #1a7a4a;
  --gpl-accent-soft: #e8f5ee;
  --gpl-wa: #25d366;
  --gpl-error: #dc2626;
  --gpl-radius: 14px;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--gpl-text);
  -webkit-font-smoothing: antialiased;
}

/* não depende do reset do tema */
.gpl-form-wrap, .gpl-form-wrap *, .gpl-form-wrap *::before, .gpl-form-wrap *::after,
.gpl-modal, .gpl-modal *, .gpl-modal *::before, .gpl-modal *::after { box-sizing: border-box; }

.gpl-ctx-inline {
  background: var(--gpl-bg);
  border: 1px solid var(--gpl-border);
  border-radius: 20px;
  padding: 32px 30px;
  max-width: 560px;
  margin: 0 auto;
  box-shadow: 0 4px 24px rgba(15, 15, 13, .05);
}

.gpl-form { position: relative; }

/* ── Cabeçalho ── */
.gpl-head { margin-bottom: 22px; }
.gpl-title {
  font-size: clamp(20px, 4vw, 26px);
  line-height: 1.2;
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: -.02em;
  color: #0f0f0d;
}
.gpl-sub { font-size: 14.5px; line-height: 1.55; color: var(--gpl-muted); margin: 0 0 16px; }

.gpl-progress { height: 4px; background: var(--gpl-surface); border-radius: 99px; overflow: hidden; }
.gpl-progress__bar { display: block; height: 100%; background: var(--gpl-accent); border-radius: 99px; transition: width .35s cubic-bezier(.4, 0, .2, 1); }
.gpl-steps-count { font-size: 11.5px; color: #9b9b98; margin-top: 7px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }

/* ── Etapas ── */
.gpl-step { display: none; animation: gplIn .3s ease both; }
.gpl-step.is-active { display: block; }
.gpl-success { display: none; text-align: center; padding: 20px 0 6px; animation: gplIn .35s ease both; }
.gpl-success.is-active { display: block; }

@keyframes gplIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Labels e inputs ── */
.gpl-label {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  margin: 16px 0 8px;
  color: var(--gpl-text);
}
.gpl-label:first-child { margin-top: 0; }
.gpl-label small { font-weight: 500; color: #9b9b98; }
.gpl-mt { margin-top: 22px; }

.gpl-input {
  width: 100%;
  border: 1.5px solid var(--gpl-border);
  background: #fff;
  border-radius: 11px;
  padding: 13px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--gpl-text);
  transition: border-color .18s, box-shadow .18s;
  box-sizing: border-box;
}
.gpl-input::placeholder { color: #b5b5b1; }
.gpl-input:focus {
  outline: none;
  border-color: var(--gpl-accent);
  box-shadow: 0 0 0 3px rgba(26, 122, 74, .12);
}
.gpl-textarea { resize: vertical; min-height: 84px; line-height: 1.55; }

/* ── Select (modo simples) ── */
.gpl-select-wrap { position: relative; }
.gpl-select-wrap::after {
  content: '';
  position: absolute;
  right: 16px; top: 50%;
  width: 9px; height: 9px;
  border-right: 2px solid var(--gpl-muted);
  border-bottom: 2px solid var(--gpl-muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.gpl-select-field {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  cursor: pointer;
  background-image: none;
}
.gpl-select-field:invalid, .gpl-select-field option[value=""] { color: #b5b5b1; }
.gpl-select-field option { color: var(--gpl-text); }

/* ── Modo simples ── */
.gpl-simple .gpl-head { margin-bottom: 20px; }
.gpl-simple .gpl-actions { margin-top: 22px; }
.gpl-simple .gpl-btn--submit { flex: 1; }
/* depois de enviar, o título e o subtítulo de convite não fazem mais sentido */
.gpl-simple .gpl-form.is-done .gpl-head { display: none; }
.gpl-simple .gpl-form.is-done .gpl-success { padding-top: 8px; }

/* ── Cards (tipo de projeto) ── */
.gpl-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.gpl-card { position: relative; display: block; cursor: pointer; }
.gpl-card input { position: absolute; opacity: 0; pointer-events: none; }
.gpl-card__box {
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 12px 14px;
  border: 1.5px solid var(--gpl-border);
  border-radius: 12px;
  background: #fff;
  transition: all .16s ease;
  height: 100%;
  box-sizing: border-box;
}
.gpl-card__title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.gpl-card:hover .gpl-card__box { border-color: #c9c9c4; transform: translateY(-1px); }
.gpl-card input:checked + .gpl-card__box {
  border-color: var(--gpl-accent);
  background: var(--gpl-accent-soft);
  box-shadow: 0 0 0 3px rgba(26, 122, 74, .1);
}
.gpl-card input:focus-visible + .gpl-card__box { box-shadow: 0 0 0 3px rgba(26, 122, 74, .25); }

/* ── Chips ── */
.gpl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gpl-chip { position: relative; cursor: pointer; }
.gpl-chip input { position: absolute; opacity: 0; pointer-events: none; }
.gpl-chip span {
  display: inline-block;
  padding: 10px 15px;
  border: 1.5px solid var(--gpl-border);
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 600;
  background: #fff;
  transition: all .16s ease;
}
.gpl-chip:hover span { border-color: #c9c9c4; }
.gpl-chip input:checked + span {
  border-color: var(--gpl-accent);
  background: var(--gpl-accent);
  color: #fff;
}

/* ── Condicional ── */
.gpl-conditional { display: none; }
.gpl-conditional.is-visible { display: block; animation: gplIn .25s ease both; }

/* ── Ações ── */
.gpl-actions { display: flex; gap: 9px; margin-top: 24px; }
.gpl-btn {
  flex: 1;
  border: none;
  border-radius: 11px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all .16s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  position: relative;
}
.gpl-btn--next, .gpl-btn--submit { background: #0f0f0d; color: #fff; }
.gpl-btn--submit { background: var(--gpl-wa); color: #0b3d1e; }
.gpl-btn--next:hover { background: #2a2a28; transform: translateY(-1px); }
.gpl-btn--submit:hover { filter: brightness(1.05); transform: translateY(-1px); }
.gpl-btn--ghost {
  flex: 0 0 auto;
  background: transparent;
  color: var(--gpl-muted);
  border: 1.5px solid var(--gpl-border);
  padding: 14px 18px;
}
.gpl-btn--ghost:hover { border-color: #c9c9c4; color: var(--gpl-text); }

.gpl-btn.is-loading { pointer-events: none; opacity: .75; }
.gpl-btn.is-loading .gpl-btn__text { visibility: hidden; }
.gpl-spinner { display: none; position: absolute; width: 18px; height: 18px; border: 2.5px solid rgba(0, 0, 0, .2); border-top-color: currentColor; border-radius: 50%; animation: gplSpin .7s linear infinite; }
.gpl-btn.is-loading .gpl-spinner { display: block; }
@keyframes gplSpin { to { transform: rotate(360deg); } }

/* ── Sucesso ── */
.gpl-success__icon {
  width: 56px; height: 56px; margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--gpl-accent-soft);
  color: var(--gpl-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 27px; font-weight: 700;
}
.gpl-success__title { font-size: 22px; font-weight: 800; margin: 0 0 7px; color: #0f0f0d; }
.gpl-success__text { font-size: 14.5px; color: var(--gpl-muted); margin: 0 0 20px; line-height: 1.55; }
.gpl-success .gpl-btn { display: inline-flex; flex: 0 1 auto; padding: 13px 26px; }

/* ── Erro / privacidade ── */
.gpl-error { color: var(--gpl-error); font-size: 13.5px; margin: 12px 0 0; min-height: 1px; font-weight: 600; }
.gpl-privacy { font-size: 11.5px; color: #9b9b98; margin: 12px 0 0; text-align: center; line-height: 1.5; }

.gpl-shake { animation: gplShake .38s ease; }
@keyframes gplShake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-6px)} 40%{transform:translateX(6px)} 60%{transform:translateX(-4px)} 80%{transform:translateX(4px)} }

/* ── Honeypot ── */
.gpl-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ───────────────────────── MODAL ───────────────────────── */

.gpl-modal { position: fixed; inset: 0; z-index: 99999; display: none; }
.gpl-modal.is-open { display: block; }
.gpl-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 15, 13, .55);
  backdrop-filter: blur(3px);
  animation: gplFade .2s ease both;
}
@keyframes gplFade { from { opacity: 0; } to { opacity: 1; } }

.gpl-modal__panel {
  position: relative;
  background: #fff;
  width: min(540px, calc(100% - 28px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  margin: 20px auto;
  border-radius: 20px;
  padding: 30px 28px;
  box-shadow: 0 24px 60px rgba(15, 15, 13, .28);
  animation: gplPop .28s cubic-bezier(.2, .9, .3, 1.1) both;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  overflow-x: hidden;
}
@keyframes gplPop { from { opacity: 0; transform: translateY(20px) scale(.97); } to { opacity: 1; transform: none; } }

.gpl-modal__close {
  position: absolute; top: 12px; right: 14px;
  width: 34px; height: 34px;
  border: none; background: var(--gpl-surface, #f4f4f0);
  border-radius: 50%;
  font-size: 22px; line-height: 1;
  color: #6b6b68; cursor: pointer;
  transition: all .15s;
  z-index: 2;
}
.gpl-modal__close:hover { background: #e8e8e4; color: #0f0f0d; }

html.gpl-locked, html.gpl-locked body { overflow: hidden; }

/* ───────────────────────── MOBILE ───────────────────────── */

@media (max-width: 600px) {
  .gpl-cards { grid-template-columns: 1fr; }
  .gpl-card__box { min-height: 50px; }
  .gpl-ctx-inline { padding: 24px 20px; border-radius: 16px; }
  .gpl-modal__panel {
    margin: 0;
    width: 100%;
    max-height: 100vh;
    min-height: 100vh;
    border-radius: 0;
    padding: 56px 20px 34px;
  }
  .gpl-actions { flex-direction: column-reverse; }
  .gpl-btn { width: 100%; }
  .gpl-input { font-size: 16px; } /* evita o zoom automático no iOS */
}

@media (prefers-reduced-motion: reduce) {
  .gpl-step, .gpl-success, .gpl-modal__panel, .gpl-modal__backdrop, .gpl-shake { animation: none !important; }
  .gpl-btn { transition: none; }
}
