:root {
  color-scheme: light;
  --bg: #edf3f1;
  --paper: #ffffff;
  --ink: #172822;
  --muted: #63726d;
  --line: #d3dfdb;
  --brand: #20704f;
  --brand-strong: #155c3f;
  --brand-soft: #eef8f2;
  --soft: #f4f8f6;
  --accent: #b77928;
  --danger: #9e2f2f;
  --info: #245b8f;
  --shadow: 0 22px 58px rgba(26, 45, 38, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Yu Gothic", "Hiragino Sans", system-ui, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, #f8fbfa 0%, var(--bg) 56%, #e5efea 100%);
  line-height: 1.6;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 32px 16px;
  display: grid;
  place-items: start center;
}

.form-surface {
  width: min(1040px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.form-header {
  padding: 34px 32px 32px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f3f8f5 100%);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(26px, 4vw, 42px);
  letter-spacing: 0;
}

.form-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0;
  padding: 10px;
  list-style: none;
  background: #edf4f1;
  border-bottom: 1px solid var(--line);
  counter-reset: step;
}

.progress li {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f9fbfa;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.progress li::before {
  counter-increment: step;
  content: counter(step);
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e2ebe7;
  color: #49635a;
  font-size: 12px;
}

.progress li[data-state="active"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.progress li[data-state="active"]::before {
  background: #fff;
  color: var(--brand-strong);
}

.progress li[data-state="done"] {
  background: var(--brand-soft);
  border-color: #bddbcd;
  color: var(--brand-strong);
}

.progress li[data-state="done"]::before {
  background: var(--brand);
  color: #fff;
}

.alert {
  margin: 18px 28px 0;
  padding: 12px 14px;
  border: 1px solid #e3aaaa;
  border-radius: 8px;
  background: #fff0f0;
  color: var(--danger);
  font-weight: 700;
}

.alert[data-tone="info"] {
  border-color: #a7c7e2;
  background: #edf6ff;
  color: var(--info);
}

.step-panel {
  padding: 30px 32px 32px;
}

.step-panel h2 {
  margin-bottom: 18px;
  font-size: 24px;
  letter-spacing: 0;
}

.step-copy {
  margin-bottom: 18px;
  color: var(--muted);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label,
fieldset {
  display: grid;
  gap: 7px;
  color: #30433c;
  font-weight: 700;
}

fieldset {
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 10px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfdfc;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(32, 112, 79, 0.25);
  outline-offset: 2px;
}

.wide {
  grid-column: 1 / -1;
}

.check-grid,
.agreement-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.check-card {
  min-height: 54px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #fff;
  font-weight: 700;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.check-card:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px rgba(32, 112, 79, 0.16);
}

.check-card input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--brand);
}

.rule-list,
.preview-grid {
  display: grid;
  gap: 12px;
}

.rule-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfc;
  box-shadow: 0 8px 22px rgba(26, 45, 38, 0.05);
}

.rule-index {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.rule-card h3,
.preview-grid h3 {
  margin-bottom: 4px;
  font-size: 16px;
  letter-spacing: 0;
}

.rule-card p,
.preview-grid p,
.timetree-guide p,
.privacy,
.completion p,
.line-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.rule-card-content {
  display: grid;
  gap: 10px;
}

.rule-agree {
  background: var(--brand-soft);
  border-color: #a9d1bf;
}

.rule-agree:has(input:checked) {
  background: #e4f3eb;
  border-color: var(--brand);
}

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

.preview-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfc;
  box-shadow: 0 8px 22px rgba(26, 45, 38, 0.05);
}

.timetree-guide {
  display: grid;
  gap: 12px;
}

.guide-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfc;
  box-shadow: 0 8px 22px rgba(26, 45, 38, 0.05);
}

.step-number {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.guide-step h3 {
  margin-bottom: 6px;
  font-size: 16px;
  letter-spacing: 0;
}

.guide-step .confirm {
  margin-top: 12px;
}

.example {
  width: fit-content;
  margin-top: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fff5e6;
  font-weight: 800;
  color: #7a4b14;
}

.inline-link {
  width: fit-content;
  min-height: 40px;
  margin-top: 10px;
  border-radius: 8px;
  padding: 8px 12px;
  display: inline-grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.inline-link[aria-disabled="true"] {
  opacity: 0.65;
  pointer-events: none;
}

.confirm {
  margin-top: 16px;
}

.privacy {
  margin-top: 16px;
  padding: 13px 14px;
  border-radius: 8px;
  background: #fff9ed;
  border: 1px solid #ead9bd;
  color: #72531e;
}

.actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

button,
.line-button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 18px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-grid;
  place-items: center;
}

.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 22px rgba(32, 112, 79, 0.18);
}

.primary:hover {
  background: var(--brand-strong);
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.completion {
  text-align: center;
}

.line-card {
  width: min(520px, 100%);
  margin: 0 auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  display: grid;
  gap: 14px;
  box-shadow: 0 12px 28px rgba(26, 45, 38, 0.07);
}

.line-button[aria-disabled="true"] {
  opacity: 0.65;
  pointer-events: none;
}

@media (max-width: 760px) {
  .app-shell {
    padding: 0;
  }

  .form-surface {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .form-header,
  .step-panel {
    padding: 20px;
  }

  .progress {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 14px;
    scroll-snap-type: x proximity;
  }

  .progress li {
    min-width: 128px;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .field-grid,
  .check-grid,
  .agreement-list,
  .preview-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column-reverse;
  }

  button,
  .line-button {
    width: 100%;
  }
}

.inquiry-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 8px 16px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.inquiry-link::before {
  content: '💬';
}

.inquiry-link:hover {
  background: #ddf0e5;
}

.guide-button {
  width: fit-content;
  min-height: 38px;
  margin-top: 10px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  padding: 6px 14px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.guide-button:hover {
  background: #ddf0e5;
}

.guide-modal {
  max-width: min(520px, 92vw);
  max-height: 90vh;
  border: 0;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.guide-modal::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.guide-modal-content {
  padding: 24px;
  display: grid;
  gap: 14px;
  overflow-y: auto;
  max-height: 88vh;
}

.guide-modal-content:focus {
  outline: none;
}

.guide-modal-content h3 {
  margin: 0;
  font-size: 18px;
}

.guide-modal-content p {
  margin: 0;
  color: var(--muted);
}

.guide-images {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.guide-images img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  object-fit: contain;
}

@media (max-width: 480px) {
  .guide-images {
    grid-template-columns: 1fr;
  }
}
