:root {
  --bg: #fff8f2;
  --surface: #ffffff;
  --surface-soft: #fff3e6;
  --text: #3a2719;
  --muted: #8b6f5a;
  --line: #eed8c6;
  --primary: #ef8c34;
  --primary-dark: #d96f12;
  --primary-soft: rgba(239, 140, 52, 0.12);
  --accent: #ffb063;
  --success: #197b52;
  --error: #b9492e;
  --error-bg: #fff0eb;
  --error-line: #efb6b0;
  --shadow: 0 18px 48px rgba(128, 71, 23, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 176, 99, 0.18), transparent 24%),
    linear-gradient(180deg, #fffaf6 0%, var(--bg) 100%);
}
a { color: var(--primary-dark); }
.page { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 40px 0 64px; }
.hero {
  padding: 28px 30px 22px;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,244,230,0.98));
  border: 1px solid rgba(239, 140, 52, 0.14);
  box-shadow: var(--shadow);
}
.hero-brand { width: 220px; margin-bottom: 12px; }
.hero-logo { width: 100%; height: auto; }
.option-item-card { min-width: 0; }
.catalog-card { min-width: 0; }
.catalog-card h5 { word-break: break-word; }
.eyebrow { margin: 20px 0 10px; color: var(--primary-dark); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .82rem; }
.hero h1 { margin: 0; font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.18; }
.lead { margin: 12px 0 0; max-width: 760px; color: var(--muted); line-height: 1.8; }
.shell { margin-top: 24px; }
.content-area { min-width: 0; }
.wide-only { max-width: 980px; margin: 0 auto; }
.stepper {
  margin: 0 0 18px; padding: 10px; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
  background: rgba(255,255,255,0.7); border: 1px solid var(--line); border-radius: 22px;
}
.step {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; color: var(--muted); background: transparent;
}
.step span {
  width: 32px; height: 32px; border-radius: 999px; display: inline-grid; place-items: center; font-size: .92rem; font-weight: 700;
  border: 1px solid currentColor;
}
.step strong { font-size: .96rem; }
.step.is-active { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); box-shadow: 0 10px 24px rgba(217, 111, 18, 0.22); }
.step.is-done { color: var(--primary-dark); background: rgba(239, 140, 52, 0.1); }
.form-card {
  background: rgba(255,255,255,0.96); border: 1px solid rgba(239, 140, 52, 0.14); border-radius: var(--radius-xl); box-shadow: var(--shadow); padding: 28px;
}
.form-step { display: none; }
.form-step.is-active { display: block; }
.section-head { margin-bottom: 20px; }
.section-kicker { margin: 0 0 6px; color: var(--primary-dark); font-size: .78rem; font-weight: 800; letter-spacing: .08em; }
.section-head h2 { margin: 0; font-size: 1.7rem; }
.section-head p { margin: 8px 0 0; color: var(--muted); line-height: 1.8; }
.grid { display: grid; gap: 18px; }
.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-full { grid-column: 1 / -1; }
.field, .choice-group, .option-block, .dynamic-section, .subsection-card {
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 4px 10px rgba(123, 76, 39, 0.03);
}
.field { padding: 16px 18px; display: grid; gap: 10px; align-content: start; }
.field span, .choice-group legend, .option-block legend { font-weight: 700; }
.field em, .choice-group em { font-style: normal; color: var(--primary-dark); font-size: .84rem; margin-left: 4px; }
.field input, .field textarea {
  width: 100%; border: 1px solid #d7c1af; border-radius: 14px; padding: 13px 14px; font: inherit; color: var(--text); background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input::placeholder, .field textarea::placeholder { color: #a58a74; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.hint { margin: -2px 0 0; font-size: .88rem; color: var(--muted); }
.error, .group-error, .manual-error { color: var(--error); font-size: .88rem; margin: 0; }
.error { display: none; }
.manual-error { display: block; }
.choice-group, .option-block, .dynamic-section, .subsection-card { padding: 20px; margin-top: 20px; }
.choice-group legend, .option-block legend { padding: 0 8px; }
.nested-group { margin-top: 0; }
.choice-row { display: grid; gap: 12px; margin-top: 10px; }
.choice-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-card { position: relative; display: block; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card span {
  min-height: 68px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px 14px; border-radius: 16px;
  border: 1px solid #dcc6b4; background: linear-gradient(180deg, #fff, #fff8f1); font-weight: 700; transition: all .18s ease; cursor: pointer;
}
.choice-card input:checked + span { border-color: var(--primary); background: linear-gradient(180deg, #fff4e8, #ffe7cf); box-shadow: 0 0 0 4px var(--primary-soft); color: var(--primary-dark); }
.choice-card input:disabled + span, .is-disabled { opacity: .48; pointer-events: none; }
.checkbox-card span { justify-content: flex-start; text-align: left; padding-left: 18px; }
.block-head, .subsection-head { margin-bottom: 16px; }
.block-head h3, .subsection-head h4 { margin: 0; font-size: 1.15rem; }
.block-head p, .subsection-head p { margin: 8px 0 0; color: var(--muted); line-height: 1.7; }
.option-stack { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.option-item-card {
  border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: linear-gradient(180deg, #fff, #fffaf6);
}
.option-item-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 12px; }
.option-item-head h5 { margin: 0; font-size: 1rem; }
.option-item-head p { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
.option-item-body { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: flex; justify-content: center; align-items: center; min-height: 46px; border-radius: 12px; border: 1px solid #dcc6b4; background: #fff; font-weight: 700;
}
.segmented input:checked + span { border-color: var(--primary); background: #fff2e3; color: var(--primary-dark); }
.catalog-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.catalog-card {
  border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: linear-gradient(180deg, #fff, #fffaf7); display: grid; gap: 12px;
}
.catalog-card h5 { margin: 0; font-size: 1rem; }
.catalog-card p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.6; }
.checkbox-line {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: #fffdfb;
}
.checkbox-line input { margin-top: 3px; }
.consent-checks { display: grid; gap: 12px; margin-top: 14px; }
.privacy-box { border: 1px solid var(--line); border-radius: 18px; background: #fffaf5; padding: 18px; margin-bottom: 16px; }
.privacy-box h3 { margin: 0 0 10px; font-size: 1rem; }
.privacy-scroll { max-height: 220px; overflow: auto; padding-right: 8px; color: var(--muted); line-height: 1.8; }
.actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.actions.between { justify-content: space-between; }
.btn {
  appearance: none; border: 0; border-radius: 999px; padding: 14px 24px; font: inherit; font-weight: 700; cursor: pointer; transition: transform .15s ease, box-shadow .18s ease, opacity .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); box-shadow: 0 12px 28px rgba(217, 111, 18, 0.22); }
.btn-secondary { color: var(--text); background: #fff; border: 1px solid #d9c2af; }
.btn-wide { min-width: 230px; }
.confirm-panel { display: grid; gap: 18px; }
.confirm-group {
  border: 1px solid var(--line); border-radius: 20px; padding: 18px; background: linear-gradient(180deg, #fff, #fffaf5);
}
.confirm-group h3 { margin: 0 0 14px; font-size: 1.08rem; }
.confirm-list { display: grid; grid-template-columns: 220px 1fr; gap: 10px 18px; margin: 0; }
.confirm-list dt { color: var(--muted); }
.confirm-list dd { margin: 0; font-weight: 500; white-space: pre-wrap; word-break: break-word; }
.is-invalid { border-color: var(--error-line) !important; background: var(--error-bg) !important; box-shadow: none !important; }
.is-error .choice-card span, .choice-group.is-error .choice-card span { border-color: var(--error-line); background: var(--error-bg); }
@media (max-width: 1200px) {
  .catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .option-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .grid-2, .choice-row-2, .choice-row-3, .option-item-body, .confirm-list { grid-template-columns: 1fr; }
  .catalog-grid, .option-stack { grid-template-columns: 1fr; }
  .stack-mobile { grid-template-columns: 1fr; }
  .actions.between { flex-direction: column-reverse; }
  .actions .btn { width: 100%; }
}
@media (max-width: 640px) {
  .page { width: min(100% - 20px, 100%); padding-top: 20px; }
  .hero, .form-card { padding: 20px; border-radius: 24px; }
  .stepper { grid-template-columns: 1fr; }
  .step { padding: 12px 14px; }
}


/* v5 adjustments */
.checkbox-card span {
  position: relative;
  justify-content: flex-start;
  text-align: left;
  padding: 18px 18px 18px 58px;
}
.checkbox-card span::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 50%;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid #d8b89f;
  background: #fff;
  transform: translateY(-50%);
  transition: all .18s ease;
}
.checkbox-card span::after {
  content: '✓';
  position: absolute;
  left: 25px;
  top: 50%;
  transform: translateY(-56%);
  font-size: .9rem;
  font-weight: 800;
  color: transparent;
  transition: color .18s ease;
}
.checkbox-card input:checked + span::before {
  border-color: var(--primary);
  background: #fff0e1;
}
.checkbox-card input:checked + span::after {
  color: var(--primary-dark);
}
.group-error {
  margin-top: 12px;
}


/* v9 adjustments */
.checkbox-line.is-error {
  border-color: var(--error-line);
  background: var(--error-bg);
}
.checkbox-line.is-error span {
  color: var(--error);
  font-weight: 700;
}
