/* ============================================================
   main.css  —  ブレインメンタリストNOV 共通スタイル
   Tailwind CDN のカスタム拡張と、全ページ共有のカスタムCSSをここに集約
   ============================================================ */

/* ---------- Tailwind @layer base ---------- */
@layer base {
  body { font-family: 'Noto Sans JP', sans-serif; }
}

/* ---------- Glass Card ---------- */
.glass-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.dark .glass-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ---------- Step Arrow ---------- */
.step-arrow::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -1.5rem;
  transform: translateY(-50%);
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 10px solid #CBD5E1;
  display: none;
}
@media (min-width: 1024px) {
  .step-arrow::after { display: block; }
}

/* ---------- Hero Title ---------- */
.hero-title {
  line-height: 1.15;
  letter-spacing: 0.02em;
}
.hero-title-line {
  display: block;
}
.hero-title-line-2 {
  margin-top: 0.28em;
}

/* ---------- 監修者アバター統一 ---------- */
.expert-avatar {
  width: 128px;
  height: 128px;
  border-radius: 9999px;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  border: 4px solid white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ---------- brainHP page scaffold ---------- */
.hp-page {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #fff7fb 0%, #ffffff 55%, #f2fbff 100%);
  color: #1e293b;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 767px) {
  .container {
    padding: 0 16px;
  }
}

.hp-header {
  padding: 18px 0;
}

.hp-main {
  padding: 40px 0 56px;
}

.hp-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.hp-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.site-logo {
  height: 48px;
  width: auto;
  display: block;
}

@media (max-width: 767px) {
  .site-logo {
    height: 36px;
  }
}

.hp-logo {
  height: 32px;
  width: auto;
  display: block;
}

@media (min-width: 768px) {
  .hp-logo {
    height: 38px;
  }
}

.hp-pill-link {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #ffffff;
  color: #db2777;
  border: 1px solid #fbcfe8;
  text-decoration: none;
  padding: 10px 16px;
  font-weight: 700;
}

.hp-footer {
  margin-top: 28px;
  display: flex;
  justify-content: center;
}

.hp-footer-logo {
  height: 26px;
  width: auto;
  opacity: 0.92;
  display: block;
}

@media (min-width: 768px) {
  .hp-footer-logo {
    height: 30px;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hp-hero {
  max-width: 1020px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.hp-title {
  margin: 0;
  font-size: clamp(28px, 6vw, 44px);
  line-height: 1.2;
  font-weight: 800;
}

.hp-subtitle {
  margin: 14px 0 0;
  color: #475569;
  line-height: 1.8;
}

.hp-cta-row {
  margin-top: 22px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hp-voices-section {
  margin-top: 18px;
}

.hp-voices-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hp-btn-primary,
.hp-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  padding: 12px 18px;
  text-decoration: none;
  font-weight: 700;
}

.hp-btn-primary {
  color: #ffffff;
  background: linear-gradient(90deg, #ec4899 0%, #f43f5e 100%);
}

.hp-btn-secondary {
  color: #334155;
  background: #ffffff;
  border: 1px solid #cbd5e1;
}

.diag-bubble {
  background: #ffffff;
  border: 1px solid #fbcfe8;
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 10px;
  line-height: 1.75;
}

.diag-card {
  margin-top: 18px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 18px;
}

.diag-choice-grid {
  display: grid;
  gap: 10px;
}

.diag-choice {
  width: 100%;
  text-align: left;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 15px;
}

.diag-choice:hover {
  background: #f8fafc;
}

.result-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.course-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
}

.course-card h3 {
  margin: 0;
  font-size: 18px;
}

.course-card p {
  margin: 8px 0 14px;
  color: #475569;
  line-height: 1.7;
}

.badge-reco {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  background: #f59e0b;
  color: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.course-card.is-recommended {
  border-color: rgba(244, 63, 94, 0.35);
  background: linear-gradient(180deg, rgba(255, 241, 246, 0.7) 0%, #fff 40%);
  animation: cardPulse 2.2s ease-in-out infinite;
}

.course-card.is-recommended .badge-reco {
  display: inline-block;
}

@keyframes cardPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.14), 0 8px 20px rgba(15, 23, 42, 0.05);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(244, 63, 94, 0.08), 0 12px 24px rgba(15, 23, 42, 0.09);
  }
}

@media (prefers-reduced-motion: reduce) {
  .course-card.is-recommended {
    animation: none;
  }
}

.form-card {
  margin-top: 18px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 18px;
}

.form-field {
  margin-bottom: 12px;
}

.form-field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.form-field input,
.form-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

.form-help {
  color: #64748b;
  font-size: 13px;
}

.form-error {
  color: #b91c1c;
  font-size: 14px;
  margin-top: 8px;
}

.form-success {
  color: #047857;
  font-size: 14px;
  margin-top: 8px;
}

.voice-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
}

.voice-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.45;
}

.voice-profile {
  margin-top: 6px;
  color: #64748b;
  font-size: 13px;
}

.voice-meta {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.75;
  color: #334155;
}

.voice-meta strong {
  color: #0f172a;
  font-weight: 700;
}

.voices-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .voices-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.voice-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 767px) {
  .voice-grid {
    grid-template-columns: 1fr;
  }
}

