/* =========================================================
   書類発行申請フォーム — スタイル
   AB CORPORATION の既存サイトに馴染む、落ち着いた業務フォーム調。
   フラット・白基調・濃紺アクセント・薄い枠線・控えめな角丸。
   ブランド色は :root の CSS 変数で一元管理（差し替え可）。
   ========================================================= */

:root {
  /* ブランド（濃紺をアクセントに1色） */
  --brand: #1D67CD;
  --brand-dark: #15293f;

  /* ベース */
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-muted: #f7f8fa;
  --text: #2b2b2b;
  --heading: #1a2733;
  --muted: #5b6573;
  --faint: #8a929c;
  --border: #d9dee4;
  --border-strong: #c2c9d1;
  --danger: #c0392b;
  --warning: #9a6700;
  --success: #2e7d52;

  --radius: 6px;
  --radius-sm: 4px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ---------- ヘッダー ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand-img { height: 32px; width: auto; display: block; }
.brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand-dark);
}
.site-header-sub { font-size: 0.8125rem; color: var(--faint); }

/* ---------- ページ ---------- */
.page { padding: 2rem 1rem 3rem; }
.container { max-width: 860px; margin: 0 auto; }

/* ---------- ステップインジケータ（フラット） ---------- */
.steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0.25rem;
  margin-bottom: 1.75rem;
}
.step { display: flex; flex-direction: column; align-items: center; }
.step-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 500; font-size: 0.875rem;
  background: var(--surface);
  color: var(--faint);
  border: 1px solid var(--border-strong);
}
.step-circle svg { width: 16px; height: 16px; }
.step-label {
  margin-top: 0.4rem;
  font-size: 0.8125rem;
  color: var(--faint);
  white-space: nowrap;
}
.step-bar {
  width: 56px; height: 2px;
  background: var(--border-strong);
  margin: 17px 0.5rem 0;
}
.step.is-active .step-circle,
.step.is-done .step-circle {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.step.is-active .step-label,
.step.is-done .step-label { color: var(--brand); font-weight: 500; }
.step-bar.is-done { background: var(--brand); }

/* ---------- カード ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-head {
  padding: 1.5rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}
.card-title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--heading);
}
.card-desc { margin: 0.6rem 0 0; font-size: 0.9375rem; color: var(--muted); }
.card-body { padding: 1.75rem 1.5rem 2rem; }

@media (min-width: 640px) {
  .card-body { padding: 2rem 2rem 2.25rem; }
}

/* ---------- フィールド ---------- */
.field-stack { display: flex; flex-direction: column; gap: 1.25rem; }
.field-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 720px) {
  .field-grid { grid-template-columns: 1fr 1fr; }
}
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field.col-full { grid-column: 1 / -1; }

.field-label { font-weight: 500; color: var(--heading); font-size: 0.9375rem; }
.badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.4;
  padding: 0.05rem 0.4rem;
  border-radius: var(--radius-sm);
  margin-left: 0.4rem;
  vertical-align: middle;
}
.badge-required { background: var(--danger); color: #fff; }
.badge-optional { background: #eef0f2; color: var(--muted); border: 1px solid var(--border); }

.control {
  width: 100%;
  height: 44px;
  padding: 0 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea.control {
  height: auto; min-height: 84px;
  padding: 0.55rem 0.75rem;
  resize: vertical; line-height: 1.6;
}
.control::placeholder { color: #b5bcc4; }
.control:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(31, 58, 95, 0.15);
}
.control.is-invalid { border-color: var(--danger); }
select.control {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235b6573' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  padding-right: 2rem;
}

.field-error { margin: 0; font-size: 0.8125rem; color: var(--danger); }
.field-error:empty { display: none; }
.config-warning {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--warning);
}

/* ---------- 書類固有セクション ---------- */
.sep { border: none; border-top: 1px solid var(--border); margin: 1.75rem 0; }
.doc-section-head { margin-bottom: 1.25rem; }
.doc-section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--heading);
  padding-left: 0.6rem;
  border-left: 3px solid var(--brand);
}

