/* Sales application form mechanics. Brand comes from the page: each careers page
   defines the --app-* tokens below in its own stylesheet. */

.app-form,
.app-done {
  font-family: var(--app-font);
  color: var(--app-ink);
  font-size: 16px;
  line-height: 1.55;
}
.app-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

#application {
  scroll-margin-top: 110px;
}
/* Host sites may style bare <section>; form sections carry their own spacing. */
.app-form section.app-step {
  padding: 0;
  border: 0;
}

/* Progress */
.app-progress ol {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.app-progress li {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--app-muted);
  border-top: 3px solid var(--app-line);
  padding-top: 10px;
}
.app-progress li.is-done {
  border-top-color: var(--app-accent-soft);
  color: var(--app-ink);
}
.app-progress li.is-current {
  border-top-color: var(--app-accent);
  color: var(--app-ink);
}
.app-dot {
  display: none;
}
@media (max-width: 640px) {
  .app-progress ol {
    gap: 4px;
  }
  .app-ptext {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

.app-step-title {
  font-family: var(--app-display);
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.15;
  font-weight: var(--app-display-weight, 700);
  color: var(--app-heading);
  margin: 0 0 22px;
  letter-spacing: -0.01em;
  outline: none;
}
.app-step-count {
  display: block;
  font-family: var(--app-font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--app-accent-text);
  margin-bottom: 8px;
}
.app-intro {
  margin: -8px 0 26px;
  padding: 14px 16px;
  background: var(--app-surface-2);
  border-left: 3px solid var(--app-accent);
  font-size: 15px;
}

/* Fields */
.app-field {
  margin: 0 0 30px;
  padding: 0;
  border: 0;
  min-width: 0;
}
.app-field > label:not(.app-choice),
.app-field > legend,
.app-label {
  display: block;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.4;
  color: var(--app-heading);
  margin: 0 0 6px;
  padding: 0;
}
.app-qnum {
  display: inline-block;
  min-width: 1.6em;
  color: var(--app-accent-text);
  font-variant-numeric: tabular-nums;
}
.app-optional {
  font-weight: 500;
  color: var(--app-muted);
}
.app-help {
  margin: 0 0 10px;
  font-size: 14.5px;
  color: var(--app-muted);
  max-width: 68ch;
}
.app-field input[type='text'],
.app-field input[type='email'],
.app-field input[type='tel'],
.app-field textarea {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--app-ink);
  background: var(--app-input-bg);
  border: 1.5px solid var(--app-input-line);
  border-radius: var(--app-radius);
  padding: 12px 14px;
  min-height: 48px;
  transition:
    border-color 0.15s ease-out,
    box-shadow 0.15s ease-out;
}
.app-field textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}
.app-field input:hover,
.app-field textarea:hover {
  border-color: var(--app-input-line-hover);
}
.app-field input:focus,
.app-field textarea:focus {
  outline: none;
  border-color: var(--app-accent);
  box-shadow: 0 0 0 3px var(--app-focus-ring);
}
.app-field.has-error input[type='text'],
.app-field.has-error input[type='email'],
.app-field.has-error input[type='tel'],
.app-field.has-error textarea {
  border-color: var(--app-error);
}
.app-error {
  margin: 8px 0 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--app-error);
  display: flex;
  gap: 6px;
}
.app-error[hidden] {
  display: none;
}
.app-error::before {
  content: '!';
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--app-error);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.app-count {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--app-muted);
  font-variant-numeric: tabular-nums;
}
.app-count-now.is-near {
  color: var(--app-accent-text);
  font-weight: 700;
}
.app-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}
.app-pair.is-place {
  grid-template-columns: 2fr 1fr;
}
@media (max-width: 640px) {
  .app-pair,
  .app-pair.is-place {
    grid-template-columns: 1fr;
  }
}

/* Choice tiles */
.app-choices {
  display: grid;
  gap: 8px;
}
.app-choices.is-inline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 520px) {
  .app-choices.is-inline {
    grid-template-columns: 1fr;
  }
}
.app-choice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  min-height: 48px;
  background: var(--app-input-bg);
  border: 1.5px solid var(--app-input-line);
  border-radius: var(--app-radius);
  cursor: pointer;
  font-size: 15.5px;
  line-height: 1.4;
  transition:
    border-color 0.15s ease-out,
    background-color 0.15s ease-out;
}
.app-choice:hover {
  border-color: var(--app-input-line-hover);
}
.app-choice input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--app-accent);
}
.app-choice:has(input:checked) {
  border-color: var(--app-accent);
  background: var(--app-selected);
}
.app-choice:has(input:focus-visible) {
  box-shadow: 0 0 0 3px var(--app-focus-ring);
}
.app-choice input:focus-visible {
  outline: 2px solid var(--app-accent);
  outline-offset: 2px;
}
.app-choice.is-exclusive {
  margin-top: 6px;
  border-style: dashed;
}
.app-choice.is-ack {
  font-weight: 600;
}
.app-field.has-error .app-choices .app-choice,
.app-field.has-error .app-choice.is-ack {
  border-color: var(--app-error);
}

