.p-contact__stepber {
  margin: 0 auto;
  max-width: 848px;
  width: calc(100% - 180px);
}

.p-page__stepber {
  position: relative;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  counter-reset: number 0;
}

.p-page__stepber .p-page__stepber_item {
  list-style: none;
  width: calc(33.3333333333% - 26px);
  text-align: center;
  position: relative;
  padding-top: 40px;
  margin-top: 22px;
  font-size: 14px;
  line-height: 1.8;
  color: #9d9d9d;
}

.p-page__stepber .p-page__stepber_item:before {
  content: counter(number);
  counter-increment: number 1;
  position: absolute;
  top: 0;
  left: calc(50% - 15px);
  width: 30px;
  height: 30px;
  text-align: center;
  line-height: 30px;
  font-size: 14px;
  border-radius: 30px;
  border: 1px solid #747474;
  background-color: #fff;
  box-sizing: border-box;
  color: #747474;
}

.p-page__stepber .p-page__stepber_item:after {
  content: "";
  position: absolute;
  top: 15px;
  left: calc(-50% + 15px);
  width: calc(100% - 30px);
  height: 2px;
  background-color: #dcdcdc;
  z-index: -1;
}

.p-page__stepber .p-page__stepber_item:first-child:after {
  content: none;
}

.p-page__stepber .p-page__stepber_item.is-active {
  font-weight: 700;
  color: #008060;
}

.p-page__stepber .p-page__stepber_item.is-active:before,
.p-page__stepber .p-page__stepber_item.is-complete:before {
  background-color: #008060;
  border-color: #008060;
  color: #fff;
}

.p-page__stepber .p-page__stepber_item.is-active:after,
.p-page__stepber .p-page__stepber_item.is-complete:after {
  background-color: #008060;
}

/* 2ステップ用のスタイル（自動検出） */
/* 両方のアイテムを同じ幅にして線が正しく繋がるようにする */
.p-page__stepber:has(.p-page__stepber_item:first-child:nth-last-child(2)) {
  justify-content: space-between;
  gap: 0;
}

.p-page__stepber .p-page__stepber_item:first-child:nth-last-child(2),
.p-page__stepber .p-page__stepber_item:first-child:nth-last-child(2) ~ .p-page__stepber_item {
  /* 両方のアイテムを同じ幅にする（50%から間隔分を引く） */
  width: calc(50% - 60px);
  min-width: auto;
}

/* 2番目のステップから1番目への線 */
/* 間隔120pxを埋める線 */
.p-page__stepber .p-page__stepber_item:first-child:nth-last-child(2) ~ .p-page__stepber_item:after {
  /* 線の幅: アイテム幅 + gap + 丸の直径 - 丸の直径 = アイテム幅 + gap */
  width: calc(100% + 90px);
  /* 線の開始位置: -(アイテム幅の半分 + gap + 丸の半径 - 丸の直径) */
  left: calc(-50% - 105px);
}

/* クラスベースのスタイル（明示的に指定する場合） */
.p-page__stepber.p-page__stepber--two-steps {
  justify-content: space-between;
  gap: 0;
}

.p-page__stepber.p-page__stepber--two-steps .p-page__stepber_item {
  width: calc(50% - 60px);
  min-width: auto;
}

.p-page__stepber.p-page__stepber--two-steps .p-page__stepber_item:last-child:after {
  width: calc(100% + 90px);
  left: calc(-50% - 105px);
}

@media screen and (max-width: 767px) {
  /* ヘッダーの最小幅をリセット（外部CSS local.css との競合解決） */
  .l-header {
    min-width: unset !important;
  }

  .p-contact__stepber {
    max-width: 679px;
    width: calc(100% - 48px);
  }

  /* スマートフォン用ステップバースタイル */
  .p-page__stepber .p-page__stepber_item {
    font-size: 12px;
    line-height: 1.5;
    padding-top: 36px;
    margin-top: 16px;
  }

  /* 2ステップ用スマートフォンスタイル */
  /* 両方のアイテムを同じ幅にする */
  .p-page__stepber:has(.p-page__stepber_item:first-child:nth-last-child(2)) {
    justify-content: space-between;
    gap: 0;
  }

  .p-page__stepber .p-page__stepber_item:first-child:nth-last-child(2),
  .p-page__stepber .p-page__stepber_item:first-child:nth-last-child(2) ~ .p-page__stepber_item {
    /* 間隔60pxを確保（各アイテム30pxずつ） */
    width: calc(50% - 30px);
    min-width: auto;
  }

  /* 2ステップ用の線（スマートフォン） */
  /* 間隔60pxを埋める線 */
  .p-page__stepber .p-page__stepber_item:first-child:nth-last-child(2) ~ .p-page__stepber_item:after {
    width: calc(100% + 30px);
    left: calc(-50% - 45px);
  }
}

/* パスワード表示/非表示トグル */
.password-toggle-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.password-toggle-wrapper input[type="password"],
.password-toggle-wrapper input[type="text"] {
  padding-right: 40px;
  width: 100%;
  box-sizing: border-box;
}

/* Edge/IEのネイティブパスワード表示ボタンを非表示 */
.password-toggle-wrapper input[type="password"]::-ms-reveal,
.password-toggle-wrapper input[type="password"]::-ms-clear {
  display: none;
}

.password-toggle-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: color 0.2s ease;
}

.password-toggle-btn:hover {
  color: #333;
}

.password-toggle-btn:focus {
  outline: 2px solid #008060;
  outline-offset: 2px;
  border-radius: 4px;
}

.password-toggle-btn svg {
  display: block;
}
