/* display-stepper-2 — ステップインジケーター（クリック可能・エラー表示）専用スタイル
   スコープ：.stp2-root 配下に限定 */

.stp2-root {
  --stp2-color:  #2563EB;  /* 現在・完了ステップの色 */
  --stp2-muted:  #E5E7EB;  /* 未訪問のドット・ライン色 */
  --stp2-text:   #9AA5B4;  /* 未訪問のラベル色 */
  --stp2-error:  #DC2626;  /* エラー色 */
  --stp2-success:#22C55E;  /* 完了アイコン背景 */
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* ===== ステップインジケーター ===== */
.stp2-indicator {
  display: flex;
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
}

.stp2-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* ステップ間の接続ライン（::before で前のステップとつなぐ） */
.stp2-item + .stp2-item::before {
  content: '';
  position: absolute;
  top: 13px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: var(--stp2-muted);
  z-index: 0;
}

/* 完了済みステップの後のラインをブルーにする */
.stp2-item.is-complete + .stp2-item::before,
.stp2-item.is-current + .stp2-item::before {
  background: var(--stp2-color);
}

/* ステップの丸（ドット） */
.stp2-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--stp2-muted);
  color: var(--stp2-text);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}

/* 現在のステップ・完了ステップ */
.stp2-item.is-current .stp2-dot,
.stp2-item.is-complete .stp2-dot {
  background: var(--stp2-color);
  border-color: var(--stp2-color);
  color: #fff;
}

/* エラーのステップ */
.stp2-item.is-error .stp2-dot {
  background: var(--stp2-error);
  border-color: var(--stp2-error);
  color: #fff;
}

/* クリック可能（訪問済み）ステップ */
.stp2-item.is-clickable .stp2-dot {
  cursor: pointer;
}

.stp2-item.is-clickable:hover .stp2-dot {
  transform: scale(1.08);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* クリック不可（未訪問）ステップ */
.stp2-item:not(.is-clickable) .stp2-dot {
  cursor: not-allowed;
}

/* 完了後ロック状態：どのドットもクリック不可の見た目にする */
.stp2-indicator.is-locked .stp2-item .stp2-dot {
  cursor: default;
}
.stp2-indicator.is-locked .stp2-item.is-clickable:hover .stp2-dot {
  transform: none;
  box-shadow: none;
}

/* ステップラベル */
.stp2-label {
  font-size: 11px;
  color: var(--stp2-text);
  margin-top: 5px;
  text-align: center;
}

.stp2-item.is-current .stp2-label {
  color: var(--stp2-color);
  font-weight: 700;
}

.stp2-item.is-complete .stp2-label { color: #5A6A7A; }
.stp2-item.is-error .stp2-label { color: var(--stp2-error); font-weight: 700; }

/* ===== ステップコンテンツ ===== */
.stp2-step-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 16px;
}

/* ===== 入力フィールド ===== */
.stp2-field {
  margin-bottom: 16px;
}

.stp2-field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #5A6A7A;
  margin-bottom: 6px;
}

.stp2-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  font-size: 14px;
  font-family: sans-serif;
}

.stp2-field input:focus {
  outline: none;
  border-color: var(--stp2-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* エラー時のフィールド枠 */
.stp2-field.has-error input {
  border-color: var(--stp2-error);
}

.stp2-field.has-error input:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

/* エラーメッセージ（display は指定しない。hidden 属性の標準動作を活かすため） */
.stp2-field-error {
  color: var(--stp2-error);
  font-size: 12px;
  margin: 6px 0 0;
}

/* ===== 確認画面 ===== */
.stp2-confirm {
  background: #F4F6F9;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.stp2-confirm-item { margin-bottom: 14px; }
.stp2-confirm-item:last-child { margin-bottom: 0; }

.stp2-confirm-label {
  font-size: 11px;
  font-weight: 700;
  color: #5A6A7A;
  margin: 0 0 3px;
}

.stp2-confirm-value {
  font-size: 14px;
  color: #1A2332;
  margin: 0;
  word-break: break-all;
}

/* ===== ボタン ===== */
.stp2-actions { display: flex; gap: 10px; margin-top: 8px; }

.stp2-btn-primary {
  padding: 10px 24px;
  background: var(--stp2-color);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-family: sans-serif;
  cursor: pointer;
  transition: background 0.15s;
}

.stp2-btn-primary:hover { background: #1D4ED8; }

.stp2-btn-secondary {
  padding: 10px 24px;
  background: #fff;
  color: #5A6A7A;
  border: 1.5px solid #D0D7E0;
  border-radius: 6px;
  font-size: 14px;
  font-family: sans-serif;
  cursor: pointer;
  transition: background 0.15s;
}

.stp2-btn-secondary:hover { background: #F4F6F9; }

/* ===== 完了画面 ===== */
.stp2-complete-icon {
  width: 56px;
  height: 56px;
  background: var(--stp2-success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: #fff;
  font-size: 28px;
}

.stp2-complete-message {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 24px;
}

/* ===== デモ操作エリア（リセットボタン） ===== */
.demo-controls {
  margin-top: 12px;
}

.reset-btn {
  padding: 6px 16px;
  font-size: 13px;
  color: #5A6A7A;
  background: #fff;
  border: 1.5px solid #D0D7E0;
  border-radius: 6px;
  cursor: pointer;
  font-family: sans-serif;
  transition: background 0.15s, border-color 0.15s;
}

.reset-btn:hover {
  background: #F4F6F9;
  border-color: #9AA5B4;
}

/* ===== スマホ対応 ===== */
@media (max-width: 480px) {
  .stp2-label { display: none; }
  .stp2-dot { width: 24px; height: 24px; font-size: 11px; }
  .stp2-item + .stp2-item::before { top: 11px; }
  .stp2-actions { flex-wrap: wrap; }
  .stp2-btn-primary, .stp2-btn-secondary { flex: 1; min-width: 120px; }
}
