/* ============================================================
   style.css  ─  指定申請書フォーム 共通スタイル
   ============================================================ */

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: "Yu Gothic UI","Hiragino Kaku Gothic ProN",Meiryo,sans-serif;
  background: #f0f4f8;
  padding: 24px;
  color: #333;
  font-size: 14px;
}

/* ── 表示切り替え ── */
.hidden { display: none !important; }

/* ── ログイン画面 ── */
#auth-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f4f8;
  z-index: 10;
}
.login-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  padding: 48px 56px;
  text-align: center;
  max-width: 400px;
  width: 100%;
}
.login-card h1 { color: #2c5282; font-size: 20px; margin: 0 0 8px; }
.login-card p  { color: #718096; font-size: 13px; margin: 0 0 32px; }

/* ── 選択画面 ── */
#selection-screen { max-width: 520px; margin: 60px auto; }
.selection-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  padding: 40px 48px;
}
.selection-card h2 { color: #2c5282; margin: 0 0 24px; font-size: 18px; }
.sel-field { margin-bottom: 20px; }
.sel-field label {
  display: block; font-weight: 600; margin-bottom: 6px;
  font-size: 13px; color: #2d3748;
}
.sel-field select {
  width: 100%; padding: 8px 10px; border: 1px solid #cbd5e0;
  border-radius: 4px; font-size: 14px; font-family: inherit;
}
.sel-field select:focus {
  outline: none; border-color: #3182ce;
  box-shadow: 0 0 0 2px rgba(49,130,206,.2);
}

/* ── フォーム画面 ── */
#form-screen { }
.topbar {
  max-width: 960px; margin: 0 auto 12px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: #4a5568;
}
.topbar .user-info { display: flex; align-items: center; gap: 10px; }
.container {
  max-width: 960px; margin: 0 auto; background: #fff;
  border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.08); padding: 32px 40px;
}

/* ── プログレスバー ── */
.progress-wrap {
  display: flex; align-items: flex-start; justify-content: center;
  gap: 0; margin-bottom: 32px; overflow-x: auto; padding-bottom: 4px;
}
.progress-step {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; min-width: 80px; position: relative;
}
.progress-step:not(:last-child)::after {
  content: ""; position: absolute; top: 14px; left: 50%; width: 100%;
  height: 2px; background: #e2e8f0; z-index: 0;
}
.progress-step.done::after { background: #3182ce; }
.step-bubble {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid #e2e8f0;
  background: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #a0aec0; position: relative; z-index: 1;
}
.progress-step.done   .step-bubble { background: #3182ce; border-color: #3182ce; color: #fff; }
.progress-step.active .step-bubble { background: #fff; border-color: #3182ce; color: #3182ce; }
.step-label { font-size: 11px; color: #718096; margin-top: 4px; text-align: center; line-height: 1.3; }
.progress-step.active .step-label { color: #2c5282; font-weight: 600; }

/* ── セクション ── */
.page-title { color: #2c5282; font-size: 18px; font-weight: 600; margin: 0 0 20px; }
section.field-group {
  margin: 16px 0; border: 1px solid #e2e8f0; border-radius: 6px; overflow: hidden;
}
section.field-group > h2 {
  background: #edf2f7; margin: 0; padding: 10px 16px;
  font-size: 15px; color: #2d3748; border-bottom: 1px solid #e2e8f0;
}
.group-body { padding: 16px; }
.field { margin-bottom: 14px; display: flex; align-items: flex-start; gap: 12px; }
.field-label {
  flex: 0 0 200px; font-weight: 600; color: #2d3748;
  padding-top: 7px; font-size: 13px;
}
.req {
  display: inline-block; background: #fc8181; color: #fff;
  font-size: 10px; padding: 1px 5px; border-radius: 3px;
  margin-left: 4px; vertical-align: middle;
}
.field-input { flex: 1; }
.field-input input[type=date] {
  min-width: 160px;
  cursor: pointer;
}
.field-input input[type=text],
.field-input input[type=date],
.field-input input[type=tel],
.field-input input[type=email],
.field-input input[type=number],
.field-input select,
.field-input textarea {
  padding: 6px 10px; border: 1px solid #cbd5e0; border-radius: 4px;
  font-size: 14px; font-family: inherit; background: #fff;
}
.field-input input:focus,
.field-input select:focus,
.field-input textarea:focus {
  outline: none; border-color: #3182ce;
  box-shadow: 0 0 0 2px rgba(49,130,206,.2);
}
.field-input textarea { width: 100%; min-height: 80px; resize: vertical; }
.note { font-size: 12px; color: #718096; margin-top: 4px; }
.w-wide   { width: 100%; max-width: 480px; }
.w-medium { width: 160px; }
.w-small  { width: 80px; }
.inline-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.zip-sep { font-weight: bold; color: #4a5568; }

/* ── サービステーブル ── */
table.svc-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
table.svc-table th,
table.svc-table td {
  border: 1px solid #cbd5e0; padding: 6px 8px; text-align: center; vertical-align: middle;
}
table.svc-table th { background: #2c5282; color: #fff; font-size: 12px; }
table.svc-table td.svc-cat  { text-align: left; background: #edf2f7; font-size: 11px; color: #4a5568; }
table.svc-table td.svc-name { text-align: left; font-weight: 500; background: #f7fafc; }
table.svc-table tr:hover td:not(.svc-cat):not(.svc-name) { background: #fefcbf; }
table.svc-table input[type=date] { font-size: 11px; padding: 2px 4px; width: 130px; }

/* ── 確認ページ ── */
.confirm-intro {
  background: #ebf4ff; border-left: 4px solid #4299e1;
  padding: 10px 14px; margin-bottom: 20px;
  font-size: 13px; color: #2a4365; border-radius: 0 4px 4px 0;
}
.confirm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.confirm-table tr { border-bottom: 1px solid #e2e8f0; }
.confirm-table tr:last-child { border-bottom: none; }
.confirm-table td { padding: 8px 12px; vertical-align: top; line-height: 1.5; }
.confirm-table td.c-label {
  width: 200px; color: #718096; font-weight: 600;
  white-space: nowrap;
}
.confirm-table td.c-value { color: #2d3748; }
.confirm-table td.c-empty { color: #a0aec0; font-style: italic; }

/* ── ナビゲーション ── */
.nav-buttons {
  margin-top: 28px; padding-top: 20px; border-top: 2px solid #e2e8f0;
  display: flex; justify-content: space-between; align-items: center;
}
.nav-info { font-size: 13px; color: #718096; }

/* ── ボタン共通 ── */
button {
  background: #3182ce; color: #fff; border: none;
  padding: 10px 28px; font-size: 15px; border-radius: 4px;
  cursor: pointer; font-family: inherit;
}
button:hover    { background: #2c5282; }
button:disabled { background: #a0aec0; cursor: not-allowed; }
button.secondary { background: #fff; color: #3182ce; border: 1px solid #3182ce; }
button.secondary:hover { background: #ebf4ff; }
.btn-sm { padding: 4px 14px; font-size: 13px; }

/* ── 完了画面 ── */
#done-screen { max-width: 480px; margin: 80px auto; text-align: center; }
.done-card { background: #fff; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.08); padding: 48px; }
.done-card .icon { font-size: 48px; margin-bottom: 16px; }
.done-card h2 { color: #2c5282; margin: 0 0 12px; }
.done-card p  { color: #718096; font-size: 14px; margin: 0 0 24px; }

/* ── エラーメッセージ ── */
#error-msg {
  display: none; margin-top: 16px; padding: 12px 16px; border-radius: 4px;
  background: #fed7d7; border-left: 4px solid #e53e3e; color: #742a2a; font-size: 14px;
}
.spinner {
  display: none; width: 16px; height: 16px;
  border: 2px solid #fff; border-top-color: transparent;
  border-radius: 50%; animation: spin .6s linear infinite;
  vertical-align: middle; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Flatpickr カスタマイズ ── */
.flatpickr-calendar {
  font-family: "Yu Gothic UI","Hiragino Kaku Gothic ProN",Meiryo,sans-serif;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: #3182ce;
  border-color: #3182ce;
}
.flatpickr-day:hover {
  background: #ebf4ff;
}
.flatpickr-months .flatpickr-month {
  background: #2c5282;
  color: #fff;
  border-radius: 6px 6px 0 0;
}
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  color: #fff;
  fill: #fff;
}
.flatpickr-current-month input.cur-year,
.flatpickr-current-month .flatpickr-monthDropdown-months {
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}
.flatpickr-weekday {
  color: #4a5568;
  font-weight: 600;
}
.flatpickr-day.today {
  border-color: #3182ce;
  color: #3182ce;
  font-weight: 600;
}
.flatpickr-day.today:hover {
  background: #ebf4ff;
  color: #2c5282;
}
/* 入力欄は既存スタイルを維持 */
.flatpickr-input {
  cursor: pointer;
}
