/* STEP1-3 レイアウト改善用CSS */

/* ステップタイトルの改善 */
.step-title {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 10px;
}

.step-number {
  background: #000000;
  color: white;
  padding: 6px 12px;
  border-radius: 15px;
  font-weight: bold;
  font-size: 12px;
  margin-right: 10px;
  min-width: 60px;
  text-align: center;
}

.step-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.explain {
  font-size: 12px;
  color: #666;
  margin-bottom: 15px;
  margin-top: 0;
  line-height: 1.5;
}

.option-container {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}

.option-label {
  font-weight: bold;
  color: #555;
  min-width: 15px;
  text-align: center;
  font-size: 12px;
}

/* STEP1 業態選択の改善 */
.selection-methods {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px !important; /* STEP1とSTEP2の間隔を追加 */
}

.selection-method {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 15px;
  transition: all 0.3s ease;
  margin-bottom: 15px;
}

.selection-method:hover {
  border-color: #000000;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.method-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.method-label {
  margin-right: 15px;
}

.custom-checkbox {
  width: 16px;
  height: 16px;
  border: 1px solid #ddd;
  border-radius: 3px;
  display: inline-block;
  position: relative;
  transition: all 0.3s ease;
}

.step-checkbox:checked + .custom-checkbox {
  background: #000000;
  border-color: #000000;
}

.step-checkbox:checked + .custom-checkbox::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: bold;
  font-size: 10px;
}

.method-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

/* STEP2 地域選択の改善 */
.region-selection {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 0 !important; /* STEP1のmargin-bottomと合わせる */
}

.region-option {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
  margin-bottom: 15px;
}

.region-option:hover {
  border-color: #000000;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.region-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.region-label {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.required-mark {
  background: #dc3545;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
}

.optional-mark {
  background: #6c757d;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
}

/* STEP3 ターゲット選択の改善 */
.business-type-selection {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 25px;
}

