/* === デモ: 縦並びレイアウト === */
.demo-container {
  flex-direction: column;
  align-items: stretch;
  padding: 24px;
}

/* 各パターンを囲むカード */
.tb3-pattern {
  margin-bottom: 16px;
  padding: 20px;
  background: #F4F6F9;
  border-radius: 8px;
  max-width: 520px;
}
.tb3-pattern:last-child { margin-bottom: 0; }

.tb3-pattern-label {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  color: #2B7FE8;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tb3-field-label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 500;
  color: #5A6A7A;
}

/* input 共通スタイル */
.tb3-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #D0D7E0;
  border-radius: 6px;
  font-size: 14px;
  color: #1A2332;
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  font-family: sans-serif;
}
.tb3-input:focus {
  border-color: #2B7FE8;
  box-shadow: 0 0 0 3px rgba(43, 127, 232, 0.12);
}


/* ============================================================
   Pattern 1: パスワード 表示/非表示トグル
   ============================================================ */

/* トグルボタンを右端に重ねるために relative を設定 */
.tb3-password-wrap {
  position: relative;
}
/* ボタン幅分のパディングを右側に確保 */
.tb3-password-wrap .tb3-input {
  padding-right: 44px;
}
/* 目のアイコンボタン: 入力欄の右端に絶対配置 */
.tb3-toggle-btn {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 40px;
  background: none;
  border: none;
  cursor: pointer;
  color: #9AA5B4;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}
.tb3-toggle-btn:hover { color: #5A6A7A; }


/* ============================================================
   Pattern 2: 検索ボックス × クリアボタン
   ============================================================ */

/* 虫眼鏡・×ボタンを input に重ねるために relative を設定 */
.tb3-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
/* 虫眼鏡アイコン: 左端に絶対配置。pointer-events:none でクリックを透過 */
.tb3-search-icon {
  position: absolute;
  left: 12px;
  color: #9AA5B4;
  pointer-events: none;
}
/* 左右のアイコン分を padding で確保 */
.tb3-input--search {
  padding-left: 36px;
  padding-right: 36px;
}
/* ブラウザ標準の×ボタンを非表示（Chrome/Safari が type="search" に追加する） */
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}
/* ×ボタン: 右端に絶対配置。opacity で表示/非表示をアニメーション */
.tb3-clear-btn {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 36px;
  background: none;
  border: none;
  cursor: pointer;
  color: #9AA5B4;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none; /* 非表示中はクリック不可 */
  transition: opacity 0.15s, color 0.15s;
}
/* .visible クラスを付けると表示・クリック可能になる */
.tb3-clear-btn.visible {
  opacity: 1;
  pointer-events: auto;
}
.tb3-clear-btn:hover { color: #5A6A7A; }


/* ============================================================
   Pattern 3: OTP 6桁 分割入力
   ============================================================ */

/* ボックスを横並びに配置 */
.tb3-otp-wrap {
  display: flex;
  gap: 8px;
}
/* 1文字用の正方形ボックス */
.tb3-otp-input {
  width: 44px;
  height: 52px;
  padding: 0;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  color: #1A2332;
  background: #fff;
  border: 1.5px solid #D0D7E0;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: sans-serif;
  box-sizing: border-box;
  caret-color: transparent; /* テキストカーソルを非表示にしてボックス感を出す */
}
.tb3-otp-input:focus {
  border-color: #2B7FE8;
  box-shadow: 0 0 0 3px rgba(43, 127, 232, 0.12);
}
/* 入力済みのボックスに薄い青背景を付ける */
.tb3-otp-input.filled {
  background: #EEF4FD;
}

/* ヒントテキスト */
.tb3-hint {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #9AA5B4;
  line-height: 1.5;
}


/* ============================================================
   共通パーツ
   ============================================================ */

/* リセットボタン */
.demo-controls {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}
.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;
}

/* 難易度バッジ: 中級=アンバー（黄） */
.badge-level { background: #D97706; color: #fff; }

/* 更新日 */
.updated-at { font-size: 12px; color: #9AA5B4; }

/* サンプルソースヒント */
.source-hint {
  margin: 0 0 16px;
  padding: 10px 14px;
  font-size: 13px;
  color: #5A6A7A;
  background: #F4F6F9;
  border-left: 3px solid #2B7FE8;
  border-radius: 0 6px 6px 0;
  line-height: 1.7;
}
.source-hint code {
  font-family: monospace;
  background: #E8EDF4;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
}

/* 複数プロンプトブロック */
.prompt-block { margin-bottom: 20px; }
.prompt-block:last-child { margin-bottom: 0; }
.prompt-block-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: #2B7FE8;
  letter-spacing: 0.04em;
}

/* プロンプト補足（注意・ヒント） */
.prompt-notes {
  margin-bottom: 20px;
  padding: 14px 16px;
  background: #F4F6F9;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.7;
}
.prompt-note-caution { margin: 0 0 8px; color: #E65100; }
.prompt-note-tip { margin: 0; color: #5A6A7A; }

/* レスポンシブ: 600px 以下 */
@media (max-width: 600px) {
  .tb3-pattern { max-width: 100%; }
  .demo-container { padding: 16px; }
  /* OTP ボックスを少し小さくする */
  .tb3-otp-input { width: 38px; height: 46px; font-size: 18px; }
  .tb3-otp-wrap { gap: 6px; }
}
