/*
  recruitment.css
  Page-level layout for the multi-step application form's structural
  chrome (progress bar, step container, nav buttons, success state) —
  it's embedded on the Careers page (components/recruitment-form.html)
  now, which has its own hero, so there's no separate recruitment-hero
  styling here any more. Field/input/choice styling itself lives in
  recruitment-form.css — this file is everything around the fields,
  not the fields.
*/

/* ---- Form section shell ---- */
.comrade-recruitment-form-section {
  background-color: var(--comrade-surface-deep);
  /* Tracks the same --comrade-navbar-height token the navbar itself
     uses (110px desktop, 100px tablet/mobile — see variables.css /
     responsive.css), plus a little breathing room, rather than a
     second hardcoded number that could quietly drift out of sync with
     the navbar's real height. Always uses the *un-scrolled* height
     (the taller of the navbar's two states), so the target clears the
     navbar whichever state it happens to be in when this is reached —
     scroll-margin-top can't itself react to that toggle. */
  scroll-margin-top: calc(var(--comrade-navbar-height) + 16px);
}

.comrade-recruitment-form-section__inner {
  max-width: 1050px;
  margin-inline: auto;
}

.comrade-recruitment-form {
  background-color: var(--comrade-surface-soft);
  border: 1px solid var(--comrade-border);
  border-radius: var(--comrade-radius-lg);
  padding: var(--comrade-space-lg);
  box-shadow: 0 24px 48px var(--comrade-shadow-soft);
}

/* ---- Progress ---- */
.comrade-recruitment-progress {
  margin-bottom: var(--comrade-space-lg);
}

.comrade-recruitment-progress__bar {
  position: relative;
  height: 4px;
  border-radius: var(--comrade-radius-pill);
  background-color: var(--comrade-border);
  overflow: hidden;
}

.comrade-recruitment-progress__fill {
  position: absolute;
  inset: 0;
  width: 12.5%;
  background-color: var(--comrade-primary);
  border-radius: var(--comrade-radius-pill);
  transform-origin: left;
  transition: width var(--comrade-transition-normal);
}

.comrade-recruitment-progress__steps {
  display: none;
  margin-top: var(--comrade-space-sm);
  gap: var(--comrade-space-xs);
}

.comrade-recruitment-progress__step {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
}

.comrade-recruitment-progress__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  background-color: var(--comrade-surface);
  border: 1px solid var(--comrade-border);
  color: var(--comrade-text-muted);
  transition: background-color var(--comrade-transition-normal),
    border-color var(--comrade-transition-normal),
    color var(--comrade-transition-normal);
}

.comrade-recruitment-progress__title {
  display: none;
  font-size: 0.7rem;
  color: var(--comrade-text-muted);
  white-space: nowrap;
}

.comrade-recruitment-progress__step.is-current .comrade-recruitment-progress__number {
  background-color: var(--comrade-primary);
  border-color: var(--comrade-primary);
  color: var(--comrade-text-on-primary);
}

.comrade-recruitment-progress__step.is-complete .comrade-recruitment-progress__number {
  border-color: var(--comrade-primary);
  color: var(--comrade-primary);
}

@media (min-width: 900px) {
  .comrade-recruitment-progress__steps {
    display: flex;
  }
}

/* ---- Step content ---- */
.comrade-recruitment-step {
  border: none;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.comrade-recruitment-step__eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--comrade-primary);
}

.comrade-recruitment-step__title {
  margin-top: 0.3rem;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--comrade-text);
}

.comrade-recruitment-step__intro {
  margin-top: 0.4rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--comrade-text-muted);
}

.comrade-recruitment-step__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--comrade-space-md);
  margin-top: var(--comrade-space-lg);
}

/* The acknowledgement checkboxes on the final step, set off from the
   fields above them — this used to be an inline style="" attribute,
   which this site's CSP (style-src 'self', no unsafe-inline) silently
   drops, so it was never actually rendering. */
.comrade-recruitment-step__fields--ack {
  margin-top: var(--comrade-space-xl);
  border-top: 1px solid var(--comrade-border);
  padding-top: var(--comrade-space-xl);
}

/* Smooth step transitions: opacity + a small rise, not a slide or
   anything more elaborate — a multi-step form should feel calm, not
   showy. [hidden] is toggled by recruitment-form.js; is-entering
   drives the transition immediately after that. */
.comrade-recruitment-step {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--comrade-transition-normal), transform var(--comrade-transition-normal);
}

.comrade-recruitment-step.is-entering {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .comrade-recruitment-step {
    transition: opacity var(--comrade-transition-fast);
    transform: none;
  }
}

/* ---- Nav buttons ---- */
.comrade-recruitment-form__submit-error {
  margin-top: var(--comrade-space-md);
  padding: var(--comrade-space-sm) var(--comrade-space-md);
  background-color: var(--comrade-primary-light);
  border: 1px solid var(--comrade-primary);
  border-radius: var(--comrade-radius-md);
  color: var(--comrade-primary);
  font-size: 0.9rem;
}

.comrade-recruitment-form__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--comrade-space-sm);
  margin-top: var(--comrade-space-xl);
  padding-top: var(--comrade-space-lg);
  border-top: 1px solid var(--comrade-border);
}

.comrade-recruitment-form__back {
  margin-right: auto;
}

.comrade-recruitment-form__next,
.comrade-recruitment-form__submit {
  margin-left: auto;
}

.comrade-recruitment-form__submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none !important;
}

/* ---- Success state ---- */
.comrade-recruitment-success {
  text-align: center;
  padding: var(--comrade-space-xl) var(--comrade-space-lg);
  background-color: var(--comrade-surface-soft);
  border: 1px solid var(--comrade-border);
  border-radius: var(--comrade-radius-lg);
  box-shadow: 0 24px 48px var(--comrade-shadow-soft);
}

.comrade-recruitment-success__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: var(--comrade-surface);
  border: 1px solid var(--comrade-border);
  color: var(--comrade-primary);
  box-shadow: var(--comrade-neumo-raised);
}

.comrade-recruitment-success__icon svg {
  width: 28px;
  height: 28px;
}

.comrade-recruitment-success__title {
  margin-top: var(--comrade-space-md);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--comrade-text);
}

.comrade-recruitment-success__message {
  max-width: 480px;
  margin: var(--comrade-space-sm) auto 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--comrade-text-muted);
}

@media (max-width: 576px) {
  .comrade-recruitment-form {
    padding: var(--comrade-space-md);
  }

  .comrade-recruitment-step__fields {
    grid-template-columns: 1fr;
  }

  .comrade-recruitment-form__nav {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .comrade-recruitment-form__back,
  .comrade-recruitment-form__next,
  .comrade-recruitment-form__submit {
    margin: 0;
    justify-content: center;
  }
}
