/* ============================================================
   Filter Builder フロントエンドスタイル
   テーマ干渉防止リセット付き / CSS変数でカスタマイズ可能
   ============================================================ */

/* ---- テーマ干渉防止: .fb-wrap 内の要素をリセット ---- */
.fb-wrap,
.fb-wrap *,
.fb-wrap *::before,
.fb-wrap *::after {
  box-sizing: border-box;
}

.fb-wrap label,
.fb-wrap span,
.fb-wrap div,
.fb-wrap p,
.fb-wrap button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  line-height: inherit;
  vertical-align: baseline;
}

.fb-wrap label {
  display: inline;
  float: none;
  width: auto;
  max-width: none;
  margin-bottom: 0;
  padding: 0;
  font-weight: inherit;
}

.fb-wrap input[hidden] {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  position: absolute !important;
  opacity: 0 !important;
}

/* ---- 本体 ---- */
.fb-wrap {
  --fb-color-question: #2eac6d;
  --fb-color-button: #2eac6d;

  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
}

/* ---- ヘッダー ---- */
.fb-wrap .fb-header {
  text-align: center;
  margin-bottom: 28px;
}

.fb-wrap .fb-header-text {
  display: inline-block;
  background: #fff;
  border: 2.5px solid var(--fb-color-question);
  border-radius: 40px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: bold;
  color: var(--fb-color-question);
  line-height: 1.7;
  margin: 0;
}

/* ---- 質問ブロック ---- */
.fb-wrap .fb-question-block {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid #e8e8e8;
}

.fb-wrap .fb-question-block:last-child {
  border-bottom: none;
}

.fb-wrap .fb-question-label {
  width: 200px;
  font-weight: bold;
  font-size: 15px;
  color: var(--fb-color-question);
  padding-top: 10px;
  flex-shrink: 0;
  line-height: 1.5;
}

.fb-wrap .fb-required-mark {
  color: #d93025;
  font-size: 12px;
  margin-left: 4px;
  font-weight: normal;
}

/* ---- 回答エリア（右カラム） ---- */
.fb-wrap .fb-question-right {
  flex: 1;
  min-width: 0;
}

.fb-wrap .fb-answers {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---- カード型ボタン共通 ---- */
.fb-wrap .fb-answer-card {
  cursor: pointer;
  display: block;
  margin: 0;
  padding: 0;
  float: none;
}

/* ---- カード型ボタン（ラジオ） ---- */
.fb-wrap .fb-radio-card .fb-card-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2px solid #c8c8c8;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  color: #333;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  min-width: 120px;
  text-align: center;
  user-select: none;
  line-height: 1.5;
}

.fb-wrap .fb-radio-card:hover .fb-card-inner {
  border-color: var(--fb-color-button);
  color: var(--fb-color-button);
}

.fb-wrap .fb-radio-card.fb-selected .fb-card-inner {
  border-color: var(--fb-color-button);
  background: var(--fb-color-button);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ---- カード型ボタン（チェックボックス） ---- */
.fb-wrap .fb-checkbox-card .fb-card-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 2px solid #c8c8c8;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  color: #333;
  transition: border-color 0.15s ease, background 0.15s ease;
  user-select: none;
  line-height: 1.5;
}

.fb-wrap .fb-checkbox-box {
  width: 20px;
  height: 20px;
  border: 2px solid #c8c8c8;
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease;
  background: #fff;
}

.fb-wrap .fb-checkbox-card:hover .fb-card-inner {
  border-color: var(--fb-color-button);
}

.fb-wrap .fb-checkbox-card:hover .fb-checkbox-box {
  border-color: var(--fb-color-button);
}

