/* ═══════════════════════════════════════════════════════════════════════════
   JePierre — Consentimento LGPD + Balão de WhatsApp
   Escopo prefixado (jp-cc- / jp-wa-) para não colidir com o layout existente.
   ═══════════════════════════════════════════════════════════════════════════ */

:root,
.jp-cc-root,
.jp-wa-root {
  --jp-lime: #C8FF2E;
  --jp-lime-hover: #d4ff52;
  --jp-dark: #070B14;
  --jp-card: #111827;
  --jp-card-2: #0D1424;
  --jp-line: #243044;
  --jp-text: #FFFFFF;
  --jp-muted: #AAB4C8;
  --jp-dim: #7A879C;
  --jp-green: #25D366;
  --jp-green-dark: #1DA851;
  --jp-radius: 16px;
}

/* ─────────────────────────── Consentimento ──────────────────────────────── */

.jp-cc-root *,
.jp-wa-root * {
  box-sizing: border-box;
}

/* Enquanto o banner está aberto, o balão do WhatsApp sobe para não ficar atrás */
body.jp-cc-open .jp-wa-root {
  bottom: 158px;
  transition: bottom .3s ease;
}
body.jp-cc-open .jp-wa-teaser {
  bottom: 8px;
}

.jp-cc-banner {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 9000;
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px 28px;
  padding: 20px 24px;
  background: rgba(13, 20, 36, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--jp-line);
  border-radius: var(--jp-radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  font-family: 'Sora', system-ui, -apple-system, sans-serif;
  color: var(--jp-text);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .3s ease, transform .3s ease;
}

.jp-cc-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.jp-cc-banner-body {
  flex: 1 1 420px;
  min-width: 0;
}

.jp-cc-title {
  display: block;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -.01em;
}

.jp-cc-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--jp-muted);
}

.jp-cc-text a {
  color: var(--jp-lime);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.jp-cc-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.jp-cc-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
  padding: 11px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
  white-space: nowrap;
}

.jp-cc-btn:active { transform: scale(.98); }

.jp-cc-btn-primary {
  background: var(--jp-lime);
  color: #09110A;
}
.jp-cc-btn-primary:hover { background: var(--jp-lime-hover); }

.jp-cc-btn-ghost {
  background: transparent;
  color: var(--jp-text);
  border-color: var(--jp-line);
}
.jp-cc-btn-ghost:hover {
  border-color: #3A4A66;
  background: rgba(255, 255, 255, .04);
}

.jp-cc-btn-link {
  background: transparent;
  color: var(--jp-muted);
  padding: 11px 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.jp-cc-btn-link:hover { color: var(--jp-text); }

/* Modal de preferências */

.jp-cc-overlay {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .25s ease;
  font-family: 'Sora', system-ui, -apple-system, sans-serif;
}

.jp-cc-overlay.is-visible { opacity: 1; }

.jp-cc-modal {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--jp-card-2);
  border: 1px solid var(--jp-line);
  border-radius: 18px;
  padding: 24px;
  color: var(--jp-text);
  transform: translateY(12px);
  transition: transform .25s ease;
}

.jp-cc-overlay.is-visible .jp-cc-modal { transform: translateY(0); }

.jp-cc-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.jp-cc-modal-head strong {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.jp-cc-close {
  background: transparent;
  border: 0;
  color: var(--jp-dim);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color .18s ease;
}
.jp-cc-close:hover { color: var(--jp-text); }

.jp-cc-modal-sub {
  margin: 10px 0 20px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--jp-muted);
}

.jp-cc-cats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.jp-cc-cat {
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--jp-line);
  border-radius: 12px;
  padding: 14px 16px;
}

.jp-cc-cat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.jp-cc-cat-head > div { min-width: 0; }

.jp-cc-cat-head strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 4px;
}

.jp-cc-cat-head p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--jp-dim);
}

.jp-cc-always {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--jp-lime);
  background: rgba(200, 255, 46, .1);
  border: 1px solid rgba(200, 255, 46, .25);
  border-radius: 999px;
  padding: 4px 10px;
  margin-top: 2px;
}

/* switch */

.jp-cc-switch {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 24px;
  display: inline-block;
  cursor: pointer;
  margin-top: 2px;
}

.jp-cc-switch-input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}

.jp-cc-switch-track {
  position: absolute;
  inset: 0;
  background: #2A3446;
  border-radius: 999px;
  transition: background .2s ease;
}

.jp-cc-switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s ease;
}