.voice-card-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.voice-avatar {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  object-fit: cover;
  flex: 0 0 auto;
}

.brand .site-logo{
  height: 56px !important;   /* PC */
  width: auto !important;
  max-height: none !important;
  max-width: none !important;
  display: block;
}

@media (max-width: 767px){
  .brand .site-logo{
    height: 40px !important; /* SP */
  }
}

/* 親の高さで潰される/縦ズレ対策（必要最低限） */
.brand{
  display: flex;
  align-items: center;
}

/* ===== Voice readability ===== */
#voice .voice-grid { gap: 24px; } /* 余白 */
#voice .voice-card { padding: 22px 24px; } /* カード内余白（既存があれば上書き） */
#voice .voice-card,
#voice .voice-card p,
#voice .voice-card li { line-height: 1.85; } /* 行間 */

#voice .voice-card p {
  margin: 10px 0; /* 段落間 */
  max-width: 68ch;
}

#voice .voice-card .voice-card-head { margin-bottom: 12px; }
#voice .voice-card .voice-avatar { width: 52px; height: 52px; } /* 顔少し大きく */

/* Before/Afterは実DOM上 .voice-meta + strong ラベルで出力される */
#voice .voice-card > .voice-meta strong {
  font-weight: 700;
  font-size: 0.95rem;
  margin-right: 6px;
  color: #111827;
}

#voice .voice-card .voice-meta { color: #6b7280; font-size: 0.95rem; } /* 利用者/属性 */
#voice .voice-card .form-help { margin-top: 14px; color: #6b7280; font-size: 0.95rem; } /* 関連コース */

@media (max-width: 767px){
  #voice .voice-card { padding: 18px 16px; }
  #voice .voice-card,
  #voice .voice-card p { line-height: 1.9; }
  #voice .voice-card p { max-width: none; }
}

/* ===== Voice section readability & separation ===== */
#voice .voice-card{
  padding: 22px 24px;
  line-height: 1.85;
}

#voice .voice-card p{ margin: 10px 0; }

/* Before/After をまとまりとして見せる */
#voice .voice-beforeafter{
  margin: 14px 0 12px;
  padding: 10px 12px;          /* ←左右のインデントを狭くして揃える */
  border-left: 4px solid #e5e7eb;
  background: rgba(0,0,0,0.02);
  border-radius: 10px;
}

#voice .voice-beforeafter .row{
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 8px 0;
}
#voice .voice-beforeafter .label{
  font-weight: 700;
  min-width: 68px;             /* Before/Afterの開始位置を揃える */
}
#voice .voice-beforeafter .text{
  font-weight: 400;
}

/* 本文（説明文）だけ、左右インデントを揃えて“段落ブロック”化 */
#voice .voice-body{
  margin: 12px 0 0;
  padding: 10px 12px;          /* ←ここが「左右インデントを狭く」 */
  border-left: 4px solid #f3f4f6;
  background: rgba(0,0,0,0.01);
  border-radius: 10px;
}

/* 関連コースは区切り線で分離 */
#voice .voice-course{
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #eef2f7;
  color: #6b7280;
  font-size: 0.95rem;
}

@media (max-width: 767px){
  #voice .voice-card{ padding: 18px 16px; }
  #voice .voice-beforeafter, #voice .voice-body{ padding: 10px 10px; }
  #voice .voice-beforeafter .label{ min-width: 62px; }
}