/* Experience matrix: stacked tiles on narrow containers, a real grid when there is room */
.app-mgrid {
  container-type: inline-size;
  margin-top: 6px;
}
.app-mhead {
  display: none;
}
.app-mrows {
  display: grid;
  gap: 10px;
}
.app-mrow {
  padding: 14px;
  border: 1.5px solid var(--app-line);
  border-radius: var(--app-radius);
  background: var(--app-surface-2);
  min-width: 0;
}
.app-mrow-name {
  display: block;
  font-weight: 700;
  font-size: 15.5px;
  color: var(--app-heading);
  margin: 0 0 10px;
}
.app-mopts {
  display: grid;
  gap: 8px;
}
.app-choice.is-compact {
  font-size: 14.5px;
  padding: 10px 12px;
}
.app-matrix.has-error .app-mrow:not(:has(input:checked)) {
  border-color: var(--app-error);
}

@container (min-width: 600px) {
  .app-mhead,
  .app-mrow {
    display: grid;
    grid-template-columns: minmax(150px, 1.25fr) repeat(4, minmax(0, 1fr));
  }
  .app-mhead {
    align-items: end;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--app-heading);
  }
  .app-mhead-cell {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--app-heading);
    text-align: center;
    padding: 0 8px;
  }
  .app-mrows {
    gap: 0;
  }
  .app-mrow {
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--app-line);
    border-radius: 0;
    background: transparent;
    align-items: stretch;
  }
  .app-mrow:nth-child(even) {
    background: var(--app-surface-2);
  }
  .app-mrow-name {
    margin: 0;
    padding: 14px 12px 14px 10px;
    font-size: 15px;
    align-self: center;
  }
  .app-mopts {
    display: contents;
  }
  .app-mcell {
    justify-content: center;
    align-items: center;
    min-height: 54px;
    padding: 10px;
    border: 0;
    border-left: 1px solid var(--app-line);
    border-radius: 0;
    background: transparent;
  }
  .app-mcell:hover,
  .app-mcell:has(input:checked) {
    background: var(--app-selected);
  }
  .app-mcell:has(input:checked) {
    border-color: var(--app-line);
  }
  .app-mcell input {
    margin: 0;
    width: 22px;
    height: 22px;
  }
  .app-mcell .app-mcell-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .app-matrix.has-error .app-mrow:not(:has(input:checked)) {
    box-shadow: inset 4px 0 0 var(--app-error);
  }
  .app-matrix.has-error .app-mrow:not(:has(input:checked)) .app-mrow-name {
    color: var(--app-error);
  }
}

/* Long option lists use two columns when the form is wide enough */
.app-form {
  container-type: inline-size;
}
@container (min-width: 640px) {
  .app-choices:not(.is-inline) {
    grid-template-columns: 1fr 1fr;
  }
  .app-choices:not(.is-inline) .app-choice.is-exclusive {
    grid-column: 1 / -1;
  }
}

