/* =========================================
   CSS カスタムプロパティ
   ★ デザイナーはここを編集してください ★
   ========================================= */
:root {
  --color-primary:   #2D6A4F;   /* メインカラー（緑系） */
  --color-secondary: #52B788;   /* サブカラー */
  --color-accent:    #D4A84B;   /* アクセントカラー（ゴールド） */
  --color-text:      #333333;
  --color-text-sub:  #666666;
  --color-bg:        #ffffff;
  --color-bg-sub:    #f5f7f5;
  --color-border:    #dddddd;
  --font-sans:       'Noto Sans JP', sans-serif;
  --font-serif:      'Noto Serif JP', serif;
  --border-radius:   8px;
  --max-width:       640px;
}

/* =========================================
   リセット・ベース
   ========================================= */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }
h1, h2, h3 { margin: 0; }
a { color: inherit; }

/* =========================================
   共通レイアウト
   ========================================= */
.wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* =========================================
   ボタン 共通
   ========================================= */
.btn {
  display: block;
  width: 100%;
  padding: 15px 20px;
  border: 2px solid var(--color-primary);
  border-radius: var(--border-radius);
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.2s;
  -webkit-appearance: none;
  appearance: none;
  letter-spacing: 0.05em;
}
.btn:hover { opacity: 0.82; }
.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-sub {
  background: transparent;
  color: var(--color-primary);
}
.btn-sub:hover { background: rgba(45,106,79,0.06); opacity: 1; }

/* =========================================
   スタート画面
   ========================================= */
.start {}

.start-kv { width: 100%; }
.start-kv img { width: 100%; }

.start-notice {
  padding: 16px 20px;
  background: var(--color-bg-sub);
  font-size: 0.88rem;
  line-height: 1.85;
  border-top: 3px solid var(--color-primary);
}

.start-inner {
  padding: 28px 20px 48px;
}

.start-lead {
  margin-bottom: 28px;
  text-align: center;
}
.start-lead-text {
  font-size: 1rem;
  line-height: 1.8;
  font-weight: 700;
  margin-bottom: 6px;
}
.start-lead-time {
  font-size: 0.82rem;
  color: var(--color-text-sub);
}

.start-name { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.form-text {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-text);
  background: #fff;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.form-text:focus {
  border-color: var(--color-primary);
  outline: none;
}
.form-text.is-error { border-color: #e74c3c; }

.error-message {
  color: #e74c3c;
  font-size: 0.82rem;
  margin: 6px 0 0;
}

/* =========================================
   ステージラッパー
   ========================================= */
.stage-wrapper { display: none; }
.stage-wrapper.active { display: block; }
.stage { display: none; }

/* =========================================
   プログレスバー
   ========================================= */
.progress-bar {
  padding: 20px 20px 0;
  margin-bottom: 4px;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  position: relative;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  z-index: 1;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-sub);
  transition: all 0.3s;
}
.step-label {
  font-size: 0.7rem;
  color: var(--color-text-sub);
  white-space: nowrap;
}

.progress-step.active .step-num {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}
.progress-step.active .step-label { color: var(--color-primary); font-weight: 700; }

.progress-step.completed .step-num {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
  opacity: 0.45;
}

.progress-track {
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: -36px;
  position: relative;
  z-index: 0;
}
.progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 2px;
  transition: width 0.45s ease;
  width: 0;
}

/* =========================================
   ステージ内共通
   ========================================= */
.stage-inner {
  padding: 24px 20px 8px;
}

.stage-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-primary);
}

.stage-desc {
  font-size: 0.88rem;
  color: var(--color-text-sub);
  margin: -12px 0 20px;
}

/* =========================================
   プランカード（Stage 1）
   ========================================= */
.plan-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.plan-card {
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}
.plan-card:hover {
  border-color: var(--color-secondary);
}
.plan-card.active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(45,106,79,0.15);
}

.plan-card-name {
  padding: 12px 16px 10px;
  font-weight: 700;
  font-size: 0.95rem;
  background: var(--color-bg-sub);
  border-bottom: 1px solid var(--color-border);
  transition: background 0.2s;
}
.plan-card.active .plan-card-name {
  background: var(--color-primary);
  color: #fff;
  border-bottom-color: transparent;
}

.plan-card-body {
  padding: 10px 16px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.plan-card-detail {
  font-size: 0.82rem;
  color: var(--color-text-sub);
  line-height: 1.5;
  margin: 0;
}
.plan-card-price {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
  margin: 0;
}
.plan-card.active .plan-card-price { color: var(--color-primary); }

/* =========================================
   フォームセクション（Stage 2）
   ========================================= */
.form-section {
  margin-bottom: 28px;
}
.form-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text-sub);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.form-group {
  margin-bottom: 16px;
}

/* 数値入力（人数） */
.num-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  background: #fff;
  color: var(--color-primary);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}
.btn-num:hover {
  background: var(--color-primary);
  color: #fff;
}

.form-num {
  width: 64px;
  padding: 8px 10px;
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  color: var(--color-text);
  -webkit-appearance: none;
  appearance: none;
}
.form-num:focus {
  border-color: var(--color-primary);
  outline: none;
}
/* number input の矢印非表示 */
.form-num::-webkit-inner-spin-button,
.form-num::-webkit-outer-spin-button { -webkit-appearance: none; }
.form-num[type=number] { -moz-appearance: textfield; }

