/* ============================================================
   LEAD FORM
   Shared by the landing page (#start) and the contact page.
   The landing page does not load tokens.css, so every value here
   is literal -- do not swap in --ink / --line / --accent.
   Source markup: site/partials/lead-form.<lang>.html
   Behaviour:     site/assets/js/lead-form.js
   ============================================================ */

.lead-form {
  --lf-ink: #0b0d12;
  --lf-muted: #5b6472;
  --lf-dim: #8b929c;
  --lf-line: rgba(10, 11, 13, 0.14);
  --lf-line-soft: rgba(10, 11, 13, 0.08);
  --lf-accent: #2f6bff;
  --lf-accent-deep: #1f4fd8;
  --lf-danger: #c0392b;
  position: relative;
  max-width: 860px;
  margin: 40px auto 0;
  padding: 32px;
  border: 1px solid var(--lf-line-soft);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--lf-ink);
  font: 400 15px/1.5 var(--font-inter, "Inter"), system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.lead-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.lead-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lead-wide { grid-column: 1 / -1; }

.lead-field > label,
.lead-fieldset > legend {
  padding: 0;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--lf-muted);
}
.lead-req { color: var(--lf-accent); }

.lead-field input,
.lead-field select,
.lead-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--lf-line);
  border-radius: 10px;
  background: #fff;
  color: var(--lf-ink);
  padding: 11px 14px;
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.lead-field textarea { resize: vertical; min-height: 88px; }
.lead-field select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' fill='none' stroke='%235b6472' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.lead-field input::placeholder,
.lead-field textarea::placeholder { color: #a7aeba; }
.lead-field input:focus,
.lead-field select:focus,
.lead-field textarea:focus {
  border-color: var(--lf-accent);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.14);
}
.lead-field.is-invalid input,
.lead-field.is-invalid select,
.lead-field.is-invalid textarea { border-color: var(--lf-danger); }
.lead-field.is-invalid input:focus,
.lead-field.is-invalid select:focus,
.lead-field.is-invalid textarea:focus { box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12); }

.lead-hint { margin: 0; font-size: 12px; line-height: 18px; color: var(--lf-dim); }
.lead-err { margin: 0; font-size: 13px; line-height: 18px; color: var(--lf-danger); }
.lead-err[hidden], .lead-hint[hidden] { display: none; }

/* Team size: real radios, visually chips. Native radios keep keyboard and
   screen-reader behaviour without reinventing a listbox. */
.lead-fieldset { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lead-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lead-chips label { position: relative; }
.lead-chips input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.lead-chips span {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--lf-line);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  color: var(--lf-muted);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}
.lead-chips input:checked + span {
  border-color: var(--lf-accent);
  background: rgba(47, 107, 255, 0.08);
  color: var(--lf-accent-deep);
  font-weight: 500;
}
.lead-chips input:focus-visible + span { box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.18); }

.lead-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.lead-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 22px;
  font-size: 14px;
  line-height: 22px;
  color: var(--lf-muted);
  cursor: pointer;
}
.lead-consent input { margin: 4px 0 0; width: 16px; height: 16px; flex: none; accent-color: var(--lf-accent); }
.lead-consent a { color: var(--lf-accent-deep); text-underline-offset: 3px; white-space: nowrap; }
.lead-consent.is-invalid span { color: var(--lf-danger); }
/* The cross-border consent is a second, related line: closer to the first
   than the block is to the fields above. */
.lead-form .lead-consent ~ .lead-consent { margin-top: 10px; }

.lead-actions { display: flex; align-items: center; gap: 18px; margin-top: 24px; flex-wrap: wrap; }
.lead-submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 40px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  background: var(--lf-accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}
.lead-submit:hover { background: var(--lf-accent-deep); }
.lead-submit:active { transform: translateY(1px); }
.lead-submit:disabled { cursor: progress; }
.lead-submit:focus-visible { outline: 2px solid var(--lf-accent); outline-offset: 3px; }
.lead-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lf-spin 700ms linear infinite;
}
.lead-submit[aria-busy="true"] .lead-spinner { display: inline-block; }
@keyframes lf-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .lead-spinner { animation-duration: 2s; }
  .lead-submit { transition: none; }
}

