/* Hire Us page (/hire-us/). Loaded only by hire-us/index.html, after application.css and orangecard.css.
   Inputs, radios and buttons come from the main stylesheet; this file only lays out the one-question-per-step form. */

.hire-us-form {
  max-width: 36rem;
}

.hire-us-form__progress {
  color: var(--color--text-dimmed);
  font-family: var(--font-family--form-label);
  font-size: 0.875rem;
  letter-spacing: var(--letter-spacing--label);
  margin-bottom: 1.75rem;
}

/* Progress bar above the step counter, like thoughtbot's: a 3px grey track filling with the brand colour. */
.hire-us-form__progress-bar {
  background-color: var(--color--gray-500);
  border-radius: 1.5px;
  height: 3px;
  margin-bottom: var(--spacing--x-small);
  overflow: hidden;
}

.hire-us-form__progress-fill {
  background-color: var(--color--button-background);
  border-radius: 1.5px;
  height: 100%;
  transition: width 300ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .hire-us-form__progress-fill {
    transition: none;
  }
}

/* The question is the label (or legend, for the choice step): bold monospace, like thoughtbot's, a little larger. */
.hire-us-form__question {
  color: var(--color--text);
  display: block;
  font-family: var(--font-family--form-label);
  font-size: 1.25rem;
  font-weight: var(--font-weight--bold);
  letter-spacing: normal;
  line-height: 1.35;
  margin-bottom: 1.125rem;
  padding: 0;
}

.hire-us-form__required {
  color: var(--color--text-accent);
  margin-left: 0.15em;
}

.hire-us-form__step input:not([type="radio"]) {
  font-size: 1rem;
  height: 48px;
  margin-bottom: var(--spacing--x-small);
}

.hire-us-form__step textarea {
  font-size: 1rem;
  line-height: 1.4;
  margin-bottom: var(--spacing--x-small);
  min-height: 8rem;
  resize: vertical;
  width: 100%;
}

.hire-us-form__step textarea[aria-invalid="true"] {
  border-bottom-color: var(--color--background-error);
}

.hire-us-form__step input[aria-invalid="true"] {
  border-bottom-color: var(--color--background-error);
}

.hire-us-form__fieldset {
  border: 0;
  margin: 0;
  min-width: 0;
  padding: 0;
}

/* Choice step, matching thoughtbot's budget question: options sit side by side and wrap, each in a thin bordered box
   with a round radio drawn in CSS. Colours are the site's own greys (#928a85 border, #eae6e4 on hover). */
.hire-us-form__options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hire-us-option {
  align-items: center;
  border: 1px solid var(--color--gray-400);
  border-radius: 5px;
  color: var(--color--text);
  cursor: pointer;
  display: grid;
  font-family: var(--font-family--body);
  font-size: 1rem;
  gap: 0.75rem;
  grid-template-columns: 1.25rem auto;
  letter-spacing: normal;
  line-height: 1.4;
  margin: 0;
  padding: 0.5rem;
  transition: border-color 150ms ease-in-out;
}

/* Long option labels (the state-of-product and help-needed questions) get a full-width box, like thoughtbot's. */
.hire-us-option--wide {
  flex-basis: 100%;
}

.hire-us-option:hover {
  border-color: var(--color--gray-200);
}

.hire-us-option input[type="radio"] {
  -webkit-appearance: none;
          appearance: none;
  background-color: var(--color--gray-700);
  border: 1px solid var(--color--gray-400);
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  height: 1.25rem;
  margin: 0;
  place-content: center;
  width: 1.25rem;
}

.hire-us-option input[type="radio"]::before {
  background-color: var(--color--button-background);
  border-radius: 50%;
  content: "";
  height: 0.625rem;
  transform: scale(0);
  transition: transform 150ms ease-in-out;
  width: 0.625rem;
}

.hire-us-option input[type="radio"]:checked::before {
  transform: scale(1);
}

.hire-us-option input[type="radio"]:focus-visible {
  outline: 2px solid var(--color--button-background);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .hire-us-option,
  .hire-us-option input[type="radio"]::before {
    transition: none;
  }
}

.hire-us-form__other {
  margin-top: 1.5rem;
}

/* "Please describe": bold monospace, like the question, a size smaller. */
.hire-us-form__other label {
  color: var(--color--text);
  font-size: 1rem;
  font-weight: var(--font-weight--bold);
  letter-spacing: normal;
  margin-bottom: 1rem;
  padding-left: 0;
}

.hire-us-form__hint,
.hire-us-form__error {
  font-family: var(--font-family--form-label);
  font-size: 0.8rem;
  letter-spacing: var(--letter-spacing--label);
}

.hire-us-form__hint {
  color: var(--color--text-dimmed);
}

/* Errors stay red, as everywhere else on the site. */
.hire-us-form__error {
  color: var(--color--background-error);
}

/* Phones and tablets have no Enter key to point at; the Continue button does the job. */
@media (hover: none) and (pointer: coarse) {
  .hire-us-form__hint {
    display: none;
  }
}

.hire-us-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing--small);
  margin-top: 2.25rem;
}

/* Continue/Submit sits on the right, also on step 1 where there is no Back button. */
.hire-us-form__continue {
  margin-left: auto;
}

/* Each new question fades in. */
.hire-us-form__step {
  animation: hire-us-step-in 200ms ease-out;
}

@keyframes hire-us-step-in {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hire-us-form__step {
    animation: none;
  }
}

/* Thank-you state. It takes focus when it appears, so screen readers announce it; no focus ring on a non-control. */
.hire-us-form--done:focus {
  outline: none;
}

.hire-us-form--done p {
  margin-bottom: var(--spacing--base);
}

.hire-us-form__fallback {
  color: var(--color--text-dimmed);
}

/* Illustration in the right half. Decorative: on narrow screens it would only sit below the form, so it is hidden.
   The drawing starts 49/708 (6.92%) of the image's width below its top edge; pulling the figure up by that much
   (a % margin scales with the column width) puts the tip of the top block level with the centre of the progress bar. */
.hire-us__illustration {
  margin: 0;
  margin-top: calc(1.5px - 6.92%);
}

.hire-us__illustration img {
  display: block;
  width: 100%;
}

@media (max-width: 49.99em) {
  .hire-us__illustration {
    display: none;
  }
}

/* Under the error when an enquiry couldn't be sent: the email alternative and "Copy my answers". */
.hire-us-form__step .hire-us-form__fallback {
  font-size: 0.9rem;
  margin-top: var(--spacing--small);
}

.hire-us-form__step .hire-us-form__fallback p {
  margin-bottom: var(--spacing--small);
}
