/* =========================================================
   Dom Diego · Exit Intent Popup · DS v5
   Modal que aparece quando usuário vai fechar a aba (desktop)
   ou fica inativo X segundos (mobile)
   ========================================================= */

.dd-exit-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.72);
  z-index: 260;
  opacity: 0;
  visibility: hidden;
  transition: opacity 360ms ease, visibility 0ms linear 360ms;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.dd-exit-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 360ms ease;
}

.dd-exit {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.94);
  width: calc(100% - 40px);
  max-width: 460px;
  background: var(--dd-ink, #0A0A0A);
  color: #fff;
  border-radius: 6px;
  padding: 40px 36px 32px;
  z-index: 270;
  opacity: 0;
  visibility: hidden;
  transition: opacity 340ms ease, transform 340ms cubic-bezier(.2,.7,.2,1),
              visibility 0ms linear 340ms;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  font-family: var(--dd-font-sans, 'Montserrat', sans-serif);
  overflow: hidden;
}
/* Scroll só aparece quando o conteúdo não couber (mobile pequeno em landscape etc) */
@media (max-height: 640px) {
  .dd-exit {
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    scrollbar-width: thin;
  }
  .dd-exit::-webkit-scrollbar { width: 4px; }
  .dd-exit::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
}
.dd-exit.is-open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
  transition: opacity 340ms ease, transform 340ms cubic-bezier(.2,.7,.2,1);
}

/* Losango decorativo */
.dd-exit::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -60px;
  width: 260px;
  height: 130px;
  background: var(--dd-accent, #7A1F2B);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  opacity: 0.25;
  pointer-events: none;
}
.dd-exit::after {
  content: "";
  position: absolute;
  bottom: -60px;
  left: -80px;
  width: 220px;
  height: 110px;
  background: var(--dd-gold, #E6C06C);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  opacity: 0.1;
  pointer-events: none;
}

.dd-exit-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background 150ms ease;
}
.dd-exit-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.dd-exit-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.dd-exit-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--dd-gold, #E6C06C);
  color: var(--dd-ink, #0A0A0A);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 3px;
  margin-bottom: 20px;
}
.dd-exit-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dd-accent, #7A1F2B);
  animation: dd-exit-pulse 1.6s ease-in-out infinite;
}
@keyframes dd-exit-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

.dd-exit-title {
  font-family: var(--dd-font-display, 'Cormorant', serif);
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 14px;
  color: #fff;
  text-wrap: balance;
}
.dd-exit-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--dd-gold, #E6C06C);
}

.dd-exit-desc {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
  margin: 0 0 24px;
}

.dd-exit-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.dd-exit-form input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  text-align: center;
  letter-spacing: 0.02em;
  outline: none;
  transition: border-color 150ms ease;
}
.dd-exit-form input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
.dd-exit-form input:focus {
  border-color: var(--dd-gold, #E6C06C);
  background: rgba(255, 255, 255, 0.12);
}

.dd-exit-cta {
  width: 100%;
  height: 50px;
  background: var(--dd-gold, #E6C06C);
  color: var(--dd-ink, #0A0A0A);
  border: 0;
  border-radius: 3px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 160ms ease, transform 80ms ease;
}
.dd-exit-cta:hover {
  background: #fff;
}
.dd-exit-cta:active { transform: translateY(1px); }
.dd-exit-cta::after {
  content: "→";
  font-size: 14px;
  transition: transform 160ms ease;
}
.dd-exit-cta:hover::after { transform: translateX(3px); }

.dd-exit-dismiss {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 8px;
  cursor: pointer;
  font-family: inherit;
  margin-top: 6px;
}
.dd-exit-dismiss:hover {
  color: #fff;
}

.dd-exit-trust {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.04em;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}
.dd-exit-trust span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.dd-exit-trust svg {
  color: var(--dd-gold, #E6C06C);
  flex-shrink: 0;
}

/* Success state */
.dd-exit.is-success .dd-exit-form,
.dd-exit.is-success .dd-exit-dismiss { display: none; }
.dd-exit-success {
  display: none;
  text-align: center;
  padding: 8px 0;
}
.dd-exit.is-success .dd-exit-success { display: block; }
.dd-exit.is-success .dd-exit-title,
.dd-exit.is-success .dd-exit-desc,
.dd-exit.is-success .dd-exit-badge { display: none; }
.dd-exit-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--dd-gold, #E6C06C);
  color: var(--dd-ink, #0A0A0A);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  animation: dd-exit-check 500ms cubic-bezier(.2,.8,.3,1.3);
}
@keyframes dd-exit-check {
  from { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.1); }
  to   { transform: scale(1); opacity: 1; }
}
.dd-exit-success h4 {
  font-family: var(--dd-font-display, 'Cormorant', serif);
  font-size: 28px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.dd-exit-success p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
  margin: 0 0 20px;
}
.dd-exit-coupon-code {
  display: inline-block;
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed var(--dd-gold, #E6C06C);
  padding: 10px 18px;
  border-radius: 3px;
  font-family: ui-monospace, monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--dd-gold, #E6C06C);
  letter-spacing: 0.16em;
  margin-bottom: 18px;
}

/* === Mobile === */
@media (max-width: 480px) {
  .dd-exit { padding: 32px 24px 24px; }
  .dd-exit-title { font-size: 28px; }
  .dd-exit-desc { font-size: 13px; margin-bottom: 20px; }
  .dd-exit::before { width: 200px; height: 100px; top: -30px; right: -50px; }
  .dd-exit::after { width: 180px; height: 90px; }
  .dd-exit-trust { gap: 10px; font-size: 9px; }
  .dd-exit-coupon-code { font-size: 14px; padding: 8px 14px; }
  .dd-exit-success h4 { font-size: 24px; }
}
