/* Modern order step counter */
:root {
  --ms-accent: #00bfa5;
  --ms-accent-dark: #0d9488;
  --ms-done: #0f766e;
  --ms-muted: #94a3b8;
  --ms-line: #e2e8f0;
  --ms-bg: #ffffff;
  --ms-soft: rgba(0, 191, 165, .1);
  --ms-text: #0f172a;
  --ms-shadow: 0 10px 30px rgba(15, 23, 42, .08);
}

.modern-stepper,
#general-step.modern-stepper {
  width: 100%;
  max-width: 100%;
}

.modern-stepper-card {
  background: linear-gradient(180deg, #fff 0%, #f8fffd 100%);
  border: 1px solid rgba(15, 23, 42, .06);
  border-radius: 18px;
  box-shadow: var(--ms-shadow);
  padding: 1rem .85rem 1.1rem;
  position: relative;
  overflow: hidden;
}

.modern-stepper-card::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ms-accent), #34d399 55%, #67e8f9);
}

.modern-stepper-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .85rem;
  padding: 0 .25rem;
}

.modern-stepper-head strong {
  font-size: .82rem;
  color: var(--ms-text);
  font-weight: 700;
}

.modern-stepper-count {
  font-size: .72rem;
  color: var(--ms-accent-dark);
  background: var(--ms-soft);
  border: 1px solid rgba(0, 191, 165, .22);
  border-radius: 999px;
  padding: .2rem .55rem;
  font-weight: 700;
  white-space: nowrap;
}

.modern-stepper-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--ms-line);
  overflow: hidden;
  margin: 0 .25rem .95rem;
}

.modern-stepper-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ms-accent-dark), var(--ms-accent));
  transition: width .35s ease;
}

.modern-stepper-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  counter-reset: ms-step;
}

.modern-stepper-list > li {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: .65rem;
  align-items: start;
  padding: .35rem .2rem .35rem .1rem;
  color: var(--ms-muted);
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.35;
  counter-increment: ms-step;
}

.modern-stepper-list > li .ms-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--ms-line);
  background: #fff;
  color: var(--ms-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 800;
  z-index: 2;
  position: relative;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .05);
  transition: all .25s ease;
}

.modern-stepper-list > li .ms-dot::before {
  content: counter(ms-step);
}

.modern-stepper-list > li .ms-label {
  padding-top: .35rem;
}

.modern-stepper-list > li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 30px;
  right: 13px;
  width: 2px;
  height: calc(100% - 8px);
  background: var(--ms-line);
  z-index: 1;
  border-radius: 99px;
}

.modern-stepper-list > li.past-step {
  color: var(--ms-done);
}

.modern-stepper-list > li.past-step .ms-dot {
  background: var(--ms-done);
  border-color: var(--ms-done);
  color: #fff;
}

.modern-stepper-list > li.past-step .ms-dot::before {
  content: "✓";
  font-size: .78rem;
}

.modern-stepper-list > li.past-step:not(:last-child)::after {
  background: linear-gradient(180deg, var(--ms-done), rgba(13, 148, 136, .35));
}

.modern-stepper-list > li.active-step {
  color: var(--ms-accent-dark);
}

.modern-stepper-list > li.active-step .ms-dot {
  background: var(--ms-accent);
  border-color: var(--ms-accent);
  color: #fff;
  box-shadow: 0 0 0 5px var(--ms-soft), 0 8px 18px rgba(0, 191, 165, .28);
  transform: scale(1.06);
}

.modern-stepper-list > li.active-step .ms-label {
  font-weight: 800;
}

/* Kill legacy progressbar pseudo-elements when modern markup is present */
.modern-stepper .progressbar,
.modern-stepper .progressbar li {
  counter-reset: none !important;
}
.modern-stepper .progressbar li:before,
.modern-stepper .progressbar li:after,
.modern-stepper .progressbar li:not(:last-child):after {
  content: none !important;
  display: none !important;
  border: 0 !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}
.modern-stepper .progressbar li {
  min-width: 0;
  text-align: inherit;
  font-size: inherit;
  flex: initial;
}
.modern-stepper-list > li:not(:last-child)::after {
  content: "";
  display: block;
}