/* ===== お客様の声：可読性改善 ===== */
#voice .voice-card p {
  line-height: 1.9;
  margin: 0.65rem 0 0;
}

#voice .voice-meta {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-top: 0.55rem;
}

#voice .voice-meta strong {
  flex: 0 0 5.2em;
  line-height: 1.9;
}

#voice .voice-meta span,
#voice .voice-meta strong + * {
  flex: 1 1 auto;
  min-width: 0;
}

#voice .voice-body {
  margin-top: 1rem;
  padding-top: 0.2rem;
  text-indent: 1em;
  line-height: 2;
  white-space: pre-wrap;
}

#voice .voice-card .form-help {
  margin-top: 0.9rem;
}

@media (max-width: 640px) {
  #voice .voice-body {
    text-indent: 0.6em;
  }
  #voice .voice-meta strong {
    flex-basis: 4.6em;
  }
}

.pricing-tabs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 18px 0 24px;
  flex-wrap: wrap;
}

.pricing-tab {
  padding: 10px 14px;
  border-radius: 9999px;
  border: 1px solid #eee;
  background: #fff;
  font-weight: 700;
  color: #334155;
  line-height: 1;
}

.pricing-tab.is-active {
  border-color: #ff2b7a;
  box-shadow: 0 8px 24px rgba(255, 43, 122, 0.18);
  color: #be185d;
}

@media (max-width: 767px) {
  .pricing-tabs {
    justify-content: flex-start;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.badge-next {
  letter-spacing: 0.03em;
}

#diagnosis .diag-chat-wrap {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 16px;
}

#diagnosis .diag-top {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: start;
}

#diagnosis .diag-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#diagnosis .diag-chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

#diagnosis .diag-chat-progress {
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
}

#diagnosis .diag-chat-log {
  display: grid;
  gap: 10px;
  min-height: 220px;
  max-height: 420px;
  overflow: hidden;
  padding: 4px;
}

#diagnosis .diag-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

#diagnosis .diag-row-brain {
  justify-content: flex-start;
}

#diagnosis .diag-row-user {
  justify-content: flex-end;
}

#diagnosis .diag-avatar {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  object-fit: cover;
  border: 1px solid #e2e8f0;
  flex: 0 0 auto;
}

#diagnosis .diag-bubble {
  max-width: min(80%, 560px);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: clamp(18px, 2.6vw, 20px);
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-top: 0;
  align-self: flex-start;
}

#diagnosis .diag-bubble-brain {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}

#diagnosis #bubbleText:empty {
  display: none;
}

#diagnosis .diag-bubble-user {
  background: #ff2b7a;
  color: #fff;
  border: 1px solid #ff2b7a;
}

#diagnosis .diag-chat-choices,
#diagnosis .diag-choices {
  display: grid;
  gap: 10px;
  margin-top: 0;
}

#diagnosis .diag-choice-btn {
  appearance: none;
  width: 100%;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  font-size: clamp(16px, 2.2vw, 18px);
  line-height: 1.6;
  font-weight: 500;
  padding: 14px 18px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
  transition: transform 0.08s ease, box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

#diagnosis .diag-choice-btn:hover {
  background: #ffffff;
  border-color: #94a3b8;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

#diagnosis .diag-choice-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#diagnosis .diag-choice-btn:focus-visible {
  outline: 3px solid rgba(236, 72, 153, 0.35);
  outline-offset: 2px;
}

#diagnosis .diag-choice-btn.is-selected {
  background: rgba(236, 72, 153, 0.08);
  border-color: rgba(236, 72, 153, 0.65);
  box-shadow: 0 10px 24px rgba(236, 72, 153, 0.10);
  font-weight: 600;
}

#diagnosis .diag-back-btn {
  appearance: none;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  border-radius: 9999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

#diagnosis .diag-back-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#diagnosis .diag-progress-track {
  height: 8px;
  border-radius: 9999px;
  background: #f1f5f9;
  overflow: hidden;
  margin-bottom: 12px;
}

#diagnosis .diag-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ff2b7a 0%, #ff7cae 100%);
  transition: width 0.2s ease;
}

#diagnosis .diag-question-enter {
  animation: diagQuestionIn 0.18s ease;
}

