/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Noto Sans JP', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  background: #fafafa;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

button {
  cursor: pointer;
  font: inherit;
  border: none;
  background: none;
}

input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===== Variables ===== */
:root {
  --primary: #ff1250;
  --primary-light: #ffebf0;
  --blue: #005dbd;
  --blue-bg: #f2f7fc;
  --border: #e4e4e4;
  --muted: #888;
  --bg: #fafafa;
  --card: #fff;
  --text: #333;
  --radius: 12px;
}

/* ===== Layout ===== */
.page-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  padding-bottom: 180px;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 16px;
}

.header-back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.header-back:hover {
  color: var(--text);
}

.header-back svg {
  width: 16px;
  height: 16px;
}

.header-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.header-logo-img {
  height: 28px;
  width: auto;
  display: block;
}

.header-logo-sub {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.2;
  text-align: center;
}

.header-phone {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

.header-phone:hover {
  background: #f5f5f5;
}

.header-phone svg {
  width: 14px;
  height: 14px;
  color: var(--primary);
}

/* ===== Stepper ===== */
.stepper {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.stepper-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

.stepper-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stepper-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  transition: color .2s;
}

.stepper-label.active,
.stepper-label.complete {
  color: var(--primary);
}

.stepper-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: all .2s;
  background: var(--border);
  color: var(--muted);
}

.stepper-circle.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 18, 80, .3);
}

.stepper-circle.complete {
  background: #888;
  color: #fff;
}

.stepper-line {
  width: 60px;
  height: 2px;
  margin: 0 8px;
  margin-top: 16px;
  background: var(--border);
  transition: background .2s;
}

.stepper-line.complete {
  background: rgba(136, 136, 136, .4);
}

/* ===== Content ===== */
.content {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ===== Page Title ===== */
.page-title {
  text-align: center;
  margin-bottom: 24px;
}

.page-title .step-label {
  font-size: 11px;
  color: var(--primary);
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.page-title h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
}

.page-title p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

/* ===== Section Card ===== */
.section-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.section-header svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.section-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

/* ===== Required Badge ===== */
.required-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary);
}

/* ===== Sub Section ===== */
.sub-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  margin-bottom: 12px;
}

.sub-label:first-child {
  margin-top: 0;
}

.sub-label span {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

/* ===== Grid Buttons (2x2, 3x, etc) ===== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.grid-btn {
  border-radius: var(--radius);
  border: 2px solid var(--border);
  padding: 16px 8px;
  text-align: center;
  transition: all .15s;
  background: var(--card);
}

.grid-btn:hover {
  border-color: #ccc;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

.grid-btn.selected {
  border-color: var(--blue);
  background: var(--blue-bg);
}

.grid-btn .big {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.grid-btn.selected .big {
  color: var(--blue);
}

.grid-btn .label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}

.grid-btn.selected .label {
  color: var(--blue);
}

.grid-btn .sub {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

/* Model card */
.model-btn {
  border-radius: var(--radius);
  border: 2px solid var(--border);
  padding: 12px;
  text-align: center;
  transition: all .15s;
  background: var(--card);
}

.model-btn:hover {
  border-color: #ccc;
}

.model-btn.selected {
  border-color: var(--blue);
  background: var(--blue-bg);
}

.model-btn .img-wrap {
  aspect-ratio: 4/3;
  border-radius: 8px;
  background: #f0f0f0;
  overflow: hidden;
  margin-bottom: 8px;
}

.model-btn .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f8f8f8;
  transition: opacity .3s;
  opacity: 0;
}

.model-btn .img-wrap img.loaded {
  opacity: 1;
}

/* Shimmer Loading Effect */
.img-wrap.loading {
  position: relative;
  overflow: hidden;
  background: #f0f0f0;
}

