/* leadflow — every rule scoped under .lf-root. Theme through --lf-* custom
   properties; defaults sit in :where() (zero specificity) so any site mapping
   such as `.lf-root { --lf-bg: var(--bg) }` wins without !important. */

:where(.lf-root) {
  --lf-bg: #0b0d10;
  --lf-surface: #11141a;
  --lf-text: #ececec;
  --lf-text-dim: rgba(236, 236, 236, 0.64);
  --lf-accent: #4d9fff;
  --lf-on-accent: #0b0d10;
  --lf-line: rgba(236, 236, 236, 0.12);
  --lf-line-strong: rgba(236, 236, 236, 0.24);
  --lf-danger: #ff6b6b;
  --lf-radius: 10px;
  --lf-font: inherit;
  --lf-font-display: inherit;
  --lf-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --lf-accent-soft: color-mix(in srgb, var(--lf-accent) 16%, transparent);
  --lf-media-position: 70% 50%;
}

:where(.lf-root[data-lf-theme="light"]),
:where([data-theme="light"]) :where(.lf-root:not([data-lf-theme="dark"])) {
  --lf-bg: #f5f3ee;
  --lf-surface: #ffffff;
  --lf-text: #15171b;
  --lf-text-dim: rgba(21, 23, 27, 0.66);
  --lf-accent: #1a5cd6;
  --lf-on-accent: #ffffff;
  --lf-line: rgba(11, 13, 16, 0.10);
  --lf-line-strong: rgba(11, 13, 16, 0.22);
  --lf-danger: #c62828;
}

@media (prefers-color-scheme: light) {
  :where(.lf-root[data-lf-theme="auto"]) {
    --lf-bg: #f5f3ee;
    --lf-surface: #ffffff;
    --lf-text: #15171b;
    --lf-text-dim: rgba(21, 23, 27, 0.66);
    --lf-accent: #1a5cd6;
    --lf-on-accent: #ffffff;
    --lf-line: rgba(11, 13, 16, 0.10);
    --lf-line-strong: rgba(11, 13, 16, 0.22);
    --lf-danger: #c62828;
  }
}

.lf-root {
  container-type: inline-size;
  container-name: lf;
  display: block;
  width: 100%;
  min-width: 0;
  color: var(--lf-text);
  font-family: var(--lf-font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.lf-root *,
.lf-root *::before,
.lf-root *::after { box-sizing: border-box; }

.lf-root button,
.lf-root input,
.lf-root textarea { font: inherit; color: inherit; margin: 0; }
.lf-root button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; cursor: pointer; }
.lf-root button:disabled { cursor: default; }

.lf-root .lf-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--lf-surface);
  border: 1px solid var(--lf-line);
  border-radius: var(--lf-radius);
  overflow: hidden;
}

/* Media: a fixed-height band above the question on narrow containers. Text never sits on the photo. */
.lf-root .lf-media {
  position: relative;
  height: clamp(112px, 36cqw, 210px);
  background: color-mix(in srgb, var(--lf-bg) 70%, var(--lf-accent) 6%);
  overflow: hidden;
}
.lf-root .lf-media__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--lf-media-position);
  display: block;
  animation: lf-fade 320ms ease both;
}

.lf-root .lf-main {
  min-width: 0;
  padding: clamp(16px, 5cqw, 36px);
  padding-top: clamp(10px, 3cqw, 24px);
}

/* Side panel from 720px of component width (container query: works in any column). */
@container lf (min-width: 720px) {
  .lf-root[data-lf-media="true"] .lf-frame { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .lf-root .lf-media { height: auto; min-height: 100%; }
  .lf-root .lf-main { padding: 28px 36px 36px; }
}

.lf-root .lf-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
}
.lf-root .lf-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 10px 0 0;
  background: none;
  border: 0;
  color: var(--lf-text-dim);
  font-family: var(--lf-font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.lf-root .lf-back--ghost { visibility: hidden; }
.lf-root .lf-count {
  font-family: var(--lf-font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--lf-text-dim);
  font-variant-numeric: tabular-nums;
}
.lf-root .lf-bar {
  height: 2px;
  background: var(--lf-line);
  border-radius: 2px;
  overflow: hidden;
}
.lf-root .lf-bar__fill {
  display: block;
  height: 100%;
  background: var(--lf-accent);
  transform-origin: left center;
  transition: transform 320ms ease;
}

.lf-root .lf-stage { margin-top: clamp(16px, 4cqw, 26px); }
.lf-root .lf-step { animation: lf-in 240ms ease both; min-width: 0; }

.lf-root .lf-eyebrow {
  margin: 0 0 8px;
  font-family: var(--lf-font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lf-accent);
  font-weight: 400;
}
.lf-root .lf-q {
  margin: 0 0 8px;
  font-family: var(--lf-font-display);
  font-size: clamp(21px, 5.6cqw, 30px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  outline: none;
  color: var(--lf-text);
  text-transform: none;
}
.lf-root .lf-help,
.lf-root .lf-hint {
  margin: 0 0 4px;
  color: var(--lf-text-dim);
  font-size: 15px;
}
.lf-root .lf-hint { font-size: 14px; }

.lf-root .lf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.lf-root .lf-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  max-width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--lf-line-strong);
  border-radius: 999px;
  background: transparent;
  font-size: 15px;
  line-height: 1.25;
  text-align: left;
  overflow-wrap: anywhere;
  transition: border-color 150ms ease, background-color 150ms ease;
}
.lf-root .lf-chip[aria-pressed="true"] {
  background: var(--lf-accent-soft);
  border-color: var(--lf-accent);
}
@media (hover: hover) {
  .lf-root .lf-chip:not(:disabled):hover { border-color: var(--lf-accent); }
}
.lf-root .lf-tick {
  flex: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--lf-line-strong);
  border-radius: 4px;
  position: relative;
}
.lf-root .lf-chip[aria-pressed="true"] .lf-tick {
  background: var(--lf-accent);
  border-color: var(--lf-accent);
}
.lf-root .lf-chip[aria-pressed="true"] .lf-tick::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid var(--lf-on-accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Inputs: 16px minimum everywhere — below that iOS zooms the page on focus. */
.lf-root .lf-input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font-size: max(16px, 1rem);
  line-height: 1.4;
  background: var(--lf-bg);
  border: 1px solid var(--lf-line-strong);
  border-radius: calc(var(--lf-radius) * 0.7);
  -webkit-appearance: none;
  appearance: none;
}
.lf-root .lf-input::placeholder { color: var(--lf-text-dim); opacity: 0.8; }
.lf-root .lf-input:focus { outline: none; border-color: var(--lf-accent); box-shadow: 0 0 0 3px var(--lf-accent-soft); }
.lf-root .lf-input[aria-invalid="true"] { border-color: var(--lf-danger); }
.lf-root .lf-input--area { resize: vertical; min-height: 96px; }
.lf-root .lf-step[data-kind="text"] .lf-input { margin-top: 18px; }
.lf-root .lf-other { margin-top: 12px; }

