/*
 * Job application (/form/application-new-hire, webform application_new_hire):
 * design 5 "Conversational", shown one section at a time
 * (tmp/application-form-designs.html). Without JavaScript the whole form is
 * one page with every section open. js/application-form.js adds .apply--flow,
 * which shows one section (its .webform-flexbox rows) at a time. Scoped to form.apply
 * because templates/form/ and css/auth.css are shared with the account forms.
 */

/* ---------- One page (no JavaScript) ---------- */
.apply {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  font-family: var(--mui-font);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.apply__hello {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid #2a2a2a;
}
.wrapper .apply .field--markup-01 h4 {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}
.apply .field--markup-01 strong { font-weight: inherit; }
.wrapper .apply__title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.15;
}
.wrapper .apply__lede {
  max-width: 62ch;
  margin-top: 8px;
  color: #c4c4c4;
}
.apply__lede-flow { display: none; }
.apply__star,
.apply .field__label--required::after,
.apply .form-required::after {
  content: '*';
  display: inline;
  width: auto;
  height: auto;
  margin-left: 3px;
  background: none;
  color: #ff6b6d;
  font-weight: 700;
  vertical-align: baseline;
}

/* Sections: the webform's details elements, open, with the summary as heading. */
.apply details { margin: 0 0 8px; }
.apply summary {
  margin: 0 0 14px;
  padding: 18px 0 0;
  border-top: 1px solid #2a2a2a;
  color: #f7f7f7;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
}
.apply details:first-of-type > summary { padding-top: 0; border-top: 0; }
.apply summary:focus-visible { outline: 2px solid var(--primary-hover); outline-offset: 2px; }
/* Headings for the repeated blocks and the top-level Availability rows. */
.apply [data-apply-heading]::before {
  content: attr(data-apply-heading);
  display: block;
  width: 100%;
  margin: 6px 0 12px;
  color: #a6a6a6;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.apply .apply__block-start:not(summary + *) {
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid #2e2e2e;
}
.apply #edit-flexbox-41::before {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #2a2a2a;
  color: #f7f7f7;
  font-size: 1.25rem;
  letter-spacing: 0;
  text-transform: none;
}

/* Fields. css/auth.css, which also lays out .field and .auth-button, loads
   only for anonymous visitors (login drawer), so the form sets its own base. */
.apply .webform-flex { min-width: 0; }
.apply .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 0 0 16px;
}
.apply .field .field { margin: 0; }
.apply .field__label,
.apply legend {
  padding: 0;
  color: #ededed;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: normal;
  overflow: visible;
}
.apply fieldset {
  min-width: 0;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}
.apply legend { margin-bottom: 6px; }
/* Radios render either in a fieldset or in a .field--radios div whose inline
   style (from the webform definition) sets display: inline-block. */
