/* Lead form modal — overlay, card, transitions */

.lf-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  transition: opacity 220ms ease-out;
}
.lf-overlay.lf-open { opacity: 1; }

.lf-card {
  position: relative;
  width: 100%; max-width: 640px;
  height: min(640px, calc(100vh - 2.5rem));
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.35);
  display: flex; flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.97);
  opacity: 0;
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1), opacity 220ms ease-out;
  font-family: 'Inter', -apple-system, sans-serif;
  color: #1e293b;
}
.lf-overlay.lf-open .lf-card { transform: translateY(0) scale(1); opacity: 1; }

.lf-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}
.lf-header-left {
  display: flex; align-items: center; gap: 0.6rem;
  color: #64748b; font-size: 0.78rem; font-weight: 600;
}
.lf-back, .lf-close {
  background: transparent; border: none; cursor: pointer;
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #64748b;
  transition: background 150ms, color 150ms;
}
.lf-back:hover, .lf-close:hover { background: #f1f5f9; color: #1e293b; }
.lf-back[hidden] { visibility: hidden; }

.lf-stage {
  flex: 1 1 auto; overflow: hidden;
  padding: 2.25rem 2rem 1.25rem;
  display: flex; flex-direction: column;
  min-height: 0;
}
.lf-stage-inner {
  position: relative;
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
}

.lf-step {
  opacity: 0;
  transition:
    opacity 220ms ease-out,
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.lf-step.lf-enter-forward { transform: translateX(28px); }
.lf-step.lf-enter-back    { transform: translateX(-28px); }
.lf-step.lf-active        { opacity: 1; transform: translateX(0); }
.lf-step.lf-vcenter {
  margin-top: auto; margin-bottom: auto;
  text-align: center;
}
.lf-step.lf-split {
  display: flex; flex-direction: column;
  flex: 1 1 auto; min-height: 0;
}
.lf-step.lf-split .lf-step-head { flex: 0 0 auto; }
.lf-step.lf-split .lf-step-body {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  margin: 0 -0.5rem; padding: 0.25rem 0.5rem 0.5rem;
  scroll-behavior: smooth;
  scrollbar-width: thin;
}
.lf-step.lf-split .lf-step-body::-webkit-scrollbar { width: 6px; }
.lf-step.lf-split .lf-step-body::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }
.lf-step.lf-split .lf-step-body::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }
.lf-step.lf-vcenter .lf-eyebrow,
.lf-step.lf-vcenter .lf-title,
.lf-step.lf-vcenter .lf-desc { text-align: center; }
.lf-step.lf-vcenter .lf-desc { max-width: 460px; margin-left: auto; margin-right: auto; }
.lf-step.lf-leaving       {
  position: absolute; inset: 0; pointer-events: none;
  transition:
    opacity 200ms ease-in,
    transform 240ms cubic-bezier(0.4, 0, 1, 1);
}
.lf-step.lf-leaving.lf-exit-forward { opacity: 0; transform: translateX(-28px); }
.lf-step.lf-leaving.lf-exit-back    { opacity: 0; transform: translateX(28px); }

.lf-eyebrow {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.15em;
  text-transform: uppercase; color: #f97316;
  margin-bottom: 0.65rem;
}
.lf-title {
  font-size: 1.65rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em;
  margin: 0 0 0.55rem;
}
/* When the title is the last block in the head (no description), give it
   the same bottom spacing the description would have provided. */