.lf-root .lf-contact { display: grid; gap: 14px; margin-top: 18px; }
.lf-root .lf-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--lf-text-dim);
}
.lf-root .lf-opt { opacity: 0.8; }

.lf-root .lf-consents { display: grid; gap: 4px; margin-top: 2px; }
.lf-root .lf-consent { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; }
.lf-root .lf-consent__link { padding-left: 36px; min-height: 32px; display: inline-flex; align-items: center; }
.lf-root .lf-check {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 44px;
  padding: 10px 0;
  cursor: pointer;
  font-size: 15px;
}
.lf-root .lf-check input {
  position: absolute;
  left: 0;
  top: 0;
  width: 44px;
  height: 44px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.lf-root .lf-check__box {
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 1.5px solid var(--lf-line-strong);
  border-radius: 5px;
  position: relative;
  background: var(--lf-bg);
}
.lf-root .lf-check input:checked + .lf-check__box { background: var(--lf-accent); border-color: var(--lf-accent); }
.lf-root .lf-check input:checked + .lf-check__box::after {
  content: "";
  position: absolute;
  left: 6.5px;
  top: 2.5px;
  width: 5px;
  height: 11px;
  border: solid var(--lf-on-accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.lf-root .lf-check input:focus-visible + .lf-check__box { outline: 2px solid var(--lf-accent); outline-offset: 2px; }
.lf-root .lf-check__text { overflow-wrap: anywhere; }

.lf-root .lf-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 22px;
}
.lf-root .lf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: opacity 150ms ease, transform 150ms ease;
}
.lf-root .lf-btn--primary { background: var(--lf-accent); color: var(--lf-on-accent); }
.lf-root .lf-btn--primary:disabled { opacity: 0.45; }
.lf-root .lf-btn--ghost { background: transparent; border-color: var(--lf-line-strong); }
.lf-root .lf-skip {
  min-height: 44px;
  padding: 0 6px;
  background: none;
  border: 0;
  color: var(--lf-text-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 15px;
}
.lf-root .lf-link { color: var(--lf-accent); font-size: 14px; text-decoration: none; }
.lf-root .lf-link:hover { text-decoration: underline; }

.lf-root .lf-note {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-left: 2px solid var(--lf-accent);
  background: var(--lf-accent-soft);
  border-radius: 0 6px 6px 0;
  font-size: 15px;
}
.lf-root .lf-err { margin: 8px 0 0; color: var(--lf-danger); font-size: 14px; }
.lf-root .lf-alert {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--lf-danger);
  border-radius: calc(var(--lf-radius) * 0.7);
  font-size: 15px;
}
.lf-root .lf-alert p { margin: 0; }
.lf-root .lf-alert .lf-actions { margin-top: 12px; }

.lf-root .lf-done .lf-q { font-size: clamp(22px, 6cqw, 32px); }

.lf-root .lf-spin {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: lf-spin 700ms linear infinite;
}
.lf-root .lf-ico { flex: none; }

.lf-root :is(.lf-chip, .lf-btn, .lf-back, .lf-skip, .lf-link):focus-visible {
  outline: 2px solid var(--lf-accent);
  outline-offset: 2px;
}

.lf-root .lf-sr,
.lf-root .lf-hp {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.lf-root .lf-hp { left: -10000px; }

@keyframes lf-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes lf-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lf-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .lf-root .lf-step,
  .lf-root .lf-media__img { animation: none; }
  .lf-root .lf-bar__fill,
  .lf-root .lf-chip,
  .lf-root .lf-btn { transition: none; }
  .lf-root .lf-spin { animation-duration: 1.6s; }
}
