:root {
  color-scheme: light;
  --bg: #f7fbff;
  --bg-soft: #edf6ff;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --text: #17212f;
  --muted: #5b6675;
  --line: rgba(46, 92, 129, 0.18);
  --primary: #1267a3;
  --primary-strong: #0b4b78;
  --accent: #f0b84e;
  --accent-soft: #fff5d9;
  --shadow: 0 20px 54px rgba(33, 73, 103, 0.13);
  --radius: 8px;
  --content: 1120px;
  font-family: "Noto Sans JP", "Yu Gothic", "Meiryo", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  letter-spacing: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 249, 255, 0.9)),
    radial-gradient(circle at 18% 12%, rgba(18, 103, 163, 0.12), transparent 34%),
    var(--bg);
}

body[data-theme="review"] {
  --bg: #f7fbff;
  --bg-soft: #edf6ff;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --text: #17212f;
  --muted: #5b6675;
  --line: rgba(46, 92, 129, 0.18);
  --primary: #1267a3;
  --primary-strong: #0b4b78;
  --accent: #f0b84e;
  --accent-soft: #fff5d9;
}

body[data-theme="production"],
body[data-theme="estimate"] {
  --bg: #f7f2e8;
  --bg-soft: #efe5d3;
  --panel: rgba(255, 252, 246, 0.95);
  --panel-strong: #fffdfa;
  --text: #201b16;
  --muted: #6f6254;
  --line: rgba(93, 71, 42, 0.22);
  --primary: #283c50;
  --primary-strong: #172637;
  --accent: #b4873e;
  --accent-soft: #fff3d8;
  --shadow: 0 24px 64px rgba(55, 43, 30, 0.16);
  background:
    linear-gradient(135deg, rgba(255, 252, 244, 0.96), rgba(246, 237, 222, 0.9)),
    radial-gradient(circle at 18% 14%, rgba(180, 135, 62, 0.14), transparent 32%),
    var(--bg);
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 10;
  transform: translateY(-140%);
  background: var(--primary-strong);
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px);
}

body[data-theme="production"] .site-header,
body[data-theme="estimate"] .site-header {
  background: rgba(255, 250, 241, 0.82);
}

.site-header__inner,
.site-footer__inner,
.form-shell,
.hub {
  width: min(var(--content), calc(100% - 32px));
  margin: 0 auto;
}

.site-header__inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand strong {
  display: block;
  font-size: 1rem;
  line-height: 1.2;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.3;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-links a,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.35;
}

.header-links a {
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.9rem;
}

.button {
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 10px 24px rgba(18, 103, 163, 0.2);
}

.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.62;
  pointer-events: none;
}

body[data-theme="production"] .button,
body[data-theme="estimate"] .button {
  box-shadow: 0 10px 24px rgba(55, 43, 30, 0.18);
}

.button--ghost {
  background: transparent;
  color: var(--primary-strong);
  box-shadow: none;
}

