/*
 * WP Contextual CTA — Frontend styles
 * Filosofia visual/técnica: Lightweight SaaS Component. O CSS usa namespace próprio,
 * herda a tipografia do tema e evita seletores genéricos para reduzir conflitos.
 */
:root {
  --wpccta-brand: #0f766e;
  --wpccta-brand-dark: color-mix(in srgb, var(--wpccta-brand) 82%, #000 18%);
  --wpccta-surface: #ffffff;
  --wpccta-text: #17211f;
  --wpccta-muted: #5f6f6b;
  --wpccta-border: rgba(15, 23, 42, 0.12);
  --wpccta-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

html.wpccta-lock-scroll {
  overflow: hidden;
}

.wpccta,
.wpccta *,
.wpccta *::before,
.wpccta *::after,
.wpccta-thankyou,
.wpccta-thankyou *,
.wpccta-thankyou *::before,
.wpccta-thankyou *::after {
  box-sizing: border-box;
}

.wpccta {
  position: relative;
  z-index: 99990;
  font-family: inherit;
}

.wpccta__floating-button {
  position: fixed;
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 99991;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center;
  gap: 10px !important;
  min-height: 54px;
  max-width: min(calc(100vw - 32px), 360px);
  padding: 13px 18px 13px 14px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, var(--wpccta-brand), var(--wpccta-brand-dark)) !important;
  color: #ffffff !important;
  font-family: inherit !important;
  font-size: 15px !important;
  font-weight: 750 !important;
  line-height: 1.15 !important;
  letter-spacing: -0.01em;
  text-align: left;
  text-decoration: none !important;
  text-transform: none !important;
  white-space: normal !important;
  box-shadow: 0 18px 42px color-mix(in srgb, var(--wpccta-brand) 42%, transparent), 0 6px 14px rgba(15, 23, 42, 0.18) !important;
  appearance: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.wpccta--right .wpccta__floating-button {
  right: max(22px, env(safe-area-inset-right));
}

.wpccta--left .wpccta__floating-button {
  left: max(22px, env(safe-area-inset-left));
}

.wpccta--center .wpccta__floating-button {
  left: 50%;
  transform: translateX(-50%);
}

.wpccta__floating-button:hover {
  transform: translateY(-2px);
  filter: saturate(1.08);
  box-shadow: 0 22px 52px color-mix(in srgb, var(--wpccta-brand) 48%, transparent), 0 8px 18px rgba(15, 23, 42, 0.18);
}

.wpccta--center .wpccta__floating-button:hover {
  transform: translateX(-50%) translateY(-2px);
}

.wpccta__floating-button:focus-visible,
.wpccta__close:focus-visible,
.wpccta__submit:focus-visible,
.wpccta-thankyou__button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--wpccta-brand) 35%, #ffffff 65%);
  outline-offset: 3px;
}

.wpccta__button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.17);
  color: #ffffff;
}

.wpccta__button-icon svg {
  display: block;
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.wpccta__button-label {
  display: inline-block !important;
  max-width: 250px;
  overflow: hidden;
  color: #ffffff !important;
  font-family: inherit !important;
  font-size: 15px !important;
  font-weight: 750 !important;
  line-height: 1.15 !important;
  opacity: 1 !important;
  visibility: visible !important;
  text-indent: 0 !important;
  text-transform: none !important;
  white-space: normal !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.wpccta__overlay {
  position: fixed;
  inset: 0;
  z-index: 99992;
  background: rgba(4, 12, 10, 0.58);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 180ms ease;
}

.wpccta__modal {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 99993;
  width: min(420px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 120px));
  overflow: auto;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 26px;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--wpccta-brand) 12%, transparent), transparent 34%),
    var(--wpccta-surface);
  color: var(--wpccta-text);
  box-shadow: var(--wpccta-shadow);
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 190ms ease, transform 190ms ease;
}

.wpccta--left .wpccta__modal {
  right: auto;
  left: 22px;
  transform-origin: bottom left;
}

.wpccta--center .wpccta__modal {
  right: auto;
  left: 50%;
  transform: translateX(-50%) translateY(14px) scale(0.98);
  transform-origin: bottom center;
}

.wpccta.is-open .wpccta__overlay,
.wpccta.is-open .wpccta__modal {
  opacity: 1;
}

.wpccta.is-open .wpccta__modal {
  transform: translateY(0) scale(1);
}

.wpccta--center.is-open .wpccta__modal {
  transform: translateX(-50%) translateY(0) scale(1);
}

.wpccta__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--wpccta-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--wpccta-muted);
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.wpccta__close:hover {
  color: var(--wpccta-text);
  background: #ffffff;
  transform: rotate(3deg);
}

.wpccta__eyebrow,
.wpccta-thankyou__eyebrow {
  display: inline-flex;
  margin: 0 0 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--wpccta-brand) 11%, #ffffff 89%);
  color: var(--wpccta-brand-dark);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.wpccta__title,
#wpccta-root .wpccta__modal #wpccta-title {
  display: block !important;
  margin: 0 38px 10px 0 !important;
  color: var(--wpccta-text) !important;
  font-family: inherit !important;
  font-size: clamp(20px, 2.1vw, 24px) !important;
  font-style: normal !important;
  font-weight: 850 !important;
  line-height: 1.18 !important;
  letter-spacing: -0.025em !important;
  text-transform: none !important;
}

.wpccta__description {
  margin: 0 0 22px;
  color: var(--wpccta-muted);
  font-size: 15.5px;
  line-height: 1.55;
}

.wpccta__form {
  display: grid;
  gap: 14px;
}

.wpccta__field {
  display: grid;
  gap: 7px;
  margin: 0;
  color: var(--wpccta-text);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
}