.form-num-unit {
  font-size: 0.88rem;
  color: var(--color-text-sub);
}

/* セレクトボックス */
.form-select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--color-text);
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.form-select:focus {
  border-color: var(--color-primary);
  outline: none;
}

/* =========================================
   オプション（Stage 3）
   ========================================= */
.option-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}
.option-row:last-child { border-bottom: none; }

.option-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.option-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.option-info {
  flex: 1;
}
.option-name {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
}
.option-note {
  display: block;
  font-size: 0.78rem;
  color: var(--color-text-sub);
  margin-top: 2px;
}
.option-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}

.option-qty-wrap {
  display: none;
  margin-top: 10px;
  padding-left: 32px;
}
.option-qty-label {
  font-size: 0.88rem;
  color: var(--color-text-sub);
  display: flex;
  align-items: center;
  gap: 8px;
}
.option-qty {
  width: 64px;
}

.members-section { margin-top: 8px; }
.option-row-members { border-bottom: none; }

/* =========================================
   question-next（ボタンエリア）
   ========================================= */
.question-next {
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* =========================================
   ローディング
   ========================================= */
.loading {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  z-index: 999;
  align-items: center;
  justify-content: center;
}
.loading-inner { text-align: center; }
.loading-spin {
  display: block;
  width: 44px;
  height: 44px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  font-size: 0.9rem;
  color: var(--color-text-sub);
  margin: 0;
}

/* =========================================
   結果ページ
   ========================================= */
.result {}

.result-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px 48px;
}

.result-kv { margin-bottom: 24px; }
.result-kv img { width: 100%; }

.result-label {
  text-align: center;
  font-size: 0.88rem;
  color: var(--color-text-sub);
  margin: 0 0 8px;
}
.result-name {
  color: var(--color-primary);
  font-weight: 700;
}

.result-plan-heading {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  color: var(--color-primary);
  margin: 0 0 28px;
  line-height: 1.4;
}

/* 明細ブロック */
.estimate-block {
  background: var(--color-bg-sub);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 28px;
}
.estimate-block-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-primary);
}

.estimate-list {
  margin-bottom: 16px;
}

.estimate-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.estimate-item:last-child { border-bottom: none; }

.estimate-item-inner {
  flex: 1;
}
.estimate-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.4;
}
.estimate-qty {
  display: block;
  font-size: 0.78rem;
  color: var(--color-text-sub);
  margin-top: 2px;
}
.estimate-subtotal {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--color-text);
}

.estimate-item-discount .estimate-subtotal { color: #e74c3c; }
.estimate-item-empty {
  font-size: 0.88rem;
  color: var(--color-text-sub);
  text-align: center;
  padding: 20px 0;
  border-bottom: none;
}

/* 合計 */
.estimate-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 2px solid var(--color-primary);
  gap: 12px;
}
.estimate-total-label {
  font-size: 0.92rem;
  font-weight: 700;
}
.estimate-total-value-wrap {
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.estimate-total-value {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
}
.estimate-total-unit {
  font-size: 0.9rem;
  color: var(--color-text);
}

.estimate-note {
  font-size: 0.78rem;
  color: var(--color-text-sub);
  margin: 16px 0 0;
  line-height: 1.7;
}

/* CTA */
.result-cta { margin: 0 0 24px; }
.result-cta-text {
  font-size: 0.88rem;
  text-align: center;
  margin: 0 0 14px;
  color: var(--color-text-sub);
}
.btn-cta {
  display: block;
  padding: 18px;
  background: var(--color-primary);
  color: #fff;
  text-align: center;
  text-decoration: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 700;
  transition: opacity 0.2s;
  letter-spacing: 0.05em;
}
.btn-cta:hover { opacity: 0.82; }

/* 印刷 */
.result-print { text-align: center; }
.btn-print {
  font-size: 0.82rem;
  color: var(--color-text-sub);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-sans);
}

/* =========================================
   フッター
   ========================================= */
footer {
  padding: 24px 20px;
  text-align: center;
  border-top: 1px solid var(--color-border);
}
.copyright {
  font-size: 0.75rem;
  color: var(--color-text-sub);
}

/* =========================================
   PC（768px以上）
   ========================================= */
@media (min-width: 768px) {
  .start-notice { padding: 20px 40px; }
  .start-inner  { padding: 36px 40px 60px; }

  .progress-bar  { padding: 28px 40px 0; }

  .stage-inner { padding: 32px 40px 8px; }

  .plan-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .plan-card-body { flex-direction: column; align-items: flex-start; gap: 6px; }

  .question-next {
    padding: 28px 0;
    flex-direction: row-reverse;
    align-items: center;
  }
  .btn-sub { width: auto; min-width: 140px; }
  .btn-to-stage2,
  .btn-to-stage3,
  .btn-result { flex: 1; }

  .result-inner { padding: 0 40px 60px; }
  .estimate-block { padding: 28px; }
}

/* =========================================
   印刷
   ========================================= */
@media print {
  .result-cta,
  .result-print,
  footer { display: none; }
  .result-inner { padding: 0; }
}
