/* ベース */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  /* モダンな暖色系カラーパレット */
  --bg: #fffbf5; /* 非常に薄いクリーム色 */
  --card-bg: #ffffff;

  /* アクセント：コーラル〜オレンジ */
  --accent-primary: #f97316; /* オレンジ */
  --accent-secondary: #fb923c; /* ソフトオレンジ */
  --accent-soft: #ffedd5; /* ペールオレンジ */

  /* テキストカラー */
  --text-main: #431407; /* 濃いブラウン */
  --text-sub: #78350f; /* やや明るいブラウン */
  --text-muted: #9ca3af;

  /* ボーダー */
  --border: #fed7aa;

  /* 半径と影 */
  --radius-lg: 24px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 4px 6px -1px rgba(251, 146, 60, 0.1), 0 2px 4px -1px rgba(251, 146, 60, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(251, 146, 60, 0.1), 0 4px 6px -2px rgba(251, 146, 60, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(251, 146, 60, 0.1), 0 10px 10px -5px rgba(251, 146, 60, 0.04);

  --font-main: "Zen Maru Gothic", system-ui, -apple-system, sans-serif;
}

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

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image: radial-gradient(at 0% 0%, rgba(254, 215, 170, 0.3) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(251, 146, 60, 0.15) 0px, transparent 50%);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.6;
}

/* レイアウト */
.container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

.main-content {
  padding: 40px 0 60px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  flex: 1;
}

/* ヘッダー */
.site-header {
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(254, 215, 170, 0.5);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 16px 0;
}

.site-title {
  margin: 0 0 8px;
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 800;
  color: var(--accent-primary);
  letter-spacing: -0.02em;
}

.site-subtitle {
  margin: 0;
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 500;
}

/* カード共通 */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* フォーム */
.search-card-header {
  margin-bottom: 24px;
}

.search-lead {
  margin: 0;
  font-size: 14px;
  color: var(--text-sub);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: repeat(12, 1fr);
    align-items: end;
  }

  .form-group:nth-child(1) {
    grid-column: span 3;
  } /* 苗字 */
  .form-group:nth-child(2) {
    grid-column: span 5;
  } /* 漢字 */
  .form-group:nth-child(3) {
    grid-column: span 2;
  } /* 運勢 */
  .form-actions {
    grid-column: span 2;
  } /* ボタン */
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.note {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-sub);
  margin-left: 4px;
  opacity: 0.8;
}

input[type="text"],
select {
  height: 48px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  font-size: 16px;
  color: var(--text-main);
  background: #fff;
  transition: all 0.2s ease;
  width: 100%;
  font-family: inherit;
}

input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

/* ボタン */
.primary-button {
  height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(234, 88, 12, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  width: 100%;
  transition: all 0.2s ease;
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(234, 88, 12, 0.4);
  filter: brightness(1.1);
}

.primary-button:active {
  transform: translateY(0);
}

/* 検索結果エリア */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 16px;
}

.results-summary {
  font-size: 14px;
  color: var(--text-sub);
  font-weight: 600;
}

.results-group {
  margin-bottom: 32px;
}

.results-group-title {
  font-size: 18px;
  color: var(--accent-primary);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.results-group-title::before {
  content: "";
  display: block;
  width: 6px;
  height: 24px;
  background: var(--accent-primary);
  border-radius: 4px;
}

.results-group-count {
  font-size: 12px;
  color: var(--text-sub);
  margin: 0 0 16px;
  padding-left: 14px;
}

/* 結果テーブル */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #fff;
  white-space: nowrap;
}

.results-table thead {
  background: var(--accent-soft);
}

.results-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  color: var(--text-sub);
  border-bottom: 1px solid var(--border);
}

.results-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  color: var(--text-main);
}

/* 各行（JSで result-row が付与される） */
.results-table tbody tr.result-row {
  cursor: pointer;
  transition: background 0.1s;
}

.results-table tbody tr.result-row:hover {
  background-color: #fff3d8;
}

/* トグルアイコン（▶ を丸背景で見やすくする） */
.arrow-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;

  color: var(--accent-primary);
  font-size: 12px;
  transition: transform 0.2s ease, background 0.2s ease;
}

/* 詳細行（app.js で display: table-row に切り替え） */
.detail-row {
  display: none;
  background-color: #fff7ed;
}

/* ヒーローセクション */
.hero {
  margin-top: 20px;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 40px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  position: relative;
  overflow: hidden;
}

/* 装飾的な背景円 */
.hero-inner::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: rgba(251, 146, 60, 0.1);
  border-radius: 50%;
  z-index: 0;
}

.hero-text {
  position: relative;
  z-index: 1;
}

.hero-tag {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 16px;
  border: 1px solid rgba(251, 146, 60, 0.2);
}

.hero-title {
  font-size: clamp(24px, 5vw, 36px);
  line-height: 1.3;
  margin: 0 0 16px;
  color: #431407;
}

.hero-body {
  font-size: 15px;
  color: var(--text-sub);
  margin-bottom: 24px;
}

.hero-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.hero-bullets li {
  margin-bottom: 8px;
  padding-left: 24px;
  position: relative;
  font-weight: 500;
  font-size: 14px;
}

.hero-bullets li::before {
  content: "✔";
  position: absolute;
  left: 0;
  color: var(--accent-primary);
}

.hero-cta {
  width: fit-content;
}

.hero-visual {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-card-preview {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  padding: 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  margin-top: -40px;
  width: 80%;
  max-width: 280px;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.hero-score-excellent {
  color: #ea580c;
  font-weight: bold;
}

.hero-score-good {
  color: #f97316;
  font-weight: bold;
}

/* 特長セクション */
.features-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

/* Feature全体の整列を安定させる */
.feature-item {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* アイコン枠 */
.feature-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;

  border-radius: 12px;
  background: transparent;
}

/* アイコン画像 */
.feature-icon img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  display: block;
  border-radius: 12px;
}

.feature-text h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--text-main);
}

.feature-text p {
  margin: 0;
  font-size: 13px;
  color: var(--text-sub);
}

/* Before/After */
.beforeafter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .beforeafter-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.before-block,
.after-block {
  padding: 24px;
  border-radius: var(--radius-md);
}

.before-block {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.after-block {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
}

.before-block h3,
.after-block h3 {
  margin-top: 0;
  font-size: 16px;
}

.before-block ul,
.after-block ul {
  padding-left: 20px;
  margin-bottom: 0;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  padding: 16px;
  background: #fff7ed;
  border-radius: var(--radius-sm);
}

.faq-item h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--accent-primary);
}

/* 最後の検索カード */
.search-card-bottom {
  text-align: center;
  background: linear-gradient(to bottom, #fff, #fff7ed);
}

/* フッター */
.site-footer {
  text-align: center;
  padding: 40px 0;
  color: var(--text-sub);
  font-size: 12px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.5);
}

@media (min-width: 768px) {
  .hero-inner {
    flex-direction: row;
    align-items: center;
  }
  .hero-text,
  .hero-visual {
    flex: 1;
  }
}