/* Résumé */
.app-drop {
  position: relative;
}
.app-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.app-drop-label {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  min-height: 76px;
  border: 2px dashed var(--app-input-line);
  border-radius: var(--app-radius);
  background: var(--app-input-bg);
  color: var(--app-ink);
  font-size: 15.5px;
  cursor: pointer;
}
.app-drop-label svg {
  width: 28px;
  height: 28px;
  flex: none;
  color: var(--app-accent-text);
}
.app-drop-label strong {
  color: var(--app-accent-text);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.app-drop.is-over .app-drop-label,
.app-drop:hover .app-drop-label {
  border-color: var(--app-accent);
  background: var(--app-selected);
}
.app-file-input:focus-visible + .app-drop-label {
  border-color: var(--app-accent);
  box-shadow: 0 0 0 3px var(--app-focus-ring);
}
.app-file.has-error .app-drop-label {
  border-color: var(--app-error);
}
@media (hover: none) {
  .app-drop-extra {
    display: none;
  }
}
.app-chosen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: var(--app-radius);
  background: var(--app-selected);
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.app-chosen[hidden] {
  display: none;
}

/* Buttons */
.app-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--app-line);
}
.app-btn {
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  min-height: 50px;
  padding: 12px 22px;
  border-radius: var(--app-radius);
  cursor: pointer;
  border: 2px solid transparent;
  transition:
    background-color 0.15s ease-out,
    border-color 0.15s ease-out,
    transform 0.15s ease-out;
}
.app-btn.is-primary {
  background: var(--app-btn-bg);
  color: var(--app-btn-ink);
  border-color: var(--app-btn-bg);
}
.app-btn.is-primary:hover:not(:disabled) {
  background: var(--app-btn-bg-hover);
  border-color: var(--app-btn-bg-hover);
}
.app-btn.is-secondary {
  background: transparent;
  color: var(--app-heading);
  border-color: var(--app-input-line);
}
.app-btn.is-secondary:hover:not(:disabled) {
  border-color: var(--app-heading);
}
.app-btn:focus-visible,
.app-linkbtn:focus-visible {
  outline: 3px solid var(--app-accent);
  outline-offset: 3px;
}
.app-btn:disabled {
  opacity: 0.65;
  cursor: progress;
}
.app-linkbtn {
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--app-accent-text);
  background: none;
  border: 0;
  padding: 6px 4px;
  min-height: 36px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
@media (max-width: 520px) {
  .app-nav {
    flex-direction: column-reverse;
  }
  .app-nav > span:empty {
    display: none;
  }
  .app-btn {
    width: 100%;
  }
}

/* Messages */
.app-errsum,
.app-status,
.app-restored {
  border-radius: var(--app-radius);
  padding: 16px 18px;
  margin: 0 0 24px;
  outline: none;
}
.app-errsum,
.app-status {
  border: 2px solid var(--app-error);
  background: var(--app-error-bg);
}
.app-errsum:focus,
.app-status:focus {
  box-shadow: 0 0 0 3px var(--app-focus-ring);
}
.app-errsum h4 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--app-error);
}
.app-errsum ul {
  margin: 0;
  padding-left: 20px;
  font-size: 15px;
}
.app-errsum a {
  color: var(--app-error);
  font-weight: 700;
}
.app-status p {
  margin: 0;
}
.app-status.is-info {
  border-color: var(--app-heading);
  background: var(--app-surface-2);
}
.app-restored {
  background: var(--app-surface-2);
  border: 1px solid var(--app-line);
  font-size: 15px;
}
.app-notice {
  font-size: 14.5px;
  color: var(--app-muted);
  margin: 0 0 18px;
}
.app-notice p {
  margin: 0;
}
.app-notice strong {
  color: var(--app-heading);
}

/* Review */
.app-sum-sec {
  border: 1.5px solid var(--app-line);
  border-radius: var(--app-radius);
  padding: 16px 18px;
  margin: 0 0 14px;
  background: var(--app-input-bg);
}
.app-sum-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.app-sum-head h4 {
  margin: 0;
  font-size: 17px;
  color: var(--app-heading);
}
.app-sum-sec dl {
  margin: 0;
}
.app-sum-sec dl > div {
  padding: 10px 0;
  border-top: 1px solid var(--app-line);
}
.app-sum-sec dt {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--app-muted);
  margin-bottom: 3px;
}
.app-sum-sec dd {
  margin: 0;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.app-sum-sec dd ul {
  margin: 0;
  padding-left: 18px;
}
.app-sum-matrix {
  list-style: none;
  padding: 0 !important;
}
.app-sum-matrix li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 12px;
  padding: 3px 0;
}
.app-sum-matrix li span:first-child {
  font-weight: 600;
}
@media (max-width: 520px) {
  .app-sum-matrix li {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 5px 0;
  }
}
.app-pre {
  white-space: pre-wrap;
}
.app-muted {
  color: var(--app-muted);
}

/* Receipt */
.app-done {
  border: 2px solid var(--app-accent);
  border-radius: var(--app-radius);
  background: var(--app-input-bg);
  padding: 28px;
}
.app-done h3 {
  font-family: var(--app-display);
  font-size: 28px;
  margin: 0 0 12px;
  color: var(--app-heading);
  outline: none;
}
.app-done p {
  margin: 0 0 18px;
  max-width: 64ch;
}
.app-receipt {
  margin: 0;
  display: grid;
  gap: 0;
}
.app-receipt > div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--app-line);
}
.app-receipt dt {
  font-weight: 700;
  color: var(--app-muted);
  font-size: 14px;
}
.app-receipt dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.app-receipt .tabular {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
@media (max-width: 520px) {
  .app-receipt > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-form *,
  .app-done * {
    transition: none !important;
  }
}
