/* Enquiry form: steady step heights, a progress rail, and errors beside their question. */
.contact-next{width:fit-content;max-width:34em;margin:20px auto 0;padding:0;list-style:none;counter-reset:next;display:grid;gap:10px;text-align:left}
.contact-next li{display:grid;grid-template-columns:28px minmax(0,1fr);gap:12px;align-items:start;font-size:16px;line-height:1.6;color:var(--ink)}
.contact-next li::before{counter-increment:next;content:counter(next);display:grid;place-items:center;width:28px;height:28px;margin-top:-1px;border:1px solid var(--line);border-radius:50%;font-size:14px;font-weight:600;line-height:1;color:var(--muted);font-variant-numeric:tabular-nums}

.form-rail{display:flex;gap:4px;margin-bottom:10px}
.form-rail span{flex:1;height:2px;background:var(--line);overflow:hidden}
.form-rail span::after{content:'';display:block;height:100%;background:var(--accent);transform-origin:left;scale:0 1}
.form-rail .is-done::after,.form-rail .is-current::after{scale:1 1}
.inquiry .form-progress{font-size:14px;line-height:1.5}

/* The error slot holds one line, so a message appears without pushing the answers down; a rare second line moves only the buttons, on the tap. */
.inquiry legend{margin-bottom:6px}
.inquiry .form-error{display:flex;align-items:flex-start;gap:8px;min-height:24px;margin:0 0 6px;font-size:15px;line-height:1.5;color:var(--ink)}
.form-error-icon{flex:none;margin-top:3px;color:#9b352c}
.inquiry .form-hint{margin:0 0 16px;font-size:15px;line-height:1.5}
.inquiry .demo-note{font-size:14px;line-height:1.5}
.inquiry .form-back{font-size:14px}
.inquiry .field>span{font-size:14px}

/* A checked answer carries an accent edge, so the choice still reads in a glance at the list. */
.inquiry .choice:has(input:checked){box-shadow:inset 3px 0 0 var(--accent)}

/* While the panel holds its pre-Send height, the thanks sits centred in it, so the space reads as a panel, not a gap. */
.inquiry:has(> .inquiry-complete:not([hidden])){display:flex;flex-direction:column}
.inquiry > .inquiry-complete{margin-block:auto}

/* Straight under a page's own hero the form's heading is a label, so the h1 stays the only display line. */
.fit-hero + .contact #contact-title{margin-top:32px;font-size:20px;font-weight:600;letter-spacing:normal;line-height:1.3}
/* The hero's closing space would leave an empty band over that label; the label's own margin is the gap. */
.fit-hero:has(+ .contact){padding-bottom:0}

/* Each step sets its own height, so Continue sits straight under the last answer; the panel glides between them. */
@media (max-width:760px){.contact-next{margin-left:0}}
/* On a phone the primary action spans the thumb's reach, as the open menu's Let's talk does, with Back under it. */
@media (max-width:599px){
  .inquiry .form-actions{flex-direction:column-reverse;align-items:stretch;gap:4px}
  .inquiry .form-next{inline-size:100%;margin-left:0}
  .inquiry .form-back{align-self:center;margin-left:0}
}

@media (prefers-reduced-motion:no-preference){
  .form-rail .is-current::after{transition:scale var(--dur-enter) var(--ease-move)}
  /* Back empties the segment it leaves the way it filled, toward the steps still done. */
  .form-rail .is-draining::after{transition:scale var(--dur-enter) var(--ease-move)}
  .inquiry .choice{transition:background-color var(--dur-quick) var(--ease-out),border-color var(--dur-quick) var(--ease-out),box-shadow var(--dur-ui) var(--ease-out)}
  @supports (transition-behavior:allow-discrete){
    /* A step arrives from the side it lies on, so Back reads as going back. */
    .inquiry.is-stepping{overflow-x:clip}
    .inquiry.is-stepping fieldset{transition:opacity var(--dur-ui) var(--ease-out),translate var(--dur-ui) var(--ease-out)}
    @starting-style{
      .inquiry.is-stepping[data-dir=next] fieldset{opacity:0;translate:var(--travel-lg) 0}
      .inquiry.is-stepping[data-dir=back] fieldset{opacity:0;translate:calc(var(--travel-lg) * -1) 0}
    }
    @media (max-width:760px){
      @starting-style{
        .inquiry.is-stepping[data-dir=next] fieldset{translate:var(--travel) 0}
        .inquiry.is-stepping[data-dir=back] fieldset{translate:calc(var(--travel) * -1) 0}
      }
    }
    /* The wait for the reply is already the pause, so the thanks starts at once; only the heading travels. */
    .inquiry-complete h3{transition:opacity var(--dur-enter) var(--ease-calm),translate var(--dur-enter) var(--ease-calm)}
    .inquiry-complete p,.inquiry-complete button{transition:opacity var(--dur-enter) var(--ease-calm) var(--dur-press)}
    @starting-style{.inquiry-complete h3{opacity:0;translate:0 var(--travel)}.inquiry-complete p,.inquiry-complete button{opacity:0}}
    /* An error fades in where its slot already sits; a shake would read as scolding. */
    .inquiry .form-error > *{transition:opacity var(--dur-quick) var(--ease-out)}
    @starting-style{.inquiry .form-error > *{opacity:0}}
  }
}
@media (prefers-reduced-motion:reduce){
  @supports (transition-behavior:allow-discrete){
    @starting-style{.inquiry.is-stepping fieldset{opacity:0}}
    .inquiry-complete h3,.inquiry-complete p,.inquiry-complete button,.inquiry .form-error > *{transition:opacity var(--dur-quick) var(--ease-out)}
    @starting-style{.inquiry-complete h3,.inquiry-complete p,.inquiry-complete button,.inquiry .form-error > *{opacity:0}}
  }
}