/* Horizontal (mobile) */
@media (max-width: 991.98px) {
  .modern-stepper-card {
    padding: .85rem .7rem .95rem;
    border-radius: 16px;
  }

  .modern-stepper-list {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: .15rem;
  }

  .modern-stepper-list > li {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: .35rem;
    padding: .15rem .1rem;
    grid-template-columns: none;
    font-size: .68rem;
  }

  .modern-stepper-list > li .ms-label {
    padding-top: 0;
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .modern-stepper-list > li:not(:last-child)::after {
    top: 13px;
    right: auto;
    left: calc(50% + 16px);
    width: calc(100% - 32px);
    height: 2px;
  }
}

/* Card header stepper (_StepNavigation) */
.ms-nav {
  --ms-nav-bg: linear-gradient(135deg, #0f766e 0%, #14b8a6 48%, #2dd4bf 100%);
  background: var(--ms-nav-bg);
  border-radius: 16px 16px 0 0;
  padding: 1rem 1rem .95rem;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.12);
}

.ms-nav::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  top: -70px;
  left: -40px;
  pointer-events: none;
}

.ms-nav-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(255,255,255,.92);
  font-size: .78rem;
  margin-bottom: .75rem;
  position: relative;
  z-index: 1;
}

.ms-nav-meta strong {
  font-weight: 800;
}

.ms-nav-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  overflow: hidden;
  margin-bottom: .9rem;
  position: relative;
  z-index: 1;
}

.ms-nav-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #fff;
  box-shadow: 0 0 12px rgba(255,255,255,.45);
  transition: width .35s ease;
}

.ms-nav-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .25rem;
  position: relative;
  z-index: 1;
}

.ms-nav-item {
  flex: 1;
  min-width: 0;
  text-align: center;
  color: rgba(255,255,255,.78);
}

.ms-nav-circle {
  width: 30px;
  height: 30px;
  margin: 0 auto .4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 800;
  border: 2px solid rgba(255,255,255,.45);
  background: rgba(255,255,255,.12);
  color: #fff;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.ms-nav-title {
  font-size: .72rem;
  line-height: 1.35;
  font-weight: 600;
}

.ms-nav-line {
  flex: 0 0 auto;
  width: clamp(18px, 6vw, 42px);
  height: 2px;
  margin-top: 14px;
  border-radius: 99px;
  background: rgba(255,255,255,.28);
}

.ms-nav-item.is-done .ms-nav-circle {
  background: #fff;
  color: var(--ms-done);
  border-color: #fff;
}

.ms-nav-item.is-current .ms-nav-circle {
  background: #fbbf24;
  border-color: #fff;
  color: #78350f;
  box-shadow: 0 0 0 4px rgba(251, 191, 36, .28);
  transform: scale(1.08);
}

.ms-nav-item.is-current .ms-nav-title {
  color: #fff;
  font-weight: 800;
}

.ms-nav-item.is-done + .ms-nav-line {
  background: rgba(255,255,255,.85);
}

.ms-nav-item.is-clickable .ms-nav-circle {
  cursor: pointer;
}

@media (max-width: 575.98px) {
  .ms-nav-title {
    font-size: .62rem;
  }
  .ms-nav-circle {
    width: 26px;
    height: 26px;
    font-size: .68rem;
  }
}

/* Legacy progressList modernization */
#progressList {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

#progressList li {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem .35rem;
  border-radius: 12px;
  color: #64748b;
  font-size: .85rem;
  font-weight: 600;
  position: relative;
}

#progressList li span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #e2e8f0;
  background: #fff;
  color: #94a3b8;
  font-size: .75rem;
  font-weight: 800;
  flex-shrink: 0;
}

#progressList li.active {
  color: #0f766e;
  background: rgba(0, 191, 165, .08);
}

#progressList li.active span {
  background: #00bfa5;
  border-color: #00bfa5;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(0, 191, 165, .15);
}

#progressList li.deactive span {
  opacity: .85;
}

.progressbar.legacy-modern,
#stepIndicator {
  font-weight: 800;
  color: #0f766e;
}
