/* ヒアリングの入力画面(新規サイトのウィザード・ヒアリング内容の編集フォーム)
   のスタイル(layout.tsのlayout()がapp.cssの後に読み込む) */

/* ウィザード上部の2段の流れ: 質問のまとまり(基本情報 > 目的と雰囲気 > …)
   と、表示中のまとまりの中の質問(サイト名 > 業種 > …)。今の位置・答え
   終えたものの印付けと、出さないものを隠すのはbrief-wizard.js */
.wizard-progress-trail {
  display:flex;
  flex-direction:column;
  gap:10px;
  margin:0 0 14px;
}

.wizard-groups,
.wizard-step-trail {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  row-gap:6px;
  list-style:none;
  margin:0;
  padding:0;
}

.wizard-group,
.wizard-trail-step {
  display:flex;
  align-items:center;
}

/* 流れの区切りの矢印 */
.wizard-trail-separator {
  display:inline-flex;
  margin:0 4px;
  color:var(--text-faint);
}

.wizard-trail-separator .icon {
  width:14px;
  height:14px;
}

/* まとまり・質問の名前はボタン(一度通ったものだけ押して戻れる。押せる
   ようにするのはbrief-wizard.js) */
.wizard-group-name,
.wizard-trail-step-name {
  font:inherit;
  cursor:pointer;
}

.wizard-group-name:disabled,
.wizard-trail-step-name:disabled {
  cursor:default;
}

.wizard-group-name {
  padding:4px 12px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--surface);
  font-size:12px;
  color:var(--text-muted);
}

.wizard-group-name:not(:disabled):hover {
  border-color:var(--primary);
}

.wizard-group.wizard-group-done .wizard-group-name {
  border-color:var(--primary-soft);
  color:var(--primary);
}

.wizard-group.wizard-group-current .wizard-group-name {
  border-color:var(--primary);
  background:var(--primary-soft);
  color:var(--primary);
  font-weight:700;
}

.wizard-group.wizard-group-skipped {
  display:none;
}

/* まとまりの中の質問の流れ(まとまりの流れより一段控えめに) */
.wizard-step-trail {
  min-height:20px;
  padding-left:2px;
  font-size:13px;
  color:var(--text-faint);
}

.wizard-trail-step-name {
  padding:0;
  border:0;
  background:none;
  font-size:inherit;
  color:inherit;
}

.wizard-trail-step-name:not(:disabled):hover {
  text-decoration:underline;
}

.wizard-trail-step.wizard-trail-step-done {
  color:var(--text-muted);
}

.wizard-trail-step.wizard-trail-step-current {
  color:var(--primary);
  font-weight:700;
}

.wizard-trail-step.wizard-trail-step-hidden {
  display:none;
}

/* 最初のステップの「サイトができるまで」の流れ */
.wizard-flow {
  display:flex;
  flex-direction:column;
  gap:14px;
  list-style:none;
  margin:20px 0 0;
  padding:0;
}

.wizard-flow-stage {
  display:flex;
  align-items:flex-start;
  gap:12px;
}

.wizard-flow-stage p {
  margin:2px 0 0;
}

.wizard-flow-icon {
  display:inline-flex;
  flex:none;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border-radius:50%;
  background:var(--primary-soft);
  color:var(--primary);
}

/* 最後のステップの、「サイトを作成」を押した後の流れの案内 */
.wizard-next-note {
  margin-top:24px;
  padding:12px 14px;
  border-radius:12px;
  background:var(--surface-tint);
  border:1px solid var(--border);
  font-size:13px;
}

.wizard-head {
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  margin:6px 0;
}

.wizard-bar {
  height:8px;
  background:var(--track);
  border-radius:99px;
  overflow:hidden;
  margin-bottom:20px;
}

.wizard-bar > i {
  display:block;
  height:100%;
  background:var(--brand-gradient);
  transition:width .2s;
}

.wizard-step {
  display:none;
}

/* ヒアリングのウィザード本体(進捗・質問・ボタン)を囲む枠。下のボタンの列を
   質問の長さに関わらず画面の下の同じ位置に出すため、枠を画面の高さ以上に
   伸ばし、ボタンの列を枠の下端に置く(画面の下端に固定するのは
   .wizard-actionsのsticky。枠の上端は画面の上端より下にあるので、枠の下端は
   必ず画面の外になり、ボタンの列は常に画面の下端に貼り付く) */
.wizard-card {
  display:flex;
  flex-direction:column;
  min-height:100dvh;
  padding:28px 32px;
}

/* 質問とボタンの列を囲むフォーム。枠の残りの高さを埋める */
.wizard-form {
  display:flex;
  flex:1;
  flex-direction:column;
}

/* 質問とボタンの列の間の余白(質問が長いときも詰まらないように) */
.wizard-form .wizard-step {
  margin-bottom:26px;
}

@media (max-width: 760px) {
  .wizard-card {
    padding:20px 16px;
  }
}

.q {
  font-size:20px;
  font-weight:700;
  margin:18px 0 4px;
}

.q-sub {
  color:var(--text-muted);
  font-size:13px;
  margin-bottom:20px;
}