.jp-cc-switch-input:checked + .jp-cc-switch-track { background: var(--jp-lime); }
.jp-cc-switch-input:checked + .jp-cc-switch-track::after { transform: translateX(20px); }
.jp-cc-switch-input:focus-visible + .jp-cc-switch-track {
  outline: 2px solid var(--jp-lime);
  outline-offset: 2px;
}

.jp-cc-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ──────────────────────────── WhatsApp ──────────────────────────────────── */

.jp-wa-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 8000;
  font-family: 'Sora', system-ui, -apple-system, sans-serif;
}

.jp-wa-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.jp-wa-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* botão flutuante */

.jp-wa-button {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: var(--jp-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .4), 0 0 0 0 rgba(37, 211, 102, .55);
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
  animation: jp-wa-pulse 2.8s ease-out 3;
}

.jp-wa-button:hover {
  background: var(--jp-green-dark);
  transform: scale(1.06);
}

.jp-wa-button.is-active {
  background: var(--jp-green-dark);
}

.jp-wa-button.has-teaser {
  animation: jp-wa-bounce 1.2s ease-in-out 3;
}

@keyframes jp-wa-pulse {
  0%   { box-shadow: 0 12px 30px rgba(0,0,0,.4), 0 0 0 0 rgba(37,211,102,.5); }
  70%  { box-shadow: 0 12px 30px rgba(0,0,0,.4), 0 0 0 18px rgba(37,211,102,0); }
  100% { box-shadow: 0 12px 30px rgba(0,0,0,.4), 0 0 0 0 rgba(37,211,102,0); }
}

@keyframes jp-wa-bounce {
  0%, 100% { transform: scale(1); }
  40%      { transform: scale(1.12); }
}

.jp-wa-icon,
.jp-wa-icon-close {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .18s ease, transform .18s ease;
}

.jp-wa-icon-close {
  position: absolute;
  opacity: 0;
  transform: scale(.6);
}

.jp-wa-button.is-active .jp-wa-icon { opacity: 0; transform: scale(.6); }
.jp-wa-button.is-active .jp-wa-icon-close { opacity: 1; transform: scale(1); }

/* teaser "Em que posso te ajudar?" */

.jp-wa-teaser {
  position: absolute;
  right: 74px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 220px;
  max-width: calc(100vw - 120px);
  padding: 11px 14px;
  background: #fff;
  color: #111;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  border-radius: 14px 14px 4px 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .3);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px) scale(.96);
  pointer-events: none;
  transition: opacity .28s ease, transform .28s ease;
}

.jp-wa-teaser.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.jp-wa-teaser::after {
  content: '';
  position: absolute;
  right: -6px;
  bottom: 10px;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: rotate(45deg);
  border-radius: 2px;
}

.jp-wa-teaser-close {
  background: transparent;
  border: 0;
  color: #8A8A8A;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 2px;
  margin-left: 2px;
}
.jp-wa-teaser-close:hover { color: #333; }

/* painel de chat */

.jp-wa-chat {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: min(354px, calc(100vw - 44px));
  max-height: min(560px, calc(100vh - 140px));
  display: flex;
  flex-direction: column;
  background: var(--jp-card-2);
  border: 1px solid var(--jp-line);
  border-radius: 18px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .6);
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px) scale(.97);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity .26s ease, transform .26s ease;
}

.jp-wa-chat.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.jp-wa-chat-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 16px;
  background: var(--jp-green-dark);
  color: #fff;
  flex: 0 0 auto;
}

.jp-wa-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.jp-wa-who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.jp-wa-who strong {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.jp-wa-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  opacity: .92;
}

.jp-wa-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7CFFB2;
  flex: 0 0 auto;
}

.jp-wa-status em { font-style: normal; }

.jp-wa-close {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, .85);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  flex: 0 0 auto;
  transition: color .18s ease;
}
.jp-wa-close:hover { color: #fff; }

.jp-wa-chat-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* mensagens */

.jp-wa-msg {
  background: #1B2436;
  border-radius: 4px 14px 14px 14px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--jp-text);
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 92%;
  align-self: flex-start;
  animation: jp-wa-fade .3s ease both;
}

.jp-wa-msg-cta {
  align-self: stretch;
  animation: jp-wa-fade .3s ease .05s both;
}

.jp-wa-hint {
  margin: 0;
  font-size: 11.5px;
  color: var(--jp-dim);
  text-align: center;
  animation: jp-wa-fade .3s ease .1s both;
}

@keyframes jp-wa-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* botão principal do chat */

.jp-wa-cta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 16px;
  background: var(--jp-green);
  color: #04220F;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}

