@font-face { font-family: "jf-jinxuanlatte9"; src: url("assets/fonts/jinxuanlatte-9.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "jf-jinxuanlatte3"; src: url("assets/fonts/jinxuanlatte-3.woff2") format("woff2"); font-display: swap; }

:root {
  --bg: #FAF7F0; --ink: #2C2C2C; --soft: #5F5454; --line: #E6E3E4;
  --red: #D14B63; --purple: #4C458A; --yellow: #EBE79D; --white: #FFFFFF;
  --head: "jf-jinxuanlatte9", "jf金萱那提2.0", "Noto Sans TC", "PingFang TC", system-ui, sans-serif;
  --body: "jf-jinxuanlatte3", "jf金萱那提2.0", "Noto Sans TC", "PingFang TC", system-ui, sans-serif;
  --plain: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink); font: 400 17px/1.7 var(--body); }
[hidden] { display: none !important; }

.page { width: 100%; max-width: 640px; margin: 0 auto; padding: 32px 16px calc(32px + env(safe-area-inset-bottom)); }

.head { padding: 8px 4px 24px; }
.eyebrow { margin: 0 0 4px; color: var(--soft); font-size: 15px; }
h1 { margin: 0 0 8px; font: 400 38px/1.3 var(--head); letter-spacing: -.5px; }
.lead { margin: 0; font-size: 18px; }

.safe { margin: 0 0 16px; padding: 16px; border-radius: 16px; background: var(--yellow); }
.safe p { margin: 0; font-size: 16px; }
.safe .safe-title { margin-bottom: 4px; font: 400 18px/1.6 var(--head); }

.card { margin: 0 0 16px; padding: 24px 16px; border-radius: 16px; background: var(--white); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; font: 400 22px/1.5 var(--head); }
h2 i { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--red); color: var(--white); font: 400 16px/1 var(--head); }

.summary { margin: 0; }
.summary .row { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid var(--line); }
.summary .row:first-child { border-top: 0; padding-top: 0; }
.summary dt { flex: none; color: var(--soft); }
.summary dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.summary .wide { display: block; }
.summary .wide dd { margin-top: 2px; text-align: left; }
.summary.money { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.summary.money .row:first-child { padding-top: 0; }
.summary .total dt, .summary .total dd { color: var(--red); font: 400 21px/1.5 var(--head); }

.hint { margin: 8px 0 0; color: var(--soft); font-size: 15px; }
h2 + .hint { margin-top: -8px; margin-bottom: 16px; }

.field { display: block; margin: 0 0 16px; }
.field > span { display: block; margin-bottom: 4px; font-size: 16px; }
input[type="text"], input[type="tel"], select, textarea {
  display: block; width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #7A7A7A; border-radius: 8px;
  background: var(--white); color: var(--ink); font: 400 17px/1.5 var(--plain); appearance: none;
}
select { background-position: right 12px center; }
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .plain:focus-visible, .cta:focus-visible, .line:focus-visible { outline: 3px solid var(--purple); outline-offset: 1px; }
input::placeholder, textarea::placeholder { color: #7A7A7A; }
.is-bad { border-color: var(--red) !important; }

.err { display: block; color: #B03E54; font-size: 15px; font-style: normal; }
.err:empty { display: none; }
.center { text-align: center; }

.check { display: flex; gap: 8px; margin-top: 16px; font-size: 16px; }
.check input { flex: none; width: 24px; height: 24px; margin: 3px 0 0; accent-color: var(--red); }

.choice { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.opt { display: block; position: relative; cursor: pointer; }
.opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.opt span { display: block; height: 100%; padding: 12px; border: 2px solid var(--line); border-radius: 8px; transition: border-color .15s ease-out; }
.opt b { display: block; font: 400 18px/1.5 var(--head); }
.opt small { display: block; color: var(--soft); font-size: 14px; line-height: 1.5; }
.opt input:checked + span { border-color: var(--red); }
.opt input:focus-visible + span { outline: 3px solid var(--purple); outline-offset: 1px; }

.ids { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.id-tile { display: flex; position: relative; align-items: center; justify-content: center; aspect-ratio: 8 / 5; overflow: hidden; border: 1px solid #7A7A7A; border-radius: 8px; background: var(--bg); text-align: center; cursor: pointer; }
.id-tile span { font-size: 16px; line-height: 1.5; }
.id-tile small { display: block; color: var(--soft); font-size: 14px; }
.id-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.id-tile:focus-within { outline: 3px solid var(--purple); }
.sr { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

.sign { display: block; width: 100%; height: 200px; border: 1px solid #7A7A7A; border-radius: 8px; background: var(--white); touch-action: none; }
.sign-bar { display: flex; justify-content: flex-end; margin-top: 4px; }
.plain { min-height: 44px; padding: 8px 12px; border: 0; background: none; color: var(--purple); font: 400 16px/1.5 var(--body); text-decoration: underline; cursor: pointer; }

.cta-wrap { margin: 24px 0 16px; text-align: center; }
.cta {
  display: inline-block; width: 100%; max-width: 420px; min-height: 56px; padding: 12px 24px; border: 0; border-radius: 999px; cursor: pointer;
  background-image: linear-gradient(to right, #D14B63, #FF7C99, #F4B79C, #EBE79D, #FF7C99, #D14B63);
  background-size: 600% auto; background-position: right center;
  animation: flow 6s linear infinite, pulse 2.5s ease-in-out infinite;
  color: var(--white); font: 400 20px/1.6 var(--head); text-align: center; text-decoration: none; text-shadow: 0 1px 3px rgba(176,62,84,.6);
}
.cta:hover { filter: brightness(1.05); }
.cta[disabled] { opacity: .7; cursor: progress; animation: none; }
@keyframes flow { 0%, 100% { background-position: 100% center; } 50% { background-position: 0% center; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }

.doc { display: block; width: 100%; margin: 8px 0 16px; border: 1px solid var(--line); border-radius: 8px; }
.result-btns { display: grid; gap: 8px; justify-items: center; }

.contact { padding: 24px 0 0; text-align: center; }
.contact p { margin: 0 0 8px; font-size: 16px; }
.line { display: inline-block; min-height: 48px; padding: 10px 28px; border-radius: 999px; background: #06C755; color: var(--white); font: 400 18px/1.6 var(--head); text-decoration: none; }
.contact .line-id { margin: 8px 0 0; color: var(--soft); font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  .cta { animation: none; background-position: 100% center; }
  .opt span { transition: none; }
}
@media (min-width: 720px) {
  .page { padding-top: 48px; }
  .card { padding: 32px; }
  .safe { padding: 16px 24px; }
}
