/* form.css - public pages (form "/", card "/w/<token>", shared bits of /policy). Sits on the frozen base.css
   (order-check app.css) and only adds; no inline styles anywhere (CSP style-src 'self'). */
:root {
  /* help pictures (pics.js) */
  --pic-bezel: #1d1d1f; --pic-screen: #f2f2f4; --pic-panel: #ffffff; --pic-bar: #dcdce1; --pic-thumb: #c7c7cc;
  --pic-hot: #ee4d2d; --pic-hot-tint: #fff0eb;
  --pic-body: #3a3a3c; --pic-body-line: #1d1d1f; --pic-detail: #8e8e93;
  --pic-sticker: #ffffff; --pic-ink: #1d1d1f;
  --invalid: var(--red-text);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --pic-bezel: #48484a; --pic-screen: #000000; --pic-panel: #1c1c1e; --pic-bar: #3a3a3c; --pic-thumb: #48484a;
    --pic-hot: #ff7043; --pic-hot-tint: #3a1d12;
    --pic-body: #2c2c2e; --pic-body-line: #636366; --pic-detail: #8e8e93;
    --pic-sticker: #e5e5ea; --pic-ink: #1c1c1e;
  }
}
:root[data-theme="dark"] {
  --pic-bezel: #48484a; --pic-screen: #000000; --pic-panel: #1c1c1e; --pic-bar: #3a3a3c; --pic-thumb: #48484a;
  --pic-hot: #ff7043; --pic-hot-tint: #3a1d12;
  --pic-body: #2c2c2e; --pic-body-line: #636366; --pic-detail: #8e8e93;
  --pic-sticker: #e5e5ea; --pic-ink: #1c1c1e;
}

