/* ============================================================
   form-textbox-4.css — オートコンプリート TextBox
   ============================================================ */

/* ラベル */
.tb4-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-label, #5A6A7A);
}

/* 入力欄ラッパー（ドロップダウンの絶対配置基点） */
.tb4-input-wrap {
  position: relative;
  max-width: 320px;
}

/* テキスト入力欄 */
.tb4-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--color-text);
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  font-family: sans-serif;
}
.tb4-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(43, 127, 232, 0.12);
}

/* 候補ドロップダウン */
.tb4-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 4px 0;
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

/* 候補アイテム */
.tb4-dropdown-item {
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  color: var(--color-text);
  transition: background 0.1s;
}
.tb4-dropdown-item:hover {
  background: var(--color-bg);
}

/* キーボードナビ時のハイライト */
.tb4-dropdown-item.active {
  background: var(--color-accent);
  color: #fff;
}

/* 選択結果表示エリア */
.tb4-result {
  margin-top: 14px;
  font-size: 14px;
}
.tb4-result.has-value {
  padding: 12px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  color: var(--color-text);
}

/* デモコンテナを縦並びにする */
.demo-container {
  flex-direction: column;
  align-items: flex-start;
}

/* リセットボタン */
.demo-controls {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  width: 100%;
  max-width: 320px;
}
.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) {
  .tb4-input-wrap { max-width: 100%; }
  .demo-controls { max-width: 100%; }
}