.fb-wrap .fb-checkbox-card.fb-selected .fb-card-inner {
  border-color: var(--fb-color-button);
  background: color-mix(in srgb, var(--fb-color-button) 8%, #fff);
}

.fb-wrap .fb-checkbox-card.fb-selected .fb-checkbox-box {
  background: var(--fb-color-button);
  border-color: var(--fb-color-button);
}

.fb-wrap .fb-checkbox-card.fb-selected .fb-checkbox-box::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 6px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---- 必須エラー表示 ---- */
.fb-wrap .fb-question-block.fb-error .fb-question-label {
  color: #d93025;
}

.fb-wrap .fb-question-error {
  display: none;
  color: #d93025;
  font-size: 13px;
  margin-top: 8px;
  line-height: 1.4;
}

.fb-wrap .fb-question-block.fb-error .fb-question-error {
  display: block;
}

/* ---- 検索ボタン ---- */
.fb-wrap .fb-search-btn-wrap {
  text-align: center;
  margin: 28px 0;
}

.fb-wrap .fb-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--fb-color-button);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 44px;
  font-size: 17px;
  font-weight: bold;
  cursor: pointer;
  transition: filter 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  letter-spacing: 0.05em;
  line-height: 1.4;
}

.fb-wrap .fb-search-btn:hover {
  filter: brightness(0.9);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.fb-wrap .fb-search-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.fb-wrap .fb-search-icon {
  font-size: 20px;
}

.fb-wrap .fb-search-arrow {
  font-size: 13px;
  opacity: 0.8;
}

/* ---- 検索結果 ---- */
.fb-wrap .fb-results {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid var(--fb-color-button);
}

.fb-wrap .fb-results-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--fb-color-question);
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.4;
}

.fb-wrap .fb-results-hit-msg {
  text-align: center;
  font-size: 15px;
  font-weight: bold;
  color: var(--fb-color-question);
  margin-bottom: 16px;
  line-height: 1.5;
}

.fb-wrap .fb-results-hit-msg:empty {
  display: none;
}

.fb-wrap .fb-results-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fb-wrap .fb-result-card {
  overflow: hidden;
}

/* ---- 該当なし ---- */
.fb-wrap .fb-no-results {
  text-align: center;
  padding: 40px 20px;
  font-size: 15px;
  color: #888;
  line-height: 1.5;
}

/* ---- もう一度診断するボタン ---- */
.fb-wrap .fb-retry-wrap {
  text-align: center;
  margin-top: 28px;
}

.fb-wrap .fb-retry-btn {
  display: inline-block;
  background: #fff;
  color: var(--fb-color-button);
  border: 2px solid var(--fb-color-button);
  border-radius: 50px;
  padding: 12px 40px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  line-height: 1.4;
}

.fb-wrap .fb-retry-btn:hover {
  background: var(--fb-color-button);
  color: #fff;
}

/* ---- ブログパーツ ---- */
.fb-wrap .fb-blog-parts {
  padding: 0;
}

.fb-wrap .fb-blog-parts > *:first-child {
  margin-top: 0;
}

.fb-wrap .fb-blog-parts > *:last-child {
  margin-bottom: 0;
}

/* ============================================================
   レスポンシブ
   ============================================================ */
@media (max-width: 600px) {
  .fb-wrap {
    padding: 0 10px;
  }

  .fb-wrap .fb-question-block {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 0;
  }

  .fb-wrap .fb-question-label {
    width: auto;
    padding-top: 0;
    font-size: 15px;
    text-align: center;
  }

  .fb-wrap .fb-question-right {
    width: 100%;
  }

  .fb-wrap .fb-answers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
  }

  .fb-wrap .fb-answers.fb-type-checkbox {
    grid-template-columns: repeat(2, 1fr);
  }

  .fb-wrap .fb-answer-card {
    display: block;
    width: 100%;
  }

  .fb-wrap .fb-answer-card:only-child {
    grid-column: 1 / -1;
    max-width: 60%;
    margin: 0 auto;
  }

  .fb-wrap .fb-radio-card .fb-card-inner,
  .fb-wrap .fb-checkbox-card .fb-card-inner {
    width: 100%;
    min-width: 0;
    padding: 10px 8px;
    font-size: 13px;
    justify-content: center;
    text-align: center;
  }

  .fb-wrap .fb-search-btn {
    padding: 12px 32px;
    font-size: 15px;
  }

  .fb-wrap .fb-header-text {
    font-size: 14px;
    padding: 12px 20px;
  }

  .fb-wrap .fb-question-error {
    text-align: center;
  }
}