.business-type-header h3 {
  margin: 0 0 15px 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.bto-radio {
  display: flex;
  gap: 20px;
}

.radio-option {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 10px 15px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  transition: all 0.3s ease;
  background: white;
}

.radio-option:hover {
  border-color: #000000;
  background: #f8f9ff;
}

.radio-option input[type="radio"] {
  display: none;
}

.radio-custom {
  width: 16px;
  height: 16px;
  border: 1px solid #ddd;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  margin-right: 8px;
  transition: all 0.3s ease;
}

.radio-option input[type="radio"]:checked + .radio-custom {
  border-color: #000000;
  background: #000000;
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
}

.radio-label {
  font-size: 13px;
  font-weight: 500;
  color: #333;
}

/* ファネルセクションの改善 */
.funnel-section {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 15px;
}

.funnel-header {
  text-align: center;
  margin-bottom: 15px;
}

.funnel-header h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.funnel-description {
  margin: 0;
  color: #666;
  font-size: 12px;
  line-height: 1.4;
}

.funnel-container {
  width: 100%;
  max-width: 970px;
  margin: 0 auto;
  overflow-x: auto;
}

.funnel-container svg {
  width: 100%;
  height: auto;
  max-width: 970px;
}

/* ドロップダウンの改善 */
.dropdown {
  position: relative;
  width: 100%;
}

.dropdown-btn {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  background: white;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.dropdown-btn:hover {
  border-color: #000000;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.dropdown-btn.not-empty {
  border-color: #000000;
  background: #f8f9ff;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
  display: none;
}

.dropdown-menu div {
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 1px solid #f0f0f0;
}

.dropdown-menu div:hover {
  background: #f8f9ff;
  color: #000000;
}

.dropdown-menu div:last-child {
  border-bottom: none;
}

.dropdown-menu div.selected {
  background: #000000;
  color: white;
}

.dropdown-menu div.inactive {
  opacity: 0.5;
  pointer-events: none;
}

/* 基本レイアウト設定 */
.container.step-container-upper {
  display: flex !important;
  gap: 10px !important;
  align-items: flex-start !important;
  flex-direction: row !important;
  width: 100% !important;
  justify-content: flex-start !important;
  padding: 15px 20px !important;
  z-index: 12 !important;
}

.container.step-container-upper .left-panel {
  width: 25% !important;
  min-width: 300px !important;
  max-width: none !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  flex-shrink: 0 !important;
}

.container.step-container-upper .middle-panel {
  flex: 1 !important;
  min-width: 400px !important;
  max-width: none !important;
  position: relative !important;
  flex-shrink: 0 !important;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .container.step-container-upper {
    flex-direction: column !important;
  }
  
  .container.step-container-upper .left-panel {
    width: 100% !important;
    max-width: none !important;
    margin-bottom: 20px !important;
  }
  
  .container.step-container-upper .middle-panel {
    width: 100% !important;
    max-width: none !important;
  }
  
  .selection-methods {
    gap: 20px;
  }
  
  .selection-method {
    padding: 15px;
  }
  
  .region-selection {
    gap: 15px;
  }
  
  .region-option {
    padding: 15px;
  }
  
  .bto-radio {
    flex-direction: column;
    gap: 10px;
  }
  
  .radio-option {
    justify-content: center;
  }
  
  .funnel-container {
    overflow-x: scroll;
  }
  
  .funnel-container svg {
    min-width: 970px;
  }
}

@media (max-width: 480px) {
  .step-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .step-number {
    margin-right: 0;
    margin-bottom: 10px;
  }
  
  .method-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .method-label {
    margin-right: 0;
  }
  
  .region-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* アニメーション効果 */
.selection-method,
.region-option,
.business-type-selection,
.funnel-section {
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* フォーカス状態の改善 */
.dropdown-btn:focus,
.radio-option:focus-within {
  outline: 2px solid #000000;
  outline-offset: 2px;
}

/* 選択状態の視覚的フィードバック */
.step-checkbox:checked + .custom-checkbox + h3 {
  color: #000000;
}

.radio-option input[type="radio"]:checked ~ .radio-label {
  color: #000000;
  font-weight: 600;
}

/* 基本レイアウト設定 - PCで横並びにする */
body #wrap .container.step-container-upper {
  display: flex !important;
  flex-direction: row !important;
  gap: 10px !important;
  align-items: flex-start !important;
  max-width: 1600px !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 15px 20px !important;
  justify-content: flex-start !important;
}

body #wrap .container.step-container-upper .left-panel {
  width: 25% !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  flex-shrink: 0 !important;
  padding-right: 20px !important;
}

body #wrap .container.step-container-upper .middle-panel {
  flex: 1 !important;
  position: relative !important;
  flex-shrink: 0 !important;
  padding-left: 0 !important;
}

/* より強力なセレクターで既存スタイルを上書き */
#wrap .container.step-container-upper {
  display: flex !important;
  flex-direction: row !important;
  gap: 10px !important;
  align-items: flex-start !important;
  max-width: 1600px !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 15px 20px !important;
}

#wrap .container.step-container-upper .left-panel {
  width: 25% !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  flex-shrink: 0 !important;
  padding-right: 20px !important;
}

#wrap .container.step-container-upper .middle-panel {
  flex: 1 !important;
  position: relative !important;
  flex-shrink: 0 !important;
  padding-left: 0 !important;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  body #wrap .container.step-container-upper {
    flex-direction: column !important;
  }
  
  body #wrap .container.step-container-upper .left-panel {
    width: 100% !important;
    max-width: none !important;
    margin-bottom: 20px !important;
  }
  
  body #wrap .container.step-container-upper .middle-panel {
    width: 100% !important;
    max-width: none !important;
  }
}

/* 既存のstyle.cssの幅設定を強制的に上書き */
body #wrap .container.step-container-upper .left-panel {
  width: 25% !important;
  min-width: 300px !important;
  max-width: none !important;
}

body #wrap .container.step-container-upper .middle-panel {
  flex: 1 !important;
  min-width: 400px !important;
  max-width: none !important;
}

/* さらに強力なセレクターで確実に適用 */
html body #wrap .container.step-container-upper {
  display: flex !important;
  flex-direction: row !important;
  gap: 10px !important;
  align-items: flex-start !important;
  max-width: 1600px !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 15px 20px !important;
  justify-content: flex-start !important;
}

/* 最高優先度で確実に適用 */
html body #wrap .main-content .container.step-container-upper {
  display: flex !important;
  flex-direction: row !important;
  gap: 10px !important;
  align-items: flex-start !important;
  max-width: 1600px !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 15px 20px !important;
  justify-content: flex-start !important;
}

