/* Lead Kit — themable form styles. Inherits the host site's font.
   Override any --lk-* variable on [data-leadkit] (or a parent) to match the client brand. */

[data-leadkit] {
  --lk-ink: #14181f;
  --lk-muted: #555e6b;
  --lk-bg: #ffffff;
  --lk-surface: #f5f6f8;
  --lk-line: #d5d9e0;
  --lk-accent: #1f5f4a;       /* buttons, selected cards, progress */
  --lk-on-accent: #ffffff;
  --lk-accent-soft: #e6f0ec;
  --lk-error: #b42318;
  --lk-radius: 10px;
  --lk-gap: 1.25rem;
  --lk-min-h: 34rem;          /* reserved before JS mounts → no layout shift */
  display: block;
  min-height: var(--lk-min-h);
  color: var(--lk-ink);
}
[data-leadkit].is-ready { min-height: 0; }
[data-leadkit] [hidden] { display: none !important; }

.lk {
  background: var(--lk-bg);
  border: 1px solid var(--lk-line);
  border-radius: calc(var(--lk-radius) * 1.6);
  padding: clamp(1.25rem, 4vw, 2.25rem);
  font: inherit;
  line-height: 1.5;
  container-type: inline-size;
}
.lk *, .lk *::before, .lk *::after { box-sizing: border-box; }
.lk :where(p, h2, h3, h4, h5, h6, fieldset, legend) { margin: 0; padding: 0; }
.lk fieldset { border: 0; min-width: 0; }

.lk-heading { font-size: clamp(1.35rem, 2.6vw, 1.7rem); font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.lk-intro { color: var(--lk-muted); margin-top: 0.35rem !important; }

.lk-progress { margin: 1.25rem 0 1.5rem !important; }
.lk-progress__text { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--lk-muted); }
.lk-progress__bar { height: 4px; margin-top: 0.5rem; background: var(--lk-surface); border-radius: 99px; overflow: hidden; }
.lk-progress__bar span { display: block; height: 100%; background: var(--lk-accent); transform-origin: left; transform: scaleX(0); transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1); }

.lk-step__title { font-size: 1.15rem; font-weight: 700; line-height: 1.3; margin-bottom: var(--lk-gap) !important; outline: none; }
.lk-step__title:focus-visible { outline: 2px solid var(--lk-accent); outline-offset: 4px; border-radius: 4px; }

.lk-q + .lk-q { margin-top: var(--lk-gap); }
.lk-label { display: block; font-weight: 600; font-size: 0.9375rem; margin-bottom: 0.45rem !important; }
.lk-q--choice .lk-label { margin-bottom: 0.6rem !important; float: none; width: 100%; }
.lk-req { color: var(--lk-error); }
.lk-hint { font-size: 0.875rem; color: var(--lk-muted); margin: -0.25rem 0 0.55rem !important; }

/* text inputs */
.lk input:not([type="radio"]), .lk select, .lk textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem; /* ≥16px stops iOS zoom */
  color: var(--lk-ink);
  background: var(--lk-bg);
  border: 1.5px solid var(--lk-line);
  border-radius: var(--lk-radius);
  padding: 0.8rem 0.9rem;
  min-height: 3rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}
