:root {
  color-scheme: light;
  --red: #e54b4b;
  --red-deep: #c83b44;
  --teal: #0e4d58;
  --teal-dark: #083841;
  --cream: #f9f7f2;
  --paper: #fffefa;
  --ink: #16353b;
  --muted: #65797b;
  --line: #dcded8;
  --success: #187653;
}

* { box-sizing: border-box; }
html { background: var(--cream); scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 86% 5%, rgb(229 75 75 / 8%) 0 82px, transparent 83px),
    var(--cream);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.camera-open { overflow: hidden; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 3px solid rgb(229 75 75 / 28%); outline-offset: 2px; }

.shell { width: min(100%, 560px); min-height: 100dvh; margin: 0 auto; padding: 0 18px max(28px, env(safe-area-inset-bottom)); }
.site-header {
  min-height: 74px;
  margin: 0 -18px;
  padding: 9px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgb(255 255 255 / 90%);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand-lockup { display: flex; min-width: 0; align-items: center; gap: 5px; text-decoration: none; }
.brand-lockup > img:first-child { width: 44px; height: 44px; object-fit: contain; }
.wordmark { width: clamp(128px, 42vw, 180px); height: auto; }
.header-tag {
  flex: none;
  padding: 6px 10px;
  border: 1px solid #e9b7b7;
  border-radius: 999px;
  color: var(--red-deep);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.hero { position: relative; overflow: hidden; padding: 38px 3px 23px; }
.hero::after {
  position: absolute;
  top: -110px;
  right: -93px;
  width: 210px;
  height: 210px;
  border: 25px solid rgb(14 77 88 / 5%);
  border-radius: 50%;
  content: "";
}
.eyebrow { margin: 0; color: var(--red-deep); font-size: 12px; font-weight: 900; letter-spacing: .17em; }
.hero h1 {
  position: relative;
  z-index: 1;
  margin: 9px 0 12px;
  color: var(--teal);
  font-size: clamp(32px, 9vw, 44px);
  line-height: 1.13;
  letter-spacing: -.045em;
}
.hero > p:not(.eyebrow) { position: relative; z-index: 1; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.trust-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
}
.trust-row i { width: 4px; height: 4px; border-radius: 50%; background: var(--red); }

.card, .receipt-card {
  margin-bottom: 16px;
  padding: 24px 21px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 14px 38px rgb(27 56 61 / 7%);
}
.card h2 { margin: 0 0 10px; color: var(--teal); font-size: 23px; line-height: 1.3; letter-spacing: -.025em; }
.step { display: flex; align-items: center; gap: 8px; margin: 0 0 13px; color: var(--red-deep); font-size: 12px; font-weight: 900; letter-spacing: .07em; }
.step::before { width: 18px; height: 3px; border-radius: 3px; background: var(--red); content: ""; }
.muted { margin: 8px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.status-card { display: flex; align-items: center; justify-content: center; gap: 11px; min-height: 92px; color: var(--muted); font-size: 13px; }
.status-card p { margin: 0; }
.spinner { width: 18px; height: 18px; border: 2px solid #cad7d5; border-top-color: var(--teal); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

label:not(.consent) { display: block; margin-bottom: 8px; color: var(--ink); font-size: 14px; font-weight: 800; }
input:not([type="checkbox"]) {
  display: block;
  width: 100%;
  min-height: 58px;
  margin: 0 0 15px;
  padding: 11px 15px;
  border: 1px solid #bdccca;
  border-radius: 12px;
  background: #fff;
  color: var(--teal);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: .18em;
  outline: none;
}
input:not([type="checkbox"]):focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgb(14 77 88 / 10%); }
input::placeholder { color: #adb9b9; font-size: 16px; font-weight: 500; letter-spacing: 0; }
button:not(.shutter):not(#closeCamera) {
  width: 100%;
  min-height: 51px;
  padding: 12px 15px;
  border: 0;
  border-radius: 12px;
  background: var(--red);
  color: #fff;
  font-size: 15px;
  font-weight: 850;
  cursor: pointer;
}
button:not(.shutter):not(#closeCamera):hover { background: var(--red-deep); }
button.secondary { margin-top: 10px; background: #e8f0ee; color: var(--teal); }
button.secondary:hover { background: #dae7e4; }
button:disabled { opacity: .55; cursor: wait !important; }
.message { min-height: 1.4em; margin: 12px 0 0; color: #ac3540; font-size: 13px; line-height: 1.6; }
.message:empty { display: none; }
.privacy-note { margin: 13px 0 0; color: #839294; font-size: 11px; }

.eligible-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px 15px;
  border-radius: 14px;
  background: var(--teal);
  color: #fff;
}
.eligible-banner span { color: #bed7d6; font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.eligible-banner strong { max-width: 62%; text-align: right; }
.member-summary, .receipt-details { margin: 0; }
.member-summary > div, .receipt-details > div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid #e7e8e2; }
.member-summary dt, .receipt-details dt { color: var(--muted); font-size: 12px; }
.member-summary dd, .receipt-details dd { margin: 0; color: var(--teal); font-size: 13px; font-weight: 800; text-align: right; overflow-wrap: anywhere; }
.face-intro { display: flex; gap: 13px; margin: 20px 0 13px; padding: 14px; border-radius: 14px; background: #eff4f2; }
.face-intro strong { color: var(--teal); font-size: 14px; }
.face-intro p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.face-symbol { position: relative; width: 42px; height: 42px; flex: none; border: 2px solid var(--red); border-radius: 13px; }
.face-symbol::before { position: absolute; top: 8px; left: 13px; width: 12px; height: 13px; border: 2px solid var(--red); border-radius: 50%; content: ""; }
.face-symbol::after { position: absolute; bottom: 7px; left: 9px; width: 20px; height: 9px; border: 2px solid var(--red); border-top-left-radius: 12px; border-top-right-radius: 12px; content: ""; }
.consent { display: flex; align-items: flex-start; gap: 10px; margin: 13px 0; color: #5d7173; font-size: 11px; line-height: 1.65; }
.consent input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--red); }

.receipt-card { overflow: hidden; padding: 0; border-color: #0a414a; background: var(--teal); color: #fff; }
.receipt-status { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 15px; background: #dff3e9; color: #126342; font-size: 12px; letter-spacing: .03em; }
.receipt-status span { width: 9px; height: 9px; border-radius: 50%; background: #18a66f; box-shadow: 0 0 0 5px rgb(24 166 111 / 14%); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgb(24 166 111 / 3%); } }
.receipt-status.expired { background: #ffe7e1; color: #9e3039; }
.receipt-status.expired span { background: var(--red); box-shadow: none; animation: none; }
.receipt-hero { padding: 25px 22px 20px; border-bottom: 1px solid rgb(255 255 255 / 15%); }
.receipt-hero small { color: #b9d6d4; font-weight: 800; letter-spacing: .08em; }
.receipt-hero h2 { margin: 7px 0 10px; color: #fff; font-size: 31px; line-height: 1.2; }
.receipt-hero p { margin: 0; color: #ffc1b8; font-size: 13px; font-weight: 800; }
.live-clock { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 15px 22px; background: rgb(0 0 0 / 10%); }
.live-clock span { color: #b9d6d4; font-size: 11px; }
.live-clock strong { color: #fff; font-size: 18px; font-variant-numeric: tabular-nums; }
.receipt-details { padding: 9px 22px 5px; }
.receipt-details > div { border-bottom-color: rgb(255 255 255 / 12%); }
.receipt-details dt { color: #b9d6d4; }
.receipt-details dd { color: #fff; }
.staff-note { margin: 14px 22px 16px; padding: 12px 13px; border: 1px solid rgb(255 255 255 / 17%); border-radius: 11px; color: #d4e4e2; font-size: 11px; line-height: 1.7; }
.receipt-card .secondary.light { width: calc(100% - 44px); margin: 0 22px 21px; background: #fff; color: var(--teal); }
.receipt-card .claim-recorded:disabled { opacity: 1; cursor: default !important; }
.light-message { margin: -8px 22px 17px; color: #ffd3cc; }

footer { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 22px 0 8px; color: var(--teal); font-size: 11px; font-weight: 800; }
footer i { width: 1px; height: 12px; background: var(--red); }
.hidden { display: none !important; }

.camera-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; height: 100vh; height: 100dvh; flex-direction: column; background: #061b1f; color: #fff; }
.camera-top { min-height: 80px; padding: max(12px, env(safe-area-inset-top)) 18px 10px; display: flex; align-items: center; gap: 13px; }
#closeCamera { width: 42px; height: 42px; padding: 0; flex: none; border: 1px solid rgb(255 255 255 / 25%); border-radius: 50%; background: rgb(255 255 255 / 9%); color: #fff; font-size: 29px; cursor: pointer; }
.camera-top strong, .camera-top span { display: block; }
.camera-top span { color: #bed1cf; font-size: 11px; }
.camera-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; flex: 1; overflow: hidden; background: #153137; }
.camera-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.face-guide { position: relative; z-index: 1; width: min(70vw, 325px); height: min(67vh, 455px); border: 3px solid rgb(255 255 255 / 82%); border-radius: 48% 48% 43% 43%; box-shadow: 0 0 0 999px rgb(0 0 0 / 19%); }
.face-guide::before, .face-guide::after, .face-guide span::before, .face-guide span::after { position: absolute; width: 26px; height: 26px; border-color: #ff8b80; content: ""; }
.face-guide::before { top: -4px; left: -4px; border-top: 4px solid; border-left: 4px solid; border-radius: 18px 0 0; }
.face-guide::after { top: -4px; right: -4px; border-top: 4px solid; border-right: 4px solid; border-radius: 0 18px 0 0; }
.face-guide span::before { bottom: -4px; left: -4px; border-bottom: 4px solid; border-left: 4px solid; border-radius: 0 0 0 18px; }
.face-guide span::after { right: -4px; bottom: -4px; border-right: 4px solid; border-bottom: 4px solid; border-radius: 0 0 18px; }
.camera-bottom { min-height: 148px; padding: 12px 10px max(12px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.camera-bottom small { color: #c6d5d3; }
.camera-capture-actions { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.camera-message { min-height: 18px; color: #ffd0c9 !important; text-align: center; }
.camera-processing { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 28px; background: linear-gradient(160deg, #0e4d58, #082f37); text-align: center; }
.camera-processing strong { font-size: 20px; }
.camera-processing small { max-width: 290px; color: #c6d5d3; line-height: 1.7; }
.processing-spinner { width: 48px; height: 48px; border: 4px solid rgb(255 255 255 / 24%); border-top-color: #ff8b80; border-radius: 50%; animation: processing-spin .9s linear infinite; }
@keyframes processing-spin { to { transform: rotate(360deg); } }
.shutter { display: grid; width: 76px; height: 76px; padding: 6px; place-items: center; border: 4px solid #fff; border-radius: 50%; background: transparent; cursor: pointer; }
.shutter span { width: 100%; height: 100%; border-radius: 50%; background: var(--red); }

@media (max-width: 360px) {
  .shell { padding-right: 12px; padding-left: 12px; }
  .site-header { margin-right: -12px; margin-left: -12px; padding-right: 12px; padding-left: 12px; }
  .card { padding: 21px 17px; }
  .trust-row { gap: 6px; font-size: 10px; }
  .member-summary > div { grid-template-columns: 78px 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spinner, .receipt-status span, .processing-spinner { animation: none; }
}