html body #wrap .container.step-container-upper .left-panel {
  width: 25% !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  flex-shrink: 0 !important;
  padding-right: 20px !important;
}

/* 最高優先度で確実に適用 */
html body #wrap .main-content .container.step-container-upper .left-panel {
  width: 25% !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  flex-shrink: 0 !important;
  padding-right: 20px !important;
}

html body #wrap .container.step-container-upper .middle-panel {
  flex: 1 !important;
  position: relative !important;
  flex-shrink: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* 最高優先度で確実に適用 */
html body #wrap .main-content .container.step-container-upper .middle-panel {
  flex: 1 !important;
  position: relative !important;
  flex-shrink: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* STEP3のブロック全体の幅調整 */
html body #wrap .container.step-container-upper .middle-panel.step-container {
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding: 25px !important;
  background-color: #fff !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

/* STEP3の右側余白をSTEP4・5に合わせる */
html body #wrap .container.step-container-upper .middle-panel {
  max-width: none;
  margin-right: 0;
}

/* STEP3のコンテナにパディングを強制適用 */
html body #wrap .main-content .container.step-container-upper .middle-panel.step-container {
  padding: 25px !important;
  background-color: #fff !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

/* STEP3の最も具体的なセレクター */
.middle-panel.step-container {
  padding: 25px !important;
  background-color: #fff !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

/* すべてのSTEPでタイトルと説明文の間隔を縮める */
.step-title {
  margin-bottom: 8px !important;
}

.explain {
  margin-top: 0 !important;
}

/* STEP4とSTEP5のレイアウト修正 */
.step4-box, .step5-box {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 25px;
  margin-bottom: 20px;
  max-width: none;
  width: 100%;
  margin-left: 0;
  margin-right: auto;
}

/* STEP4・5のコンテナ全体の幅制限 */
.container:not(.step-container-upper) {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px;
}

.step4-box .step-content, .step5-box .step-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.step4-box .dropdown, .step5-box .dropdown {
  margin-bottom: 15px;
}

.step4-box .btn_free, .step5-box .btn_free {
  grid-column: 1 / -1;
  text-align: right;
  margin-top: 20px;
}

/* 強制的なスタイル上書き - 最高優先度 */
html body #wrap .container.step-container-upper .step-title h2 {
  font-size: 18px !important;
  font-weight: 600 !important;
  color: #333 !important;
  margin: 0 !important;
}

/* STEP1とSTEP2の間隔を強制的に適用 */
html body #wrap .container.step-container-upper .left-panel .selection-methods {
  margin-bottom: 20px !important;
}

html body #wrap .container.step-container-upper .left-panel .region-selection {
  margin-top: 0 !important;
}

/* STEP1のコンテナにmargin-bottomを追加 */
html body #wrap .container.step-container-upper .left-panel .step1-box {
  margin-bottom: 20px !important;
}

/* STEP2のコンテナにmargin-topを追加 */
html body #wrap .container.step-container-upper .left-panel .step2-box {
  margin-top: 0 !important;
}

html body #wrap .container.step-container-upper .explain {
  font-size: 12px !important;
  color: #666 !important;
  margin-bottom: 15px !important;
  margin-top: 0 !important;
  line-height: 1.5 !important;
}

html body #wrap .container.step-container-upper .dropdown-btn {
  font-size: 13px !important;
  padding: 8px 12px !important;
  border: 1px solid #e9ecef !important;
  border-radius: 6px !important;
}

html body #wrap .container.step-container-upper .custom-checkbox {
  width: 16px !important;
  height: 16px !important;
  border: 1px solid #ddd !important;
  border-radius: 3px !important;
}

html body #wrap .container.step-container-upper .radio-custom {
  width: 16px !important;
  height: 16px !important;
  border: 1px solid #ddd !important;
  margin-right: 8px !important;
}

html body #wrap .container.step-container-upper .radio-label {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #333 !important;
}

html body #wrap .container.step-container-upper .option-label {
  font-size: 12px !important;
  font-weight: bold !important;
  color: #555 !important;
  min-width: 15px !important;
  text-align: center !important;
}