/* 下のボタンの列。枠の下端に置き(margin-top:auto)、画面の下端に固定する。
   枠の左右・下の余白(.wizard-cardのpadding)の分だけはみ出させて、枠の幅
   いっぱいの帯にする */
.wizard-actions {
  position:sticky;
  bottom:0;
  z-index:5;
  display:flex;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
  gap:12px;
  margin:auto -32px -28px;
  padding:14px 32px;
  background:var(--surface);
  border-top:1px solid var(--border);
  border-radius:0 0 var(--radius) var(--radius);
}

@media (max-width: 760px) {
  .wizard-actions {
    margin:auto -16px -20px;
    padding:12px 16px;
  }
}

/* ボタンの左側(キャンセルと一時保存)。進む操作(戻る・次へ)とは離して置く */
.wizard-actions-side {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:12px;
}

/* 「キャンセル」。押し間違えないよう、進む操作から離した左端に、ボタンでなく
   文字だけの目立たない形で置く(押すと確認ダイアログが開く) */
.wizard-cancel {
  padding:8px 4px;
  border:0;
  background:none;
  color:var(--text-muted);
  font:inherit;
  font-size:14px;
  font-weight:600;
  text-decoration:underline;
  cursor:pointer;
}

.wizard-cancel:hover {
  color:var(--danger);
}

.dynamic-row {
  display:flex;
  gap:8px;
  align-items:center;
  margin-bottom:8px;
}

.dynamic-row input {
  flex:1;
}

.dynamic-add {
  margin-top:2px;
}

/* ヒアリングウィザードの進捗バーの初期幅
   (表示後はbrief-wizard.jsがstyle.widthで上書きする) */
.wizard-progress {
  width:10%;
}

/* 「チャットのみ」選択時の注意書き。初期は非表示で、
   brief-wizard.jsがstyle.displayで表示/非表示を切り替える */
.wizard-chat-warning {
  display:none;
  margin-top:14px;
}

/* ── ヒアリング内容の編集フォーム(全項目を1ページに並べたもの) ── */

/*
 * 変更は作り直して公開するまで公開中のサイトに反映されない、という案内。
 * 語の途中でなく句読点で改行させる
 */
.brief-edit-reflection-note {
  background:var(--warning-soft);
  color:var(--warning);
  padding:10px 14px;
  border-radius:10px;
  margin:8px 0 0;
  word-break:keep-all;
  overflow-wrap:anywhere;
}

/* ページ内の目次。各まとまりへのリンクを横に並べ、狭い画面では折り返す */
.brief-edit-toc {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:0 0 16px;
}

.brief-edit-toc a {
  padding:6px 14px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--surface);
  color:var(--text);
  font-size:13px;
  font-weight:600;
  text-decoration:none;
  box-shadow:var(--shadow-small);
}

.brief-edit-toc a:hover {
  border-color:var(--primary);
  color:var(--primary);
}

/* 見出し付きのまとまり(白いカード)。目次から飛んだときに、上部に固定の
   ヘッダーの下へ見出しが隠れないよう余白を取る */
.brief-edit-section {
  padding:24px 28px;
  scroll-margin-top:72px;
}

.brief-edit-section > h2 {
  margin:0;
  padding-bottom:10px;
  border-bottom:1px solid var(--border);
}

/* ウィザードでは1つずつ表示する項目を、編集フォームでは全て並べる
   (今の選択に該当しない項目はbrief-edit-form.jsがhidden属性で隠す) */
.brief-edit-form .wizard-step {
  display:block;
  min-height:0;
}

.brief-edit-form .wizard-step[hidden] {
  display:none;
}

/* 項目の見出し。まとまりの見出し(h2)より控えめにする */
.brief-edit-form .q {
  font-size:16px;
  margin:24px 0 4px;
}

.brief-edit-form .q-sub {
  margin-bottom:12px;
}

/* まとまりの項目が全て隠れているときに出す説明 */
.brief-edit-empty-note {
  margin:16px 0 0;
}

/* 画面下に固定する操作(キャンセル・保存) */
.brief-edit-actions {
  position:sticky;
  bottom:0;
  z-index:5;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-top:16px;
  padding:12px 20px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow-medium);
}

@media (max-width: 760px) {
  .brief-edit-section {
    padding:20px 16px;
  }

  .brief-edit-actions {
    padding:10px 16px;
  }
}

/* 未入力・形式の違いで「次へ」「保存する」を止めた欄と、サーバー側で受け
   付けられなかった欄の枠(付け外しはlib/brief-fields.jsの
   reportFirstInputError()・reportInvalidField()・clearRequiredError())。
   入力欄はその欄、行を増やせる一覧は全ての行、選択肢の一覧は全ての選択肢を
   赤く囲む */
input.invalid-field,
textarea.invalid-field,
.invalid-field input:not([type=radio]),
.invalid-field .choice {
  border-color:var(--danger);
}

input.invalid-field:focus,
textarea.invalid-field:focus,
.invalid-field input:not([type=radio]):focus {
  outline-color:var(--danger-soft);
  border-color:var(--danger);
}