@keyframes diagQuestionIn {
  from {
    opacity: 0.2;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#diagnosis .diag-done-text {
  display: none;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #fecdd3;
  border-radius: 12px;
  background: #ffe3ef;
  color: #9d174d;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  white-space: normal;
  word-break: break-word;
}

#doneText {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.7;
  letter-spacing: 0.02em;
  white-space: normal;
  word-break: break-word;
}

.recommend-pulse {
  animation: recommendPulse 1s ease-in-out infinite;
}

@keyframes recommendPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 46, 131, 0.55);
  }
  70% {
    transform: scale(1.02);
    box-shadow: 0 0 0 12px rgba(255, 46, 131, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 46, 131, 0);
  }
}

#pricing .pricing-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
  font-size: 12px;
  padding: 6px 10px;
  max-width: 16em;
}

#diagnosis .diag-character {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

#diagnosis #diagCharacter {
  display: block;
  width: min(200px, 100%);
  height: auto;
  pointer-events: none;
}

@media (max-width: 767px) {
  #diagnosis .diag-chat-wrap {
    padding: 12px;
  }
  #diagnosis .diag-bubble {
    max-width: 88%;
  }
  #diagnosis .diag-done-text {
    font-size: 16px;
  }
}

@media (max-width: 720px) {
  #diagnosis .diag-top {
    grid-template-columns: 1fr;
  }
  #diagnosis .diag-character {
    justify-content: center;
  }
  #diagnosis .diag-bubble {
    align-self: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  #pricing .pricing-badge {
    font-size: 11px;
  }
  #doneText {
    font-size: 16px;
  }
}

#diagnosis .chat-speaker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

#diagnosis .chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  background: #fff;
}

#diagnosis .chat-name {
  font-size: 11px;
  line-height: 1;
  color: #64748b;
  font-weight: 700;
}

@media (max-width: 767px) {
  #diagnosis .chat-avatar {
    width: 32px;
    height: 32px;
  }
}

#diagnosis .chat-avatar{
  width: 64px;
  height: 64px;
}

@media (max-width: 767px){
  #diagnosis .chat-avatar{
    width: 48px;
    height: 48px;
  }
}

#diagnosis .chat-avatar{
  width: 64px;
  height: 64px;
  border-radius: 999px;
  object-fit: contain;   /* まずは切れない安全設定 */
  background: transparent;
}

@media (max-width: 767px){
  #diagnosis .chat-avatar{ width: 48px; height: 48px; }
}

/* ===== diagnosis chat tweaks ===== */
#diagnosis .chat-avatar{
  border-radius: 0 !important;  /* 丸くしない */
  border: none !important;       /* 枠を消す */
  background: transparent !important;
  width: 88px;                   /* 少し大きめ */
  height: auto;                  /* 縦は画像に合わせる */
  object-fit: contain !important;
  display: block;
}

@media (max-width: 767px){
  #diagnosis .chat-avatar{ width: 72px; }
}

/* 名前ラベルを消す（要素が残ってても非表示） */
#diagnosis .chat-name,
#diagnosis .chat-speaker,
#diagnosis .chat-label{
  display: none !important;
}

/* セリフっぽい吹き出し（左） */
#diagnosis .bubble-left{
  position: relative;
  background: #ffffff;
  border: 1px solid #dbe3f0;
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

/* 左吹き出しの“しっぽ” */
#diagnosis .bubble-left::before{
  content: "";
  position: absolute;
  left: -10px;
  top: 18px;
  width: 0; height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 10px solid #dbe3f0; /* 枠色 */
}
#diagnosis .bubble-left::after{
  content: "";
  position: absolute;
  left: -9px;
  top: 18px;
  width: 0; height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-right: 9px solid #ffffff;  /* 背景色 */
}

/* ユーザー（右）も吹き出し感を少し */
#diagnosis .bubble-right{
  position: relative;
  background: #fff5fa;
  border: 1px solid #ffd3e3;
  border-radius: 18px;
  padding: 14px 16px;
}
#diagnosis .bubble-right::before{
  content:"";
  position:absolute;
  right:-10px;
  top:18px;
  width:0; height:0;
  border-top:10px solid transparent;
  border-bottom:10px solid transparent;
  border-left:10px solid #ffd3e3;
}
#diagnosis .bubble-right::after{
  content:"";
  position:absolute;
  right:-9px;
  top:18px;
  width:0; height:0;
  border-top:9px solid transparent;
  border-bottom:9px solid transparent;
  border-left:9px solid #fff5fa;
}
