/* HAAB's Passport, Paris edition. A passport has a loud cover and quiet pages: one red cover, then white
   paper and dark ink, with red only on what has been earned or can be used now. From the team's mood & tone
   (Nov 2026) come the script for French words, the hand for headings, the stamp face for numbers and the
   Paris street-sign green for milestones. The one loud thing inside is the tower: one bar per mile, stacked
   the way the campaign art stacks them. */

:root {
  color-scheme: light;
  --red: #ca232b;        /* the HAAB cover, same red as the logo tile */
  --stamp: #ca232b;      /* bars earned, things to press */
  --stamp-press: #a81c23;
  --green: #516b52;      /* Paris street sign: milestones, ready to use */
  --green-ink: #3d5540;
  --paper: #ffffff;
  --card: #ffffff;
  --ink: #2a1a1d;
  --ink-2: #6f6466;
  --ink-3: #a8a09f;
  --rule: #ebe5e3;
  --ticket: #f5f1ef;     /* a ticket lying on the page */
  --ticket-on: #fbeeee;  /* one that can be used now */
  --blank: #cfc6c4;
  --line-green: #06c755;
  /* the diamond lattice of the HAAB box, drawn as thin as the security print on a passport page */
  --lattice: repeating-linear-gradient(45deg, var(--lattice-ink) 0 1px, transparent 1px 17px),
             repeating-linear-gradient(-45deg, var(--lattice-ink) 0 1px, transparent 1px 17px);
  --lattice-ink: rgba(202, 35, 43, .06);
  --text: "IBM Plex Sans Thai", -apple-system, "Segoe UI", system-ui, sans-serif;   /* anything that has to be read, not admired */
  --hand: "Mali", "IBM Plex Sans Thai", system-ui, sans-serif;
  --script: "Parisienne", "Snell Roundhand", cursive;
  --face: "Londrina Solid", "Mali", system-ui, sans-serif;
  --gutter: 24px;
  --measure: 480px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--text); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: var(--stamp); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--stamp); outline-offset: 3px; }
