/* ── 申込フォーム専用スタイル ── */

body {
  background: #f1f5f9;
  color: #1e293b;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ヘッダー */
.apply-header {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  color: #fff;
  padding: 1.75rem 0 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.apply-header h1 {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  letter-spacing: 0.2px;
}
.apply-header p {
  font-size: 0.88rem;
  opacity: 0.85;
  margin: 0;
}

/* ステップインジケーター */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: opacity 0.2s;
}
.step-num {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #cbd5e1;
  color: #64748b;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, color 0.25s;
  border: 2px solid transparent;
}
.step.active .step-num {
  background: #2563eb;
  color: #fff;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.2);
}
.step.done .step-num {
  background: #16a34a;
  color: #fff;
  border-color: #15803d;
}
.step-label {
  font-size: 0.75rem;
  color: #94a3b8;
  white-space: nowrap;
}
.step.active .step-label { color: #2563eb; font-weight: 600; }
.step.done  .step-label  { color: #16a34a; }
.step-arrow {
  color: #94a3b8;
  font-size: 1.4rem;
  line-height: 1;
  padding-bottom: 22px;
  user-select: none;
}

/* カード */
.apply-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  max-width: 740px;
  margin: 0 auto;
}
.apply-card .card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e3a5f;
}
.apply-card .card-footer {
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
  border-radius: 0 0 10px 10px;
}
.apply-card .card-body {
  padding: 1.5rem;
}

/* フッター */
.apply-footer {
  margin-top: auto;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}
.apply-footer a {
  color: #64748b;
  text-decoration: none;
  font-size: 0.85rem;
}
.apply-footer a:hover { text-decoration: underline; color: #2563eb; }

/* レスポンシブ */
@media (max-width: 576px) {
  .apply-header { padding: 1.2rem 0 1rem; }
  .apply-header h1 { font-size: 1.15rem; }
  .step-label { display: none; }
  .step-arrow { padding-bottom: 0; }
  .apply-card .card-body { padding: 1.25rem 1rem; }
}

/* ── Step B-2 additions ── */
.section-heading {
  font-size: 0.82rem;
  font-weight: 600;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 0.6rem;
}
.form-label-sm { font-size: 0.82rem; font-weight: 500; color: #374151; }
.billing-block {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 1rem;
}

/* ── B-3a: 検体カード ── */
.sample-card { border: 1px solid #dee2e6; border-radius: 8px; }
.sample-card .card-header {
  background: #f8f9fa; border-bottom: 1px solid #e9ecef;
  border-radius: 7px 7px 0 0; padding: 0.5rem 0.75rem;
}
.sample-card .card-body { padding: 1rem 1rem 0.75rem; }
.amount-group { max-width: 180px; }
.amount-group .form-control { max-width: 100px; }
.amount-group .form-select  { max-width: 80px; }
@media (max-width: 576px) { .amount-group { max-width: 100%; } }

/* ── B-3b-2: 分析項目セクション ── */
.analysis-section { border-top: 1px solid #e9ecef; padding-top: 0.75rem; }
.analysis-placeholder { padding: 0.5rem 0; }
.analysis-items .form-check { margin-bottom: 0.2rem; font-size: 0.88rem; }

/* ── B-3b-3: 検体量・小計・合計 ── */
.sample-amount-display { font-size: 0.88rem; padding: 0.25rem 0.5rem; background: #eff6ff; border-radius: 4px; color: #1e40af; }
.sample-subtotal .subtotal-items { padding: 0.25rem 0; }
#grand-total { font-size: 0.9rem; }
#grand-total #total-with-tax { font-size: 1rem; color: #1d4ed8; }

/* ── B-3c-3: ステップ2エラーボックス ── */
.step2-error-box {
  background: #fff5f5;
  border: 1px solid #e53e3e;
  border-radius: 6px;
  padding: 12px 16px;
  margin: 0 0 12px 0;
  color: #c53030;
}
.step2-error-box strong {
  display: block;
  margin-bottom: 6px;
}
.step2-error-box ul {
  margin: 0;
  padding-left: 20px;
}
.step2-error-box li {
  margin: 2px 0;
}

/* ── B-3c-4b-2: 過去データ使用セクション ── */
.past-analysis-section {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fafafa;
}
.past-analysis-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
}
.past-analysis-details {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e0;
}
.past-analysis-file-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 8px 0;
}
.past-analysis-file-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  margin: 3px 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 0.82rem;
}
.past-analysis-file-list li.uploading { color: #888; font-style: italic; }
.past-analysis-file-list .file-remove {
  margin-left: auto;
  background: none;
  border: none;
  color: #c53030;
  cursor: pointer;
  padding: 1px 6px;
  font-size: 0.8rem;
}
.btn-add-pdf {
  padding: 4px 10px;
  border: 1px dashed #4a5568;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.82rem;
}
.btn-add-pdf:hover { background: #edf2f7; }

/* ── B-4: ステップ3 確認・完了 ── */
.step3-summary-section { margin-bottom: 1rem; }
.step3-summary-row {
  display: flex;
  align-items: flex-start;
  padding: 4px 0;
  font-size: 0.88rem;
  border-bottom: 1px solid #f0f0f0;
}
.step3-summary-row:last-child { border-bottom: none; }
.step3-summary-label {
  min-width: 130px;
  color: #555;
  font-weight: 500;
  flex-shrink: 0;
}
.step3-summary-value { flex: 1; color: #222; }
.step3-summary-subtotal {
  background: #f8f9fa;
  border-radius: 4px;
  padding: 4px 8px;
  margin-top: 4px;
  border-bottom: none !important;
}
.step3-error-box {
  background: #fff5f5;
  border: 1px solid #e53e3e;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 16px;
  color: #c53030;
  font-size: 0.88rem;
}
.step3-error-box strong { display: block; margin-bottom: 6px; }
.step3-error-box ul { margin: 0; padding-left: 20px; }
.step3-complete-icon { font-size: 2.5rem; line-height: 1; }

/* ── Phase 3: 顧客コード ── */
.customer-code-form {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1rem;
  font-weight: 700;
  background: #f0f4ff;
  color: #1d4ed8;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.06em;
}
.btn-copy-form {
  font-size: 0.72rem;
  padding: 2px 8px;
  border: 1px solid #adb5bd;
  border-radius: 3px;
  background: #fff;
  color: #495057;
  cursor: pointer;
  line-height: 1.4;
}
.btn-copy-form:hover { background: #e9ecef; }
.btn-copy-form:disabled { opacity: 0.6; cursor: default; }
