:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  color: #172033;
  background: #f3f7fb;
  --blue: #1769c2;
  --blue-soft: #eaf4ff;
  --red: #c62828;
  --red-soft: #fff1f1;
  --green: #218739;
  --green-soft: #edf9ef;
  --border: #a9bdd2;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 320px; }
button, input, select { -webkit-tap-highlight-color: transparent; }

.page-shell {
  min-height: 100svh;
  padding: max(12px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}
.card { width: 100%; max-width: 640px; margin: 0 auto; background: #fff; border-radius: 16px; padding: 22px 16px 26px; box-shadow: 0 8px 28px rgba(24, 50, 82, .09); }
.header { text-align: center; margin-bottom: 24px; }
.logo { display: block; width: min(100%, 300px); height: auto; margin: 0 auto; }
h1 { margin: 14px 0 0; font-size: clamp(1.35rem, 6vw, 1.65rem); letter-spacing: .03em; }
.shop-name { margin: 7px 0 0; color: #5b6b7d; font-size: .92rem; }
.stack { display: grid; gap: calc(22px + 1pt); }
.lead { margin: 0; text-align: center; color: #526477; font-size: .92rem; line-height: 1.7; }
.lead.left { text-align: left; }
.status { padding: 30px 12px; text-align: center; color: #637083; }
.alert { margin-bottom: 18px; padding: 13px 14px; border: 1px solid #e58b8b; border-radius: 10px; background: var(--red-soft); color: #951c1c; white-space: pre-line; animation: reveal .25s ease-out; }

fieldset, .field, .control-wrap { min-width: 0; max-width: 100%; }
fieldset { margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 10px; }
.field-note { margin: -4px 0 10px; color: #637083; font-size: .78rem; line-height: 1.5; }
.two-columns { display: grid; gap: calc(14px + 1pt); }
.phone-columns { gap: 14px; }
.field > label, legend, .section-title { display: flex; align-items: center; gap: 7px; font-size: .94rem; font-weight: 750; }
.field > label, .section-title { margin-bottom: 7px; }
.required, .optional { display: inline-flex; align-items: center; min-height: 19px; border-radius: 4px; padding: 1px 6px; font-size: .68rem; font-weight: 750; line-height: 1.3; }
.required { background: #ffe7e7; color: #a91d1d; }
.optional { background: #edf1f5; color: #667484; }
.control-wrap { position: relative; }
input, select {
  display: block; width: 100%; max-width: 100%; min-width: 0; min-height: 52px; border: 2px solid var(--blue); border-radius: 10px;
  padding: 11px 43px 11px 13px; background: #fff; color: #172033;
  font: inherit; font-size: 16px; font-weight: 400;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease, transform .2s ease;
}
.birthdate-control { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 9px; width: 100%; max-width: 100%; min-width: 0; }
.calendar-button { display: grid; place-items: center; width: 52px; min-width: 52px; padding: 0; }
.calendar-button svg { width: 23px; height: 23px; fill: currentColor; }
.date-picker-proxy { position: absolute; left: 20px; bottom: 0; width: 1px; min-width: 1px; height: 1px; min-height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
select { appearance: none; padding-right: 72px; }
.select-wrap::before { content: ""; position: absolute; z-index: 1; right: 48px; top: 50%; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 7px solid #526477; transform: translateY(-35%); pointer-events: none; }
input::placeholder { color: #8b98a6; opacity: 1; }
input:focus, select:focus { outline: 0; border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 4px rgba(23, 105, 194, .16); }
.valid-check { position: absolute; right: 13px; top: 50%; display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: var(--green); color: #fff; font-size: .85rem; font-weight: 800; opacity: 0; transform: translateY(-50%) scale(.45) rotate(-20deg); pointer-events: none; transition: opacity .2s ease, transform .24s cubic-bezier(.2,.8,.2,1.35); }
.field.is-valid input, .field.is-valid select { border-color: var(--green); background: var(--green-soft); }
.field.is-valid input:focus, .field.is-valid select:focus { box-shadow: 0 0 0 4px rgba(33, 135, 57, .17); }
.field.is-valid .valid-check { opacity: 1; transform: translateY(-50%) scale(1) rotate(0); }
.field.is-invalid input, .field.is-invalid select { border-color: var(--red); background: var(--red-soft); animation: field-shake .28s ease-out; }
.field.is-invalid input:focus, .field.is-invalid select:focus { box-shadow: 0 0 0 4px rgba(198, 40, 40, .16); }
.field-message { min-height: 0; margin: 5px 2px 0; color: var(--red); font-size: .76rem; line-height: 1.45; }
.field-message:empty { display: none; }
.code-input { text-align: center; font-size: 1.65rem; letter-spacing: .28em; padding-left: calc(13px + .28em); }

.postal-status { margin-top: 7px; color: #526477; font-size: .78rem; }
.address-candidates { display: grid; gap: 7px; margin-top: 9px; animation: reveal .25s ease-out; }
.candidate-label { margin: 0; color: #33485d; font-size: .8rem; font-weight: 700; }
.address-candidate { min-height: 44px; border: 1px solid #8db4dc; border-radius: 9px; padding: 9px 11px; background: #f4f9ff; color: #174f84; text-align: left; font-size: .84rem; font-weight: 650; }

button { min-height: 52px; border: 0; border-radius: 10px; padding: 12px 18px; background: var(--blue); color: #fff; font: inherit; font-weight: 750; cursor: pointer; box-shadow: 0 4px 11px rgba(23, 105, 194, .22); transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease; }
button:active:not(:disabled) { transform: scale(.985); box-shadow: 0 2px 5px rgba(23, 105, 194, .18); }
button:disabled { background: #aab4c0; cursor: not-allowed; box-shadow: none; }
.consent { padding: 15px; border: 2px solid var(--blue); border-radius: 10px; background: #f8fbfe; transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease; }
.consent p { margin: 0 0 12px; font-size: .84rem; line-height: 1.65; }
.checkbox { display: flex !important; align-items: center !important; gap: 9px !important; margin: 0 !important; font-weight: 550 !important; }
.checkbox input { flex: 0 0 23px; width: 23px; min-height: 23px; padding: 0; accent-color: var(--green); }
.consent-field.is-invalid .consent { border-color: var(--red); background: var(--red-soft); animation: field-shake .28s ease-out; }
.consent-field.is-valid .consent { border-color: var(--green); background: var(--green-soft); }
.flow-options { display: grid; gap: 12px; }
.flow-option { background: #fff; color: var(--blue); border: 2px solid var(--blue); }
.flow-option:active:not(:disabled) { background: var(--blue-soft); }
.link-button { min-height: 0; background: none; box-shadow: none; color: #526477; font-weight: 600; font-size: .85rem; padding: 6px; text-decoration: underline; }
.link-button:active:not(:disabled) { background: none; box-shadow: none; transform: none; }
.checkbox-list { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 6px; }
.checkbox-inline { display: inline-flex !important; width: auto !important; }
.honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.complete { text-align: center; padding: 20px 0; animation: reveal .35s ease-out; }
.complete h2 { margin: 14px 0 9px; }
.complete p { color: #637083; line-height: 1.7; }
.complete small { display: block; margin-top: 24px; color: #7f8d9c; }
.complete-check { display: grid; place-items: center; width: 68px; height: 68px; margin: auto; border: 4px solid var(--green); border-radius: 50%; color: var(--green); font-size: 42px; line-height: 1; animation: check-pop .45s cubic-bezier(.2,.8,.2,1.35); }

@keyframes field-shake { 0%,100% { transform: translateX(0); } 30% { transform: translateX(-4px); } 65% { transform: translateX(4px); } }
@keyframes reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes check-pop { from { opacity: 0; transform: scale(.55) rotate(-18deg); } to { opacity: 1; transform: scale(1) rotate(0); } }

@media (min-width: 430px) {
  .page-shell { padding-top: 24px; }
  .card { padding: 30px 28px 34px; }
  .two-columns { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 720px) { .page-shell { padding-top: 42px; } .card { padding: 36px 40px 42px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