.lk textarea { resize: vertical; min-height: 6rem; }
.lk input:not([type="radio"]):hover, .lk select:hover, .lk textarea:hover { border-color: color-mix(in srgb, var(--lk-ink) 35%, var(--lk-line)); }
.lk input:not([type="radio"]):focus-visible, .lk select:focus-visible, .lk textarea:focus-visible {
  outline: none;
  border-color: var(--lk-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--lk-accent) 22%, transparent);
}
.lk-select { position: relative; display: block; }
.lk-select::after {
  content: ""; position: absolute; right: 1rem; top: 50%; width: 0.55rem; height: 0.55rem;
  border: solid var(--lk-muted); border-width: 0 2px 2px 0; transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.lk select { padding-right: 2.5rem; cursor: pointer; }

/* choice cards */
.lk-cards { display: grid; gap: 0.6rem; grid-template-columns: 1fr; }
/* Columns follow the FORM's width (container query), not the window's */
@container (min-width: 24rem) { .lk-cards:is([data-cols="2"], [data-cols="3"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 34rem) { .lk-cards[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* short labels, no hints (e.g. WhatsApp / Call / Email) fit three across on phones too */
@container (min-width: 16.5rem) { .lk-cards[data-cols="3"][data-compact] { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.lk-card { position: relative; display: block; cursor: pointer; }
.lk-card input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.lk-card__box {
  display: grid; grid-template-columns: 1.375rem 1fr; column-gap: 0.7rem; align-items: start;
  height: 100%; padding: 0.85rem 0.95rem; min-height: 3rem;
  border: 1.5px solid var(--lk-line); border-radius: var(--lk-radius); background: var(--lk-bg);
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.lk-card:hover .lk-card__box { border-color: color-mix(in srgb, var(--lk-accent) 55%, var(--lk-line)); }
.lk-card__tick {
  grid-row: 1 / span 2; width: 1.375rem; height: 1.375rem; margin-top: 0.05rem;
  border: 1.5px solid var(--lk-line); border-radius: 50%; display: grid; place-items: center; color: transparent;
  transition: background-color 0.15s, border-color 0.15s;
}
.lk-card__tick svg { width: 0.95rem; height: 0.95rem; }
.lk-card__label { font-weight: 600; line-height: 1.35; }
.lk-card__hint { grid-column: 2; font-size: 0.8125rem; color: var(--lk-muted); line-height: 1.4; margin-top: 0.15rem; }
.lk-card input:checked + .lk-card__box { border-color: var(--lk-accent); background: var(--lk-accent-soft); box-shadow: inset 0 0 0 1px var(--lk-accent); }
.lk-card input:checked + .lk-card__box .lk-card__tick { background: var(--lk-accent); border-color: var(--lk-accent); color: var(--lk-on-accent); }
.lk-card input:focus-visible + .lk-card__box { outline: 2px solid var(--lk-accent); outline-offset: 2px; }

/* errors */
.lk-err { color: var(--lk-error); font-size: 0.875rem; font-weight: 500; min-height: 0; margin-top: 0.35rem !important; }
.lk-err:empty { display: none; }
.lk-q.is-invalid input:not([type="radio"]), .lk-q.is-invalid select, .lk-q.is-invalid textarea, .lk-q.is-invalid .lk-card__box { border-color: var(--lk-error); }

/* nav */
.lk-nav { display: flex; gap: 0.75rem; justify-content: flex-end; align-items: center; margin-top: 1.75rem; flex-wrap: wrap; }
.lk-nav [data-back] { margin-right: auto; }
.lk-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1;
  min-height: 3rem; padding: 0 1.4rem; border-radius: var(--lk-radius);
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, transform 0.15s, opacity 0.15s;
}
.lk-btn svg { width: 1.15rem; height: 1.15rem; flex: none; }
.lk-btn--main { background: var(--lk-accent); color: var(--lk-on-accent); }
.lk-btn--main:hover { background: color-mix(in srgb, var(--lk-accent) 86%, #000); }
.lk-btn--main[data-last] { padding: 0 1.75rem; }
.lk-btn--main:disabled { opacity: 0.65; cursor: progress; }
.lk-btn--ghost { background: transparent; color: var(--lk-ink); border-color: var(--lk-line); }
.lk-btn--ghost:hover { border-color: var(--lk-ink); }
.lk-btn:focus-visible { outline: 2px solid var(--lk-accent); outline-offset: 3px; }
.lk-btn:active { transform: translateY(1px); }
/* narrow forms: Back becomes an icon button so the main button never wraps */
.lk-btn { white-space: nowrap; }
@container (max-width: 26rem) {
  .lk-btn--main { flex: 1; }
  .lk-nav [data-back] { padding: 0; width: 3rem; }
  .lk-nav [data-back] span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

.lk-fail {
  margin-top: 1rem !important; padding: 0.85rem 1rem; border-radius: var(--lk-radius);
  background: color-mix(in srgb, var(--lk-error) 8%, var(--lk-bg)); color: var(--lk-ink);
  border: 1px solid color-mix(in srgb, var(--lk-error) 35%, transparent); font-size: 0.9375rem;
}
.lk-fail a { color: inherit; font-weight: 700; }
.lk-fail svg { width: 1rem; height: 1rem; vertical-align: -0.15em; margin-right: 0.25rem; }
.lk-privacy { margin-top: 1.1rem !important; font-size: 0.8125rem; color: var(--lk-muted); }

.lk-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* done */
.lk-done { text-align: center; padding: 1.5rem 0.5rem; outline: none; }
.lk-done__icon {
  display: inline-grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 50%;
  background: var(--lk-accent); color: var(--lk-on-accent); margin-bottom: 1rem;
}
.lk-done__icon svg { width: 1.75rem; height: 1.75rem; }
.lk-done__h { font-size: 1.35rem; font-weight: 700; line-height: 1.25; }
.lk-done__p { color: var(--lk-muted); margin: 0.5rem auto 1.4rem !important; max-width: 32rem; }
.lk-done .lk-btn svg { color: #1b8a4c; }

@media (prefers-reduced-motion: reduce) {
  .lk *, .lk *::before, .lk *::after { transition: none !important; }
}

/* compact cards: no tick circle, centred label, so three fit side by side on a phone */
.lk-cards[data-compact] .lk-card__box { grid-template-columns: 1fr; place-items: center; text-align: center; padding: 0.8rem 0.5rem; }
.lk-cards[data-compact] .lk-card__tick { display: none; }
