/* ==========================================================================
   client-form.css - the client rates form (/client-form)
   Builds on form.css: the fields, upload box and submit button are the
   enquiry form's. This adds the steps, the rate rows and the step buttons.
   ========================================================================== */

.client-intro {
  max-width: 750px;
  margin: calc(-1 * var(--space-3)) auto var(--space-4);
  color: var(--on-dark-dim);
  text-align: center;
}

/* --- steps ---------------------------------------------------------------- */

.client-step {
  min-width: 0;
  border: 0;
}

/* Without script all three steps show at once; this spaces them apart. */
.client-step + .client-step {
  margin-top: var(--space-5);
}

/* Focused by initClientForm() so a screen reader announces the new step. */
.client-step:focus {
  outline: none;
}

.client-step__title {
  margin-bottom: var(--space-3);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
}

.client-step__hint {
  margin-bottom: var(--space-3);
  color: var(--on-dark-dim);
  font-size: var(--text-sm);
}

/* --- rate rows ------------------------------------------------------------ */

.rate-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.rate-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  white-space: nowrap;
  cursor: pointer;
}

/* Undo the text-field styling form.css gives every input. */
.contact-form .rate-sub input {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--paper);
  cursor: pointer;
}

/* form.css sets outline: none on every input, and a checkbox has no caret to
   fall back on. */
.contact-form .rate-sub input:focus-visible {
  outline: 2px solid var(--line);
  outline-offset: 2px;
}

.add-row {
  display: block;
  margin: var(--space-3) auto 0;
  padding: 8px var(--space-3);
  border: 1px solid var(--muted-soft);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--on-dark);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: var(--transition);
}

.add-row:hover {
  border-color: var(--paper);
}

.client-extras {
  margin-top: var(--space-4);
}

/* Number spinners crowd the placeholder and invite accidental changes. */
.client-extras input[type="number"] {
  appearance: textfield;
}

/* --- step buttons --------------------------------------------------------- */

.step-nav {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.step-nav > * {
  flex: 1;
}

.step-nav[hidden],
.step-btn[hidden],
.add-row[hidden] {
  display: none;
}

/* Mirrors .submit-btn in form.css. A separate class because wireContactForm()
   in main.js treats the first .submit-btn in the form as the send button. */
.step-btn {
  padding: 12px;
  border: 1px solid var(--muted-soft);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--paper);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.step-btn:hover {
  border-color: var(--paper);
}

.client-form .cf-turnstile {
  margin-top: var(--space-3);
}

@media (max-width: 767px) {
  .client-intro {
    padding-inline: 15px;
  }

  .rate-row {
    grid-template-columns: 1fr 1fr;
    margin-bottom: var(--space-3);
  }

  .rate-sub {
    grid-column: 1 / -1;
  }
}