.img-wrap.loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.model-btn .name {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.model-btn.selected .name {
  color: var(--blue);
}

.model-btn .price {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ===== Radio ===== */
.radio-list {
  border-top: 1px solid var(--border);
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  width: 100%;
  text-align: left;
}

.radio-item:last-child {
  border-bottom: none;
}

.radio-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #cabbbb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color .15s;
}

.radio-dot.checked {
  border-color: var(--blue);
}

.radio-dot .inner {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
  display: none;
}

.radio-dot.checked .inner {
  display: block;
}

.radio-item .text {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  min-width: 0;
}

.radio-item .text.bold {
  font-weight: 500;
}

.radio-item .note {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  text-align: right;
}

/* ===== Checkbox ===== */
.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.check-item:last-child {
  border-bottom: none;
}

.check-box {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: 2px solid #cabbbb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}

.check-box.checked {
  background: var(--blue);
  border-color: var(--blue);
}

.check-box svg {
  display: none;
}

.check-box.checked svg {
  display: block;
}

.check-item .text {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  min-width: 0;
}

.check-item .note {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  text-align: right;
}

/* ===== Mic row ===== */
.mic-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.mic-row:last-child {
  border-bottom: none;
}

.mic-info {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--text);
}

.mic-price-label {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  text-align: right;
}

.mic-select {
  width: 76px;
  flex-shrink: 0;
  margin-left: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 28px 8px 12px;
  font-size: 13px;
  background: var(--card) url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23888'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E") no-repeat right 8px center / 18px;
  appearance: none;
  color: var(--text);
}

/* ===== Insurance days input ===== */
.ins-days-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ins-days-input {
  width: 56px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  font-size: 13px;
  text-align: center;
  background: var(--card);
  color: var(--text);
}

.ins-days-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(0, 93, 189, .15);
}

/* ===== Hint text ===== */
.hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 12px;
}

.hint-primary {
  font-size: 11px;
  color: var(--primary);
  margin-top: 4px;
}

/* ===== Text Input ===== */
.text-input {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--card);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  transition: border-color .15s;
}

.text-input::placeholder {
  color: #ccc;
}

.text-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(0, 93, 189, .12);
}

/* ===== Date Input ===== */
.date-input {
  display: block;
  width: 100%;
  width: -moz-available;
  width: -webkit-fill-available;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--card);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  transition: border-color .15s;
}

.date-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(0, 93, 189, .12);
}

/* ===== Field Error ===== */
.field-error {
  font-size: 12px;
  color: var(--primary);
  margin-top: 4px;
  display: none;
}

.field-error.show {
  display: block;
}

/* ===== Postal Code ===== */
.postal-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.postal-input {
  width: 72px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--card);
  padding: 10px 8px;
  font-size: 13px;
  text-align: center;
  color: var(--text);
}

.postal-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(0, 93, 189, .12);
}

.postal-input-long {
  width: 88px;
}

.postal-dash {
  font-weight: 500;
  color: var(--text);
}

.btn-autofill {
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border: none;
}

.btn-autofill:hover {
  opacity: .9;
}

.postal-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--blue);
  margin-top: 6px;
}

.postal-link:hover {
  text-decoration: underline;
}

.postal-link svg {
  width: 12px;
  height: 12px;
}

/* ===== Phone ===== */
.phone-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.phone-input {
  flex: 1;
  min-width: 0;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--card);
  padding: 10px 8px;
  font-size: 13px;
  text-align: center;
  color: var(--text);
}

.phone-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(0, 93, 189, .12);
}

/* ===== Field Group ===== */
.field-group {
  margin-bottom: 20px;
}

.field-group:last-child {
  margin-bottom: 0;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}

/* ===== Category toggle (3 col) ===== */
.cat-btn {
  flex: 1;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  padding: 12px 0;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  transition: all .15s;
  color: var(--text);
  background: var(--card);
}

.cat-btn:hover {
  border-color: #ccc;
}

.cat-btn.selected {
  border-color: var(--blue);
  background: var(--blue-bg);
  color: var(--blue);
}

/* ===== Summary (collapsible) ===== */
.summary-card {
  background: var(--blue);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  color: #fff;
}

.summary-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  cursor: pointer;
  color: #fff;
}

.summary-toggle h4 {
  font-size: 15px;
  font-weight: 700;
}

.summary-toggle svg {
  width: 20px;
  height: 20px;
}

.summary-body {
  padding: 0 20px 20px;
}

.summary-total-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.summary-total-row .label {
  font-size: 13px;
  opacity: .7;
}

.summary-total-row .amount {
  font-size: 22px;
  font-weight: 700;
  margin-left: auto;
}

.summary-note {
  font-size: 10px;
  opacity: .5;
  margin-top: 4px;
  line-height: 1.6;
}

