/*
 * Famlog の公開サイト（https://famlog-app.github.io/）とアプリ内の法務ページ共通のスタイル。
 * アプリに同梱してオフラインでも表示するので、外部のフォントや画像は読み込まない。
 * アプリの中（iframe）では html に data-embed が付き、サイトのヘッダーとダークモードを使わない。
 */
:root {
  --brand: #19c36a;
  --brand-deep: #0d8a4a;
  --brand-soft: #e7f8ee;
  --btn: #0f9a55;
  --on-btn: #ffffff;
  --bg: #fbfcfa;
  --surface: #ffffff;
  --surface-2: #f3f6f2;
  --text: #1f2a24;
  --muted: #66736b;
  --line: rgba(20, 40, 28, 0.09);
  --shadow: 0 1px 2px rgba(20, 40, 28, 0.04), 0 8px 24px rgba(20, 40, 28, 0.06);
  --danger: #c0392b;
  --radius: 18px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-embed]) {
    --brand: #2fd47e;
    --brand-deep: #5fe39d;
    --brand-soft: rgba(47, 212, 126, 0.12);
    --btn: #2fd47e;
    --on-btn: #062312;
    --bg: #0f1412;
    --surface: #171e1a;
    --surface-2: #1d2621;
    --text: #e8eee9;
    --muted: #98a59c;
    --line: rgba(255, 255, 255, 0.09);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --danger: #ff8a7a;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: 15.5px;
  line-height: 1.85;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}

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

a {
  color: var(--brand-deep);
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ───────── サイトのヘッダー ───────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}

.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1040px;
  height: 60px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  flex: none;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  box-shadow: 0 0 0 1px var(--line);
}

.site-nav {
  display: flex;
  gap: 2px;
}

.site-nav a {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

@media (max-width: 380px) {
  .site-nav .wide:not([aria-current]) {
    display: none;
  }
}

@media (max-width: 560px) {
  .site-nav a {
    padding: 6px 9px;
    font-size: 13px;
  }
}

/* アプリの中では、アプリ側に見出しと「閉じる」があるのでサイトのヘッダーは出さない */
[data-embed] .site-header {
  display: none;
}

/* ───────── ページの骨組み ───────── */
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-left)) 56px;
}

.page-hero {
  padding: 40px 0 8px;
}

[data-embed] .page-hero {
  padding-top: 20px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

h1 {
  margin: 0;
  font-size: clamp(26px, 5vw, 34px);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.lead {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

h2 {
  margin: 44px 0 12px;
  padding-left: 12px;
  border-left: 4px solid var(--brand);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.5;
}

h3 {
  margin: 24px 0 6px;
  font-size: 16px;
  font-weight: 700;
}

p,
ul,
ol {
  margin: 10px 0;
}

ul,
ol {
  padding-left: 1.4em;
}

li {
  margin: 4px 0;
}

li::marker {
  color: var(--brand);
}

strong {
  font-weight: 700;
  background: linear-gradient(transparent 62%, color-mix(in srgb, var(--brand) 22%, transparent) 62%);
}

.box,
.card {
  margin: 14px 0;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
}

.box > :first-child,
.card > :first-child {
  margin-top: 0;
}

.box > :last-child,
.card > :last-child {
  margin-bottom: 0;
}

.note {
  margin: 14px 0;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 14px;
}

/* ───────── 目次（プライバシーポリシー・利用規約） ───────── */
.toc {
  margin: 24px 0 8px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.toc summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  list-style: none;
}

.toc summary::-webkit-details-marker {
  display: none;
}

.toc summary::after {
  content: "＋";
  float: right;
  color: var(--muted);
}

.toc[open] summary::after {
  content: "－";
}

.toc ol {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  columns: 2 240px;
  column-gap: 24px;
}

.toc li {
  margin: 0;
  break-inside: avoid;
}

.toc a {
  display: block;
  padding: 4px 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.toc a:hover {
  color: var(--brand-deep);
}

/* ───────── サポート：入口のカード ───────── */
.quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 28px 0 8px;
}

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

.quick a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.quick a:hover {
  transform: translateY(-2px);
}

.quick .ic {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.quick .ic svg {
  width: 22px;
  height: 22px;
}

.quick b {
  display: block;
  font-size: 15px;
  line-height: 1.4;
}

.quick small {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
}

/* ───────── よくある質問（開閉） ───────── */
.faq {
  margin: 12px 0;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
  overflow: hidden;
}

.faq details + details {
  border-top: 1px solid var(--line);
}

.faq summary {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.6;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::before {
  content: "Q";
  display: grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.faq summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin: 8px 4px 0 auto;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  margin-top: 12px;
  transform: rotate(-135deg);
}

.faq summary:hover {
  background: var(--surface-2);
}

.faq .answer {
  padding: 0 18px 16px 54px;
}

.faq .answer > :first-child {
  margin-top: 0;
}

.faq .answer > :last-child {
  margin-bottom: 0;
}

@media (max-width: 480px) {
  .faq .answer {
    padding-left: 18px;
  }
}

/* ───────── 手順 ───────── */
.steps {
  counter-reset: step;
  padding: 0;
  list-style: none;
}

.steps li {
  position: relative;
  margin: 8px 0;
  padding-left: 38px;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 2px;
  left: 0;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 13px;
  font-weight: 800;
}

/* ───────── フォーム（support.html・delete-account.html） ───────── */
form.box {
  padding: 22px 20px;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
}

.field > span .opt {
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.field select,
.field textarea,
.field input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  /* 16px 未満だと iOS が入力時に画面を拡大してしまう */
  font-size: 16px;
  line-height: 1.6;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.field select {
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.field select:focus,
.field textarea:focus,
.field input:focus {
  border-color: var(--brand);
  background-color: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
  outline: none;
}

.field textarea {
  resize: vertical;
}

::placeholder {
  color: color-mix(in srgb, var(--muted) 80%, transparent);
}

form.box button[type="submit"] {
  width: 100%;
  margin-top: 4px;
  padding: 14px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--btn);
  color: var(--on-btn);
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--btn) 30%, transparent);
  transition: transform 0.1s ease, filter 0.15s ease;
}

form.box button[type="submit"]:hover {
  filter: brightness(1.05);
}

form.box button[type="submit"]:active {
  transform: scale(0.98);
}

form.box button[type="submit"]:disabled {
  opacity: 0.5;
  cursor: default;
}

.status {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 700;
}

.status.ok {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.status.ng {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
}

/* ───────── 日付・フッター ───────── */
.dates {
  margin-top: 48px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13.5px;
}

.site-footer .inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px max(16px, env(safe-area-inset-left)) calc(28px + env(safe-area-inset-bottom));
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.site-footer a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--brand-deep);
  text-decoration: underline;
}

[data-embed] .site-footer .copy {
  display: none;
}

/* ───────── トップページ ───────── */
.home main {
  max-width: 1040px;
  /* 傾けた画面のスクリーンショットで横スクロールが出ないように */
  overflow-x: clip;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 40px;
  padding: 56px 0 24px;
}

.hero .app-icon {
  width: 88px;
  height: 88px;
  margin-bottom: 20px;
  border-radius: 22px;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--brand) 35%, transparent);
}

.hero h1 {
  font-size: clamp(30px, 5.4vw, 46px);
  line-height: 1.3;
}

.hero h1 .accent {
  color: var(--brand-deep);
}

.hero .lead {
  max-width: 34em;
  font-size: 16px;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.1s ease, filter 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn svg {
  width: 20px;
  height: 20px;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

.btn-primary:hover {
  filter: brightness(1.15);
  text-decoration: none;
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--line);
}

.btn-ghost:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.cta-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.shots {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 12px 0;
}

.shots::before {
  content: "";
  position: absolute;
  inset: 8% 2%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 22%, transparent), transparent);
  filter: blur(8px);
}

