/* =============================================
   AI導入補助金ナビ - base.css
   CSS変数・リセット・共通UI・ダークモード
   ============================================= */

/* === CSS変数 === */
:root {
  --accent-primary:   #1d4ed8;    /* 信頼感のある紺青 */
  --accent-secondary: #059669;    /* 補助金＝お得の緑 */
  --accent-warning:   #d97706;    /* 注意・締切の橙 */
  --accent-danger:    #dc2626;    /* エラー・警告の赤 */
  --accent-hover:     #1e40af;    /* primary hover */

  --bg-primary:   #ffffff;
  --bg-secondary: #f8fafc;
  --bg-surface:   #f1f5f9;
  --bg-hover:     #e2e8f0;

  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --text-inverse:   #ffffff;

  --border-color:  #e2e8f0;
  --border-radius: 8px;
  --radius-sm:     4px;
  --radius-md:     12px;
  --radius-lg:     16px;
  --radius-xl:     24px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 20px rgba(0,0,0,.08);
  --shadow-lg:  0 8px 40px rgba(0,0,0,.12);
  --shadow-xl:  0 20px 60px rgba(0,0,0,.15);

  --font-sans:  'LINE Seed JP', 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --font-mono:  'JetBrains Mono', 'Cascadia Code', 'Courier New', monospace;

  --container:  1140px;
  --header-h:   64px;
  --sidebar-w:  280px;

  --transition: 0.2s ease;
}

/* === ダークモード === */
[data-theme="dark"] {
  --bg-primary:   #0f172a;
  --bg-secondary: #1e293b;
  --bg-surface:   #334155;
  --bg-hover:     #475569;

  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;

  --border-color: #334155;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.5);
}

/* === リセット === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
ul, ol { list-style: none; }
button { font-family: var(--font-sans); cursor: pointer; }
input, textarea, select { font-family: var(--font-sans); }

/* === コンテナ === */
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
@media (max-width: 768px) { .container { padding: 0 16px; } }

/* =============================================
   ヘッダー
   ============================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,.9);
}
.site-header .container { height: 100%; }
[data-theme="dark"] .site-header {
  background: rgba(15,23,42,.9);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}
.site-logo .logo-badge {
  background: var(--accent-primary);
  color: #fff;
  font-size: .65rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  letter-spacing: .02em;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.header-nav a {
  color: var(--text-secondary);
  font-size: .9rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.header-nav a:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}
.btn-consult-header {
  background: var(--accent-primary);
  color: #fff !important;
  padding: 8px 16px !important;
  border-radius: var(--radius-md) !important;
  font-weight: 600;
  font-size: .875rem !important;
}
.btn-consult-header:hover {
  background: var(--accent-hover) !important;
  color: #fff !important;
}
.header-theme-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px;
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  transition: background var(--transition);
}
.header-theme-btn:hover { background: var(--bg-surface); }

/* ハンバーガー */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  padding: 6px;
  color: var(--text-primary);
}
@media (max-width: 768px) {
  .header-nav { display: none; }
  .hamburger-btn { display: flex; }
}

/* ドロワー */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.drawer-overlay.open { opacity: 1; pointer-events: all; }
.drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(320px, 85vw);
  height: 100%;
  background: var(--bg-primary);
  z-index: 201;
  padding: 24px;
  overflow-y: auto;
  transition: right .3s ease;
}
.drawer.open { right: 0; }
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}
.drawer-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 4px;
}
.drawer-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  font-size: .95rem;
}

/* =============================================
   フッター
   ============================================= */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  margin-top: 0;
  padding: 48px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 40px;
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-brand .site-logo { font-size: 1rem; margin-bottom: 12px; }
.footer-brand p { font-size: .85rem; color: var(--text-secondary); line-height: 1.6; }
.footer-col h4 {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 12px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col ul li a {
  font-size: .875rem;
  color: var(--text-secondary);
  transition: color var(--transition);
}
.footer-col ul li a:hover { color: var(--accent-primary); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  font-size: .8rem;
  color: var(--text-muted);
}
@media (max-width: 480px) {
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}
.footer-links,
.footer-bottom-links { display: flex; gap: 16px; }
.footer-links a,
.footer-bottom-links a { color: var(--text-muted); }
.footer-links a:hover,
.footer-bottom-links a:hover { color: var(--text-secondary); }

/* =============================================
   固定CTAボタン
   ============================================= */
.fab-cta {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  background: var(--accent-secondary);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius-xl);
  font-weight: 700;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.fab-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  color: #fff;
}
@media (max-width: 480px) {
  .fab-cta { bottom: 16px; right: 16px; padding: 12px 16px; font-size: .85rem; }
}

/* トップへ戻るボタン */
.scroll-top-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 50;
  width: 44px;
  height: 44px;
  background: var(--accent-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s, transform .3s;
}
.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
}
.scroll-top-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}
.scroll-top-btn i { width: 20px; height: 20px; }
@media (max-width: 480px) {
  .scroll-top-btn { bottom: 16px; left: 16px; width: 40px; height: 40px; }
}

