/* JOY MILES. HAAB red, the takeaway-box diamond pattern, Kanit. The one loud thing is the
   boarding pass with the member's miles; everything else stays quiet around it. */

:root {
  color-scheme: light;
  --red: #ca232b;
  --red-deep: #a11b22;
  --red-soft: #fbe3e3;
  --blush: #fdeeec;
  --gold: #b8943f;
  --gold-deep: #8f6f24;
  --gold-soft: #f7edd3;
  --ink: #2a1416;
  --ink-2: #6b4a4c;
  --ink-3: #9b7d7f;
  --bg: #fff8f7;
  --paper: #ffffff;
  --line: #f1dedd;
  --line-strong: #e4c5c3;
  --ok: #127a4a;
  --ok-soft: #e2f3e8;
  --pattern: repeating-linear-gradient(45deg, rgba(255,255,255,.07) 0 2px, transparent 2px 22px),
             repeating-linear-gradient(-45deg, rgba(255,255,255,.07) 0 2px, transparent 2px 22px);
  --font: "Kanit", -apple-system, "Segoe UI", system-ui, sans-serif;
  --r: 16px;
  --r-lg: 22px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--red); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.staging { background: #2a1416; color: #ffe9a8; text-align: center; font-size: 13px; padding: 4px 12px; }

/* ── band ── */
.band { background-color: var(--red); background-image: var(--pattern); color: #fff; padding-top: env(safe-area-inset-top); }
.band-in { max-width: 520px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.logo { border-radius: 12px; box-shadow: 0 0 0 2px rgba(255,255,255,.35); flex: none; }
.wordmark .name { font-weight: 800; font-size: 26px; line-height: 1; letter-spacing: .01em; display: flex; align-items: center; gap: 8px; }
.wordmark .plane { width: 22px; height: 22px; fill: #fff; }
.wordmark .sub { font-size: 13.5px; opacity: .9; margin-top: 4px; }

main { max-width: 520px; margin: 0 auto; padding: 0 16px 40px; }
section { margin-top: 28px; }
h1, h2, p { margin: 0; }
.sec { font-size: 19px; font-weight: 700; margin-bottom: 10px; color: var(--red-deep); }
.note { color: var(--ink-2); font-size: 13.5px; margin-bottom: 12px; }

/* ── hero ── */
.hero { margin-top: 22px; text-align: center; }
.ribbon {
  display: inline-block; background: var(--red-soft); color: var(--red-deep); font-weight: 600; font-size: 13.5px;
  padding: 4px 14px; border-radius: 999px; margin-bottom: 12px;
}
.hero h1 { font-size: 30px; font-weight: 700; line-height: 1.2; }
.hero h1 b { color: var(--red); font-weight: 800; white-space: nowrap; }
.hero .h-product { white-space: nowrap; }
.hero .eq { color: var(--ink-3); font-weight: 500; }
.lead { color: var(--ink-2); margin-top: 8px; }

/* ── cards and forms ── */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: 0 12px 30px -22px rgba(202,35,43,.5); }
.signin { margin-top: 20px; }
.signin h2 { font-size: 20px; font-weight: 700; }
.hint { color: var(--ink-2); font-size: 14px; margin: 2px 0 12px; }
input[type="tel"], input[type="text"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
  width: 100%; border: 1.5px solid var(--line-strong); border-radius: 14px; padding: 13px 14px; background: #fff; font-size: 18px;
}
input[type="tel"] { font-size: 22px; font-weight: 600; letter-spacing: .06em; text-align: center; }
input::placeholder { color: var(--ink-3); font-weight: 400; letter-spacing: .04em; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px;
  border-radius: 14px; border: 1.5px solid var(--line-strong); background: #fff; font-weight: 600; font-size: 17px; padding: 10px 16px;
  text-decoration: none; color: var(--ink);
}
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:active { background: var(--red-deep); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.line { background: #06c755; border-color: #06c755; color: #fff; }
.btn[disabled] { opacity: .55; cursor: default; }
.signin .btn { margin-top: 10px; }
.join { text-align: center; font-size: 14.5px; color: var(--ink-2); margin-top: 14px; }
.join a { font-weight: 600; }
.msg { margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: var(--red-soft); color: var(--red-deep); font-size: 14.5px; }
.msg.wide { margin-top: 14px; }
.msg a { font-weight: 600; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--ink-2); font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; }
.link-btn.light { color: rgba(255,255,255,.9); }

/* ── boarding pass ── */
.pass {
  margin-top: 20px; border-radius: var(--r-lg); color: #fff; padding: 18px 20px 14px; position: relative; overflow: hidden;
  background-color: var(--red); background-image: var(--pattern), linear-gradient(160deg, #d8323a 0%, #b51d25 100%);
  box-shadow: 0 18px 36px -20px rgba(161,27,34,.8);
}
.pass-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tiny { font-size: 11px; letter-spacing: .16em; font-weight: 600; opacity: .75; }
.pass-name { font-size: 20px; font-weight: 600; line-height: 1.25; }
.pass-phone { font-size: 13.5px; opacity: .85; letter-spacing: .04em; }
.pass .link-btn { color: rgba(255,255,255,.85); flex: none; }
.pass-miles { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; }
.miles-num { font-size: 84px; font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.miles-unit { font-size: 20px; font-weight: 700; letter-spacing: .14em; opacity: .9; }
.pass-next { font-size: 15px; margin-top: 2px; min-height: 22px; }
.pass-next b { font-weight: 700; }

.route { position: relative; height: 62px; margin: 14px 6px 0; --p: 0; }
.route-line { position: absolute; left: 0; right: 0; top: 13px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.28); }
.route-fill { height: 100%; width: calc(var(--p) * 100%); border-radius: 4px; background: #fff; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.route-plane {
  position: absolute; top: 0; left: calc(var(--p) * 100%); width: 30px; height: 30px; margin-left: -15px; border-radius: 50%;
  background: #fff; display: grid; place-items: center; transition: left .9s cubic-bezier(.2,.8,.2,1); box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.route-plane svg { width: 18px; height: 18px; fill: var(--red); transform: rotate(45deg); }
.stop { position: absolute; top: 7px; left: calc(var(--at) * 100%); transform: translateX(-50%); text-align: center; }
.stop:last-child { transform: translateX(-100%); text-align: right; }
.stop:last-child .dot { margin-left: auto; margin-right: 0; }
.stop .dot { width: 16px; height: 16px; border-radius: 50%; margin: 0 auto; background: var(--red-deep); border: 3px solid rgba(255,255,255,.55); }
.stop.hit .dot { background: #fff; border-color: #fff; }
.stop.gold.hit .dot { background: #f5d98a; border-color: #f5d98a; }
.stop .lbl { font-size: 11.5px; margin-top: 12px; opacity: .85; white-space: nowrap; line-height: 1.2; }
.stop .lbl b { display: block; font-size: 13px; font-weight: 700; }
.stop.hit .lbl { opacity: 1; }
.pass-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12px; opacity: .85; border-top: 1px dashed rgba(255,255,255,.35); padding-top: 8px; }

/* ── reward tickets ── */
.tiers { display: grid; gap: 12px; }
.tier {
  display: grid; grid-template-columns: 64px 1fr; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
}
.tier-stub {
  background: var(--blush); color: var(--red-deep); display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-right: 2px dashed var(--line-strong); padding: 10px 4px;
}
.tier-stub .n { font-size: 26px; font-weight: 800; line-height: 1; }
.tier-stub .u { font-size: 10.5px; letter-spacing: .1em; font-weight: 600; }
.tier-main { padding: 12px 14px; min-width: 0; }
.tier-name { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--ink-3); }
.tier-reward { font-size: 18px; font-weight: 700; line-height: 1.3; }
.tier-detail { font-size: 13px; color: var(--ink-2); }
.tier-state { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tier .btn { margin-top: 10px; min-height: 44px; font-size: 16px; }
.tier.locked .tier-reward { color: var(--ink-2); }
.tier.locked .tier-stub { background: #f6efee; color: var(--ink-3); }
.bar { flex: 1 1 90px; height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; width: calc(var(--p) * 100%); background: var(--red); border-radius: 6px; }
.tier.ready { border-color: var(--red); box-shadow: 0 10px 24px -18px rgba(202,35,43,.9); }
.tier.ready .tier-stub { background: var(--red); color: #fff; border-right-color: rgba(255,255,255,.6); }
.tier.gold .tier-stub { background: var(--gold-soft); color: var(--gold-deep); }
.tier.gold.ready, .tier.gold.claimed { border-color: var(--gold); }
.tier.gold.ready .tier-stub, .tier.gold.claimed .tier-stub, .tier.gold.fulfilled .tier-stub { background: var(--gold); color: #fff; }
.tier.gold .bar i { background: var(--gold); }
.tier.used, .tier.fulfilled { background: #fbf7f6; }
.tier.used .tier-reward, .tier.soldout .tier-reward, .tier.expired .tier-reward { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.stamp {
  display: inline-block; border: 2px solid var(--ok); color: var(--ok); border-radius: 6px; padding: 0 8px; font-weight: 700; font-size: 13px;
  transform: rotate(-4deg); letter-spacing: .04em; background: var(--ok-soft);
}
.stamp.wait { border-color: var(--gold); color: var(--gold-deep); background: var(--gold-soft); }
.stamp.off { border-color: var(--ink-3); color: var(--ink-3); background: transparent; }
.pill { display: inline-block; background: var(--gold-soft); color: var(--gold-deep); border-radius: 999px; padding: 1px 10px; font-size: 12.5px; font-weight: 600; }

/* ── history ── */
.history { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }
.history li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--line); }
.history li:first-child { border-top: 0; }
.history .what { min-width: 0; }
.history .what b { display: block; font-weight: 500; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history .what span { font-size: 12.5px; color: var(--ink-3); }
.history .plus { font-weight: 700; color: var(--red); white-space: nowrap; }
.history .empty { color: var(--ink-2); justify-content: center; text-align: center; font-size: 14.5px; }

/* ── the offer (everyone sees it) ── */
.offer-tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.offer { background: var(--blush); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 12px; text-align: center; }
.offer .o-miles { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 800; font-size: 22px; line-height: 1; }
.offer .o-miles small { display: block; font-size: 9.5px; font-weight: 500; letter-spacing: .06em; }
.offer .o-name { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--red-deep); margin-top: 8px; font-weight: 600; }
.offer .o-reward { font-size: 17px; font-weight: 700; line-height: 1.25; margin-top: 2px; }
.offer .o-detail { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
/* an odd one out before the gold card takes the full row */
.offer:nth-last-child(2):nth-child(odd) { grid-column: 1 / -1; }
.offer.gold { grid-column: 1 / -1; background: var(--red); background-image: var(--pattern); border-color: var(--red); color: #fff; }
.offer.gold .o-miles { background: var(--gold); }
.offer.gold .o-name { color: #f5d98a; }
.offer.gold .o-detail { color: rgba(255,255,255,.88); }
.offer.gold .o-limit { display: inline-block; margin-top: 8px; background: rgba(255,255,255,.16); border-radius: 999px; padding: 1px 12px; font-size: 12.5px; }

.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px 12px 58px; }
.steps li::before {
  content: counter(s); position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%;
  background: var(--red-soft); color: var(--red); font-weight: 800; display: grid; place-items: center;
}
.steps b { display: block; font-weight: 600; }
.steps li > span { font-size: 13.5px; color: var(--ink-2); }
.terms ul { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 13.5px; display: grid; gap: 4px; }

footer { text-align: center; padding: 26px 16px calc(30px + env(safe-area-inset-bottom)); color: var(--ink-3); font-size: 13.5px; border-top: 1px solid var(--line); }
footer img { border-radius: 9px; margin-bottom: 6px; }

/* ── coupon modal ── */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(42,20,22,.72); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.sheet { width: 100%; max-width: 400px; position: relative; animation: pop .28s cubic-bezier(.2,.9,.3,1.2); }
@keyframes pop { from { transform: translateY(18px) scale(.96); opacity: 0; } }
.close { position: absolute; right: 6px; top: 6px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.2); color: #fff; font-size: 26px; line-height: 1; }
.ticket { border-radius: 22px; overflow: hidden; background: var(--paper); }
.ticket-head { background-color: var(--red); background-image: var(--pattern); color: #fff; padding: 22px 22px 20px; }
.ticket.gold .ticket-head { background-color: var(--gold); }
.ticket-reward { font-size: 26px; font-weight: 800; line-height: 1.2; margin-top: 4px; padding-right: 30px; }
.ticket-detail { font-size: 14px; opacity: .92; margin-top: 4px; }
.ticket-cut { height: 0; border-top: 3px dashed var(--line-strong); margin: 0 14px; position: relative; }
.ticket-cut::before, .ticket-cut::after { content: ""; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%; background: #4a3033; }
.ticket-cut::before { left: -26px; }
.ticket-cut::after { right: -26px; }
.ticket-body { padding: 20px 22px 22px; text-align: center; }
.ticket-body .tiny { color: var(--ink-3); opacity: 1; }
.code { font-size: 40px; font-weight: 800; letter-spacing: .1em; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; }
.code small { font-size: 22px; color: var(--ink-3); font-weight: 600; margin-right: 6px; }
.clock { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; margin-top: 2px; }
.clock::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 6px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.ticket-how { font-size: 14.5px; color: var(--ink-2); margin-top: 12px; }
.ticket-actions { display: grid; gap: 10px; margin-top: 16px; }
.ticket .stamp { font-size: 20px; padding: 2px 14px; margin-top: 6px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@media (min-width: 560px) {
  .hero h1 { font-size: 36px; }
}