.jp-wa-cta:hover { background: #2ee874; }
.jp-wa-cta:active { transform: scale(.985); }

/* formulário */

.jp-wa-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: jp-wa-fade .3s ease both;
}

.jp-wa-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.jp-wa-field > span {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--jp-muted);
}

.jp-wa-field input {
  width: 100%;
  padding: 11px 13px;
  background: #0A1120;
  border: 1px solid var(--jp-line);
  border-radius: 10px;
  color: var(--jp-text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.jp-wa-field input::placeholder { color: #5C6A80; }

.jp-wa-field input:focus {
  outline: none;
  border-color: var(--jp-lime);
  box-shadow: 0 0 0 3px rgba(200, 255, 46, .12);
}

/* checkbox de consentimento */

.jp-wa-consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--jp-dim);
  cursor: pointer;
  padding: 11px 12px;
  background: rgba(200, 255, 46, .045);
  border: 1px solid rgba(200, 255, 46, .18);
  border-radius: 10px;
}

.jp-wa-consent a {
  color: var(--jp-lime);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.jp-wa-check {
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin: 1px 0 0;
  border: 1.5px solid #46566F;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: background .16s ease, border-color .16s ease;
}

.jp-wa-check:checked {
  background: var(--jp-lime);
  border-color: var(--jp-lime);
}

.jp-wa-check:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 9px;
  border: solid #09110A;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.jp-wa-check:focus-visible {
  outline: 2px solid var(--jp-lime);
  outline-offset: 2px;
}

/* erro e envio */

.jp-wa-error {
  background: #3A1420;
  color: #FFB5B5;
  border: 1px solid rgba(255, 120, 120, .3);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.5;
}

.jp-wa-error[hidden] { display: none; }

.jp-wa-submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 16px;
  background: var(--jp-lime);
  color: #09110A;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 2px;
  transition: background .18s ease, transform .18s ease, opacity .18s ease;
}

.jp-wa-submit:hover { background: var(--jp-lime-hover); }
.jp-wa-submit:active { transform: scale(.985); }

.jp-wa-submit.is-sending,
.jp-wa-submit:disabled {
  opacity: .72;
  cursor: default;
  pointer-events: none;
}

/* concluído */

.jp-wa-done {
  text-align: center;
  padding: 16px 8px 6px;
  animation: jp-wa-fade .3s ease both;
}

.jp-wa-done-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(37, 211, 102, .16);
  color: var(--jp-green);
  font-size: 22px;
  margin-bottom: 12px;
}

.jp-wa-done strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--jp-text);
  margin-bottom: 6px;
}

.jp-wa-done p {
  margin: 0 0 16px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--jp-muted);
}

/* ───────────────────────────── Responsivo ───────────────────────────────── */

@media (max-width: 760px) {
  .jp-cc-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 18px;
    gap: 14px;
    flex-direction: column;
    align-items: stretch;
  }

  .jp-cc-banner-body { flex: 1 1 auto; }

  .jp-cc-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .jp-cc-actions .jp-cc-btn-link {
    grid-column: 1 / -1;
    order: -1;
    text-align: center;
  }

  .jp-cc-btn {
    width: 100%;
    padding: 12px 14px;
    text-align: center;
  }

  .jp-cc-modal {
    padding: 20px 18px;
    max-height: 90vh;
  }

  .jp-cc-modal-actions {
    flex-direction: column-reverse;
  }

  /* o botão do WhatsApp sobe para não colidir com o CTA fixo do site */
  .jp-wa-root {
    right: 16px;
    bottom: 92px;
  }

  /* No mobile o banner ocupa a base da tela: esconde o balão até a decisão.
     Assim o usuário não é bloqueado e não há sobreposição. */
  body.jp-cc-open .jp-wa-root {
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity .2s ease, transform .2s ease;
  }

  body.jp-cc-open .jp-wa-teaser {
    display: none;
  }

  .jp-wa-button {
    width: 56px;
    height: 56px;
  }

  .jp-wa-chat {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 158px;
    width: auto;
    max-height: calc(100vh - 200px);
    transform-origin: bottom center;
  }

  .jp-wa-teaser {
    right: 66px;
    width: 200px;
    max-width: calc(100vw - 110px);
    font-size: 12.5px;
  }
}

/* respeita preferência por menos movimento */
@media (prefers-reduced-motion: reduce) {
  .jp-wa-button,
  .jp-wa-button.has-teaser {
    animation: none;
  }
  .jp-cc-banner,
  .jp-cc-overlay,
  .jp-cc-modal,
  .jp-wa-chat,
  .jp-wa-teaser {
    transition: none;
  }
}