.apply .field--radios { display: flex !important; }
.apply .form-text,
.apply .form-email,
.apply .form-tel,
.apply .form-date,
.apply .form-textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #767676;
  border-radius: 8px;
  box-shadow: none;
  background: #1e1e1e;
  color: #f7f7f7;
  color-scheme: dark;
  font: inherit;
}
.apply .form-textarea {
  display: block;
  min-height: 88px;
  resize: vertical;
}
.apply .form-text:hover,
.apply .form-tel:hover,
.apply .form-date:hover,
.apply .form-textarea:hover { box-shadow: none; border-color: #a6a6a6; }
.apply .form-text:focus-visible,
.apply .form-tel:focus-visible,
.apply .form-date:focus-visible,
.apply .form-textarea:focus-visible {
  outline: 2px solid var(--primary-hover);
  outline-offset: 2px;
  border-color: var(--primary);
  box-shadow: none;
}
.apply .error,
.apply .field--error .form-text { border-color: #ff6b6d; }
.apply .field__help {
  color: #a6a6a6;
  font-size: 0.8125rem;
}

/* Yes/No options as bordered choices. */
.apply .js-webform-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.apply .field--radio {
  position: relative;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 0 14px 0 10px;
  border: 1px solid #3d3d3d;
  border-radius: 8px;
  background: #1a1a1a;
}
.apply .field--radio .field__label {
  color: #f7f7f7;
  font-size: 0.9375rem;
  font-weight: 400;
  cursor: pointer;
}
.apply .form-radio {
  appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 2px solid #8c8c8c;
  border-radius: 50%;
  cursor: pointer;
}
.apply .form-radio:checked {
  border-color: var(--primary);
  background: radial-gradient(var(--primary) 0 42%, transparent 46%);
}
.apply .field--radio:has(.form-radio:checked) { border-color: var(--primary); background: #152625; }
.apply .form-radio:focus-visible { outline: 2px solid var(--primary-hover); outline-offset: 3px; }

/* ID upload: the file input as a dashed drop area. */
.apply .form-managed-file {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.apply .form-file {
  flex: 1 1 100%;
  min-width: 0;
  padding: 18px 14px;
  border: 1.5px dashed #767676;
  border-radius: 10px;
  background: #1a1a1a;
  color: #a6a6a6;
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}
.apply .form-file::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #0d0d0d;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.apply .form-file:focus-visible { outline: 2px solid var(--primary-hover); outline-offset: 2px; }
.apply .form-managed-file a { color: var(--primary); }

/* Buttons: Apply (primary), Upload/Remove (secondary). */
.apply .auth-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: auto;
  border: 0;
  background: var(--primary);
  font: inherit;
  line-height: 1.75;
  cursor: pointer;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 10px;
  font-weight: 700;
  text-transform: none;
}
.apply .webform-button--submit {
  width: 100%;
  margin-top: 20px;
  color: #0d0d0d;
  font-size: 1rem;
}
.apply .webform-button--submit:hover { background: var(--primary-hover); }
.apply .form-managed-file .auth-button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #767676;
  background: transparent;
  color: #f7f7f7;
  font-weight: 600;
}
.apply .auth-button:focus-visible { outline: 2px solid var(--primary-hover); outline-offset: 2px; }
/* A submit is in flight (js/application-form.js): other submit buttons wait. */
.apply[data-busy] button[type="submit"]:not([aria-busy="true"]) { opacity: 0.5; pointer-events: none; }
.apply .auth-button .spinner { margin-right: 10px; }

/* Disclaimer text before the signature date. */
.apply .field--markup {
  display: block;
  width: 100%;
  margin: 18px 0 16px;
  padding: 14px 16px;
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  background: #1a1a1a;
  color: #d6d6d6;
  font-size: 0.875rem;
}
.apply .field--markup strong { color: #f7f7f7; letter-spacing: 0.06em; }

@media (min-width: 768px) {
  .apply { padding: 36px 40px 56px; }
  .wrapper .apply__title { font-size: 2.5rem; }
  .apply .webform-flexbox { display: flex; flex-wrap: wrap; column-gap: 18px; }
  .apply .webform-flex { flex: 1 1 0; }
  .apply .webform-flex--2 { flex-grow: 2; }
  .apply .webform-flex--3 { flex-grow: 3; }
  .apply .webform-button--submit { width: auto; min-width: 240px; }
}

/* ---------- One section at a time (JavaScript) ---------- */
.apply--flow .apply__lede-flow { display: inline; }
/* The section title shows in .apply-q__head instead. */
.apply--flow summary,
.apply--flow #edit-flexbox-41::before { display: none; }
.apply--flow details { margin: 0; }
.apply--flow details:not(.is-current),
.apply--flow .webform-flexbox[data-apply-section]:not(.is-current),
.apply--flow .webform-actions:not(.is-current),
.apply--flow .form-managed-file .js-hide { display: none; }
.apply--flow .apply__block-start:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.apply--flow .webform-actions.is-current { display: inline-flex; margin-left: auto; }
.apply-q__head [hidden],
.apply-q__nav [hidden] { display: none; }
.apply--flow .webform-button--submit { width: auto; margin: 0; }
.apply-q__head { scroll-margin-top: 24px; }
.apply-q__bar {
  height: 4px;
  margin-bottom: 14px;
  border-radius: 2px;
  background: #2e2e2e;
}
.apply-q__bar i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--primary);
}
.wrapper .apply-q__ctx {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: #a6a6a6;
  font-size: 0.8125rem;
}
.apply-q__ctx [data-optional] {
  padding: 0 8px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  color: var(--primary-hover);
  font-weight: 600;
}
.wrapper .apply-q__title {
  margin: 0 0 20px;
  color: #f7f7f7;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}
.apply-q__title:focus { outline: none; }
.wrapper .apply-q__note {
  margin: -12px 0 20px;
  color: #a6a6a6;
}
/* A required question left blank when Next or Apply was pressed. */
.apply--flow .is-missing :is(.form-text, .form-email, .form-tel, .form-date, .form-textarea, .form-file),
.apply--flow .is-missing .field--radio { border-color: #ff6b6d; }
.apply--flow .is-missing .webform-flex--container::after {
  content: 'This question is required.';
  display: block;
  margin: -8px 0 16px;
  color: #ff8a8c;
  font-size: 0.8125rem;
}
.apply-q__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 20px;
  border-top: 1px solid #2a2a2a;
}
.apply-q__next,
.apply-q__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.apply-q__next { margin-left: auto; border: 0; background: var(--primary); color: #0d0d0d; }
.apply-q__next:hover { background: var(--primary-hover); }
.apply-q__back {
  border: 1px solid #767676;
  background: transparent;
  color: #f7f7f7;
}
.apply-q__next .icon,
.apply-q__back .icon { font-size: 20px; }
.apply-q__next:focus-visible,
.apply-q__back:focus-visible,
.apply-outline button:focus-visible { outline: 2px solid var(--primary-hover); outline-offset: 2px; }
.wrapper .apply-q__error {
  flex-basis: 100%;
  margin: 0;
  color: #ff8a8c;
  font-size: 0.875rem;
}

/* Outline: every section is a button that opens it. On phones a scrolling row. */
.wrapper .apply-outline__head { display: none; }
.apply-outline ol {
  display: flex;
  gap: 8px;
  margin: 0 -16px 20px;
  padding: 0 16px 4px;
  overflow-x: auto;
  list-style: none;
  counter-reset: apply-section;
}
.apply-outline li { flex: none; counter-increment: apply-section; }
.apply-outline button {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  min-height: 44px;
  padding: 6px 12px 6px 8px;
  border: 1px solid #3d3d3d;
  border-radius: 10px;
  background: #1a1a1a;
  color: #a6a6a6;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.apply-outline button::before {
  content: counter(apply-section);
  grid-row: span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid #555;
  border-radius: 50%;
  font-size: 0.75rem;
}
.apply-outline button span { color: #d6d6d6; font-weight: 600; white-space: nowrap; }
.apply-outline button small { font-size: 0.75rem; white-space: nowrap; }
.apply-outline button:hover span { color: #f7f7f7; }
.apply-outline li.is-current button { border-color: var(--primary); }
.apply-outline li.is-current span { color: var(--primary-hover); }
.apply-outline li.is-current button::before { border-color: var(--primary); background: var(--primary); color: #0d0d0d; }
.apply-outline li.is-done button::before { content: '\2713'; border-color: var(--primary); color: var(--primary); }

@media (min-width: 768px) {
  .apply.apply--flow {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    column-gap: 48px;
    align-content: start;
    max-width: 1200px;
    margin: 40px auto 56px;
    padding: 0 24px;
  }
  .apply--flow > :not(.apply-outline) { grid-column: 2; }
  .apply--flow .apply__hello {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .apply--flow > [data-drupal-selector="edit-container"] { max-width: 820px; padding: 8px 0 24px; }
  .apply-outline {
    grid-column: 1;
    grid-row: 1 / span 20;
    align-self: start;
    position: sticky;
    top: 24px;
    padding: 28px 20px;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    background: #161616;
  }
  .wrapper .apply-outline__head {
    display: block;
    margin: 0 0 10px 8px;
    color: #a6a6a6;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  .apply-outline ol { flex-direction: column; gap: 6px; margin: 0; padding: 0; overflow: visible; }
  .apply-outline button {
    width: 100%;
    padding: 8px;
    border-color: transparent;
    background: transparent;
  }
  .apply-outline button span { white-space: normal; }
  .apply-outline button:hover { background: #1e1e1e; }
  .apply-outline li.is-current button { border-color: transparent; background: #1e1e1e; }
  .wrapper .apply-q__title { font-size: 2rem; }
}
