/* 全ページ共通。スマホ優先・システムフォント・外部読み込みなし */

:root {
  --color-bg: #ffffff;
  --color-text: #333333;
  --color-muted: #5f5f5f;
  --color-border: #d6d6d6;
  --color-input-border: #8a8a8a;
  --color-surface: #f6f7f6;
  --color-accent: #1A7A4C;
  --color-accent-dark: #145f3b;
  --color-accent-weak: #edf6f1;
  --color-error: #b3261e;
  --color-error-weak: #fdeeed;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", sans-serif;
  --radius: 6px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.8;
  line-break: strict;
  overflow-wrap: break-word;
}

a {
  color: var(--color-accent-dark);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--color-accent);
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  line-height: 1.5;
  color: #222222;
}

p {
  margin: 0 0 1em;
}

.container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---- header / footer ---- */

.site-header {
  border-bottom: 1px solid var(--color-border);
  padding: 12px 0;
}

.site-name {
  color: #222222;
  font-weight: 700;
  text-decoration: none;
}

.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--color-border);
  padding: 24px 0 32px;
  color: var(--color-muted);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.footer-links a {
  display: inline-block;
  padding: 4px 0;
}

.footer-company {
  margin: 0;
}

/* ---- sections ---- */

.hero {
  padding: 40px 0 32px;
  background: var(--color-accent-weak);
}

.hero h1 {
  margin: 0 0 12px;
  font-size: 1.5rem;
}

.hero-sub {
  margin: 0 0 16px;
  color: var(--color-accent-dark);
  font-weight: 700;
}

.hero-note {
  font-weight: 700;
}

.hero-cta {
  margin: 24px 0 0;
}

.section {
  padding: 40px 0;
}

.section-tinted {
  background: var(--color-surface);
}

.section h2 {
  margin: 0 0 20px;
  padding-left: 12px;
  border-left: 4px solid var(--color-accent);
  font-size: 1.375rem;
}

@media (min-width: 720px) {
  .hero {
    padding: 56px 0 48px;
  }

  .hero h1 {
    font-size: 2rem;
  }
}

/* ---- buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--color-accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--color-accent-dark);
  color: #ffffff;
}

.btn-secondary {
  background: #ffffff;
  color: var(--color-accent-dark);
  box-shadow: inset 0 0 0 2px var(--color-accent);
}

.btn-secondary:hover {
  background: var(--color-accent-weak);
  color: var(--color-accent-dark);
}

.btn:disabled {
  background: #e0e0e0;
  color: #4d4d4d;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

/* ---- 特徴・使い方 ---- */

