/* TS Newsletter — Exit-intent modal styling
 * Uses theme-friendly tones; supports dark backdrop. */

html.ts-ei-open {
  overflow: hidden;
}

.ts-ei-modal[hidden] {
  display: none !important;
}

.ts-ei-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: tsEiFade 0.25s ease both;
}

.ts-ei-modal__backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    120% 80% at 50% 0%,
    rgba(99, 102, 241, 0.18) 0%,
    rgba(8, 12, 28, 0.78) 60%,
    rgba(0, 0, 0, 0.85) 100%
  );
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

.ts-ei-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: linear-gradient(180deg, #131a30 0%, #0f1428 100%);
  color: #ecf0fb;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(99, 102, 241, 0.12) inset;
  padding: 30px 28px 26px;
  animation: tsEiPop 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

.ts-ei-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 0;
  color: #cdd5ea;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}
.ts-ei-modal__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: rotate(90deg);
}

.ts-ei-modal__badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.12em;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  margin-bottom: 14px;
}

.ts-ei-modal__title {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.ts-ei-modal__lead {
  margin: 0 0 22px;
  font-size: 15px;
  line-height: 1.55;
  color: #c2cbe1;
}

.ts-ei-modal__form {
  display: block;
}

.ts-ei-modal__form .ts-ei-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.ts-ei-modal__email {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 15px;
  outline: none;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
  margin-bottom: 12px;
}
.ts-ei-modal__email::placeholder {
  color: rgba(236, 240, 251, 0.55);
}
.ts-ei-modal__email:focus {
  border-color: #6366f1;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
}

.ts-ei-modal__submit {
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1 0%, #22d3ee 100%);
  color: #0b1020;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}
.ts-ei-modal__submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(99, 102, 241, 0.45);
}
.ts-ei-modal__submit:disabled {
  opacity: 0.65;
  cursor: progress;
}

.ts-ei-modal__msg {
  min-height: 22px;
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.45;
}
.ts-ei-modal__msg[data-state="success"] {
  color: #4ade80;
}
.ts-ei-modal__msg[data-state="error"] {
  color: #f87171;
}
.ts-ei-modal__msg[data-state="pending"] {
  color: #cbd5e1;
}

.ts-ei-modal__legal {
  margin: 12px 0 0;
  font-size: 12px;
  color: #8893ad;
  line-height: 1.5;
}

.ts-ei-modal__consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #c2cbe1;
  cursor: pointer;
  user-select: none;
}
.ts-ei-modal__consent-cb {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: #6366f1;
  cursor: pointer;
}
.ts-ei-modal__consent a {
  color: #a5b4fc;
  text-decoration: underline;
}
.ts-ei-modal__consent a:hover { color: #c7d2fe; }

/* Footer form inline status message (Blocksy form) */
.ct-newsletter-subscribe-form .ts-nl-msg {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: #e2e8f0;
}
.ct-newsletter-subscribe-form .ts-nl-msg[data-state="success"] {
  color: #4ade80;
}
.ct-newsletter-subscribe-form .ts-nl-msg[data-state="error"] {
  color: #f87171;
}

@keyframes tsEiFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes tsEiPop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 480px) {
  .ts-ei-modal__dialog {
    padding: 24px 20px 20px;
    border-radius: 16px;
  }
  .ts-ei-modal__title {
    font-size: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ts-ei-modal,
  .ts-ei-modal__dialog {
    animation: none !important;
  }
  .ts-ei-modal__close:hover {
    transform: none;
  }
}
