/* =========================================================
   TakaNoriショップ 買取フォーム
   Figma「宅配買取」ワイヤーフレームをもとにしたスタイル
   ========================================================= */

:root {
  --color-bg: #ffffff;
  --color-text: #000000;
  --color-muted: #666666;
  --color-line: #000000;
  --color-line-soft: #cccccc;
  --color-card: #fafafa;
  --color-drop: #d9d9d9;
  --color-drop-hover: #cfcfcf;
  --color-error: #c62828;
  --color-error-bg: #fdecea;
  --color-focus: #1a73e8;
  --color-ok: #2e7d32;

  --font-sans: "Inter", "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;

  --fs-title: clamp(22px, 4vw, 32px);
  --fs-label: clamp(16px, 2.2vw, 20px);
  --fs-body: 16px;
  --fs-small: 13px;

  --page-max: 960px;
  --gutter: 16px;
  --radius: 2px;
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

img, svg { display: block; max-width: 100%; }

[hidden] { display: none !important; }

button, input, select, textarea { font: inherit; color: inherit; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Page ---------- */
.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 40px var(--gutter) 80px;
}

.page-header { margin-bottom: 32px; }

.title {
  display: inline-block;
  margin: 0 0 24px;
  padding-bottom: 12px;
  font-size: var(--fs-title);
  font-weight: 400;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--color-line);
}