.points {
  counter-reset: point;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.points > li {
  counter-increment: point;
  position: relative;
  padding: 16px 16px 16px 60px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.points > li::before {
  content: counter(point);
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #ffffff;
  font-weight: 700;
  line-height: 1;
}

.points h3 {
  margin: 0 0 4px;
  font-size: 1.0625rem;
  overflow-wrap: anywhere;
}

.points p {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (min-width: 720px) {
  .points-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---- 登録フォーム: 入力画面 ---- */

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choices {
  margin-bottom: 24px;
}

.choices:last-child {
  margin-bottom: 0;
}

.choices legend {
  margin-bottom: 8px;
  padding: 0;
  font-weight: 700;
}

.choice-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.choice-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 480px) {
  .choice-grid-medium {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .choice-grid-compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 640px) {
  .choice-grid-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #ffffff;
  line-height: 1.5;
  cursor: pointer;
}

.choice span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.choice:has(input:checked) {
  border-color: var(--color-accent);
  background: var(--color-accent-weak);
}

.choice input,
.consent input,
.agent-pick input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--color-accent);
}

/* ---- 登録フォーム: 確認画面 ---- */

.confirm-lead {
  margin: 0 0 16px;
}

/* Live regions stay in the page; while empty they take no space. */
.form-error:empty,
.form-status:empty {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}

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

.agent-list:not(:empty) {
  margin-bottom: 16px;
}

.agent {
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.agent:has(.agent-pick input:checked) {
  border-color: var(--color-accent);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}

.agent-list:focus-visible {
  outline-offset: 4px;
}

.agent-name {
  margin: 0 0 4px;
  font-size: 1.0625rem;
  overflow-wrap: anywhere;
}

.agent-license {
  margin: 0 0 12px;
  color: var(--color-muted);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.agent-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  color: var(--color-accent-dark);
  font-weight: 700;
  cursor: pointer;
}

.agent-pick:has(input:checked) {
  background: var(--color-accent-weak);
}

/* ---- 登録フォーム: 入力欄・同意・ボタン ---- */

/* Disabled: no opacity, so every text keeps a contrast of 4.5:1 or more on white. */
.register-fields:disabled .field-label {
  color: var(--color-muted);
}

.field input:disabled {
  background: #f2f2f2;
  color: var(--color-muted);
}

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

.field-label {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
  line-height: 1.5;
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--color-input-border);
  border-radius: var(--radius);
  background: #ffffff;
  color: inherit;
  font: inherit;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0 20px;
  line-height: 1.6;
  cursor: pointer;
}

.consent input {
  margin-top: 3px;
}

.consent span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.form-actions .btn {
  flex: 1 1 10em;
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-error {
  margin: 0 0 12px;
  color: var(--color-error);
  font-weight: 700;
}

.form-status {
  margin: 12px 0 0;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--color-surface);
}

.form-status[data-state="error"] {
  background: var(--color-error-weak);
  color: var(--color-error);
}

.form-done {
  margin: 0;
  padding: 16px;
  border: 2px solid var(--color-accent);
  border-radius: 8px;
  background: var(--color-accent-weak);
  font-weight: 700;
}

/* ---- よくある質問 ---- */

.faq {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.faq summary,
.faq details p {
  overflow-wrap: anywhere;
}

.faq details {
  padding: 0 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.faq summary {
  padding: 14px 0;
  font-weight: 700;
  line-height: 1.6;
  cursor: pointer;
}

.faq details p {
  margin: 0 0 14px;
}

/* ---- 利用規約・運営者情報 ---- */

.doc {
  padding: 32px 0 0;
}

.doc h1 {
  margin: 0 0 16px;
  font-size: 1.5rem;
}

.doc h2 {
  margin: 32px 0 8px;
  font-size: 1.125rem;
}

.doc ol {
  margin: 0 0 8px;
  padding-left: 1.6em;
}

.doc li {
  margin-bottom: 4px;
}

.doc li > p {
  margin: 0;
}

.doc li > ol {
  margin-top: 4px;
}

.info {
  margin: 0;
  border-top: 1px solid var(--color-border);
}

.info > div {
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.info dt {
  font-weight: 700;
}

.info dd {
  margin: 0;
}

@media (min-width: 640px) {
  .info > div {
    display: grid;
    grid-template-columns: 13em minmax(0, 1fr);
    gap: 16px;
  }
}

/* ---- 記事型のページ（仕組み・編集と運営の方針・記事の入口・記事） ---- */

.guide .breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  color: var(--color-muted);
  font-size: 0.875rem;
}

.breadcrumb li {
  overflow-wrap: anywhere;
}

.breadcrumb li + li::before {
  content: "›";
  margin: 0 8px;
}

.guide-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0 0 20px;
  color: var(--color-muted);
  font-size: 0.875rem;
}

.guide-dates > div {
  display: flex;
  gap: 8px;
}

.guide-dates dt,
.guide-dates dd {
  margin: 0;
}

.guide-box {
  margin: 0 0 24px;
  padding: 16px;
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius);
  background: var(--color-accent-weak);
  font-weight: 700;
}

.guide h3 {
  margin: 24px 0 8px;
  font-size: 1.0625rem;
}

.guide ul {
  margin: 0 0 16px;
  padding-left: 1.4em;
}

.guide h1,
.guide h2,
.guide h3,
.guide li,
.guide td,
.guide th {
  overflow-wrap: anywhere;
}

.guide blockquote {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-left: 4px solid var(--color-input-border);
  background: var(--color-surface);
}

.guide blockquote p {
  margin: 0 0 8px;
}

.guide blockquote p:last-child {
  margin-bottom: 0;
}

.table-scroll {
  margin: 0 0 16px;
  overflow-x: auto;
}

.table-scroll table {
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.table-scroll th,
.table-scroll td {
  min-width: 6em;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.table-scroll th {
  background: var(--color-surface);
}

.sources a {
  word-break: break-all;
}

.guide-related,
.guide-service {
  margin-top: 32px;
}

.guide-service {
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.guide-service-link {
  margin: 0;
}

.guide .guide-items {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.guide-items > li {
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.guide-item-title {
  margin: 0 0 4px;
  font-weight: 700;
}

.guide-item-text {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.9375rem;
}

/* ---- 登録の窓と固定のボタン（templates/entry.html、assets/js/entry.js） ---- */

/* Room under the footer, so the fixed button never covers it. */
.site-footer {
  padding-bottom: 96px;
}

.entry-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--color-accent);
  color: #ffffff;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.25);
}

.entry-fab:hover {
  background: var(--color-accent-dark);
  color: #ffffff;
}

.entry {
  width: min(100% - 32px, 640px);
  max-height: calc(100% - 32px);
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--color-bg);
  color: var(--color-text);
}

/* A window not opened stays out of the page, whatever the browser's own styles. */
.entry:not([open]) {
  display: none;
}

.entry::backdrop {
  background: rgb(0 0 0 / 0.5);
}

.entry-body {
  padding: 20px;
}

.entry-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.entry-head h2 {
  margin-top: 0;
}

.entry-close {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  cursor: pointer;
}

.entry-close::before,
.entry-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  background: var(--color-text);
}

.entry-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.entry-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.entry-note {
  color: var(--color-muted);
  font-size: 0.875rem;
}

.entry-link a {
  display: inline-block;
  min-height: 44px;
  padding: 10px 0;
}

@media print {
  .entry-fab,
  .entry {
    display: none;
  }

  .site-footer {
    padding-bottom: 32px;
  }
}