.wpccta__field input,
.wpccta__field textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--wpccta-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--wpccta-text);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  outline: none;
  padding: 11px 13px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.wpccta__field input:focus,
.wpccta__field textarea:focus {
  border-color: color-mix(in srgb, var(--wpccta-brand) 62%, #ffffff 38%);
  background: #ffffff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--wpccta-brand) 13%, transparent);
}

.wpccta__field input::placeholder,
.wpccta__field textarea::placeholder {
  color: color-mix(in srgb, var(--wpccta-muted) 64%, #ffffff 36%);
}

.wpccta__privacy {
  margin: 0;
  color: var(--wpccta-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.wpccta__feedback {
  min-height: 20px;
  color: var(--wpccta-muted);
  font-size: 13px;
  line-height: 1.35;
}

.wpccta__feedback.is-error {
  color: #b42318;
}

.wpccta__feedback.is-success {
  color: #067647;
}

.wpccta__submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--wpccta-brand), var(--wpccta-brand-dark));
  color: #ffffff;
  font: inherit;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}

.wpccta__submit:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: saturate(1.07);
}

.wpccta__submit:disabled {
  cursor: wait;
  opacity: 0.78;
}

.wpccta__submit-loader {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.34);
  border-top-color: #ffffff;
  border-radius: 999px;
  animation: wpccta-spin 700ms linear infinite;
}

.wpccta__submit.is-loading .wpccta__submit-loader {
  display: inline-block;
}

.wpccta-thankyou {
  width: 100%;
  padding: clamp(30px, 6vw, 72px) 18px;
  color: var(--wpccta-text);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
}

.wpccta-thankyou__card {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 46px);
  border: 1px solid var(--wpccta-border);
  border-radius: 30px;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--wpccta-brand) 12%, transparent), transparent 34%),
    #ffffff;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.12);
}

.wpccta-thankyou .wpccta-thankyou__card > h1.wpccta-thankyou__title,
.wpccta-thankyou__title {
  all: unset;
  display: block !important;
  box-sizing: border-box !important;
  max-width: 620px !important;
  margin: 0 0 16px !important;
  padding: 0 !important;
  color: var(--wpccta-text) !important;
  font-family: inherit !important;
  font-size: clamp(26px, 3.1vw, 38px) !important;
  font-style: normal !important;
  font-weight: 760 !important;
  line-height: 1.14 !important;
  letter-spacing: -0.032em !important;
  text-transform: none !important;
  text-align: left !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important;
}

.wpccta-thankyou__text {
  max-width: 620px;
  margin: 0 0 16px;
  color: var(--wpccta-muted);
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.65;
}

.wpccta-thankyou__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin-top: 10px;
  padding: 14px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--wpccta-brand), var(--wpccta-brand-dark));
  color: #ffffff !important;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.1;
  text-decoration: none !important;
  box-shadow: 0 14px 34px color-mix(in srgb, var(--wpccta-brand) 34%, transparent);
  transition: transform 160ms ease, filter 160ms ease;
}


.wpccta-thankyou__button--whatsapp {
  gap: 10px;
  background: linear-gradient(135deg, #25d366, #128c7e);
  box-shadow: 0 16px 36px rgba(37, 211, 102, 0.3);
}

.wpccta-thankyou__whatsapp-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.wpccta-thankyou__whatsapp-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.wpccta-thankyou__button:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
}

.wpccta-thankyou__origin {
  margin: 26px 0 0;
  color: var(--wpccta-muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.wpccta-thankyou__origin a {
  color: var(--wpccta-brand-dark);
}

@keyframes wpccta-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 640px) {
  .wpccta-thankyou {
    padding: 22px 14px !important;
  }

  .wpccta-thankyou__card {
    border-radius: 22px !important;
    padding: 24px 20px !important;
  }

  .wpccta-thankyou .wpccta-thankyou__card > h1.wpccta-thankyou__title,
  .wpccta-thankyou__title {
    font-size: clamp(24px, 8vw, 32px) !important;
    line-height: 1.16 !important;
    letter-spacing: -0.025em !important;
  }

  .wpccta__floating-button {
    right: 14px;
    left: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    width: calc(100vw - 28px);
    justify-content: center;
    max-width: none;
  }

  .wpccta--left .wpccta__floating-button,
  .wpccta--center .wpccta__floating-button,
  .wpccta--right .wpccta__floating-button {
    right: 14px;
    left: 14px;
    transform: none;
  }

  .wpccta--center .wpccta__floating-button:hover {
    transform: translateY(-2px);
  }

  .wpccta__modal,
  .wpccta--left .wpccta__modal,
  .wpccta--center .wpccta__modal {
    right: 12px;
    left: 12px;
    bottom: 84px;
    width: auto;
    max-height: calc(100vh - 106px);
    padding: 23px;
    border-radius: 22px;
    transform-origin: bottom center;
  }

  .wpccta--center .wpccta__modal,
  .wpccta--center.is-open .wpccta__modal {
    transform: translateY(14px) scale(0.98);
  }

  .wpccta--center.is-open .wpccta__modal {
    transform: translateY(0) scale(1);
  }

  .wpccta__title,
  #wpccta-root .wpccta__modal #wpccta-title {
    margin-right: 34px !important;
    font-size: 21px !important;
    line-height: 1.2 !important;
  }

  .wpccta__button-label {
    display: inline-block !important;
    max-width: calc(100vw - 112px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wpccta__floating-button,
  .wpccta__overlay,
  .wpccta__modal,
  .wpccta__close,
  .wpccta__field input,
  .wpccta__submit,
  .wpccta-thankyou__button {
    transition: none;
  }

  .wpccta__submit-loader {
    animation-duration: 1200ms;
  }
}


.wpccta__honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.wpccta__help {
  display: block;
  margin-top: 0.25rem;
  color: var(--wpccta-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}