.staging { background: var(--ink); color: #fff; text-align: center; font-size: 12.5px; padding: 3px 12px; }
.staging a { color: inherit; }

/* ── the cover ── */
.cover {
  background-color: var(--red); color: #fff;
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .1) 0 1px, transparent 1px 17px),
                    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .1) 0 1px, transparent 1px 17px);
  min-height: 100svh; display: flex; flex-direction: column;
  padding: calc(20px + env(safe-area-inset-top)) var(--gutter) 36px;
}
.cover-in { width: 100%; max-width: var(--measure); margin: 0 auto; flex: 1; display: flex; flex-direction: column; }
.cover-logo { display: block; width: 76px; height: 76px; margin-left: -10px; clip-path: inset(7%); }
.cover-pass { font-family: var(--face); font-size: 25px; letter-spacing: .16em; line-height: 1; margin-top: -6px; }
.cover-title { margin-top: clamp(28px, 9svh, 84px); }
.dest { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.dest-city { font-family: var(--script); font-size: clamp(72px, 24vw, 104px); line-height: .95; }
.dest-no { font-family: var(--hand); font-size: 15px; font-weight: 500; }
.cover-title .campaign { font-family: var(--face); font-size: 30px; letter-spacing: .08em; line-height: 1.1; margin-top: 10px; }
.cover-title .tag { font-size: 15px; margin-top: 2px; opacity: .9; }
/* the phone field comes before the pitch: checking miles is what people came for */
#signin { order: 1; }
#hero { order: 2; margin-top: 36px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .4); }
.cover h1 { font-family: var(--hand); font-size: 18px; font-weight: 500; line-height: 1.4; }
.cover .period { font-size: 14px; opacity: .9; margin-top: 2px; }

.signin { margin-top: 28px; }
.signin label { display: block; font-size: 14px; opacity: .9; }
.signin input {
  width: 100%; background: transparent; border: 0; border-bottom: 1.5px solid rgba(255, 255, 255, .6); border-radius: 0;
  color: #fff; font-family: var(--face); font-size: 30px; letter-spacing: .06em; padding: 4px 0 6px; margin-top: 2px;
}
.signin input::placeholder { color: rgba(255, 255, 255, .42); }
.signin input:focus { outline: none; border-bottom-color: #fff; }
.signin .btn { margin-top: 20px; background: var(--paper); border-color: var(--paper); color: var(--stamp); }
.signin .btn:active { background: #f6e9e9; }
.signin .join { font-size: 14px; margin-top: 16px; }
.signin .join a { color: #fff; font-weight: 500; }
.signin .msg { background: rgba(0, 0, 0, .2); color: #fff; border-left-color: #fff; }
.signin .msg a { color: #fff; }

/* signed in: the cover closes to a strip */
.in .cover { min-height: 0; padding-bottom: 10px; padding-top: calc(10px + env(safe-area-inset-top)); }
.in .cover .cover-in { flex-direction: row; align-items: center; gap: 4px; }
.in .cover .cover-logo { width: 44px; height: 44px; margin-left: -6px; }
.in .cover .cover-pass { font-size: 19px; margin: 0; }
.in .cover .cover-title { margin: 0 0 0 auto; padding: 0; }
.in .cover .campaign { font-size: 19px; margin: 0; opacity: .9; }
.in .cover :is(.dest, .tag) { display: none; }

/* ── paper ── */
main { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter) 56px; }
main > section { margin-top: 48px; }
.sec { font-family: var(--hand); font-size: 17px; font-weight: 600; padding-bottom: 8px; border-bottom: 1.5px solid var(--ink); }
.sec + * { margin-top: 16px; }
.note { color: var(--ink-2); font-size: 13.5px; margin-top: 12px; }
.btn {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 50px; padding: 10px 16px;
  border: 1.5px solid var(--ink); border-radius: 12px; background: transparent; color: var(--ink);
  font-weight: 600; font-size: 16px; text-decoration: none;
}
.btn.primary, .btn.gold { background: var(--stamp); border-color: var(--stamp); color: var(--paper); }
.btn.primary:active, .btn.gold:active { background: var(--stamp-press); border-color: var(--stamp-press); }
.btn.line { background: var(--line-green); border-color: var(--line-green); color: #fff; }
.btn[disabled] { opacity: .5; cursor: default; }
.link-btn { background: none; border: 0; padding: 6px 0; color: var(--ink-2); font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; }
.msg { margin-top: 14px; padding: 10px 14px; border-left: 2px solid var(--stamp); background: #fbf1f1; font-size: 14.5px; }

/* ── the passport page ── */
main > .page { margin-top: 26px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.hello { font-family: var(--script); font-size: 40px; line-height: 1; color: var(--stamp); }
.pass-name { font-family: var(--hand); font-size: 17px; font-weight: 600; line-height: 1.3; margin-top: 6px; }
.pass-phone { font-size: 13px; color: var(--ink-2); }
.count { display: flex; align-items: baseline; gap: 10px; margin-top: 20px; }
.miles-num { font-family: var(--face); font-size: 84px; line-height: .86; color: var(--stamp); font-variant-numeric: tabular-nums; }
.miles-unit { font-size: 17px; color: var(--ink-2); }
.pass-next { margin-top: 8px; font-size: 15px; color: var(--ink-2); min-height: 23px; }
.pass-next b { color: var(--ink); font-weight: 600; }

.tower {
  position: relative; margin: 28px calc(var(--gutter) * -1) 0; padding: 22px var(--gutter) 16px;
  background-image: var(--lattice); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
/* the route: one line, left to right. A bar per mile, the stops named under it, a plane where you are. */
.stamps { position: relative; padding-top: 30px; }
.plane {
  position: absolute; top: 0; left: calc(var(--at) * 100%); translate: -50% 0; color: var(--stamp); font-size: 22px; line-height: 1;
  animation: fly .7s cubic-bezier(.2, .8, .3, 1) backwards;
}
@keyframes fly { from { left: 0; opacity: 0; } }
.bars { display: flex; gap: 4px; }
.slot {
  flex: 1 1 0; min-width: 0; height: 36px; border-radius: 8px; border: 1.5px dashed var(--blank); background: var(--paper); color: var(--blank);
  font-family: var(--face); font-size: 14px; line-height: 33px; text-align: center; overflow: hidden;
}
.slot.mark { border: 1.5px solid var(--green); color: var(--green-ink); }
.slot.hit { border: 1.5px solid var(--stamp); background: var(--stamp); color: #fff; animation: fill .3s ease-out backwards; animation-delay: calc(var(--i) * 60ms + 100ms); }
.slot.hit.mark { border-color: var(--green); background: var(--green); }
@keyframes fill { from { background: var(--paper); color: var(--blank); border-color: var(--blank); } }
.stops { position: relative; height: 46px; margin-top: 4px; }
.stop {
  position: absolute; top: 0; left: calc(var(--at) * 100%); translate: -50% 0; padding-top: 11px;
  text-align: center; white-space: nowrap; font-size: 11.5px; line-height: 1.35; color: var(--ink-2);
}
.stop::before { content: ""; position: absolute; left: 50%; top: 0; width: 1.5px; height: 8px; background: var(--green); }
.stop b { display: block; font-family: var(--hand); font-size: 12.5px; font-weight: 600; color: var(--ink); }
.stop.hit b { color: var(--green-ink); }
.page-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }

/* ── rewards: each one is a ticket you can tear off, a stub with the miles and a body with the reward ── */
.tier, .offer {
  position: relative; display: grid; grid-template-columns: 76px 1fr; margin-top: 12px;
  background: var(--ticket); border-radius: 14px;
}
/* the two notches where the stub tears off */
.tier::before, .tier::after, .offer::before, .offer::after {
  content: ""; position: absolute; left: 68px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper);
}
.tier::before, .offer::before { top: -8px; }
.tier::after, .offer::after { bottom: -8px; }
.tier-stub, .offer .o-miles {
  display: grid; place-content: center; justify-items: center; gap: 3px; padding: 14px 4px; border-radius: 14px 0 0 14px;
  border-right: 2px dashed var(--paper); color: var(--ink-3);
}
.tier-stub .n, .offer .o-miles span { font-family: var(--face); font-size: 38px; line-height: .9; font-variant-numeric: tabular-nums; text-align: center; }
.tier-stub .u, .offer .o-miles small { display: block; font-family: var(--face); font-size: 11px; letter-spacing: .14em; line-height: 1.6; text-transform: uppercase; }
/* a coupon that comes with a reward is a smaller ticket tucked under it */
.tier.part { grid-template-columns: 58px 1fr; margin: 8px 0 0 26px; }
.tier.part::before, .tier.part::after { left: 51px; width: 14px; height: 14px; }
.tier.part::before { top: -7px; }
.tier.part::after { bottom: -7px; }
.tier.part .tier-stub { padding: 10px 2px; }
.tier.part .tier-stub .n { font-size: 21px; }
.tier.part .tier-stub .u { font-size: 9px; letter-spacing: .1em; }
.tier.part .tier-main { padding: 10px 14px 12px; }
.tier.part .tier-name { font-size: 12px; }
.tier.part .tier-reward { font-size: 16px; }
.tier.part .tier-state { margin-top: 4px; }
.tier.part .btn { margin-top: 8px; min-height: 42px; font-size: 15px; }
/* and before it is unlocked, only a hint of it shows on the parent */
.tier-hint { margin-top: 12px; padding-top: 10px; border-top: 2px dashed var(--paper); font-size: 13px; color: var(--ink-2); }
.tier-hint ul { display: grid; gap: 5px; margin-top: 7px; }
.tier-hint li { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink); }
.tier-hint li i { flex: none; width: 22px; height: 15px; border-radius: 4px; border: 1.5px dashed var(--ink-3); rotate: -6deg; }
.tier-hint li:nth-child(even) i { rotate: 5deg; }
.tier-main { min-width: 0; padding: 14px 16px 16px; }
.tier-name { font-size: 13px; color: var(--ink-2); }
.tier-reward { font-family: var(--hand); font-size: 18px; font-weight: 600; line-height: 1.35; }
.tier-detail { font-size: 13.5px; color: var(--ink-2); }
.tier-state { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.tier .btn { margin-top: 12px; min-height: 46px; }
.stamp { color: var(--green-ink); font-weight: 600; }
.stamp.wait { color: var(--ink); }
.stamp.off { color: var(--ink-2); font-weight: 500; }
.pill { color: var(--ink-2); }
.bar { flex: 1 1 100%; height: 3px; border-radius: 2px; background: var(--paper); margin-bottom: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: calc(var(--p) * 100%); background: var(--stamp); }
/* usable now: the stub is inked */
.tier:is(.ready, .claimed, .waiting) .tier-stub, .offer .o-miles { background: var(--stamp); color: #fff; }
.tier:is(.ready, .claimed, .waiting) { background: var(--ticket-on); }
.tier.locked .tier-reward { font-weight: 500; }
/* finished: the ticket has been through the stamp */
.tier:is(.used, .fulfilled, .soldout, .expired) .tier-reward { color: var(--ink-2); font-weight: 500; }
.tier:is(.used, .fulfilled) .stamp {
  font-family: var(--face); font-weight: 400; font-size: 15px; letter-spacing: .06em; color: var(--stamp);
  border: 3px double var(--stamp); border-radius: 6px; padding: 0 8px; transform: rotate(-4deg); opacity: .8;
}
.done { margin-top: 14px; }
.done summary { padding: 8px 0; font-size: 14.5px; color: var(--ink-2); cursor: pointer; }

/* ── proof of identity: asked once per device, before rewards open ── */
.verify form { background: var(--ticket-on); border-radius: 14px; padding: 16px; }
.verify .note { margin: 0; color: var(--ink); font-size: 14px; }
.verify label { display: block; font-size: 13px; color: var(--ink-2); margin-top: 14px; }
.verify input {
  width: 100%; background: transparent; border: 0; border-bottom: 1.5px solid var(--ink); border-radius: 0;
  font-family: var(--face); font-size: 28px; letter-spacing: .06em; padding: 2px 0 4px;
}
.verify input::placeholder { color: var(--blank); }
.verify input:focus { outline: none; border-bottom-color: var(--stamp); }
.verify .btn { margin-top: 16px; }

/* ── history ── */
.history li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--rule); }
.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-2); }
.history .plus { font-family: var(--face); font-size: 18px; color: var(--stamp); white-space: nowrap; }
.history .empty { color: var(--ink-2); font-size: 14.5px; }

/* ── the offer, steps, terms ── */
.offer { padding: 14px 16px 16px 0; }
.offer .o-miles { grid-row: 1 / span 6; margin: -14px 16px -16px 0; }
.offer > :not(.o-miles) { grid-column: 2; }
.offer .o-name { font-size: 13px; color: var(--ink-2); }
.offer .o-reward { font-family: var(--hand); font-size: 18px; font-weight: 600; line-height: 1.35; }
.offer .o-detail, .offer .o-list, .offer .o-limit { font-size: 13.5px; color: var(--ink-2); }
.steps { counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; gap: 0 8px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.steps li::before { content: counter(s); grid-row: 1 / span 2; font-family: var(--face); font-size: 34px; line-height: 1; color: var(--green); }
.steps b { font-family: var(--hand); font-weight: 600; }
.steps li > span { grid-column: 2; font-size: 13.5px; color: var(--ink-2); }
.terms ul { margin-top: 14px; display: grid; gap: 7px; font-size: 14px; color: var(--ink); }
.terms li { padding-left: 14px; text-indent: -14px; }
.terms li::before { content: "– "; }

footer { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 22px var(--gutter) calc(32px + env(safe-area-inset-bottom)); font-size: 13px; color: var(--ink-2); border-top: 1.5px solid var(--ink); }
.merci { font-family: var(--script); font-size: 34px; line-height: 1.1; color: var(--stamp); margin-bottom: 4px; }

/* ── the coupon: a visa sticker ── */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(35, 31, 32, .8); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.sheet { width: 100%; max-width: 400px; position: relative; animation: rise .22s ease-out; }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.close { position: absolute; right: 8px; top: 12px; z-index: 2; width: 40px; height: 40px; border: 0; background: none; color: var(--ink-2); font-size: 28px; font-weight: 300; line-height: 1; }
.ticket { background: var(--card); border-top: 6px solid var(--stamp); border-radius: 4px; padding: 22px 24px 20px; }
.ticket-hello { font-family: var(--script); font-size: 28px; line-height: 1; color: var(--stamp); text-align: right; margin-top: 14px; }
.ticket .tiny { font-size: 13px; color: var(--ink-2); }
.ticket-reward { font-family: var(--hand); font-size: 25px; font-weight: 600; line-height: 1.3; margin-top: 2px; padding-right: 28px; }
.ticket-detail { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.ticket-cut { border-top: 1.5px dashed var(--blank); margin: 18px 0; }
.ticket-body .tiny { display: none; }
/* the code is read out and typed by staff: plain letters, set wide */
.code { font-family: var(--text); font-size: 42px; font-weight: 600; letter-spacing: .1em; line-height: 1.1; color: var(--ink); white-space: nowrap; }
.code small { font-size: 20px; font-weight: 500; color: var(--ink-2); margin-right: 8px; letter-spacing: .06em; }
.clock { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; font-variant-numeric: tabular-nums; }
.clock::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--stamp); margin-right: 7px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .15; } }
.ticket-how { font-size: 14.5px; color: var(--ink-2); margin-top: 16px; }
.ticket-actions { display: grid; gap: 10px; margin-top: 18px; }
.ticket .stamp { display: inline-block; font-size: 20px; color: var(--stamp); border: 4px double var(--stamp); border-radius: 6px; padding: 2px 14px; transform: rotate(-5deg); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
