/**
 * AYBDX 簡易診断ウィジェット スタイル
 * - 既存 css/style.css の :root トークンのみ使用（新しい色・フォントを足さない）
 * - モバイルファースト。タップ領域は最低 44px。
 * - キーボード操作の可視フォーカス、prefers-reduced-motion を尊重。
 */

/* セクション枠（Top/Serviceに埋め込む外枠） */
.dx-diagnosis-wrap {
  padding: 72px 0;
}
.dx-diagnosis-wrap .container {
  max-width: 720px;
}
/* 既存セクションの内側（Serviceの料金セクション内）に差し込む場合の余白調整 */
.dx-diagnosis-inline {
  padding: 0;
  margin: 56px auto;
  max-width: 720px;
}
.dx-diagnosis-wrap > .container > h2 {
  margin-bottom: 8px;
}

/* ウィジェット本体カード */
.dx-diagnosis {
  margin-top: 28px;
  background: var(--frost);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 28px 24px 24px;
}

/* 進捗 */
.dx-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.dx-progress-label {
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.dx-progress-track {
  flex: 1;
  height: 4px;
  background: rgba(200, 220, 255, 0.12);
  border-radius: 100px;
  overflow: hidden;
}
.dx-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--aurora-green), var(--aurora-teal));
  border-radius: 100px;
  transition: width 0.4s ease;
}

/* 設問 */
.dx-question-title {
  font-size: 21px;
  line-height: 1.6;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 20px;
}
.dx-question-title:focus,
.dx-result-heading:focus {
  outline: none; /* SR読み上げ用のプログラム的フォーカス。可視リングは操作要素側にのみ出す */
}

/* 選択肢リスト */
.dx-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dx-option {
  display: block;
  width: 100%;
  min-height: 44px;
  text-align: left;
  padding: 15px 18px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: rgba(200, 220, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}
.dx-option:hover {
  border-color: var(--aurora-green);
  background: rgba(0, 229, 160, 0.06);
}
.dx-option:active {
  transform: scale(0.995);
}
.dx-option .dx-option-num {
  display: inline-block;
  min-width: 1.6em;
  color: var(--aurora-green);
  font-weight: 700;
}

/* フッター操作（戻る） */
.dx-nav {
  margin-top: 20px;
  min-height: 24px;
}
.dx-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  font-size: 14px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
}
.dx-back:hover {
  color: var(--text-primary);
}

/* 結果画面 */
.dx-result-heading {
  font-size: 22px;
  line-height: 1.55;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 20px;
}
.dx-saving {
  border: 1px solid rgba(0, 229, 160, 0.3);
  background: rgba(0, 229, 160, 0.07);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 22px;
}
.dx-saving-label {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 4px;
}
.dx-saving-value {
  font-size: 15px;
  color: var(--text-primary);
  margin: 0;
}
.dx-saving-value strong {
  font-size: 30px;
  font-weight: 800;
  color: var(--aurora-green);
  margin: 0 4px;
}
.dx-saving.is-note .dx-saving-value {
  font-size: 16px;
}

/* 診断サマリ */
.dx-summary {
  margin: 0 0 24px;
  border-top: 1px solid var(--border-color);
}
.dx-summary-row {
  display: flex;
  gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}
.dx-summary-key {
  flex: 0 0 42%;
  color: var(--text-muted);
}
.dx-summary-val {
  flex: 1;
  color: var(--text-primary);
}

/* CTA */
.dx-result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}
.dx-result-actions .dx-cta {
  width: 100%;
  justify-content: center;
  text-align: center;
}
.dx-subcta {
  align-self: center;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
}
.dx-subcta:hover {
  color: var(--text-primary);
}

/* 画面切替アニメーション（1問ずつ） */
.dx-step {
  animation: dxFadeIn 0.35s ease both;
}
@keyframes dxFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* キーボード操作の可視フォーカス */
.dx-option:focus-visible,
.dx-back:focus-visible,
.dx-subcta:focus-visible,
.dx-cta:focus-visible {
  outline: 2px solid var(--aurora-green);
  outline-offset: 2px;
}

/* モーション抑制の尊重 */
@media (prefers-reduced-motion: reduce) {
  .dx-progress-fill { transition: none; }
  .dx-option { transition: none; }
  .dx-step { animation: none; }
}

/* モバイル微調整 */
@media (max-width: 480px) {
  .dx-diagnosis-wrap { padding: 56px 0; }
  .dx-diagnosis { padding: 22px 16px 18px; }
  .dx-question-title { font-size: 19px; }
  .dx-option { font-size: 15px; padding: 14px 15px; }
  .dx-saving-value strong { font-size: 26px; }
  .dx-summary-key { flex-basis: 46%; }
}

/* ==========================================
   contact.html：診断プレフィル通知バー（Phase 2）
   ========================================== */
.dx-prefill-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(0, 229, 160, 0.08);
  border: 1px solid rgba(0, 229, 160, 0.3);
  border-radius: 10px;
  padding: 13px 16px;
  margin-bottom: 22px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
}
.dx-prefill-notice-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--aurora-green);
  color: #05080f;
  font-size: 12px;
  font-weight: 800;
}