/* ---------- 同意 / ハニーポット ---------- */
.consent {
  display: flex; align-items: flex-start; gap: 0.6rem;
  padding: 0.875rem 1rem;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.consent-check {
  width: 17px; height: 17px;
  margin-top: 0.2rem;
  accent-color: var(--brand);
  cursor: pointer; flex-shrink: 0;
}
.consent-label { font-size: 0.9375rem; color: var(--text); cursor: pointer; }
.link { color: var(--brand); text-decoration: underline; }
.link:hover { color: var(--brand-dark); }

/* ハニーポット: 人には見えない位置に隠す（display:none を避けボットに入力させる） */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: auto;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* hCaptcha */
.hcaptcha-container { margin-top: 1.25rem; }
.hcaptcha-container.is-hidden { display: none; }

/* ---------- ボタン / アクション ---------- */
.actions { display: flex; gap: 0.75rem; padding-top: 1.5rem; }
.actions-center { justify-content: center; }
.actions-split { flex-direction: column; }
@media (min-width: 640px) {
  .actions-split { flex-direction: row; justify-content: center; }
}
.btn {
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.75rem 2.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { color: #fff; background: var(--brand); border-color: var(--brand); }
.btn-primary:not(:disabled):hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-outline { background: var(--surface); color: var(--muted); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }

/* スマホ時のボタン順序（送信を上・戻るを下） */
.actions-split .btn-outline { order: 2; }
.actions-split .btn-primary { order: 1; }
@media (min-width: 640px) {
  .actions-split .btn-outline { order: 1; }
  .actions-split .btn-primary { order: 2; }
}

/* ---------- 確認画面 ---------- */
.notice {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.9375rem;
}
.confirm-list {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.confirm-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.2rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
}
.confirm-row:last-child { border-bottom: none; }
.confirm-row:nth-child(even) { background: var(--surface-muted); }
@media (min-width: 720px) {
  .confirm-row { grid-template-columns: 1fr 2fr; gap: 0.75rem; }
}
.confirm-label { font-weight: 500; color: var(--muted); font-size: 0.9375rem; }
.confirm-value { color: var(--heading); white-space: pre-wrap; word-break: break-word; }

.submit-error {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  background: #fdf0ee;
  border: 1px solid #f0c6c0;
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 0.9375rem;
}

/* ---------- 完了画面 ---------- */
.step-done { text-align: center; padding: 1rem 0; }
.done-icon {
  width: 56px; height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.done-icon svg { width: 28px; height: 28px; }
.done-title { font-size: 1.25rem; font-weight: 700; color: var(--heading); margin: 0 0 1.25rem; }
.done-box {
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.25rem;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-align: left;
}
.done-box p { margin: 0; }
.done-box p + p { margin-top: 0.5rem; }
.done-note { font-size: 0.875rem; }

/* ---------- フッター ---------- */
.footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--faint);
}
.footer-company { margin: 0; font-weight: 700; color: var(--muted); letter-spacing: 0.02em; }
.footer-copy { margin: 0.35rem 0 0; font-size: 0.8125rem; }

/* ---------- プライバシーポリシー ---------- */
.policy-card .card-head { background: var(--surface); }
.policy-body { font-size: 0.9375rem; }
.policy-section { padding: 1.15rem 0; border-bottom: 1px solid var(--border); }
.policy-section:first-child { padding-top: 0; }
.policy-section:last-of-type { border-bottom: none; }
.policy-section h2 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  color: var(--heading);
}
.policy-section p { margin: 0.45rem 0; }
.policy-section ul { margin: 0.5rem 0 0; padding-left: 1.3rem; }
.policy-section li { margin: 0.25rem 0; }
.policy-contact {
  padding: 0.75rem 0.9rem;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.policy-date { margin: 1.25rem 0 0; color: var(--muted); text-align: right; }

/* ---------- ユーティリティ ---------- */
.is-hidden { display: none !important; }

@media (max-width: 480px) {
  .step-prefix { display: none; }
  .step-bar { width: 28px; }
  .btn { padding: 0.75rem 1.25rem; width: 100%; }
  .actions-center .btn { max-width: 320px; }
}
