/* =============================================
   フィジカルAI補助金ナビ - base.css
   CSS変数・リセット・共通UI（紫カラーパレット）
   ============================================= */

/* === CSS変数（フィジカルAI専用カラー） === */
:root {
  --accent-primary:   #7c3aed;    /* テクノロジー感の紫 */
  --accent-secondary: #059669;    /* 補助金＝お得の緑 */
  --accent-warning:   #d97706;    /* 注意・締切の橙 */
  --accent-danger:    #dc2626;
  --accent-hover:     #6d28d9;    /* primary hover */

  --bg-primary:   #ffffff;
  --bg-secondary: #faf5ff;        /* 薄紫のセカンダリ */
  --bg-surface:   #f3f0ff;
  --bg-hover:     #ede9fe;

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

  --border-color:  #e5e7eb;
  --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:   #0f0a1e;
  --bg-secondary: #1a0f2e;
  --bg-surface:   #2d1b52;
  --bg-hover:     #3d2866;

  --text-primary:   #f1f5f9;
  --text-secondary: #a78bfa;
  --text-muted:     #7c3aed;

  --border-color: #2d1b52;

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

/* === リセット === */
*, *::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);
}
[data-theme="dark"] .site-header {
  background: rgba(15,10,30,.9);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}
.site-logo .logo-badge {
  background: var(--accent-primary);
  color: #fff;
  font-size: .6rem;
  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) !important;
  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: 80px;
  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);
}
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--text-muted); }

/* =============================================
   固定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;
}

/* =============================================
   ボタン
   ============================================= */
.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(124,58,237,.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(124,58,237,.1);
}
textarea.form-control { min-height: 120px; resize: vertical; }
.form-hint { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: .8rem; color: var(--accent-danger); margin-top: 4px; }

/* =============================================
   カード・バッジ・アラート・Toast（共通）
   ============================================= */
.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(124,58,237,.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; }
.alert-info    { background: #f5f3ff; color: #4c1d95; }
.alert-success { background: #f0fdf4; color: #166534; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-danger  { background: #fef2f2; color: #991b1b; }
.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: #f5f3ff; color: #4c1d95; }
.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); }
.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-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.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-muted   { color: var(--text-muted); }
.font-bold    { font-weight: 700; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.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; }
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .admin-form-grid { grid-template-columns: 1fr; } }
.mr-1 { margin-right: 4px; }
.mb-2 { margin-bottom: 8px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }

/* === 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); }