.lf-title.lf-title-no-desc { margin-bottom: 1.5rem; }
.lf-desc {
  font-size: 0.98rem; color: #64748b; margin: 0 0 1.5rem; line-height: 1.5;
}
.lf-meta {
  display: inline-flex; align-items: center; gap: 0.45rem;
  margin: 0; padding: 0.35rem 0.85rem;
  font-size: 0.92rem; font-weight: 700; color: #1e293b;
  background: #f1f5f9; border-radius: 999px;
}
.lf-meta svg { color: #f97316; flex-shrink: 0; }
.lf-step.lf-vcenter .lf-meta { margin-left: auto; margin-right: auto; }

.lf-disclaimer {
  font-size: 0.74rem; color: #94a3b8;
  line-height: 1.5; margin: 3.5rem 0 0;
  max-width: 400px;
}
.lf-step.lf-vcenter .lf-disclaimer { margin-left: auto; margin-right: auto; text-align: center; }
.lf-disclaimer a { color: #64748b; text-decoration: underline; text-decoration-color: #cbd5e1; text-underline-offset: 2px; }
.lf-disclaimer a:hover { color: #1e293b; text-decoration-color: #94a3b8; }
.lf-disclaimer kbd {
  font-family: 'JetBrains Mono', monospace; font-size: 0.68rem;
  padding: 1px 5px; border-radius: 4px;
  background: #f1f5f9; color: #475569;
  border: 1px solid #e2e8f0;
}

/* Honeypot — visible to bots, invisible to humans (and screen readers via aria-hidden in JS) */
[data-lf-honeypot] {
  position: absolute !important;
  left: -9999px !important; top: auto !important;
  width: 1px !important; height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.lf-options {
  display: flex; flex-direction: column; gap: 0.55rem;
  margin-bottom: 0.5rem;
}
.lf-option {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.95rem 1.05rem;
  border: 1.5px solid #e2e8f0; border-radius: 12px;
  background: #fff; color: #1e293b;
  font-size: 0.98rem; font-weight: 500; text-align: left;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 220ms ease;
}
.lf-option:hover { border-color: #cbd5e1; background: #f8fafc; }
.lf-option:active { transform: scale(0.985); }
.lf-option.lf-selected {
  border-color: #f97316; background: #fff7ed; color: #c2410c;
  box-shadow: 0 6px 20px rgba(249,115,22,0.18);
  transform: translateX(2px);
}
.lf-option-key {
  font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; font-weight: 700;
  width: 24px; height: 24px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f1f5f9; color: #64748b;
  flex-shrink: 0;
}
.lf-option.lf-selected .lf-option-key {
  background: #f97316; color: #fff;
}

.lf-fields { display: flex; flex-direction: column; gap: 0.85rem; margin-bottom: 0.5rem; }
.lf-field { display: flex; flex-direction: column; gap: 0.3rem; }
.lf-field-label { font-size: 0.85rem; font-weight: 600; color: #1e293b; display: inline-flex; align-items: baseline; gap: 4px; }
.lf-required { color: #dc2626; font-weight: 700; }
.lf-field input {
  font: inherit; font-size: 1rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid #e2e8f0; border-radius: 12px;
  background: #fff; color: #1e293b;
  outline: none;
  transition: border-color 140ms, box-shadow 140ms;
}
.lf-field input::placeholder { color: #94a3b8; }
.lf-field input:focus { border-color: #f97316; box-shadow: 0 0 0 3px rgba(249,115,22,0.15); }
.lf-field-error {
  font-size: 0.78rem; color: #dc2626;
  min-height: 0; opacity: 0; transition: opacity 160ms ease, min-height 160ms ease;
}
.lf-group-error {
  margin-top: 0.4rem;
  display: block;
}
.lf-group-error.lf-show { opacity: 1; min-height: 1.1em; }
.lf-field.lf-invalid input { border-color: #dc2626; }
.lf-field.lf-invalid input:focus { box-shadow: 0 0 0 3px rgba(220,38,38,0.15); }
.lf-field.lf-invalid .lf-field-error { opacity: 1; min-height: 1.1em; }

.lf-phone {
  display: flex; align-items: stretch;
  border: 1.5px solid #e2e8f0; border-radius: 12px;
  background: #fff;
  position: relative;
  transition: border-color 140ms, box-shadow 140ms;
}
.lf-phone:focus-within { border-color: #f97316; box-shadow: 0 0 0 3px rgba(249,115,22,0.15); }
.lf-field.lf-invalid .lf-phone { border-color: #dc2626; }
.lf-field.lf-invalid .lf-phone:focus-within { box-shadow: 0 0 0 3px rgba(220,38,38,0.15); }

.lf-phone-cc {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 0.95rem;
  background: #f8fafc;
  border: none; border-right: 1.5px solid #e2e8f0;
  border-radius: 11px 0 0 11px;
  font: inherit; color: #1e293b; cursor: pointer;
  transition: background 140ms;
}
.lf-phone-cc:hover { background: #f1f5f9; }
.lf-phone-cc[aria-expanded="true"] { background: #f1f5f9; }
.lf-phone-flag { font-size: 1.15rem; line-height: 1; }
.lf-phone-code { font-size: 0.95rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.lf-phone-caret { font-size: 0.65rem; color: #94a3b8; transition: transform 140ms; }
.lf-phone-cc[aria-expanded="true"] .lf-phone-caret { transform: rotate(180deg); }

.lf-phone input {
  flex: 1; min-width: 0;
  border: none; outline: none;
  padding: 0.85rem 1rem;
  font: inherit; font-size: 1rem; color: #1e293b;
  background: transparent;
  border-radius: 0 11px 11px 0;
}
.lf-phone input::placeholder { color: #94a3b8; }

.lf-phone-cc-list {
  position: absolute; top: calc(100% + 6px); left: 0;
  width: 100%; max-width: 320px;
  max-height: 260px; overflow-y: auto;
  background: #fff;
  border: 1px solid #e2e8f0; border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  z-index: 10;
  padding: 4px;
  opacity: 0; transform: translateY(-4px);
  transition: opacity 160ms ease-out, transform 160ms ease-out;
  pointer-events: none;
}
.lf-phone-cc-list.lf-up {
  top: auto; bottom: calc(100% + 6px);
  transform: translateY(4px);
}
.lf-phone-cc-list.lf-open { opacity: 1; transform: translateY(0); pointer-events: auto; }

.lf-phone-cc-option {
  display: grid; grid-template-columns: 22px 1fr auto; gap: 12px;
  align-items: center;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: none; background: transparent;
  text-align: left; font: inherit; font-size: 0.92rem; color: #1e293b;
  cursor: pointer; border-radius: 8px;
  transition: background 100ms;
}
.lf-phone-cc-option:hover { background: #f1f5f9; }
.lf-phone-cc-option.lf-selected { background: #fff7ed; color: #c2410c; }
.lf-phone-cc-option .lf-phone-cc-flag { font-size: 1.05rem; line-height: 1; }
.lf-phone-cc-option .lf-phone-cc-dial {
  font-size: 0.78rem; color: #64748b;
  font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
}
.lf-phone-cc-option.lf-selected .lf-phone-cc-dial { color: #c2410c; }

.lf-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid #f1f5f9;
  flex-shrink: 0;
}
.lf-footer-hint { font-size: 0.78rem; color: #94a3b8; }
.lf-footer-hint kbd {
  font-family: 'JetBrains Mono', monospace; font-size: 0.72rem;
  padding: 1px 6px; border-radius: 4px;
  background: #f1f5f9; color: #475569;
  border: 1px solid #e2e8f0;
}
.lf-next {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.7rem 1.25rem; border-radius: 10px;
  background: #f97316; color: #fff;
  font: inherit; font-size: 0.92rem; font-weight: 700; letter-spacing: 0.02em;
  border: none; cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(249,115,22,0.32);
  transition: background 140ms, transform 140ms, box-shadow 140ms;
}
.lf-next:hover:not(:disabled) { background: #ea580c; transform: translateY(-1px); box-shadow: 0 8px 22px rgba(249,115,22,0.4); }
.lf-next:active:not(:disabled) { transform: translateY(0); }
.lf-next:disabled { background: #cbd5e1; box-shadow: none; cursor: not-allowed; }

.lf-step.lf-step-calendly {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
  margin: -2.25rem -2rem -1.25rem; /* extend to card edges */
}
.lf-step.lf-step-calendly .lf-calendly-frame {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
}
.lf-step.lf-step-calendly .calendly-inline-widget { flex: 1 1 auto; min-height: 480px; }

@media (max-width: 600px) {
  .lf-step.lf-step-calendly { margin: -1.4rem -1.1rem -0.85rem; }
  .lf-step.lf-step-calendly .calendly-inline-widget { min-height: 0; }
}

@media (max-width: 600px) {
  .lf-overlay {
    padding: 0;
    align-items: flex-end;
    backdrop-filter: blur(4px);
  }
  .lf-card {
    max-width: 100%;
    height: 92vh;
    height: 92dvh; /* dvh handles iOS Safari URL bar / keyboard properly */
    border-radius: 20px 20px 0 0;
    transform: translateY(40px);
  }
  .lf-overlay.lf-open .lf-card { transform: translateY(0) scale(1); }

  .lf-header {
    padding: 0.75rem 0.85rem 0.6rem;
  }
  .lf-back, .lf-close {
    width: 40px; height: 40px;
    font-size: 1.05rem;
  }

  .lf-stage { padding: 1.4rem 1.1rem 0.85rem; min-height: 0; }
  .lf-eyebrow { font-size: 0.68rem; margin-bottom: 0.5rem; }
  .lf-title { font-size: 1.4rem; line-height: 1.18; }
  .lf-title.lf-title-no-desc { margin-bottom: 1.2rem; }
  .lf-desc { font-size: 0.94rem; margin-bottom: 1.2rem; }
  .lf-meta { font-size: 0.88rem; padding: 0.35rem 0.8rem; }

  .lf-options { gap: 0.5rem; }
  .lf-option {
    padding: 0.95rem 0.95rem;
    font-size: 1rem;
    min-height: 52px; /* comfortable tap target */
    border-radius: 14px;
  }
  .lf-option-key {
    width: 26px; height: 26px;
    font-size: 0.78rem;
  }

  .lf-fields { gap: 0.75rem; }
  .lf-field input {
    font-size: 16px; /* prevents iOS auto-zoom on focus */
    padding: 0.95rem 1rem;
  }
  .lf-field-label { font-size: 0.88rem; }

  .lf-phone-cc { padding: 0 0.85rem; gap: 5px; }
  .lf-phone-flag { font-size: 1.1rem; }
  .lf-phone-code { font-size: 0.95rem; }
  .lf-phone input { font-size: 16px; padding: 0.95rem 0.9rem; }
  .lf-phone-cc-list {
    width: calc(100vw - 2.4rem);
    max-width: 360px;
  }
  .lf-phone-cc-option { padding: 0.7rem 0.75rem; font-size: 0.95rem; }

  .lf-footer {
    padding: 0.8rem 1.1rem;
    padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0));
  }
  .lf-footer-hint { display: none; }
  .lf-next {
    width: 100%; padding: 0.95rem 1.25rem;
    font-size: 0.95rem;
  }

  .lf-thanks-emoji { font-size: 2.5rem; }
}

@media (max-width: 380px) {
  .lf-stage { padding: 1.2rem 0.95rem 0.7rem; }
  .lf-title { font-size: 1.3rem; }
  .lf-desc { font-size: 0.9rem; }
  .lf-option { padding: 0.85rem 0.85rem; font-size: 0.94rem; min-height: 48px; }
}

/* Landscape phones: short cards — reduce vertical padding */
@media (max-width: 900px) and (max-height: 500px) {
  .lf-card { height: 100vh; height: 100dvh; border-radius: 0; }
  .lf-stage { padding: 1rem 1.25rem 0.6rem; }
  .lf-title { font-size: 1.2rem; line-height: 1.15; }
  .lf-desc { font-size: 0.88rem; margin-bottom: 0.85rem; }
  .lf-step.lf-vcenter { margin-top: 0.5rem; margin-bottom: 0.5rem; }
}
