/* Lead dialog — the one form on the site, opened by every "Book a call" /
   "Tell us your process" link and both ask composers (lead.js).
   White card on a soft ink backdrop, in the same type, radii and cobalt as
   the service cards. On phones it becomes a bottom sheet. */

body.lead-open { overflow: hidden; }

.lead-dialog {
  width: min(640px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 30px;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-display);
  box-shadow: 0 30px 80px rgba(15, 42, 68, .28);
  overflow: hidden;
}

.lead-dialog::backdrop {
  background: rgba(15, 42, 68, .48);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lead-dialog[open] { animation: lead-in .42s cubic-bezier(.22, 1, .36, 1); }
.lead-dialog[open]::backdrop { animation: lead-fade .3s ease; }
@keyframes lead-in { from { opacity: 0; transform: translateY(18px) scale(.98); } }
@keyframes lead-fade { from { opacity: 0; } }

.lead-panel {
  position: relative;
  max-height: calc(100dvh - 32px);
  padding: 40px 44px 34px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.lead-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #e3eaf1;
  border-radius: 50%;
  background: #f0f4f8;
  color: var(--ink);
  cursor: pointer;
  transition: background .2s, transform .25s cubic-bezier(.22, 1, .36, 1);
}
.lead-close:hover { background: #e2edfa; transform: rotate(90deg); }
.lead-close:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }

/* ------------------------------------------------------------ header */
.lead-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #526a80;
  font: 400 11px/1.5 var(--font-mono);
  letter-spacing: .055em;
  text-transform: uppercase;
}
.lead-eyebrow img { width: 18px; height: 18px; object-fit: contain; }

.lead-title {
  margin-top: 18px;
  padding-right: 40px;
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.05em;
}
.lead-title em,
.lead-success-title em {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.02em;
  color: var(--cobalt);
}

.lead-intro {
  max-width: 440px;
  margin-top: 12px;
  color: #526b82;
  font-size: 15px;
  line-height: 1.6;
}

/* ------------------------------------------------------------ fields */
.lead-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px 14px;
  margin-top: 28px;
}
.lead-field { display: flex; flex-direction: column; min-width: 0; }
.lead-field-wide { grid-column: 1 / -1; }

.lead-field label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: #3b5571;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.lead-optional {
  color: #8396a8;
  font: 400 10px/1 var(--font-mono);
  letter-spacing: .05em;
  text-transform: uppercase;
}

.lead-field input,
.lead-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 15px;
  border: 1px solid #dbe3ea;
  border-radius: 14px;
  background: #f7fbff;
  color: var(--ink);
  font: 500 16px/1.4 var(--font-display);  /* 16px: no zoom-on-focus in iOS */
  letter-spacing: -.01em;
  transition: border-color .2s, box-shadow .2s, background .2s;
  -webkit-appearance: none;
  appearance: none;
}
.lead-field textarea { min-height: 112px; resize: vertical; }

.lead-field input:hover,
.lead-field textarea:hover { border-color: #c4d4e3; }

.lead-field input:focus,
.lead-field textarea:focus {
  outline: none;
  border-color: var(--cobalt);
  background: var(--ground);
  box-shadow: 0 0 0 4px rgba(30, 111, 217, .12);
}

.lead-field.is-invalid input,
.lead-field.is-invalid textarea { border-color: #c8423b; background: #fff8f7; }
.lead-field.is-invalid input:focus,
.lead-field.is-invalid textarea:focus { box-shadow: 0 0 0 4px rgba(200, 66, 59, .12); }

.lead-field-error {
  min-height: 0;
  color: #b2362f;
  font-size: 12px;
  line-height: 1.4;
}
.lead-field-error:not(:empty) { margin-top: 6px; }

.lead-note {
  margin-top: 7px;
  color: #6b7a8c;
  font-size: 12px;
  line-height: 1.5;
}

/* honeypot: off-screen for people, present for bots */
.lead-hp {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ------------------------------------------------------------ error + submit */
.lead-error {
  margin-top: 20px;
  padding: 12px 15px;
  border-radius: 14px;
  background: #fff1f0;
  border: 1px solid #f3cfcc;
  color: #8f2b25;
  font-size: 14px;
  line-height: 1.5;
}
.lead-error a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.lead-error[hidden] { display: none; }

.lead-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 20px;
  margin-top: 24px;
}

.lead-submit,
.lead-book {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  min-height: 48px;
  padding: 5px 5px 5px 22px;
  border: 0;
  border-radius: 25px;
  background: var(--cobalt);
  color: #fff;
  font: 600 14px/1 var(--font-display);
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .2s, opacity .2s;
}
.lead-submit-arrow {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  color: var(--cobalt);
}
.lead-submit-arrow svg { transition: transform .25s; }
.lead-submit:hover,
.lead-book:hover { background: #1559b4; }
.lead-submit:hover .lead-submit-arrow svg { transform: rotate(-35deg); }
.lead-submit:focus-visible,
.lead-book:focus-visible,
.lead-done:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.lead-submit:disabled { cursor: progress; opacity: .7; }
.lead-submit:disabled .lead-submit-arrow svg { animation: lead-nudge 1s ease-in-out infinite; }
@keyframes lead-nudge { 50% { transform: translateX(3px); } }

.lead-privacy { color: #6b7a8c; font-size: 12px; line-height: 1.5; }
.lead-privacy a { color: var(--cobalt); text-decoration: underline; text-underline-offset: 2px; }

/* ------------------------------------------------------------ success */
.lead-form[hidden],
.lead-success[hidden] { display: none; }

.lead-success { padding: 18px 0 6px; }
.lead-success-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--cobalt);
  color: #fff;
}
.lead-success-title {
  margin-top: 24px;
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.055em;
}
.lead-success-copy {
  max-width: 420px;
  margin-top: 14px;
  color: #526b82;
  font-size: 16px;
  line-height: 1.6;
}
.lead-success-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 28px; }
.lead-book { padding: 5px 22px; }
.lead-done {
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid #dbe3ea;
  border-radius: 25px;
  background: #f0f4f8;
  color: var(--ink);
  font: 600 14px/1 var(--font-display);
  cursor: pointer;
  transition: background .2s;
}
.lead-done:hover { background: #e2edfa; }

/* ------------------------------------------------------------ phones: bottom sheet */
@media (max-width: 620px) {
  .lead-dialog {
    width: 100%;
    max-height: calc(100dvh - 24px);
    margin: auto 0 0;
    border-radius: 26px 26px 0 0;
  }
  .lead-dialog[open] { animation-name: lead-up; }
  @keyframes lead-up { from { transform: translateY(40px); opacity: 0; } }
  .lead-panel {
    max-height: calc(100dvh - 24px);
    padding: 28px 20px calc(24px + env(safe-area-inset-bottom));
  }
  .lead-close { top: 14px; right: 14px; }
  .lead-title { margin-top: 14px; font-size: 30px; }
  .lead-intro { font-size: 14px; }
  .lead-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 22px; }
  .lead-actions { flex-direction: column; align-items: stretch; gap: 12px; }
  .lead-submit { justify-content: space-between; width: 100%; }
  .lead-privacy { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .lead-dialog[open],
  .lead-dialog[open]::backdrop,
  .lead-submit:disabled .lead-submit-arrow svg { animation: none; }
  .lead-close, .lead-close:hover { transition: none; transform: none; }
}