.summary-detail {
  border-top: 1px solid rgba(255, 255, 255, .1);
  margin-top: 16px;
  padding-top: 16px;
  display: none;
}

.summary-detail.open {
  display: block;
}

.summary-cat-label {
  font-size: 11px;
  font-weight: 500;
  opacity: .5;
  margin-bottom: 4px;
}

.summary-cat-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  font-size: 13px;
}

.summary-cat-group {
  margin-bottom: 12px;
}

/* ===== Step4 Confirmation ===== */
.confirm-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 24px;
}

.confirm-card-header {
  background: rgba(0, 93, 189, .05);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
}

.confirm-card-header h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
}

.confirm-card-body {
  padding: 20px;
}

.confirm-row {
  display: flex;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.confirm-row:last-child {
  border-bottom: none;
}

.confirm-row .rlabel {
  font-size: 12px;
  color: var(--muted);
  width: 120px;
  flex-shrink: 0;
  padding-top: 2px;
}

.confirm-row .rvalue {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  flex: 1;
  word-break: break-all;
}

.price-highlight {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 8px;
}

.price-highlight .plabel {
  font-size: 13px;
  color: var(--muted);
}

.price-highlight .pamount {
  font-size: 22px;
  font-weight: 700;
  color: var(--blue);
  margin-left: auto;
}

.price-highlight .pamount small {
  font-size: 14px;
  font-weight: 700;
}

.breakdown-section {
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 16px;
}

.breakdown-cat {
  margin-bottom: 12px;
}

.breakdown-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.breakdown-cat-header .bcat {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.breakdown-cat-header .bprice {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-left: 16px;
  margin-top: 4px;
}

.breakdown-item span {
  font-size: 12px;
  color: var(--muted);
}

.confirm-notes {
  font-size: 12px;
  color: #7a5c00;
  background: #fffbeb;
  border: 1px solid #f5d85a;
  border-left: 4px solid #f0bc00;
  border-radius: 6px;
  margin-top: 16px;
  padding: 12px 14px;
  line-height: 1.8;
  font-weight: 500;
}

/* ===== Completion ===== */
.completion {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 16px;
}

.completion-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.completion-icon svg {
  width: 40px;
  height: 40px;
  color: var(--primary);
}

.completion h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.completion .desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 360px;
  margin: 0 auto;
}

.completion-phone-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  max-width: 320px;
  margin: 24px auto;
}

.completion-phone-card .cpc-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.completion-phone-card a {
  font-size: 18px;
  font-weight: 700;
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.completion-phone-card .cpc-hours {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.completion-reset {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 16px;
}

.completion-reset:hover {
  color: var(--text);
}

/* ===== Footer Bar ===== */
.footer-spacer {
  height: 5;
}

.footer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, .08);
}

.footer-inner {
  max-width: 720px;
  margin: 0 auto;
}

.footer-price-section {
  background: var(--blue);
  color: #fff;
  padding: 14px 16px;
}

.footer-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.footer-price-row .fp-label {
  font-size: 13px;
  color: rgba(255, 255, 255, .8);
}

.footer-price-row .fp-amount {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-left: auto;
}

.footer-bottom {
  padding: 12px 16px;
}

.footer-notes {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 10px;
}

.footer-btns {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--card);
}

.btn-back:hover {
  background: #f5f5f5;
}

.btn-next {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--blue);
  border: none;
  box-shadow: 0 2px 8px rgba(0, 93, 189, .3);
  transition: all .15s;
}

.btn-next:hover {
  opacity: .92;
  box-shadow: 0 4px 12px rgba(0, 93, 189, .4);
}

.btn-next:active {
  transform: scale(.98);
}

.btn-next.disabled {
  background: var(--border);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-next svg,
.btn-back svg {
  width: 16px;
  height: 16px;
}

/* Footer copyright */
.copyright {
  text-align: center;
  padding: 8px 0 10px;
  font-size: 11px;
  color: var(--muted);
}

/* ===== Hidden ===== */
.hidden {
  display: none !important;
}

/* ===== Animation ===== */
.fade-in {
  animation: fadeIn .3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .model-btn {
    padding: 8px;
  }

  .stepper-line {
    width: 40px;
  }
}