.button--soft {
  background: var(--accent-soft);
  color: #503711;
  border-color: rgba(180, 135, 62, 0.32);
  box-shadow: none;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.form-shell {
  display: grid;
  gap: 18px;
  width: min(900px, calc(100% - 32px));
  padding: 44px 0 64px;
}

.form-shell--single,
.hub {
  padding: 44px 0 64px;
}

.form-shell--single {
  width: min(880px, calc(100% - 32px));
}

.form-card,
.confirm-card,
.hub-card,
.notice-panel {
  max-width: 100%;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.intro-panel {
  padding: 0 4px 8px;
}

.form-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  margin: 0 0 14px;
}

.form-brand img {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.form-brand a {
  color: inherit;
  text-decoration: none;
}

.form-brand__logo {
  display: inline-flex;
  flex: 0 0 auto;
}

.form-brand .kicker {
  margin: 0;
  font-size: clamp(1.02rem, 2.2vw, 1.2rem);
  line-height: 1.35;
  text-transform: none;
  transform: translateY(5px);
}

.form-card,
.confirm-card {
  width: 100%;
  padding: 30px 32px 34px;
}

.confirm-card,
.confirm-card p,
.confirm-card dt,
.confirm-card dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.hub__head {
  max-width: 820px;
  margin-bottom: 26px;
}

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

.hub-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.kicker {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

.confirm-card > .kicker {
  margin-bottom: 14px;
  font-size: 1.05rem;
}

body[data-theme="production"] .kicker,
body[data-theme="estimate"] .kicker {
  color: var(--accent);
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.35;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.8rem, 4.5vw, 3.1rem);
}

.title-line,
.title-subline {
  display: block;
  white-space: nowrap;
}

.title-subline {
  font-size: clamp(0.86rem, 3vw, 2.15rem);
}

h2 {
  font-size: clamp(1.35rem, 3vw, 2rem);
}

h3 {
  font-size: 1.05rem;
}

p {
  margin: 0;
}

.lead {
  margin-top: 16px;
  color: var(--muted);
  font-size: 1.02rem;
}

.thanks-lead {
  max-width: 100%;
  min-width: 0;
  font-size: 0.94rem;
  overflow-wrap: anywhere;
}

.thanks-lead__line {
  display: block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.thanks-lead__line + .thanks-lead__line {
  margin-top: 4px;
}

.thanks-lead a {
  color: var(--primary-strong);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.step-list,
.note-list {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.step-list li,
.note-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--muted);
}

.step-list span,
.note-list span {
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: #5c3e13;
  font-size: 0.82rem;
  font-weight: 800;
}

.form-section {
  display: grid;
  gap: 18px;
}

.form-section + .form-section {
  margin-top: 26px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

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

label,
.field-group {
  display: grid;
  gap: 8px;
}

.field-group--plain {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field-label {
  font-weight: 800;
}

.field-label--with-help {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.help-tip {
  position: relative;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--primary-strong);
  cursor: help;
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1;
}

.help-tip::after {
  content: attr(data-tooltip);
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: max-content;
  max-width: min(300px, calc(100vw - 48px));
  padding: 9px 11px;
  border-radius: 7px;
  background: var(--primary-strong);
  color: #fff;
  box-shadow: 0 12px 28px rgba(23, 33, 47, 0.18);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.55;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.help-tip:hover::after,
.help-tip:focus::after,
.help-tip:focus-visible::after {
  display: block;
  opacity: 1;
  transform: translate(-50%, 0);
}

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

.required {
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
  margin-left: 4px;
}

body[data-theme="production"] .required,
body[data-theme="estimate"] .required {
  color: var(--accent);
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 116px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid color-mix(in srgb, var(--primary) 22%, transparent);
  border-color: var(--primary);
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.option-grid--three {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.option {
  min-height: 46px;
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.74);
}

.option input {
  width: 18px;
  min-height: 18px;
  flex: 0 0 auto;
}

.notice-panel {
  margin-top: 22px;
  padding: 18px;
  background: color-mix(in srgb, var(--accent-soft) 64%, #fff 36%);
  box-shadow: none;
}

.notice-panel strong {
  display: block;
  margin-bottom: 6px;
}

.turnstile-field {
  margin-top: 20px;
  min-height: 72px;
  display: flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
}

.turnstile-field .cf-turnstile {
  flex: 0 1 auto;
  max-width: 100%;
}

.form-status,
.form-note {
  margin-block: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  font-weight: 500;
}

.form-status {
  margin-top: 12px;
  min-height: 1.45rem;
}

.form-note {
  margin-top: 0.18rem;
}

.form-status[data-state="error"] {
  color: #a73535;
}

.form-status[data-state="pending"] {
  color: var(--primary-strong);
}

.actions {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.form-footnote {
  color: var(--muted);
  font-size: 0.9rem;
}

.close-fallback {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.confirm-summary {
  margin-top: 22px;
  display: grid;
  gap: 10px;
}

.summary-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.32fr) minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.summary-row dt {
  min-width: 0;
  color: var(--muted);
  font-weight: 800;
}

.summary-row dd {
  min-width: 0;
  margin: 0;
  white-space: pre-wrap;
}

.thanks-mark {
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #63420f;
  font-weight: 900;
  font-size: 1.5rem;
  margin-bottom: 18px;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer__inner {
  padding: 22px 0 32px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.site-footer--compact .site-footer__inner {
  padding-top: 14px;
}

.analytics-note {
  max-width: 760px;
  font-size: 0.82rem;
  line-height: 1.6;
}

.analytics-note a {
  color: var(--primary-strong);
  font-weight: 800;
}

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

@media (max-width: 640px) {
  .site-header__inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 0;
  }

  .header-links {
    justify-content: flex-start;
  }

  .form-shell,
  .form-shell--single,
  .hub {
    width: min(var(--content), calc(100% - 24px));
    padding: 28px 0 48px;
  }

  .form-card,
  .confirm-card,
  .hub-card {
    padding: 20px;
  }

  .form-brand {
    gap: 8px;
  }

  .form-brand img {
    width: 44px;
    height: 44px;
  }

  .form-brand .kicker {
    font-size: 0.72rem;
    line-height: 1.25;
    white-space: nowrap;
    transform: translateY(2px);
  }

  .field-grid,
  .option-grid,
  .option-grid--three {
    grid-template-columns: 1fr;
  }

  .summary-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .thanks-lead__line {
    white-space: normal;
  }

  .button,
  .header-links a {
    width: 100%;
  }
}

@media (max-width: 360px) {
  .form-brand {
    gap: 6px;
  }

  .form-brand img {
    width: 38px;
    height: 38px;
  }

  .form-brand .kicker {
    font-size: 0.65rem;
  }
}