/* =============================================
   ボタン
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: .9rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--accent-primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(29,78,216,.3);
}
.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.btn-success {
  background: var(--accent-secondary);
  color: #fff;
}
.btn-success:hover {
  background: #047857;
  color: #fff;
}
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-block { width: 100%; justify-content: center; }

/* =============================================
   フォーム
   ============================================= */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-group label .required {
  color: var(--accent-danger);
  margin-left: 4px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: .95rem;
  font-family: var(--font-sans);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,.1);
}
textarea.form-control { min-height: 120px; resize: vertical; }
select.form-control { cursor: pointer; }
.form-hint {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.form-error {
  font-size: .8rem;
  color: var(--accent-danger);
  margin-top: 4px;
}

/* =============================================
   カード
   ============================================= */
.card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-body { padding: 20px; }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
}

/* =============================================
   バッジ・タグ
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: .75rem;
  font-weight: 600;
}
.badge-primary { background: rgba(29,78,216,.1); color: var(--accent-primary); }
.badge-success { background: rgba(5,150,105,.1); color: var(--accent-secondary); }
.badge-warning { background: rgba(217,119,6,.1); color: var(--accent-warning); }
.badge-danger  { background: rgba(220,38,38,.1); color: var(--accent-danger); }
.badge-gray    { background: var(--bg-surface); color: var(--text-secondary); }

/* =============================================
   アラート・通知
   ============================================= */
.alert {
  padding: 14px 16px;
  border-radius: var(--border-radius);
  font-size: .9rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-info    { background: #eff6ff; color: #1e40af; }
.alert-success { background: #f0fdf4; color: #166534; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-danger  { background: #fef2f2; color: #991b1b; }

/* =============================================
   Toast通知
   ============================================= */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 16px;
  border-radius: var(--border-radius);
  font-size: .9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateX(120%);
  transition: transform .3s ease;
  min-width: 280px;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.show { transform: translateX(0); }
.toast-success { background: #f0fdf4; color: #166534; }
.toast-error   { background: #fef2f2; color: #991b1b; }
.toast-info    { background: #eff6ff; color: #1e40af; }

/* =============================================
   パンくずリスト
   ============================================= */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  padding: 12px 0;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent-primary); }
.breadcrumb span { color: var(--text-muted); }

/* =============================================
   ページヘッダー
   ============================================= */
.page-header {
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 40px;
}
.page-header h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
}
.page-header .lead {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* =============================================
   グリッド
   ============================================= */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* =============================================
   ローディング
   ============================================= */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
}
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =============================================
   ユーティリティ
   ============================================= */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-primary { color: var(--accent-primary); }
.text-success { color: var(--accent-secondary); }
.text-warning { color: var(--accent-warning); }
.text-danger  { color: var(--accent-danger); }
.text-muted   { color: var(--text-muted); }
.font-bold    { font-weight: 700; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}
.mr-1 { margin-right: 4px; }

/* === Privacy Policy === */
.privacy-content { max-width: 800px; padding-bottom: 60px; }
.privacy-section { margin-bottom: 32px; }
.privacy-section h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 12px; color: var(--text-primary); }
.privacy-section p { line-height: 1.8; margin-bottom: 8px; color: var(--text-secondary); }
.privacy-section ul { padding-left: 24px; margin: 8px 0; }
.privacy-section li { line-height: 1.8; color: var(--text-secondary); }
.privacy-date { margin-top: 40px; color: var(--text-muted); font-size: .85rem; }

/* === Listing Complete === */
.complete-page { max-width: 700px; margin: 0 auto; text-align: center; padding: 40px 0 80px; }
.complete-icon { margin-bottom: 16px; }
.complete-icon i { width: 64px; height: 64px; color: var(--accent-secondary); }
.complete-page h1 { font-size: 1.5rem; margin-bottom: 8px; }
.complete-steps { text-align: left; padding-left: 0; counter-reset: step; list-style: none; margin: 24px 0; }
.complete-steps li { position: relative; padding: 12px 0 12px 48px; border-bottom: 1px solid var(--border-color); counter-increment: step; }
.complete-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
}
.complete-steps li strong { display: block; margin-bottom: 4px; }
.complete-steps li p { font-size: .875rem; color: var(--text-secondary); margin: 0; }

/* === Plan Detail (public) === */
.plan-detail-card { text-align: center; padding: 32px 24px; }
.plan-detail-card.plan-popular { border-top: 4px solid var(--accent-primary); box-shadow: var(--shadow-lg); }
.plan-detail-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.plan-detail-price { font-size: 2.2rem; font-weight: 700; color: var(--accent-primary); }
.plan-detail-unit { font-size: .85rem; font-weight: 400; color: var(--text-muted); }
.plan-detail-leads { font-size: .85rem; color: var(--text-muted); margin: 8px 0 16px; }
.plan-detail-features { text-align: left; margin: 16px 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.plan-detail-features li { display: flex; gap: 6px; align-items: center; font-size: .875rem; }
.plan-detail-features i { width: 16px; height: 16px; color: var(--accent-secondary); flex-shrink: 0; }
.text-success { color: var(--accent-secondary); }
