/* ============================================================
   faq-bot demo — page styles + chat widget styles
   共通トークンは /demos/assets/css/site.css を参照
   ============================================================ */

/* ---- ヘッダーの電話表示 ---- */
.header-contact { text-align: right; line-height: 1.35; }
.header-tel { display: block; font-size: 18px; font-weight: 700; color: var(--brand-dark); white-space: nowrap; }
.header-tel-note { font-size: 11.5px; color: var(--ink-faint); }

/* ---- ヒーロー ---- */
.mj-hero {
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(232, 161, 58, 0.16), transparent 60%),
    linear-gradient(135deg, var(--brand-soft) 0%, #f1f7f1 55%, #fdf6ea 100%);
  border-bottom: 1px solid var(--line);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 32px;
  align-items: center;
}
.hero-grid .btn { margin: 4px 8px 4px 0; }
.hero-visual {
  background: linear-gradient(150deg, var(--brand) 0%, #1d8a74 55%, #5fb39c 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 26px 12px;
}
.hero-visual svg { display: block; width: 100%; height: auto; }
.hero-visual-caption {
  margin: 8px 0 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
}

/* ---- 施工メニュー ---- */
.menu-card { text-align: left; }
.menu-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin-bottom: 14px;
}
.menu-icon-kitchen { background: linear-gradient(135deg, #fdf3e3, #f7dfb4); }
.menu-icon-bath { background: linear-gradient(135deg, #e8f0fb, #c9def5); }
.menu-icon-full { background: linear-gradient(135deg, var(--brand-soft), #bfe3d8); }
.menu-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}
.menu-price strong { font-size: 19px; color: var(--brand-dark); }

/* ---- 選ばれる理由 ---- */
.reasons-section { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.reason-card { position: relative; padding-top: 30px; }
.reason-num {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 34px;
  font-weight: 700;
  color: var(--brand-soft);
  line-height: 1;
}

/* ---- 施工の流れ ---- */
.flow-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  counter-reset: flow;
}
.flow-step { position: relative; padding-top: 56px; }
.flow-step h3 { font-size: 16px; }
.flow-step h3 .badge { margin-left: 6px; vertical-align: middle; }
.flow-num {
  position: absolute;
  top: 18px;
  left: 22px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- 仕組みセクション ---- */
.bot-about { border-top: 1px solid var(--line); }
.bot-about-title { font-size: 16px; }
.bot-cta { text-align: center; background: linear-gradient(135deg, var(--brand-soft), #f3faf7); }
.bot-cta .btn { max-width: 100%; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .flow-list { grid-template-columns: 1fr; }
  .header-tel { font-size: 15px; }
  .header-tel-note { display: none; }
}

/* ============================================================
   チャットウィジェット
   ============================================================ */

.fb-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1000;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--brand) 0%, #1d8a74 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(11, 84, 71, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.fb-launcher:hover { transform: scale(1.06); box-shadow: 0 6px 18px rgba(11, 84, 71, 0.5); }
.fb-launcher svg { width: 30px; height: 30px; }
.fb-launcher-hint {
  position: fixed;
  right: 88px;
  bottom: 32px;
  z-index: 1000;
  background: var(--ink);
  color: #fff;
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
  white-space: nowrap;
}

.fb-panel {
  position: fixed;
  right: 18px;
  bottom: 92px;
  z-index: 1001;
  width: 372px;
  max-width: calc(100vw - 36px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(27, 37, 51, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.fb-panel.fb-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.fb-header {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.fb-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
}
.fb-header-text { flex: 1; min-width: 0; line-height: 1.3; }
.fb-header-title { font-size: 14.5px; font-weight: 700; }
.fb-header-status { font-size: 11.5px; opacity: 0.9; display: flex; align-items: center; gap: 5px; }
.fb-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8ef0b1;
  box-shadow: 0 0 5px #8ef0b1;
}
.fb-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 8px;
  flex-shrink: 0;
}
.fb-close:hover { background: rgba(255, 255, 255, 0.15); }

.fb-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  background: #eef3f1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fb-msg {
  max-width: 84%;
  padding: 9px 13px;
  font-size: 13.8px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: var(--shadow-sm);
}
.fb-msg-bot {
  align-self: flex-start;
  background: var(--panel);
  color: var(--ink);
  border-radius: 4px 14px 14px 14px;
}
.fb-msg-user {
  align-self: flex-end;
  background: var(--brand);
  color: #fff;
  border-radius: 14px 4px 14px 14px;
}
.fb-msg-error {
  align-self: flex-start;
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #eccfcc;
  border-radius: 4px 14px 14px 14px;
}

.fb-chips {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.fb-chip {
  background: var(--panel);
  border: 1px solid var(--brand);
  color: var(--brand-dark);
  font-family: var(--font);
  font-size: 12.8px;
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.fb-chip:hover { background: var(--brand-soft); }

.fb-typing {
  align-self: flex-start;
  background: var(--panel);
  border-radius: 4px 14px 14px 14px;
  box-shadow: var(--shadow-sm);
  padding: 13px 15px;
  display: flex;
  gap: 5px;
}
.fb-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-faint);
  animation: fb-bounce 1.2s infinite ease-in-out;
}
.fb-typing span:nth-child(2) { animation-delay: 0.15s; }
.fb-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes fb-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.fb-input-row {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  flex-shrink: 0;
}
.fb-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
}
.fb-input:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
.fb-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s ease;
}
.fb-send:hover { background: var(--brand-dark); }
.fb-send:disabled { opacity: 0.5; cursor: not-allowed; }
.fb-send svg { width: 19px; height: 19px; }

.fb-footnote {
  font-size: 10.5px;
  color: var(--ink-faint);
  text-align: center;
  padding: 0 10px 8px;
  background: var(--panel);
  flex-shrink: 0;
}

/* スマホ: ほぼ全画面のパネル */
@media (max-width: 520px) {
  .fb-panel {
    right: 8px;
    left: 8px;
    bottom: 8px;
    width: auto;
    max-width: none;
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
  }
  .fb-launcher-hint { display: none; }
}
