/*
 * stepper.css — ANZ v3 Checkout Stepper Component
 *
 * Namespace: .anz-v3-stepper
 * Covers: checkout progress indicator (IA spec §7 KEEP-MODIFY)
 * All selectors scoped: body.anz-v3 .anz-v3-stepper*
 * No hex values — var(--...) only.
 *
 * Phase 4 pages: checkout (DIGITAL-6480)
 * Disposition: KEEP-MODIFY per IA spec §7 — conservative Pacific Blue / Grey,
 *   no illustration, horizontal desktop, condensed step-indicator on mobile.
 * Provenance: plan §4.1, IA spec §7 aspirational-tag disposition table
 */


/* ===================================================================
 * STEPPER WRAPPER — horizontal on desktop
 * =================================================================== */

body.anz-v3 .anz-v3-stepper {
  align-items: flex-start;
  counter-reset: stepper-step;
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-8);
  padding: var(--space-6) 0;
  position: relative;
  width: 100%;
}

/* Connecting line behind steps */
body.anz-v3 .anz-v3-stepper::before {
  background-color: var(--border);
  content: "";
  height: 2px;
  left: 10%;
  position: absolute;
  top: calc(var(--space-6) + 16px);
  width: 80%;
}


/* ===================================================================
 * STEP ITEM
 * =================================================================== */

body.anz-v3 .anz-v3-stepper__step {
  align-items: center;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-2);
  position: relative;
  text-align: center;
}


/* ===================================================================
 * STEP INDICATOR (numbered circle)
 * =================================================================== */

body.anz-v3 .anz-v3-stepper__indicator {
  align-items: center;
  background-color: var(--anz-grey-2);
  border: 2px solid var(--anz-grey-3);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  display: flex;
  font-size: var(--type-body-s-size);
  font-weight: var(--font-weight-medium);
  height: 32px;
  justify-content: center;
  position: relative;
  transition:
    background-color var(--motion-standard) var(--motion-exit),
    border-color var(--motion-standard) var(--motion-exit),
    color var(--motion-standard) var(--motion-exit);
  width: 32px;
  z-index: 1;
}

body.anz-v3 .anz-v3-stepper__step--active .anz-v3-stepper__indicator {
  background-color: var(--anz-pacific-blue);
  border-color: var(--anz-pacific-blue);
  color: var(--text-on-primary);
}

body.anz-v3 .anz-v3-stepper__step--complete .anz-v3-stepper__indicator {
  background-color: var(--anz-pacific-blue);
  border-color: var(--anz-pacific-blue);
  color: var(--text-on-primary);
}

/* Checkmark for completed steps */
body.anz-v3 .anz-v3-stepper__step--complete .anz-v3-stepper__indicator::after {
  content: "✓";
  font-size: var(--type-body-s-size);
}


/* ===================================================================
 * STEP LABEL
 * =================================================================== */

body.anz-v3 .anz-v3-stepper__label {
  color: var(--text-muted);
  font-size: var(--type-body-s-size);
  font-weight: var(--font-weight-regular);
  line-height: var(--type-body-s-lh);
  max-width: 80px;
  transition: color var(--motion-standard) var(--motion-exit);
}

body.anz-v3 .anz-v3-stepper__step--active .anz-v3-stepper__label {
  color: var(--anz-pacific-blue);
  font-weight: var(--font-weight-medium);
}

body.anz-v3 .anz-v3-stepper__step--complete .anz-v3-stepper__label {
  color: var(--text-secondary);
}


/* ===================================================================
 * CONNECTING LINE — between steps (progress fill)
 * =================================================================== */

body.anz-v3 .anz-v3-stepper__step--complete::after {
  background-color: var(--anz-pacific-blue);
  content: "";
  height: 2px;
  left: 50%;
  position: absolute;
  top: calc(var(--space-6) + 16px - 1px);
  width: 100%;
  z-index: 0;
}

body.anz-v3 .anz-v3-stepper__step:last-child::after {
  display: none;
}


/* ===================================================================
 * MOBILE — condensed "Step N of M" indicator
 * =================================================================== */

body.anz-v3 .anz-v3-stepper__mobile-label {
  display: none;
}

@media (max-width: 768px) {
  body.anz-v3 .anz-v3-stepper {
    flex-direction: column;
    padding: var(--space-4);
  }

  body.anz-v3 .anz-v3-stepper::before {
    display: none;
  }

  body.anz-v3 .anz-v3-stepper__step {
    display: none;
  }

  body.anz-v3 .anz-v3-stepper__step--active {
    display: flex;
    flex-direction: row;
    gap: var(--space-3);
    text-align: left;
    width: 100%;
  }

  body.anz-v3 .anz-v3-stepper__step--active .anz-v3-stepper__label {
    max-width: none;
  }

  body.anz-v3 .anz-v3-stepper__mobile-label {
    color: var(--text-muted);
    display: block;
    font-size: var(--type-caption-size);
    margin-bottom: var(--space-2);
    text-align: center;
  }
}


/* ===================================================================
 * REDUCED MOTION
 * =================================================================== */

@media (prefers-reduced-motion: reduce) {
  body.anz-v3 .anz-v3-stepper__indicator,
  body.anz-v3 .anz-v3-stepper__label {
    transition: none;
  }
}
