/* ============================================================
   AIチャット スタイル
   料金シミュレーターと同じ配色・文字サイズにそろえてあります
   ============================================================ */

:root {
  --c-text:       #1f2933;
  --c-text-sub:   #5c6b7a;
  --c-bg:         #ffffff;
  --c-surface:    #f5f8fa;
  --c-border:     #d3dde5;
  --c-brand:      #0f7b8a;
  --c-brand-dark: #0a5c68;
  --c-brand-soft: #e6f4f6;
  --c-accent:     #e8730c;
  --c-accent-dark:#c85f05;
  --radius:       14px;
  --shadow:       0 2px 10px rgba(31, 41, 51, 0.08);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans",
               "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.chat {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 32px;
}

/* ---------- ヘッダー ---------- */
.chat__header { text-align: center; margin-bottom: 20px; }

.chat__site {
  display: inline-block;
  margin: 0 0 10px;
  padding: 5px 16px;
  background: var(--c-brand);
  border-radius: 99px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.5;
}

.chat__title {
  margin: 0 0 8px;
  font-size: 23px;
  line-height: 1.45;
  font-weight: 700;
  color: var(--c-brand-dark);
}

.chat__lead {
  margin: 0;
  font-size: 15px;
  color: var(--c-text-sub);
}

/* ---------- やりとり ---------- */
.chat__log {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 160px;
  margin-bottom: 18px;
}

.msg { display: flex; gap: 10px; align-items: flex-start; }

.msg--bot  { justify-content: flex-start; }
.msg--user { justify-content: flex-end; }

/* ボットのアイコン */
.msg__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--c-brand);
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
}

.msg__stack { display: flex; flex-direction: column; max-width: 82%; }

.msg--user .msg__stack { max-width: 84%; align-items: flex-end; }

/* ボットの名前 */
.msg__name {
  margin: 0 0 4px 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--c-text-sub);
  letter-spacing: 0.04em;
}

.msg__body {
  padding: 14px 17px;
  border-radius: 18px;
  font-size: 16px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg--bot .msg__body {
  background: var(--c-brand-soft);
  border: 1px solid rgba(15, 123, 138, 0.22);
  border-top-left-radius: 4px;
  color: var(--c-text);
}

.msg--user .msg__body {
  background: var(--c-brand);
  border: 1px solid var(--c-brand);
  border-bottom-right-radius: 4px;
  box-shadow: 0 1px 4px rgba(15, 123, 138, 0.25);
  color: #fff;
}

.msg--error .msg__icon { background: var(--c-accent); }

.msg--error .msg__body {
  background: #fdf3e8;
  border: 2px solid var(--c-accent);
  color: #8a4a02;
  font-weight: 700;
}

/* あいさつの下に出る小さな案内 */
.msg__sub {
  margin: 8px 0 0 2px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--c-text-sub);
}

/* 考え中の点 */
.dots { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }

.dots span {
  width: 6px;
  height: 6px;
  background: var(--c-brand);
  border-radius: 50%;
  animation: blink 1.2s infinite ease-in-out both;
}

.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0.25; }
  40%           { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .dots span { animation: none; opacity: 0.6; }
}

/* ---------- 質問例 ---------- */
.starters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.starters:empty { display: none; }

.starter {
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  background: var(--c-bg);
  border: 2px solid var(--c-border);
  border-radius: var(--radius);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  color: var(--c-text);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.starter:hover { border-color: var(--c-brand); background: var(--c-brand-soft); }

.starter:focus-visible { outline: 3px solid var(--c-brand); outline-offset: 2px; }

.starter:disabled {
  background: var(--c-surface);
  color: #93a3b1;
  cursor: default;
}

/* ---------- 入力欄 ---------- */
.composer { margin-bottom: 20px; }

.composer__label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--c-brand-dark);
}

.composer__row { display: flex; gap: 10px; align-items: flex-end; }

.composer__input {
  flex: 1;
  min-height: 60px;
  max-height: 180px;
  padding: 14px 16px;
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  border-radius: var(--radius);
  font: inherit;
  font-size: 16px;
  line-height: 1.6;
  color: inherit;
  resize: none;
  -webkit-appearance: none;
  appearance: none;
}

.composer__input:focus {
  outline: none;
  border-color: var(--c-brand);
  background: var(--c-bg);
}

.composer__send {
  flex-shrink: 0;
  min-width: 78px;
  min-height: 60px;
  padding: 12px 18px;
  background: var(--c-brand);
  border: none;
  border-radius: var(--radius);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}

.composer__send:hover:not(:disabled) { background: var(--c-brand-dark); }

.composer__send:disabled { background: var(--c-border); color: #93a3b1; cursor: default; }

.composer__note {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--c-text-sub);
}

/* ---------- 下部の導線 ---------- */
.links { display: flex; flex-direction: column; gap: 12px; }

.link {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-height: 62px;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
}

.link--sim {
  background: var(--c-accent);
  box-shadow: var(--shadow);
  color: #fff;
}

.link--sim:hover { background: var(--c-accent-dark); }

.link--tel {
  background: var(--c-bg);
  border: 2px solid var(--c-brand);
  color: var(--c-brand-dark);
}

.link--tel:hover { background: var(--c-brand-soft); }

.link__number { font-size: 22px; font-weight: 700; letter-spacing: 0.02em; }

.link__hours { font-size: 12px; font-weight: 400; color: var(--c-text-sub); }

/* ---------- ボット対策 ----------
   ここは display:none にしないでください。
   Turnstileのチェックは中身が見えている状態でないと差し込めず、
   非表示のまま差し込もうとすると静かに失敗します。
   Turnstileを使わない設定のときは、JS側（chat.js）で hidden 属性を
   付けて隠す形にしています。 */
.turnstile { margin: 0 0 16px; min-height: 1px; }

/* ---------- パソコン向けの微調整 ---------- */
@media (min-width: 600px) {
  .chat { padding: 32px 24px 40px; }
  .chat__title { font-size: 26px; }
}
