/* 利用規約・ポリシー等の静的ページ（メインアプリのトーンに合わせたレイアウト） */
html {
  scroll-behavior: smooth;
}

/* style.css の html { overflow: hidden } を打ち消し */
html:has(> body.legal-body) {
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
  min-height: 100%;
  user-select: text;
}

@media (prefers-color-scheme: dark) {
  body.legal-body {
    --bg: #121316;
    --fg: #f2f3f5;
    --muted: #9fa6b0;
    --line: #39424d;
    --panel: rgba(18, 19, 22, 0.9);
    --node-bg: #1b1d22;
    --shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
  }
}

body.legal-body {
  margin: 0;
  min-height: 100%;
  height: auto;
  overflow-x: hidden;
  overflow-y: visible;
  user-select: text;
  background: var(--bg);
  color: var(--fg);
  font-family: "Roboto", "Noto Sans JP", "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

body.legal-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(1200px 500px at 12% -10%, color-mix(in srgb, #4285f4 10%, transparent), transparent 55%),
    radial-gradient(900px 400px at 100% 0%, color-mix(in srgb, #34a853 8%, transparent), transparent 50%);
  opacity: 0.85;
}

@media (prefers-color-scheme: dark) {
  body.legal-body::before {
    opacity: 0.45;
    background: radial-gradient(1000px 480px at 10% -8%, color-mix(in srgb, #8ab4f8 12%, transparent), transparent 55%),
      radial-gradient(800px 360px at 100% 0%, color-mix(in srgb, #81c995 8%, transparent), transparent 48%);
  }
}

.legal-wrap {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 28px auto 56px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--node-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.legal-wrap header {
  margin: 0;
  padding: 22px 26px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(10px);
}

.legal-wrap > *:not(header) {
  padding-left: 26px;
  padding-right: 26px;
}

.legal-wrap header + * {
  padding-top: 22px;
}

.legal-wrap > *:not(header):last-child {
  padding-bottom: 28px;
}

.legal-wrap h1 {
  margin: 0 0 6px;
  padding-left: 12px;
  border-left: 3px solid #4285f4;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 14px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 120ms ease;
}

.legal-back:hover {
  color: #4285f4;
  text-decoration: none;
}

@media (prefers-color-scheme: dark) {
  .legal-back:hover {
    color: #8ab4f8;
  }
}

.legal-wrap h2 {
  margin: 1.5em 0 0.45em;
  padding-bottom: 0.35em;
  font-size: 1.05rem;
  font-weight: 700;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
}

.legal-wrap h2:first-of-type {
  margin-top: 0;
}

.legal-wrap h3 {
  margin: 1.2em 0 0.35em;
  font-size: 1rem;
  font-weight: 700;
}

.legal-wrap p,
.legal-wrap li {
  color: var(--fg);
}

.legal-wrap ul {
  margin: 0.5em 0;
  padding-left: 1.35em;
}

.legal-wrap .muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.legal-wrap header .muted {
  margin: 0;
}

.legal-wrap .placeholder {
  padding: 12px 16px;
  margin: 1em 0;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 65%, var(--node-bg));
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
}

.legal-wrap a {
  color: #1a73e8;
  word-break: break-all;
}

@media (prefers-color-scheme: dark) {
  .legal-wrap a {
    color: #8ab4f8;
  }
}

.legal-wrap address {
  font-style: normal;
  line-height: 1.75;
}

.contact-actions {
  margin-top: 1.25em;
}

.contact-actions a {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--node-bg);
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
}

.contact-actions a:hover {
  border-color: #4285f4;
}

.contact-form {
  position: relative;
  margin-top: 1.25em;
}

.contact-field {
  margin-bottom: 1.1em;
}

.contact-field label {
  display: block;
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--fg);
}

.contact-req {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

.contact-field input[type="text"],
.contact-field input[type="email"],
.contact-field select,
.contact-field textarea {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  padding: 10px 12px;
  box-sizing: border-box;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.contact-field textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.5;
}

.contact-field input:hover,
.contact-field select:hover,
.contact-field textarea:hover {
  border-color: color-mix(in srgb, var(--line) 70%, #4285f4);
}

.contact-field input:focus,
.contact-field select:focus,
.contact-field textarea:focus {
  outline: none;
  border-color: #4285f4;
  box-shadow: 0 0 0 3px color-mix(in srgb, #4285f4 22%, transparent);
}

.contact-honey {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.contact-consent {
  margin: 0 0 1em;
  font-size: 0.88rem;
}

.contact-actions-row {
  margin-top: 0.25em;
}

.contact-submit {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid #4285f4;
  background: #4285f4;
  color: #fff;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.2);
  transition: filter 120ms ease, box-shadow 120ms ease;
}

.contact-submit:hover {
  filter: brightness(1.05);
  box-shadow: 0 2px 6px rgba(66, 133, 244, 0.35);
}

.contact-submit:focus {
  outline: 2px solid color-mix(in srgb, #4285f4 55%, transparent);
  outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
  .contact-submit {
    background: #8ab4f8;
    border-color: #8ab4f8;
    color: #0f1115;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  }

  .contact-submit:hover {
    filter: brightness(1.06);
    box-shadow: 0 2px 8px rgba(138, 180, 248, 0.25);
  }
}