/* ---- column: 600 px content (CONTRACT §11.1) ---- */
.navbar-in, .wr-view { max-width: calc(600px + 2 * var(--gutter)); }
.wr-view { padding-bottom: 8px; }
.foot-wrap { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.foot-wrap:empty { display: none; }
.site-foot { margin-top: 32px; gap: 4px; }
.site-foot p { line-height: 1.5; }
.site-foot a { color: var(--link); }
.foot-co { font-weight: 600; }

/* nav: brand and the compact title share one slot; the title takes over once the large title scrolls away */
.nav-lead { display: grid; min-width: 0; flex: 1 1 auto; }
.nav-lead > * { grid-area: 1 / 1; align-self: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-brand { font-size: 17px; font-weight: 600; line-height: 1.3; color: var(--text); transition: opacity .2s ease; justify-self: start; border-radius: 6px; }
.navbar.is-scrolled .nav-brand { opacity: 0; pointer-events: none; }
/* [v2.1] never both at once (walk item 3: a 0.2 s cross-fade drew the small title over the brand): the outgoing one
   fades out first, the incoming one starts only after it (transition-delay = the outgoing fade); a page switch
   (.nav-instant, set by shell.js for a moment) jumps straight to the new state with no fade at all. */
.nav-lead .nav-title { transition: opacity .12s ease, transform .12s ease; transition-delay: 0s; }
.navbar.is-scrolled .nav-lead .nav-title { transition-delay: .12s; }
.nav-lead .nav-brand { transition: opacity .12s ease; transition-delay: .12s; }
.navbar.is-scrolled .nav-lead .nav-brand { transition-delay: 0s; }
.navbar.nav-instant .nav-lead > * { transition: none; }
.lang-slot { flex: none; }
.lang-seg { width: 108px; }
.lang-seg .seg-btn { min-height: 30px; font-size: 13px; }

.hero { padding-top: 10px; }
.page-sub { font-size: 16px; line-height: 1.5; margin-top: 4px; }
.req-note { margin-top: 16px; padding: 0 4px; }

/* ---- callouts the base lacks ---- */
.callout.ok { background: linear-gradient(var(--green-bg), var(--green-bg)), var(--card); }
.callout.ok > .ic, .callout.ok strong { color: var(--green-text); }
.callout.soft { padding: 10px 12px; font-size: 14px; }
.callout-sub { font-size: 13px; line-height: 1.5; color: var(--text-2); }
.callout.ok .callout-sub, .callout.info .callout-sub { color: var(--text); }
.gift-banner { margin-top: 16px; }

/* ---- form groups (iOS inset grouped, one field block per row) ---- */
.fsec { margin-top: 24px; }
.fsec-title { padding: 0 16px 6px; font-size: 15px; font-weight: 600; line-height: 1.45; color: var(--text-2); }
.fgroup { overflow: visible; }
.fb { position: relative; display: grid; gap: 6px; padding: 12px 16px 14px; min-width: 0; }
.fb + .fb::before, .fb + .tick-row::before, .tick-row + .tick-row::before, .ferr-pad + .tick-row::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; height: var(--hair); background: var(--sep);
}
.fb-sub { padding-top: 4px; }
.fb-sub::before { display: none; }
.flabel { font-size: 15px; font-weight: 600; line-height: 1.45; color: var(--text); }
.fopt { font-weight: 400; color: var(--text-2); }
.fhint { font-size: 13px; line-height: 1.5; color: var(--text-2); }
.fhint .ic, .ferr .ic { width: 16px; height: 16px; margin-top: 2px; }
.fok, .fwarn, .ferr { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 6px; align-items: start; }
.fok { color: var(--green-text); }
.fwarn { color: var(--orange-text); }
.ferr { font-size: 13px; line-height: 1.5; color: var(--red-text); font-weight: 500; }
.ferr-pad { padding: 0 16px 12px 52px; }
.fdate { color: var(--green-text); }
/* [v2.3] the chosen model's warranty terms under the model select */
.model-terms { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 6px; align-items: start; color: var(--text); }
.model-terms .ic { color: var(--link); }
.mono-in { font-family: var(--mono); letter-spacing: .02em; text-transform: uppercase; }
.mono-in::placeholder { text-transform: none; font-family: var(--font); letter-spacing: 0; }
.input[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--invalid); background: linear-gradient(var(--red-bg), var(--red-bg)), var(--card-2); }
.input[aria-invalid="true"]:focus { box-shadow: inset 0 0 0 1.5px var(--invalid), 0 0 0 3px var(--focus); }
select.input { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%238e8e93' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px 18px; }
select.input:invalid { color: var(--text-2); }
select.input option { color: var(--text); }
textarea.input { min-height: 88px; }
.pc-in { max-width: 160px; font-variant-numeric: tabular-nums; }

.in-row { display: flex; gap: 8px; min-width: 0; }
.in-row > .input { flex: 1 1 auto; min-width: 0; }
.scan-btn { flex: none; min-height: 44px; padding-left: 14px; padding-right: 14px; }
.qr-ico { width: 18px; height: 18px; }

/* help pictures */
.pic-more > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: -6px 0 -10px;
  color: var(--link); font-size: 14px; font-weight: 500; cursor: pointer; border-radius: 8px;
}
.pic-more > summary::-webkit-details-marker { display: none; }
.pic-more > summary .ic { width: 18px; height: 18px; }
.pic-more[open] > summary { margin-bottom: 0; }
.pic-wrap { display: grid; gap: 4px; padding: 10px; border-radius: 12px; background: var(--card-2); animation: reveal .2s ease; }
.pic { display: block; width: 100%; max-width: min(100%, 340px); height: auto; margin: 0 auto; }
.pic-order { aspect-ratio: 320 / 440; max-width: min(100%, 280px); }
.pic-serial { aspect-ratio: 340 / 260; }
.pic-caption { max-width: 360px; margin: 0 auto; font-size: 13px; line-height: 1.5; color: var(--text-2); text-align: center; }
.pic-bezel { fill: var(--pic-bezel); }
.pic-screen { fill: var(--pic-screen); }
.pic-panel { fill: var(--pic-panel); }
.pic-bar { fill: var(--pic-bar); }
.pic-thumb { fill: var(--pic-thumb); }
.pic-text { fill: var(--text); }
.pic-muted { fill: var(--text-2); }
.pic .mono { font-family: var(--mono); }
.pic-stroke { fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pic-scroll { fill: var(--text-2); opacity: .6; }
.pic-hot-tint { fill: var(--pic-hot-tint); }
.pic-hot-text { fill: var(--pic-hot); }
.pic-hot-btn { fill: none; stroke: var(--pic-hot); stroke-width: 1.2; }
.pic-ring { fill: none; stroke: var(--pic-hot); stroke-width: 3; }
.pic-arrow { fill: none; stroke: var(--pic-hot); stroke-width: 3; stroke-linecap: round; }
.pic-arrowhead { fill: var(--pic-hot); }
.pic-zoom { fill: none; stroke: var(--pic-hot); stroke-width: 1.5; stroke-dasharray: 4 3; }
.pic-body { fill: var(--pic-body); stroke: var(--pic-body-line); stroke-width: 1.5; }
.pic-detail { fill: none; stroke: var(--pic-detail); stroke-width: 2; }
.pic-detail-fill { fill: var(--pic-detail); }
.pic-sticker { fill: var(--pic-sticker); }
.pic-sticker-big { fill: var(--pic-sticker); stroke: var(--pic-hot); stroke-width: 2; }
.pic-ink { fill: var(--pic-ink); }
.pic-ink-soft { fill: var(--pic-ink); opacity: .35; }
.pic-ink-line { stroke: var(--pic-ink); stroke-width: 1; opacity: .3; }

/* photo picker */
.photo-actions { position: relative; display: flex; flex-wrap: wrap; gap: 8px; }
.photo-btn { min-height: 44px; cursor: pointer; }
.photo-btn .ic { width: 20px; height: 20px; }
.photo-actions:has(.file-in:focus-visible) .photo-btn { outline: 3px solid var(--focus); outline-offset: 2px; }
.fb[data-field="serialPhoto"]:has(.ferr:not([hidden])) .photo-btn { box-shadow: inset 0 0 0 1.5px var(--invalid); }
.photo-preview { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px; border-radius: 12px; background: var(--card-2); }
.photo-thumb { display: block; width: 76px; height: 76px; object-fit: cover; border-radius: 9px; background: var(--fill); }
.photo-side { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.photo-meta { font-size: 13px; line-height: 1.45; color: var(--text-2); font-variant-numeric: tabular-nums; }
.photo-busy { padding: 4px 0; }
.btn .ic { flex: none; }

/* email typo hint */
.email-hint { display: flex; align-items: center; gap: 6px; min-height: 32px; color: var(--orange); }
.email-hint .ic { width: 18px; height: 18px; }
.email-fix { font-size: 14px; font-weight: 600; min-height: 32px; }

/* address */
.fb-note { gap: 10px; }
.gift-callout .ic { width: 20px; height: 20px; }
.callout.info.gift-callout > .ic { color: var(--link); }

/* consent ticks: rounded square, filled tint + white check when ticked */
.tick-row { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 16px; min-height: 48px; }
.tick {
  appearance: none; -webkit-appearance: none; margin: 1px 0 0; width: 24px; height: 24px; border-radius: 7px; cursor: pointer;
  border: 2px solid var(--text-3); background: var(--card); display: grid; place-items: center; transition: background-color .12s ease, border-color .12s ease;
}
.tick:checked {
  border-color: var(--tint); background-color: var(--tint);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5.5 12.5l4 4L18.5 7.5' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 18px 18px; background-position: center; background-repeat: no-repeat;
}
.tick[aria-invalid="true"] { border-color: var(--invalid); }
.tick:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tick-label { display: grid; gap: 2px; font-size: 15px; line-height: 1.5; cursor: pointer; }
.tick-label { display: block; }
.tick-label a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.tick-sub { display: block; margin-top: 2px; font-size: 13px; color: var(--text-2); }
.tick-row::after { content: ""; position: absolute; inset: 0; pointer-events: none; }

/* turnstile + submit */
.ts-wrap { margin-top: 20px; display: grid; justify-items: center; gap: 6px; min-height: 65px; }
.ts-host { min-height: 65px; max-width: 100%; display: flex; justify-content: center; border-radius: 8px; }
.ts-host:focus { outline: none; }
.ts-host:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.ts-msg { text-align: center; }
.ts-wrap .ferr { justify-self: stretch; justify-content: center; grid-template-columns: 16px auto; }
.submit-block { display: grid; gap: 10px; margin-top: 16px; }
.form-error-wrap:empty { display: none; }
.submit-btn { width: 100%; }
.submit-btn:disabled { opacity: .6; }
.spinner.on-tint { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
.upload-bar {
  appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 6px; border: 0; border-radius: 3px;
  overflow: hidden; background: var(--fill); color: var(--tint);
}
.upload-bar::-webkit-progress-bar { background: var(--fill); border-radius: 3px; }
.upload-bar::-webkit-progress-value { background: var(--tint); border-radius: 3px; transition: width .15s linear; }
.upload-bar::-moz-progress-bar { background: var(--tint); border-radius: 3px; }
.upload-text { margin-top: -4px; font-size: 13px; color: var(--text-2); text-align: center; font-variant-numeric: tabular-nums; }
.submit-note { text-align: center; padding: 0 8px; }

/* live scan sheet */
.scan-wrap { display: grid; gap: 12px; padding-top: 4px; }
.scan-box { position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: #000; }
.scan-video { display: block; width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; inset: 16% 22%; border: 3px solid #fff; border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .28); }
.scan-status { text-align: center; font-size: 15px; font-weight: 500; }
.scan-tip { text-align: center; }

/* ---- card ---- */
.card-sec { margin-top: 20px; }
.wcard { padding: 16px; display: grid; gap: 14px; }
.wcard-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.status-glyph { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--c, var(--grey)); }
.status-glyph .ic { width: 24px; height: 24px; }
.status-glyph .ic path { stroke-width: 2.4; }
.tone-green { --c: var(--green); }
.tone-orange { --c: var(--orange); }
.tone-red { --c: var(--red); }
.tone-grey { --c: var(--grey); }
.tone-blue { --c: var(--blue); }
.wcard-id { min-width: 0; }
.wcard-id .cap { font-weight: 500; }
.wr-no { font-size: 22px; font-weight: 700; line-height: 1.3; letter-spacing: .01em; }
.pill.tone-green { background: linear-gradient(var(--green-bg), var(--green-bg)), var(--card); color: var(--green-text); }
.pill.tone-orange { background: linear-gradient(var(--orange-bg), var(--orange-bg)), var(--card); color: var(--orange-text); }
.pill.tone-red { background: linear-gradient(var(--red-bg), var(--red-bg)), var(--card); color: var(--red-text); }
.pill.tone-blue { background: linear-gradient(var(--tint-bg), var(--tint-bg)), var(--card); color: var(--link); }
.status-pill { font-size: 13px; padding: 3px 10px; white-space: normal; text-align: center; }
.wcard-note { font-size: 15px; line-height: 1.5; color: var(--text); }
.wcard-copy .btn { min-height: 36px; }
.wcard-kv .kv-row { min-height: 44px; align-items: center; }
.wcard-kv dd { overflow-wrap: anywhere; }
.est { color: var(--text-2); }
.card-gift { margin-top: 24px; }
.gift-box { padding: 14px 16px; display: grid; gap: 10px; }
.gift-head { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.gift-glyph { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--green); color: #fff; }
.gift-glyph .ic { width: 19px; height: 19px; }
.gift-items { list-style: none; display: grid; gap: 2px; font-size: 16px; line-height: 1.45; padding-top: 4px; }
.gift-items li { display: flex; flex-wrap: wrap; gap: 6px; }
.gift-qty { color: var(--text-2); font-variant-numeric: tabular-nums; }
.gift-head .pill { margin-top: 5px; }
.card-email-note { margin-top: 16px; }
.card-email-note .ic { color: var(--link); }
.card-actions { display: grid; gap: 4px; margin-top: 20px; justify-items: stretch; }
.card-actions .btn-lg { width: 100%; }
.card-actions .btn-plain { min-height: 44px; }
.missing-actions { justify-content: center; margin-top: 14px; }
.missing-actions .btn { min-height: 44px; }
.load-error { display: grid; gap: 12px; }

@media (max-width: 380px) {
  .wcard-head { grid-template-columns: 44px minmax(0, 1fr); }
  .wcard-head .status-pill { grid-column: 1 / -1; justify-self: start; }
  .scan-btn .btn-t { white-space: nowrap; }
}
