/* ============================================================
   SITOT — modal.css
   Conversational lead-capture modal for the pricing CTAs.
   Uses existing tokens only (paper / ink / brick / peach / Manrope).
   Desktop: centered card over a dimmed backdrop.
   Mobile (<=640px): bottom sheet that slides up.
   ============================================================ */

/* ----- Overlay ----- */
.lead {
  position: fixed;
  inset: 0;
  z-index: 2000;                 /* above nav (100) and mobile overlay (1100) */
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lead.is-open { display: flex; }

.lead__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 27, 23, 0.55);
  opacity: 0;
  transition: opacity 240ms var(--easing-out);
}
.lead.is-open .lead__backdrop { opacity: 1; }

/* ----- Card ----- */
.lead__card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(28,27,23,0.06), 0 24px 64px rgba(28,27,23,0.22);
  padding: 32px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* enter transition */
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 240ms var(--easing-out), transform 240ms var(--easing-out);
}
.lead.is-open .lead__card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ----- Close button ----- */
.lead__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: background 120ms var(--easing-out), color 120ms var(--easing-out);
}
.lead__close:hover { background: var(--peach); color: var(--ink); }
.lead__close svg { width: 20px; height: 20px; }

/* ----- Header ----- */
.lead__head { margin: 0 40px 20px 0; }
.lead__plan {
  display: inline-block;
  background: var(--peach);
  color: var(--ink);
  font: 600 11px/1 var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 7px 10px;
  border-radius: 6px;
  margin: 0 0 14px;
  white-space: nowrap;
}
.lead__intro {
  font: 500 clamp(17px, 4.5vw, 19px)/1.4 var(--font-sans);
  color: var(--ink);
  margin: 0;
  text-wrap: pretty;
}
.lead__hl {
  position: relative;
  display: inline-block;
  color: var(--ink);
  font-weight: 700;
  padding: 0.04em 0.34em;
  z-index: 0;
}
.lead__hl::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--peach);
  border-radius: 5px;
  transform: rotate(-2deg);
  z-index: -1;
}

/* ----- Progress ----- */
.lead__progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
}
.lead__bars {
  display: flex;
  gap: 6px;
  flex: 1;
}
.lead__bar {
  height: 4px;
  flex: 1;
  border-radius: 4px;
  background: var(--rule);
  transition: background 200ms var(--easing-out);
}
.lead__bar.is-on { background: var(--brick); }
.lead__count {
  font: 600 12px/1 var(--font-sans);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ----- Steps ----- */
.lead__step { display: none; }
.lead__step.is-active { display: block; }

.lead__q {
  font: 600 11px/1 var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink);
  margin: 0 0 12px;
}
.lead__step .field { margin-bottom: 0; }
.lead__step input {
  /* inherits .field input from system.css */
  background: #fff;
}

/* Single-tap choice buttons (step 3) */
.lead__choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lead__choice {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
  background: #fff;
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  padding: 16px 18px;
  font: 500 16px/1.3 var(--font-sans);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 120ms var(--easing-out), background 120ms var(--easing-out);
}
.lead__choice:hover { border-color: var(--ink); background: var(--peach); }
.lead__choice.is-selected { border-color: var(--brick); background: var(--peach); }
.lead__choice-dot {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--rule-strong);
  position: relative;
  transition: border-color 120ms var(--easing-out);
}
.lead__choice.is-selected .lead__choice-dot { border-color: var(--brick); }
.lead__choice.is-selected .lead__choice-dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--brick);
}

/* Two-field contact row */
.lead__contact { display: flex; flex-direction: column; gap: 14px; }
.lead__or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font: 500 12px/1 var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.lead__or::before,
.lead__or::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--rule);
}

/* ----- Footer / nav ----- */
.lead__foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}
.lead__back {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 14px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  font: 600 14px/1 var(--font-sans);
  cursor: pointer;
  transition: color 120ms var(--easing-out), background 120ms var(--easing-out);
}
.lead__back:hover { color: var(--ink); background: var(--peach); }
.lead__back svg { width: 16px; height: 16px; }
.lead__next { flex: 1; }

/* The .btn / .lead__back display rules are author styles and would otherwise
   override the UA [hidden] rule — force-hide when the attribute is set. */
.lead__foot [hidden] { display: none !important; }

/* Loading spinner inside the submit button */
.lead__spin {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(250,248,243,0.4);
  border-top-color: var(--paper);
  border-radius: 50%;
  animation: lead-spin 0.7s linear infinite;
  display: none;
}
.btn.is-loading .lead__spin { display: inline-block; }
@keyframes lead-spin { to { transform: rotate(360deg); } }

/* Inline error / hint message */
.lead__msg {
  font: 500 13px/1.4 var(--font-sans);
  color: var(--brick);
  margin: 12px 0 0;
  min-height: 0;
}
.lead__msg:empty { display: none; }

/* ----- Honeypot (Web3Forms botcheck) ----- */
.lead__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ----- Confirmation ----- */
.lead__done { display: none; text-align: left; }
.lead.is-done .lead__head,
.lead.is-done .lead__progress,
.lead.is-done .lead__form { display: none; }
.lead.is-done .lead__done { display: block; }
.lead__done-mark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--peach);
  color: var(--brick);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 20px;
}
.lead__done-mark svg { width: 24px; height: 24px; }
.lead__done-title {
  font: 700 clamp(22px, 5vw, 26px)/1.15 var(--font-sans);
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 12px;
  text-wrap: balance;
}
.lead__done-sub {
  font: 400 16px/1.5 var(--font-sans);
  color: var(--muted);
  margin: 0 0 28px;
  text-wrap: pretty;
}

/* ============================================================
   MOBILE — bottom sheet (primary case)
   ============================================================ */
@media (max-width: 640px) {
  .lead { align-items: flex-end; padding: 0; }
  .lead__card {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
    padding: 16px 22px calc(24px + env(safe-area-inset-bottom)) 22px;
    transform: translateY(100%);
  }
  .lead.is-open .lead__card { transform: translateY(0); }
  /* Grab handle */
  .lead__card::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 4px;
    background: var(--rule-strong);
    margin: 0 auto 18px;
  }
  .lead__close { top: 14px; right: 12px; }
  .lead__head { margin-top: 4px; }
}

/* ============================================================
   REDUCED MOTION — no transitions, instant render
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .lead__backdrop,
  .lead__card { transition: none; }
  .lead__spin { animation: none; }
}
