/**
 * となりて｜診断エンジン スタイル  shindan-engine.css
 * ─────────────────────────────────────────────────────
 * CSS変数は tonarite.com のデザインシステムに準拠:
 *   --green:#1F5A36  --green-deep:#154628  --paper:#FBFAF4
 *   --ink:#25352B    --line-soft:rgba(0,0,0,.07)
 */

/* ========== ラッパー ========== */
.sh-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 0 48px;
  font-family: inherit;
}

/* ========== ヘッダー（タイトル・説明） ========== */
.sh-head {
  text-align: center;
  margin-bottom: 28px;
}

.sh-title {
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  font-weight: 700;
  color: var(--ink, #25352B);
  margin: 0 0 10px;
  line-height: 1.4;
}

.sh-desc {
  font-size: 0.92rem;
  color: var(--ink-light, #4a5e52);
  margin: 0;
  line-height: 1.7;
}

/* ========== プログレスバー ========== */
.sh-progress {
  height: 6px;
  background: var(--line-soft, rgba(0,0,0,.07));
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 32px;
}

.sh-bar {
  height: 100%;
  background: var(--green, #1F5A36);
  border-radius: 3px;
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== 質問エリア ========== */
.sh-question {
  background: #fff;
  border: 1px solid var(--line-soft, rgba(0,0,0,.07));
  border-radius: 16px;
  padding: 28px 24px 32px;
  box-shadow: 0 2px 12px -4px rgba(31,90,54,.08);
}

.sh-q-num {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--green, #1F5A36);
  background: rgba(31,90,54,.08);
  border-radius: 20px;
  padding: 3px 10px;
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

.sh-q-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink, #25352B);
  line-height: 1.6;
  margin: 0 0 8px;
}

.sh-q-note {
  font-size: 0.82rem;
  color: var(--ink-light, #4a5e52);
  margin: 0 0 16px;
  line-height: 1.6;
}

/* ========== 選択肢ボタン ========== */
.sh-opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.sh-opt {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 14px 18px;
  border: 1.5px solid var(--line-soft, rgba(0,0,0,.1));
  border-radius: 10px;
  background: var(--paper, #FBFAF4);
  color: var(--ink, #25352B);
  font-size: 0.97rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  line-height: 1.5;
}

.sh-opt:hover:not(:disabled) {
  border-color: var(--green, #1F5A36);
  background: rgba(31,90,54,.04);
}

.sh-opt:active:not(:disabled) {
  transform: scale(0.99);
}

.sh-opt--selected {
  border-color: var(--green, #1F5A36) !important;
  background: rgba(31,90,54,.08) !important;
  color: var(--green-deep, #154628);
}

.sh-opt:disabled {
  cursor: default;
  opacity: 0.6;
}

.sh-opt--selected:disabled {
  opacity: 1;
}

.sh-opt-label {
  flex: 1;
}

/* ========== 結果エリア ========== */
.sh-result {
  background: #fff;
  border: 1px solid var(--line-soft, rgba(0,0,0,.07));
  border-radius: 16px;
  overflow: hidden;
  padding-bottom: 24px;
  box-shadow: 0 2px 12px -4px rgba(31,90,54,.08);
}

/* 判定バナー */
.sh-verdict {
  padding: 20px 24px 18px;
  background: var(--green, #1F5A36);
  color: #fff;
}

.sh-verdict--positive {
  background: var(--green, #1F5A36);
}

.sh-verdict--caution {
  background: #a05c00;
}

.sh-verdict--neutral {
  background: #3a5068;
}

.sh-verdict-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.82;
  margin-bottom: 6px;
}

.sh-verdict-text {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.4;
}

/* 結果本文 */
.sh-result-body {
  padding: 24px 24px 20px;
}

.sh-result-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink, #25352B);
  margin: 0 0 10px;
  line-height: 1.4;
}

.sh-result-text {
  font-size: 0.92rem;
  color: var(--ink-light, #4a5e52);
  line-height: 1.75;
  margin: 0;
}

/* リンク群 */
.sh-result-links {
  padding: 0 24px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sh-result-link {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(31,90,54,.07);
  border-radius: 20px;
  color: var(--green-deep, #154628);
  font-size: 0.87rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}

.sh-result-link:hover {
  background: rgba(31,90,54,.14);
  text-decoration: none;
}

/* CTA ボタン（結果 → 詳細おすすめページへ） */
.sh-result-cta {
  padding: 0 24px 20px;
}

.sh-result-cta-btn {
  display: block;
  padding: 13px 20px;
  background: var(--green, #1F5A36);
  color: #fff;
  border-radius: 10px;
  font-size: 0.97rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s;
}

.sh-result-cta-btn:hover {
  background: var(--green-deep, #154628);
  text-decoration: none;
  color: #fff;
}

/* もどる・もう一度ボタンのラッパー（結果画面） */
.sh-result-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ひとつもどるボタン（質問画面・結果画面共通） */
.sh-back {
  display: block;
  width: calc(100% - 48px);
  margin: 8px 24px 0;
  padding: 10px;
  background: transparent;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #888;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, color 0.15s;
}

.sh-back:hover {
  border-color: #888;
  color: #444;
}

/* もう一度ボタン */
.sh-retry {
  display: block;
  width: calc(100% - 48px);
  margin: 0 24px 24px;
  padding: 12px;
  border: 1.5px solid var(--line-soft, rgba(0,0,0,.1));
  border-radius: 8px;
  background: transparent;
  color: var(--ink-light, #4a5e52);
  font-size: 0.87rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.sh-retry:hover {
  border-color: var(--green, #1F5A36);
  color: var(--green-deep, #154628);
}

/* ========== 商品カード ========== */
.sh-products {
  padding: 0 24px 20px;
}

.sh-products-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-light, #4a5e52);
  text-transform: uppercase;
  margin: 0 0 6px;
}

.sh-products-notice {
  font-size: 0.75rem;
  color: #9ca3af;
  margin: 0 0 10px;
  line-height: 1.5;
}

.sh-product-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  background: var(--paper, #FBFAF4);
  border: 1px solid var(--line-soft, rgba(0,0,0,.07));
  border-radius: 10px;
  margin-bottom: 10px;
}

.sh-product-img-link {
  flex-shrink: 0;
}

.sh-product-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}

.sh-product-info {
  flex: 1;
  min-width: 0;
}

.sh-product-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink, #25352B);
  margin: 0 0 3px;
  line-height: 1.4;
}

.sh-product-price {
  font-size: 0.8rem;
  color: var(--ink-light, #4a5e52);
  margin: 0 0 4px;
}

.sh-product-note {
  font-size: 0.82rem;
  color: #374151;
  margin: 0 0 8px;
  line-height: 1.6;
}

.sh-product-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sh-pbtn {
  display: inline-block;
  padding: .25em .75em;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.15s;
}

.sh-pbtn:hover {
  opacity: 0.85;
  text-decoration: none;
}

.sh-pbtn--amazon {
  background: #FF9900;
  color: #000;
}

.sh-pbtn--rakuten {
  background: #BF0000;
  color: #fff;
}

.sh-pbtn--store {
  background: #374151;
  color: #fff;
}

@media (max-width: 480px) {
  .sh-products {
    padding: 0 16px 16px;
  }

  .sh-product-img {
    width: 64px;
    height: 64px;
  }
}

/* ========== ローディング / エラー ========== */
.sh-loading {
  text-align: center;
  padding: 48px 0;
  color: var(--ink-light, #4a5e52);
  font-size: 0.92rem;
}

.sh-loading-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green, #1F5A36);
  margin-right: 8px;
  animation: sh-pulse 1.2s ease-in-out infinite;
  vertical-align: middle;
}

@keyframes sh-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

.sh-error {
  text-align: center;
  padding: 40px 24px;
  color: #8b3a3a;
  background: #fff5f5;
  border-radius: 12px;
  border: 1px solid rgba(139,58,58,.15);
  font-size: 0.92rem;
}

/* ========== レスポンシブ ========== */
@media (max-width: 480px) {
  .sh-question {
    padding: 20px 16px 24px;
    border-radius: 12px;
  }

  .sh-q-text {
    font-size: 1rem;
  }

  .sh-opt {
    padding: 12px 14px;
    font-size: 0.93rem;
  }

  .sh-result-body {
    padding: 18px 16px 16px;
  }

  .sh-result-links {
    padding: 0 16px 16px;
  }

  .sh-result-cta {
    padding: 0 16px 16px;
  }

  .sh-back {
    width: calc(100% - 32px);
    margin: 8px 16px 0;
  }

  .sh-retry {
    width: calc(100% - 32px);
    margin: 0 16px 16px;
  }
}
