/* ============================================
   AI気分日記 — 共通スタイル
   ============================================ */

/* --- CSS Variables --- */
:root {
  --primary: #B794F4;
  --primary-light: #D6BCFA;
  --primary-dark: #9F7AEA;
  --gradient-start: #C9A8F0;
  --gradient-mid: #E8A0BF;
  --gradient-end: #FDCDA4;
  --bg: #FAF0F5;
  --bg-alt: #F2E4EE;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-solid: #fff;
  --text: #2D2040;
  --text-secondary: #6B5B7B;
  --text-tertiary: #A098AE;
  --border: #E8D8F0;
  --border-light: #F3ECF8;
  --accent: #F9A8D4;
  --error: #EF4444;
  --success: #10B981;
  --shadow: rgba(100, 60, 130, 0.10);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --max-width: 1100px;
  --header-h: 64px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans',
    'Noto Sans JP', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--primary-dark); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: .75; }

img { max-width: 100%; height: auto; display: block; }

ul { list-style: none; }

/* --- Utility --- */
.container { width: 90%; max-width: var(--max-width); margin: 0 auto; }
.text-center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* --- Header --- */
.site-header {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  height: var(--header-h);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%;
}
.site-logo {
  font-size: 1.2rem; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.site-logo .emoji { font-size: 1.5rem; }

.nav-links { display: flex; gap: 24px; }
.nav-links a {
  font-size: .9rem; font-weight: 500; color: var(--text-secondary);
  transition: color .2s;
}
.nav-links a:hover { color: var(--primary-dark); opacity: 1; }

/* Hamburger */
.hamburger {
  display: none; background: none; border: none; cursor: pointer;
  width: 32px; height: 32px; position: relative;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px;
  position: absolute; left: 5px;
  transition: transform .3s, opacity .3s;
}
.hamburger span:nth-child(1) { top: 9px; }
.hamburger span:nth-child(2) { top: 15px; }
.hamburger span:nth-child(3) { top: 21px; }
.hamburger.active span:nth-child(1) { top: 15px; transform: rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { top: 15px; transform: rotate(-45deg); }

/* Mobile nav */
.mobile-nav {
  display: none; position: fixed; top: var(--header-h); left: 0; width: 100%;
  background: rgba(255,255,255,0.97); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block; padding: 12px 5%; font-size: 1rem;
  color: var(--text-secondary); font-weight: 500;
}
.mobile-nav a:hover { color: var(--primary-dark); background: var(--bg); }

/* --- Hero --- */
.hero {
  padding: 140px 0 80px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-mid), var(--gradient-end));
  text-align: center; color: #fff;
}
.hero h1 { font-size: 2.4rem; font-weight: 800; line-height: 1.3; margin-bottom: 16px; }
.hero .subtitle { font-size: 1.1rem; opacity: .92; margin-bottom: 32px; max-width: 560px; margin-left: auto; margin-right: auto; }
.hero .cta-group { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 32px; border-radius: var(--radius-xl);
  font-size: 1rem; font-weight: 600; border: none; cursor: pointer;
  transition: transform .15s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); opacity: 1; }
.btn-primary {
  background: #fff; color: var(--primary-dark);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.btn-secondary {
  background: rgba(255,255,255,.2); color: #fff;
  border: 2px solid rgba(255,255,255,.5);
}
.btn-gradient {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-mid), var(--gradient-end));
  color: #fff; box-shadow: 0 4px 16px var(--shadow);
}
.btn-outline {
  background: transparent; color: var(--primary-dark);
  border: 2px solid var(--primary); border-radius: var(--radius-xl);
}

/* --- Section --- */
.section { padding: 80px 0; }
.section-title {
  font-size: 1.8rem; font-weight: 700; text-align: center;
  margin-bottom: 12px;
}
.section-subtitle {
  text-align: center; color: var(--text-secondary);
  margin-bottom: 48px; font-size: 1rem;
}
.section-alt { background: var(--bg-alt); }

/* --- Steps --- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.step-card {
  background: var(--surface-solid); border-radius: var(--radius-lg);
  padding: 32px 24px; text-align: center;
  box-shadow: 0 2px 12px var(--shadow);
  transition: transform .2s;
}
.step-card:hover { transform: translateY(-4px); }
.step-number {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #fff; font-size: 1.2rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.step-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.step-card p { font-size: .9rem; color: var(--text-secondary); }

/* --- Features --- */
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 48px; align-items: center; }
.feature-item { margin-bottom: 64px; }
.feature-item:last-child { margin-bottom: 0; }
.feature-text h3 { font-size: 1.3rem; margin-bottom: 8px; }
.feature-text p { color: var(--text-secondary); }
.feature-image {
  display: flex; justify-content: center;
}
.feature-image img {
  width: 240px; border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px var(--shadow);
}