.lead-status { margin: 0; font-size: 14px; line-height: 20px; color: var(--lf-muted); }
.lead-status.is-error { color: var(--lf-danger); }
.lead-status.is-ok { color: #1a8f5a; }

.lead-note { margin: 16px 0 0; font-size: 12px; line-height: 18px; color: var(--lf-dim); }

/* Error summary. Sits above the fields so a keyboard user hears the count
   before tabbing into them; each item is a link that focuses its field. */
.lead-summary {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(192, 57, 43, 0.25);
  border-radius: 10px;
  background: rgba(192, 57, 43, 0.06);
  color: #a3301f;
  font-size: 14px;
  line-height: 20px;
}
.lead-summary:focus { outline: none; }
.lead-summary ul { margin: 6px 0 0; padding-left: 18px; }
.lead-summary a { color: inherit; text-underline-offset: 2px; }

/* Done state: the form shell stays, its contents are replaced. Keeps the
   column height stable and avoids a second layout for the card. */
.lead-form.is-done { padding: 32px; }
.lead-done h3 { margin: 0; font-size: 20px; line-height: 28px; font-weight: 500; color: var(--lf-ink); }
.lead-done p { margin: 12px 0 0; font-size: 15px; line-height: 24px; color: var(--lf-muted); }
.lead-done .lead-ref { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--lf-ink); }
.lead-done-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.lead-done-actions a,
.lead-done-actions button {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 20px;
  border: 1px solid var(--lf-line);
  border-radius: 999px;
  background: #fff;
  color: var(--lf-ink);
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}
.lead-done-actions a { border-color: var(--lf-accent); background: var(--lf-accent); color: #fff; }
.lead-done-actions a:hover { background: var(--lf-accent-deep); }
.lead-done-actions button:hover { border-color: var(--lf-line); background: #f4f6fb; }
.lead-done .lead-foot { margin-top: 18px; font-size: 12px; line-height: 18px; color: var(--lf-dim); }
.lead-done .lead-contact { margin-top: 14px; font-size: 13px; line-height: 20px; color: var(--lf-muted); }
.lead-done .lead-contact a { color: var(--lf-accent-deep); text-underline-offset: 3px; }

/* The contact page renders the form inside .prose, which styles every
   descendant <p> at 14px/1.7 in ink-soft. Reset the ones that belong to us. */
.prose .lead-form p { margin: 0; font-size: 15px; line-height: 1.5; color: inherit; }
.prose .lead-form .lead-hint,
.prose .lead-form .lead-note,
.prose .lead-form .lead-foot { font-size: 12px; line-height: 18px; color: var(--lf-dim); }
.prose .lead-form .lead-err,
.prose .lead-form .lead-status.is-error { font-size: 13px; color: var(--lf-danger); }
.prose .lead-form .lead-status { font-size: 14px; color: var(--lf-muted); }
/* The reset above flattens every paragraph, including the done panel's own
   rhythm. Put the spacing back for the panel only. */
.prose .lead-form .lead-done p { color: var(--lf-muted); }
.prose .lead-form .lead-done h3 + p { margin-top: 12px; }
.prose .lead-form .lead-done .lead-contact { margin-top: 14px; }
.prose .lead-form .lead-done .lead-foot { margin-top: 18px; }
.prose .lead-form .lead-done p { font-size: 15px; line-height: 24px; color: var(--lf-muted); }

@media (width <= 700px) {
  .lead-form { padding: 22px 18px; }
  .lead-grid { grid-template-columns: 1fr; }
  .lead-form.is-done { padding: 22px 18px; }
}
/* Four chips do not fit on one line at 390 with comfortable padding.
   Two even rows read better than three plus a stray one. */
@media (width <= 430px) {
  .lead-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .lead-chips label { display: flex; }
  .lead-chips span { width: 100%; justify-content: center; }
}