/* steps */
.steps {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-small);
  color: var(--color-muted);
}
.steps__item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--color-line-soft);
  border-radius: 999px;
}
.steps__num {
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #eee;
  font-weight: 600;
}
.steps__item.is-active {
  color: var(--color-text);
  border-color: var(--color-line);
}
.steps__item.is-active .steps__num { background: var(--color-text); color: #fff; }
.steps__item.is-done .steps__num { background: var(--color-ok); color: #fff; }

/* ---------- Screens ---------- */
.screen[hidden] { display: none; }
.screen__title {
  margin: 0 0 12px;
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 500;
}
.screen__title:focus,
.form__lead:focus { outline: none; }

.form__lead {
  margin: 0 0 32px;
  color: #333;
}
.required-note { display: inline-block; margin-top: 4px; font-size: var(--fs-small); color: var(--color-muted); }

.req {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  font-size: 11px;
  line-height: 1.5;
  font-weight: 500;
  color: #fff;
  background: var(--color-error);
  border-radius: var(--radius);
  vertical-align: middle;
}

/* ---------- Sections ---------- */
.section { margin: 0 0 40px; }
.section__note {
  margin: 0 0 24px;
  font-size: var(--fs-label);
  font-weight: 400;
}
.section__title {
  margin: 0 0 16px;
  font-size: var(--fs-label);
  font-weight: 400;
}

/* field: ラベル左 / 入力右 (Figma の下線入力を再現) */
.field {
  display: grid;
  grid-template-columns: minmax(120px, 200px) 1fr;
  gap: 8px 24px;
  align-items: start;
  margin-bottom: 22px;
}
.field__label {
  padding-top: 8px;
  font-size: var(--fs-label);
  text-align: right;
}
.field__control { min-width: 0; }
.field__hint {
  margin: 6px 0 0;
  font-size: var(--fs-small);
  color: var(--color-muted);
}
.field__error {
  margin: 6px 0 0;
  font-size: var(--fs-small);
  color: var(--color-error);
  min-height: 0;
}
.field__error:empty { display: none; }
.field__error--center { text-align: center; }

/* inputs */
.input {
  width: 100%;
  max-width: 420px;
  padding: 8px 4px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-line);
  border-radius: 0;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #aaa; }
.input:focus { border-bottom-color: var(--color-focus); box-shadow: 0 1px 0 0 var(--color-focus); }
.input.is-invalid { border-color: var(--color-error); background: var(--color-error-bg); }

.input--box {
  max-width: 432px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--color-line);
}
.input--box:focus { border-color: var(--color-focus); box-shadow: 0 0 0 2px rgba(26,115,232,.2); }

.input--year { max-width: 96px; text-align: center; }
.input--mm   { max-width: 56px;  text-align: center; }
.input--zip  { max-width: 160px; }
.input--pref { max-width: 200px; }

select.input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23000' stroke-width='1.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

.birth { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.birth__unit { font-size: var(--fs-label); }

.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }

/* ---------- Card (買取に出す商品 / 身分証) ---------- */
.card {
  margin: 0 0 40px;
  padding: 28px clamp(16px, 4vw, 40px) 36px;
  background: var(--color-card);
  border-radius: var(--radius);
}
.card__title {
  margin: 0 0 8px;
  font-size: var(--fs-label);
  font-weight: 400;
}
.card__hint {
  margin: 0 0 24px;
  font-size: var(--fs-small);
  color: var(--color-muted);
}
.card__inner {
  max-width: 560px;
  margin: 0 auto;
}

/* stack: ラベル上 / 入力下 */
.stack { margin-bottom: 22px; }
.stack:last-child { margin-bottom: 0; }
.stack__label {
  display: block;
  margin-bottom: 8px;
  font-size: var(--fs-label);
}
.stack__sub { margin-left: 6px; font-size: var(--fs-small); color: var(--color-muted); }
.stack__hint {
  margin: -4px 0 10px;
  font-size: var(--fs-small);
  color: var(--color-muted);
}
.stack--row { display: flex; flex-wrap: wrap; gap: 16px 20px; }
.stack--row .stack { margin-bottom: 0; }
.stack--qty { flex: 0 0 120px; }
.stack--qty .input { max-width: 120px; }
.stack--grow { flex: 1 1 240px; }

/* ---------- Item ---------- */
.item-list { max-width: 560px; margin: 0 auto; }
.item {
  position: relative;
  margin: 0 0 24px;
  padding: 20px 20px 24px;
  border: 1px solid var(--color-line-soft);
  background: #fff;
  border-radius: var(--radius);
  min-inline-size: 0;
}
.item__legend {
  padding: 0 6px;
  font-size: var(--fs-small);
  color: var(--color-muted);
}
.item__remove {
  position: absolute;
  top: 10px; right: 12px;
  padding: 4px 10px;
  font-size: var(--fs-small);
  background: transparent;
  border: 1px solid var(--color-line-soft);
  border-radius: var(--radius);
  cursor: pointer;
}
.item__remove:hover { border-color: var(--color-error); color: var(--color-error); }
.item-list .item:only-child .item__remove { display: none; }

/* add button (Figma: 楕円 + プラス + 「追加」) */
.add-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 8px auto 0;
  padding: 6px 16px;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.add-btn__circle {
  display: grid;
  place-items: center;
  width: 110px; height: 88px;
  border: 1px solid var(--color-line);
  border-radius: 50%;
  background: #fff;
  transition: background .15s, transform .15s;
}
.add-btn:hover .add-btn__circle,
.add-btn:focus-visible .add-btn__circle { background: #f0f0f0; transform: translateY(-1px); }
.add-btn__label { font-size: var(--fs-small); }

/* ---------- Dropzone ---------- */
.dropzone {
  position: relative;
  min-height: 221px;
  padding: 20px;
  background: var(--color-drop);
  border: 2px dashed transparent;
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.dropzone:hover,
.dropzone:focus-within { background: var(--color-drop-hover); }
.dropzone.is-dragover { border-color: var(--color-text); background: var(--color-drop-hover); }
.dropzone.is-invalid { border-color: var(--color-error); }
.dropzone__input {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}
.dropzone__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 181px;
  pointer-events: none;
}
.dropzone__icon { width: 79px; height: 83px; }
.dropzone__text { margin: 0; font-size: var(--fs-body); }
.dropzone.has-files .dropzone__placeholder { display: none; }

.dropzone__previews {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}
.dropzone__previews:empty { display: none; }
.preview {
  position: relative;
  width: 120px;
  pointer-events: auto;
}
.preview__img {
  width: 120px; height: 120px;
  object-fit: cover;
  background: #fff;
  border: 1px solid var(--color-line-soft);
}
.preview__name {
  margin: 4px 0 0;
  font-size: 11px;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview__remove {
  position: absolute;
  top: -8px; right: -8px;
  width: 24px; height: 24px;
  padding: 0;
  line-height: 22px;
  font-size: 14px;
  color: #fff;
  background: var(--color-text);
  border: 1px solid #fff;
  border-radius: 50%;
  cursor: pointer;
}
.preview__remove:hover { background: var(--color-error); }
.dropzone__more {
  width: 100%;
  margin: 6px 0 0;
  font-size: var(--fs-small);
  color: #333;
}

/* ---------- Pledge ---------- */
.section--pledge { margin-top: 48px; }
.pledge {
  max-width: 634px;
  height: 420px;
  margin: 0 auto 24px;
  padding: 20px 24px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--color-line);
  font-size: 14px;
  line-height: 1.8;
}
.pledge:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.pledge h3 { margin: 0 0 12px; font-size: 16px; font-weight: 600; text-align: center; }
.pledge h4 { margin: 20px 0 6px; font-size: 14px; font-weight: 600; }
.pledge p  { margin: 0 0 8px; }
.pledge ul { margin: 0; padding-left: 1.4em; }
.pledge li { margin-bottom: 4px; }
.pledge__sign { margin-top: 20px !important; font-weight: 500; }
.pledge__meta { margin-top: 16px !important; font-size: 12px; color: var(--color-muted); text-align: right; }

.agree {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  width: fit-content;
  margin: 0 auto;
  cursor: pointer;
  user-select: none;
}
.agree__check { position: absolute; opacity: 0; width: 1px; height: 1px; }
.agree__box {
  width: 34px; height: 32px;
  border: 1px solid var(--color-line);
  background: #fff;
  display: grid;
  place-items: center;
  transition: background .15s;
}
.agree__box::after {
  content: "";
  width: 10px; height: 18px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg) translate(-1px, -2px);
  opacity: 0;
}
.agree__check:checked + .agree__box { background: var(--color-text); }
.agree__check:checked + .agree__box::after { opacity: 1; }
.agree__check:focus-visible + .agree__box { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.agree__label { font-size: var(--fs-label); }

/* ---------- Alerts / Actions ---------- */
.form__alert {
  max-width: 634px;
  margin: 24px auto;
  padding: 12px 16px;
  color: var(--color-error);
  background: var(--color-error-bg);
  border: 1px solid var(--color-error);
  border-radius: var(--radius);
  font-size: 14px;
}
.form__alert[hidden] { display: none; }

.actions {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 40px;
}

.btn {
  min-width: 120px;
  padding: 14px 24px;
  font-size: 16px;
  line-height: 1.4;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s, color .15s, opacity .15s;
}
.btn:hover { background: #f2f2f2; }
.btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { color: #fff; background: var(--color-text); }
.btn--primary:hover { background: #333; }
.btn--ghost { background: #fff; }
.btn--small {
  min-width: 0;
  padding: 7px 14px;
  font-size: var(--fs-small);
}

/* ---------- Confirm ---------- */
.confirm {
  margin: 0 0 24px;
  border-top: 1px solid var(--color-line-soft);
}
.confirm__row {
  display: grid;
  grid-template-columns: minmax(120px, 200px) 1fr;
  gap: 8px 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-line-soft);
}
.confirm__row dt { margin: 0; color: var(--color-muted); font-size: 14px; }
.confirm__row dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.confirm__group {
  margin: 24px 0 8px;
  padding: 6px 12px;
  background: var(--color-card);
  font-size: var(--fs-small);
  color: var(--color-muted);
}
.confirm__thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.confirm__thumbs img {
  width: 96px; height: 96px;
  object-fit: cover;
  border: 1px solid var(--color-line-soft);
  background: #fff;
}
.confirm__empty { color: var(--color-muted); }

/* ---------- Done ---------- */
.screen--done { text-align: center; padding-top: 24px; }
.done__text { margin: 0 0 16px; }
.done__id {
  display: inline-block;
  margin: 8px 0;
  padding: 10px 20px;
  font-weight: 600;
  letter-spacing: .05em;
  border: 1px solid var(--color-line);
}
.done__note { font-size: var(--fs-small); color: var(--color-muted); }

/* ---------- Footer ---------- */
.page-footer {
  margin-top: 64px;
  padding-top: 16px;
  border-top: 1px solid var(--color-line-soft);
  font-size: 12px;
  color: var(--color-muted);
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .page { padding-top: 24px; }
  .field { grid-template-columns: 1fr; gap: 6px; }
  .field__label { padding-top: 0; text-align: left; }
  .input { max-width: none; }
  .input--year { max-width: 96px; }
  .input--mm   { max-width: 56px; }
  .input--zip  { max-width: 160px; }
  .input--pref { max-width: 220px; }
  .card { padding-left: 16px; padding-right: 16px; }
  .item { padding: 16px 14px 20px; }
  .pledge { height: 340px; padding: 16px; }
  .actions { flex-direction: column-reverse; align-items: stretch; gap: 12px; }
  .btn { width: 100%; }
  .confirm__row { grid-template-columns: 1fr; gap: 2px; }
  .dropzone { min-height: 180px; }
  .dropzone__placeholder { min-height: 140px; gap: 16px; }
  .dropzone__icon { width: 60px; height: 63px; }
  .dropzone__text { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- 振込先 ---------- */
.stack--type { flex: 0 0 140px; }
.stack--type .input { max-width: 140px; }
.stack--row .field__error { margin-top: 6px; }

/* ---------- 選択（査定後の承認方法） ---------- */
.choice {
  display: grid;
  gap: 12px;
  max-width: 634px;
  margin: 0 auto;
}
.choice__item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--color-line);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.choice__item:hover { background: var(--color-card); }
.choice__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice__box {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  margin-top: 2px;
  border: 1px solid var(--color-line);
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
}
.choice__box::after {
  content: "";
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--color-text);
  opacity: 0;
}
.choice__input:checked + .choice__box::after { opacity: 1; }
.choice__input:checked ~ .choice__body .choice__title { font-weight: 700; }
.choice__input:focus-visible + .choice__box { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.choice__body { display: block; }
.choice__title { display: block; font-size: var(--fs-label); line-height: 1.4; }
.choice__desc { display: block; margin-top: 6px; font-size: var(--fs-small); color: var(--color-muted); }

/* ---------- 承諾・辞退ページ ---------- */
.approve { max-width: 634px; margin: 0 auto; }
.approve__lead { margin: 0 0 20px; }
.approve__table { width: 100%; border-collapse: collapse; margin: 0 0 8px; }
.approve__table th, .approve__table td { padding: 10px 8px; border-bottom: 1px solid var(--color-line-soft); text-align: left; vertical-align: top; }
.approve__table th { font-weight: 500; color: var(--color-muted); font-size: var(--fs-small); }
.approve__table td.num, .approve__table th.num { text-align: right; white-space: nowrap; }
.approve__total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 8px; font-size: var(--fs-label); border-bottom: 2px solid var(--color-line); }
.approve__total strong { font-size: 1.3em; }
.approve__comment { margin: 16px 0; padding: 12px 16px; background: var(--color-card); font-size: 14px; white-space: pre-wrap; }
.approve__status { margin: 24px 0; padding: 16px; border: 1px solid var(--color-line); text-align: center; }
.approve__status--ok { border-color: var(--color-ok); color: var(--color-ok); }
.approve__status--err { border-color: var(--color-error); color: var(--color-error); background: var(--color-error-bg); }
.approve__actions { margin-top: 32px; }
.approve__actions .btn--decline { color: var(--color-error); border-color: var(--color-error); }
.approve__confirm { margin-top: 16px; padding: 16px; border: 1px solid var(--color-line); background: var(--color-card); }
.approve__confirm p { margin: 0 0 12px; }