/* --- Testimonials --- */
.testimonials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.testimonial-card {
  background: var(--surface-solid); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: 0 2px 12px var(--shadow);
}
.testimonial-card .stars { color: #F59E0B; margin-bottom: 8px; }
.testimonial-card p { font-size: .95rem; color: var(--text-secondary); margin-bottom: 12px; }
.testimonial-card .author { font-size: .85rem; font-weight: 600; color: var(--text); }

/* --- Pricing --- */
.pricing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; max-width: 700px; margin: 0 auto; }
.pricing-card {
  background: var(--surface-solid); border-radius: var(--radius-lg);
  padding: 32px; text-align: center;
  box-shadow: 0 2px 12px var(--shadow); position: relative;
}
.pricing-card.featured { border: 2px solid var(--primary); }
.pricing-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #fff; font-size: .75rem; font-weight: 600;
  padding: 4px 16px; border-radius: var(--radius-xl);
}
.pricing-card h3 { font-size: 1.3rem; margin-bottom: 8px; }
.pricing-price { font-size: 2.2rem; font-weight: 800; margin-bottom: 16px; }
.pricing-price span { font-size: .9rem; font-weight: 400; color: var(--text-secondary); }
.pricing-features { margin-bottom: 24px; text-align: left; }
.pricing-features li { padding: 6px 0; font-size: .9rem; color: var(--text-secondary); }
.pricing-features li::before { content: '✓ '; color: var(--success); font-weight: 700; }

/* --- CTA Banner --- */
.cta-banner {
  padding: 64px 0; text-align: center;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-mid), var(--gradient-end));
  color: #fff;
}
.cta-banner h2 { font-size: 1.8rem; font-weight: 700; margin-bottom: 12px; }
.cta-banner p { opacity: .92; margin-bottom: 24px; }
.cta-banner .cta-group { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* --- Footer --- */
.site-footer {
  background: var(--text); color: rgba(255,255,255,.7);
  padding: 40px 0 24px; font-size: .85rem;
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: rgba(255,255,255,.7); }
.footer-links a:hover { color: #fff; }
.footer-copy { color: rgba(255,255,255,.5); }

/* --- Legal / Terms --- */
.page-header {
  padding: 120px 0 40px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-mid), var(--gradient-end));
  color: #fff; text-align: center;
}
.page-header h1 { font-size: 2rem; font-weight: 700; }

.legal-content {
  background: var(--surface-solid);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin: -32px auto 48px;
  max-width: 800px;
  box-shadow: 0 4px 24px var(--shadow);
  position: relative; z-index: 1;
}
.legal-content h2 {
  font-size: 1.2rem; font-weight: 700; margin: 32px 0 12px;
  padding-bottom: 8px; border-bottom: 2px solid var(--border-light);
}
.legal-content h2:first-child { margin-top: 0; }
.legal-content p, .legal-content li { font-size: .95rem; color: var(--text-secondary); line-height: 1.8; }
.legal-content ul { padding-left: 1.5em; list-style: disc; margin: 8px 0; }
.legal-content ol { padding-left: 1.5em; margin: 8px 0; }
.legal-content table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.legal-content th, .legal-content td {
  text-align: left; padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: .95rem;
}
.legal-content th { font-weight: 600; color: var(--text); background: var(--bg); white-space: nowrap; width: 30%; }
.legal-content td { color: var(--text-secondary); }

/* --- Contact Form --- */
.contact-form {
  background: var(--surface-solid);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin: -32px auto 48px;
  max-width: 640px;
  box-shadow: 0 4px 24px var(--shadow);
  position: relative; z-index: 1;
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: .9rem; font-weight: 600;
  margin-bottom: 6px; color: var(--text);
}
.form-group label .required { color: var(--error); margin-left: 4px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem; font-family: inherit;
  background: var(--bg);
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(183, 148, 244, 0.15);
}
.form-group textarea { min-height: 140px; resize: vertical; }
.form-error { font-size: .8rem; color: var(--error); margin-top: 4px; display: none; }
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea { border-color: var(--error); }
.form-group.has-error .form-error { display: block; }

.form-submit { text-align: center; margin-top: 24px; }
.form-success {
  display: none; text-align: center; padding: 24px;
  background: rgba(16,185,129,.08); border-radius: var(--radius-md);
  color: var(--success); font-weight: 600;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: block; }

  .hero { padding: 110px 0 60px; }
  .hero h1 { font-size: 1.7rem; }
  .hero .subtitle { font-size: .95rem; }

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

  .feature-grid { grid-template-columns: 1fr; gap: 24px; text-align: center; }
  .feature-grid.reverse { direction: ltr; }
  .feature-image img { width: 200px; }

  .testimonials { grid-template-columns: 1fr; }

  .pricing-grid { grid-template-columns: 1fr; }

  .legal-content, .contact-form { padding: 24px; margin-left: 5%; margin-right: 5%; }

  .footer-inner { flex-direction: column; text-align: center; }

  .section { padding: 56px 0; }
  .section-title { font-size: 1.4rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.4rem; }
  .btn { padding: 12px 24px; font-size: .9rem; }
  .feature-image img { width: 180px; }
}
