/* Tely Lead Capture — exit-intent modal.
   Uses the theme's :root design tokens (--ink, --cyan, --serif, --border …)
   so it stays on-brand. Falls back to literal values if a token is missing. */

.tely-lead {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.tely-lead[hidden] { display: none; }

.tely-lead__overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 17, 26, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.tely-lead.is-open .tely-lead__overlay { opacity: 1; }

.tely-lead__card {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--bg, #fffefb);
  border: 1px solid var(--border2, #ece9e0);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(10, 17, 26, 0.28);
  padding: 32px 30px 26px;
  /* morph-open: the card irises/expands from a point to fill — "grows" in */
  transform: scale(0.9);
  opacity: 0;
  clip-path: circle(0% at 50% 56%);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.35s ease,
              clip-path 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.tely-lead.is-open .tely-lead__card {
  transform: none; opacity: 1; clip-path: circle(150% at 50% 56%);
}

/* ---- split (two-column) variant ---- */
.tely-lead__card--split {
  display: flex;
  max-width: 764px;
  padding: 0;
  overflow: hidden;
}
.tely-lead__main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 34px 32px 26px;
  overflow-y: auto;
}

/* ---- left aside: the report rendered as a booklet (warm, landing-style) ---- */
.tely-lead__aside {
  flex: 0 0 286px;
  display: flex;
  flex-direction: column;
  padding: 34px 28px 26px;
  background: #0a111a;
  background-image: radial-gradient(120% 140% at 100% 0%, rgba(6, 182, 212, 0.20), transparent 55%);
  border-right: 1px solid rgba(255, 255, 255, 0.10);
  color: #fff;
}

.tely-lead__booklet {
  position: relative;
  width: 184px;
  height: 222px;
  margin: 2px auto 28px;
}
.tely-lead__stack {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.tely-lead__stack--1 { transform: translate(7px, 5px) rotate(-2deg); background: rgba(255, 255, 255, 0.09); }
.tely-lead__stack--2 { transform: translate(13px, 10px) rotate(-2deg); background: rgba(255, 255, 255, 0.05); }

.tely-lead__cover {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  height: 100%;
  padding: 18px 16px 16px 22px;
  background: rgba(255, 255, 255, 0.10);
  -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  box-shadow: 0 28px 54px -22px rgba(0, 0, 0, 0.65);
  transform: rotate(-2deg);
  color: #fff;
}
.tely-lead__cover-spine {
  position: absolute;
  left: 0; top: 0;
  width: 6px;
  height: 100%;
  border-radius: 10px 0 0 10px;
  background: linear-gradient(to bottom, #06b6d4, #04a3bc 45%, #0a111a);
}
.tely-lead__cover-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.tely-lead__cover-brand i { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan, #06b6d4); }
.tely-lead__cover-kicker {
  margin-top: 8px;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #5fd6e8;
}
.tely-lead__cover-title {
  font-family: var(--serif, Georgia, serif);
  font-weight: 400;
  font-size: 21px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.tely-lead__cover-meta {
  margin-top: auto;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 10px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.7);
}

.tely-lead__inside-h {
  margin: 0 0 11px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.tely-lead__inside {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.tely-lead__inside li {
  position: relative;
  padding: 11px 14px 11px 34px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 12.5px;
  font-weight: 300;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.78);
}
.tely-lead__inside li strong { color: #fff; font-weight: 600; }
.tely-lead__inside li::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 14px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(95, 214, 232, 0.18);
  box-shadow: inset 0 0 0 1.5px #5fd6e8;
}

.tely-lead__aside-trust {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 11px;
  font-weight: 300;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.55);
}

.tely-lead__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--muted, #6b6860);
  background: var(--warm, #faf7f0);
  transition: background 0.15s ease, color 0.15s ease;
}
.tely-lead__close:hover { background: var(--warm2, #f5f2ec); color: var(--ink, #0a111a); }

.tely-lead__eyebrow {
  margin: 0 0 8px;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan, #06b6d4);
}
.tely-lead__badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 14px;
  padding: 5px 12px 5px 10px;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink, #0a111a);
  background: var(--warm, #faf7f0);
  border: 1px solid var(--border, #d4d2cb);
  border-radius: 999px;
}
.tely-lead__badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green, #76cd4d);
  box-shadow: 0 0 0 3px rgba(118, 205, 77, 0.18);
}
.tely-lead__title {
  margin: 0 0 10px;
  font-family: var(--serif, Georgia, serif);
  font-weight: 400;
  font-size: clamp(23px, 3.4vw, 29px);
  line-height: 1.13;
  color: var(--ink, #0a111a);
}
.tely-lead__sub {
  margin: 0 0 18px;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--muted, #6b6860);
}

.tely-lead__form { display: block; }

.tely-lead__label {
  display: block;
  margin: 13px 0 6px;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink, #0a111a);
}
.tely-lead__form > .tely-lead__label:first-child { margin-top: 0; }

.tely-lead__input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 15px;
  font-weight: 300;
  color: var(--ink, #0a111a);
  background: var(--white, #fff);
  border: 1px solid var(--border, #d4d2cb);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tely-lead__input::placeholder { color: #a8a59c; }
.tely-lead__input:focus {
  border-color: var(--cyan, #06b6d4);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}
.tely-lead__input.is-invalid {
  border-color: #b32d2e;
  box-shadow: 0 0 0 3px rgba(179, 45, 46, 0.12);
}
.tely-lead__textarea { resize: vertical; min-height: 56px; line-height: 1.45; }

.tely-lead__row { display: flex; gap: 12px; }
.tely-lead__col { flex: 1 1 0; min-width: 0; }

/* honeypot — kept in the DOM, out of sight + out of the tab order */
.tely-lead__hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.tely-lead__error {
  margin: 14px 0 0;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 13px;
  color: #b32d2e;
}
.tely-lead__error[hidden] { display: none; }

.tely-lead__submit {
  margin-top: 18px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 18px;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--white, #fff);
  background: var(--ink, #0a111a);
  border: 1px solid var(--ink, #0a111a);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(10, 17, 26, 0.16);
  transition: background 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
}
.tely-lead__submit:hover { background: #1c2632; border-color: #1c2632; }
.tely-lead__submit:active { transform: translateY(1px); }
.tely-lead__submit[disabled] { opacity: 0.6; cursor: default; }
.tely-lead__submit--ghost {
  margin-top: 4px;
  color: var(--ink, #0a111a);
  background: transparent;
  border-color: var(--border, #d4d2cb);
  box-shadow: none;
}
.tely-lead__submit--ghost:hover { background: var(--warm, #faf7f0); }

.tely-lead__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.tely-lead__fine {
  margin: 11px 0 0;
  text-align: center;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 11.5px;
  font-weight: 300;
  color: var(--muted, #6b6860);
}

/* success step */
.tely-lead__done { text-align: center; padding: 28px 4px 8px; }
.tely-lead__check {
  width: 56px;
  height: 56px;
  margin: 4px auto 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--green, #76cd4d);
  background: rgba(118, 205, 77, 0.14);
}
.tely-lead__done .tely-lead__sub { margin-bottom: 20px; }

/* ---- mobile: the OVERLAY scrolls (reliable on iOS); the card is a normal
   block that fills the screen and MORPHS open from the top (like the nav
   menu). The whole thing — report + form — scrolls together. ---- */
@media (max-width: 720px) {
  .tely-lead {
    align-items: flex-start; justify-content: center;
    padding: 12px;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;          /* no rubber-band to the page behind */
  }
  .tely-lead__overlay { position: fixed; }   /* backdrop stays put while scrolling */
  .tely-lead__card,
  .tely-lead__card--split {
    position: relative;
    width: 100%; max-width: none;
    height: auto; min-height: 0; max-height: none;   /* size to content (no dvh jank) */
    margin: 0 auto;
    border-radius: 22px;
    flex-direction: column;
    overflow: hidden;                        /* clip the rounded corners */
    transform: none; opacity: 1;
    clip-path: inset(0 0 100% 0 round 22px);               /* collapsed at the top */
    transition: clip-path 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .tely-lead.is-open .tely-lead__card,
  .tely-lead.is-open .tely-lead__card--split { clip-path: inset(0 0 0 0 round 22px); }
  /* content fades in once the card has expanded */
  .tely-lead__aside, .tely-lead__main { opacity: 0; transition: opacity 0.3s ease 0.24s; }
  .tely-lead.is-open .tely-lead__aside,
  .tely-lead.is-open .tely-lead__main { opacity: 1; }

  .tely-lead__aside {
    flex: 0 0 auto;
    padding: 22px 22px 16px;
    border-right: none;
    border-bottom: 1px solid var(--border2, #ece9e0);
  }
  .tely-lead__booklet { display: block; width: 150px; height: 182px; margin: 2px auto 18px; }
  .tely-lead__inside-h { margin-top: 0; padding-top: 0; border-top: none; }
  /* "What's inside" becomes a horizontal swipe slider on mobile — each item a
     snap card, ~1.3 visible so the swipe affordance reads. */
  .tely-lead__inside {
    flex-direction: row;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    margin: 0 -22px;                 /* bleed to the aside edges */
    padding: 4px 22px 6px;
    scrollbar-width: none;
  }
  .tely-lead__inside::-webkit-scrollbar { display: none; }
  .tely-lead__inside li {
    scroll-snap-align: start;
    flex: 0 0 76%;
    box-sizing: border-box;
  }
  .tely-lead__aside-trust { display: none; }
  .tely-lead__main { padding: 22px 20px 24px; }
  .tely-lead__row { flex-direction: column; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  /* keep the morph-open (it's the intended effect) — just drop the overlay fade */
  .tely-lead__overlay { transition: none; }
}
