/**
 * Exit-intent popup - €30 voucher offer
 * Dark charcoal modal mirroring the inline .optin section design language.
 * Triggers: mouseleave (clientY<=0) on desktop, 45s timeout fallback on mobile.
 * Form submit -> Klaviyo subscribe; success state shows voucher code w/ copy button.
 */

.rs-exit-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 16, 0.72);
  z-index: 100050;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.rs-exit-modal {
  position: relative;
  background: #1C1C1C;
  max-width: 460px;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
  font-family: 'DM Sans', sans-serif;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.45);
}

.rs-exit-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: rgba(255, 255, 255, 0.7);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: background 0.2s ease, color 0.2s ease;
}

.rs-exit-modal-close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.rs-exit-modal-body {
  padding: 44px 36px 32px;
  text-align: center;
}

.rs-exit-modal-eyebrow {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #E55F2C;
  margin-bottom: 18px;
}

.rs-exit-modal-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 300;
  color: #fff;
  line-height: 1.18;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

.rs-exit-euro {
  color: #E55F2C;
  font-style: italic;
  font-weight: 400;
}

.rs-exit-modal-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.7;
  margin: 0 auto 26px;
  max-width: 360px;
}

.rs-exit-modal-text strong {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

/* ─── Form ─── */
.rs-exit-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
  margin: 0 auto 14px;
}

.rs-exit-form-input {
  width: 100%;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.rs-exit-form-input:focus {
  border-color: rgba(229, 95, 44, 0.6);
  background: rgba(255, 255, 255, 0.08);
}

.rs-exit-form-input::placeholder {
  color: rgba(255, 255, 255, 0.32);
}

.rs-exit-form-submit {
  width: 100%;
  background: #E55F2C;
  border: none;
  color: #fff;
  padding: 14px 20px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s ease, transform 0.15s ease;
}

.rs-exit-form-submit:hover {
  background: #C04A18;
  transform: translateY(-1px);
}

.rs-exit-form-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.rs-exit-error {
  display: none;
  background: rgba(180, 60, 60, 0.12);
  border: 1px solid rgba(180, 60, 60, 0.3);
  border-radius: 5px;
  padding: 10px 14px;
  font-size: 12px;
  color: #FFAEAE;
  text-align: center;
  margin-bottom: 12px;
}

.rs-exit-fineprint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.32);
  text-align: center;
  margin: 14px 0 0;
  line-height: 1.6;
}

.rs-exit-fineprint strong {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
}

.rs-exit-dismiss {
  display: block;
  width: 100%;
  margin-top: 18px;
  background: transparent;
  border: none;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  padding: 4px;
  font-family: inherit;
  transition: color 0.2s ease;
}

.rs-exit-dismiss:hover {
  color: rgba(255, 255, 255, 0.5);
}

/* ─── Success state ─── */
.rs-exit-success {
  display: none;
  padding: 44px 36px 36px;
  text-align: center;
  animation: rs-exit-success-in 0.35s ease;
}

@keyframes rs-exit-success-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.rs-exit-success-checkmark {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(229, 95, 44, 0.12);
  border: 1px solid rgba(229, 95, 44, 0.4);
  color: #E55F2C;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rs-exit-success-eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #E55F2C;
  margin-bottom: 12px;
}

.rs-exit-success-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 22px;
  font-weight: 300;
  color: #fff;
  line-height: 1.3;
  margin: 0 0 20px;
}

.rs-exit-voucher {
  display: flex;
  align-items: stretch;
  max-width: 320px;
  margin: 0 auto 18px;
  border: 1px dashed rgba(229, 95, 44, 0.55);
  border-radius: 8px;
  background: rgba(229, 95, 44, 0.08);
  overflow: hidden;
}

.rs-exit-voucher-code {
  flex: 1;
  padding: 14px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #fff;
  text-align: center;
  user-select: all;
}

.rs-exit-voucher-copy {
  border: none;
  background: rgba(229, 95, 44, 0.18);
  color: #E55F2C;
  padding: 0 18px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  border-left: 1px solid rgba(229, 95, 44, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
}

.rs-exit-voucher-copy:hover {
  background: rgba(229, 95, 44, 0.28);
}

.rs-exit-voucher-copy-done { display: none; }
.rs-exit-voucher-copy.is-copied .rs-exit-voucher-copy-default { display: none; }
.rs-exit-voucher-copy.is-copied .rs-exit-voucher-copy-done    { display: inline; color: #fff; }
.rs-exit-voucher-copy.is-copied { background: #E55F2C; }

.rs-exit-success-note {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  margin: 0 0 22px;
  line-height: 1.6;
}

.rs-exit-success-close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.7);
  padding: 10px 28px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.rs-exit-success-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.32);
}

/* ─── Mobile ─── */
@media (max-width: 480px) {
  .rs-exit-overlay { padding: 16px; }
  .rs-exit-modal { border-radius: 12px; }
  .rs-exit-modal-body { padding: 40px 22px 26px; }
  .rs-exit-modal-title { font-size: 26px; }
  .rs-exit-modal-text { font-size: 13px; line-height: 1.6; margin-bottom: 22px; }
  .rs-exit-form { max-width: 100%; }
  .rs-exit-success { padding: 40px 22px 28px; }
  .rs-exit-voucher-code { font-size: 16px; padding: 13px 12px; }
  .rs-exit-voucher-copy { min-width: 76px; padding: 0 14px; }
}