.phone {
  position: relative;
  width: 236px;
  padding: 8px;
  border-radius: 40px;
  background: #11161a;
  box-shadow: 0 30px 60px rgba(10, 30, 20, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.phone img {
  border-radius: 32px;
  aspect-ratio: 1320 / 2868;
  width: 100%;
  height: auto;
  background: #fff;
}

.phone.back {
  position: absolute;
  width: 200px;
  opacity: 0.96;
}

.phone.back.left {
  transform: translate(-58%, 34px) rotate(-6deg);
}

.phone.back.right {
  transform: translate(58%, 34px) rotate(6deg);
}

.phone.front {
  z-index: 1;
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 32px;
    text-align: center;
  }
  .hero .app-icon {
    margin: 0 auto 16px;
  }
  .hero .lead {
    margin-left: auto;
    margin-right: auto;
  }
  .cta {
    justify-content: center;
  }
  .phone {
    width: 200px;
  }
  .phone.back {
    width: 170px;
  }
  .phone.back.left {
    transform: translate(-50%, 30px) rotate(-6deg);
  }
  .phone.back.right {
    transform: translate(50%, 30px) rotate(6deg);
  }
}

.section-title {
  margin: 72px 0 8px;
  padding: 0;
  border: 0;
  font-size: clamp(22px, 3.6vw, 28px);
  text-align: center;
}

.section-lead {
  margin: 0 auto 28px;
  max-width: 36em;
  color: var(--muted);
  text-align: center;
}

.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.feature {
  padding: 22px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
}

.feature {
  display: flex;
  flex-direction: column;
}

/* 特徴のスクリーンショット（画面の上の部分だけを切り出したもの） */
.feature .shot {
  position: relative;
  margin: -6px -4px 18px;
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--line);
  overflow: hidden;
}

.feature .shot img {
  width: 100%;
  height: auto;
  aspect-ratio: 560 / 700;
}

/* 下の端を背景になじませる */
.feature .shot::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 22%;
  background: linear-gradient(to bottom, transparent, var(--surface));
}

.feature .ic {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.feature .ic svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 900px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .features {
    grid-template-columns: 1fr;
  }
  /* スマホでは縦に長くなりすぎないよう、画面の上の部分だけを見せる */
  .feature .shot img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: top;
  }
}

.feature h3 {
  margin: 0 0 6px;
  font-size: 16.5px;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.trust {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trust li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 14px;
  line-height: 1.65;
}

.trust li::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.help-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin: 72px 0 0;
  padding: 28px;
  border-radius: 24px;
  background: var(--brand-soft);
}

.help-band h2 {
  margin: 0 0 4px;
  padding: 0;
  border: 0;
  font-size: 20px;
}

.help-band p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .toc {
    display: none;
  }
}

/* サイトだけで出すもの（アプリの中では隠す） */
[data-embed] .site-only {
  display: none !important;
}

/* 見出しを文節の途中で折り返さない */
.nw {
  display: inline-block;
}

/* スクリーンショットがある特徴カードでは、アイコンは出さない */
.feature .shot + .ic {
  display: none;
}
