/* ============================================================================
   LOYALTY CARDS — the flows that have no shell
   ----------------------------------------------------------------------------
   Four kinds of screen live here, and none of them has a sidebar:

     auth        sign in, reset, the platform door
     onboarding  the questions that make an account into a business
     card        what a CUSTOMER sees when they open their card
     join        what a customer sees after scanning the poster

   The first two are our product and stay in the LoyaltyCards purple. The last
   two belong to the SHOP: they take that business's skin, which is why they
   are written against --brand and not against a hex.
   ========================================================================== */

/* ============================================================================
   ONE COLUMN, CENTRED — auth and onboarding
   ========================================================================== */
.flow{min-height:100dvh;display:flex;flex-direction:column;background:var(--paper);
  position:relative;isolation:isolate;overflow-x:hidden}
/* Two glows, placed off-centre and oversized, so the colour reads as light
   falling across the page rather than as a shape sitting on it. */
.flow:before,.flow:after{content:'';position:absolute;z-index:-1;pointer-events:none;
  border-radius:50%;filter:blur(10px)}
.flow:before{top:-28vh;right:-18vw;width:68vw;height:68vw;max-width:920px;max-height:920px;
  background:radial-gradient(closest-side,var(--brand-glow),transparent 70%);opacity:.72}
.flow:after{bottom:-32vh;left:-22vw;width:60vw;height:60vw;max-width:800px;max-height:800px;
  background:radial-gradient(closest-side,var(--brand-glow),transparent 70%);opacity:.42}

.flow-bar{display:flex;align-items:center;gap:14px;padding:18px clamp(18px,4vw,40px);
  position:relative;z-index:2}
.flow-bar .spacer{flex:1}
.flow-bar a{font-size:14px;font-weight:600;color:var(--muted)}
.flow-bar a:hover{color:var(--ink);text-decoration:none}

/* The wordmark. Rounded square in the brand, the name beside it. */
.logo{display:inline-flex;align-items:center;gap:12px;color:var(--ink)}
.logo:hover{text-decoration:none}
.logo .sq{width:34px;height:34px;border-radius:11px;display:grid;place-items:center;
  background:linear-gradient(145deg,var(--brand),var(--brand-deep));color:#fff;
  font-size:17px;flex-shrink:0}
.logo b{font-size:17px;font-weight:600;letter-spacing:-.035em}

.flow-body{flex:1;display:flex;align-items:center;justify-content:center;
  padding:clamp(12px,3vw,40px) clamp(18px,4vw,40px) clamp(40px,8vw,80px);position:relative;z-index:2}
/* One width, declared on the wrapper and read by the card AND by anything
   under it. The footer card was written at 470px — the base .flow-card width
   — on a page whose card is .wide at 720px, so it sat narrower than the thing
   it belongs to. Two places holding the same number is how that happens, so
   now there is one. */
.flow{--flow-w:470px}
.flow:has(.flow-card.wide){--flow-w:720px}
.flow-card{width:100%;max-width:var(--flow-w)}
.flow-foot{text-align:center;font-size:13.5px;color:var(--muted);
  padding:0 24px clamp(22px,4vw,34px);position:relative;z-index:2}

/* ── The way out of a long form ──────────────────────────────────────────────
   An address set in muted 13.5px under a five-step application is a line
   people's eyes skip, and somebody stuck on step three needs it most. This
   gives it a surface of its own and the legal links a quiet row beneath,
   so the two are not competing for the same glance.

   Scoped to .flow-ask rather than restyling .flow-foot, because that class
   also carries the one-line footer on every sign-in and reset page, where a
   card this size would be the loudest thing on screen. */
.flow-ask{max-width:var(--flow-w);margin:0 auto;display:flex;gap:14px;text-align:left;
  align-items:flex-start;padding:16px 18px;border-radius:var(--r-lg);
  background:var(--brand-soft);border:1px solid var(--brand-line)}
.flow-ask .tile-ico{flex-shrink:0;width:38px;height:38px;border-radius:12px;
  display:grid;place-items:center;font-size:18px;
  background:var(--surface);color:var(--brand-deep)}
.flow-ask b{display:block;font-size:14.5px;color:var(--ink);letter-spacing:-.01em}
.flow-ask a{display:inline-block;margin-top:2px;font-size:15px;font-weight:600;
  color:var(--brand-deep);text-decoration:none;word-break:break-all}
.flow-ask a:hover{text-decoration:underline}
.flow-ask p{margin:6px 0 0;font-size:13px;color:var(--muted);line-height:1.5}

/* Set apart from the card above it, and from each other, so neither reads as
   part of the sentence next to it. */
.flow-legal{max-width:var(--flow-w);margin:14px auto 0;display:flex;justify-content:center;
  align-items:center;gap:14px;flex-wrap:wrap;font-size:13px}
.flow-legal a{color:var(--muted);text-decoration:none}
/* The row already separates these by 14px horizontally, so the reach can be
   added on the block axis without two targets ever touching. */
@media (pointer:coarse), (max-width:900px){
  .flow-legal a{display:inline-flex;align-items:center;min-height:44px;
    padding-block:11px;margin-block:-11px}
}
.flow-legal a:hover{color:var(--ink);text-decoration:underline}
.flow-legal span{color:var(--line);user-select:none}

.card-pane{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-xl);
  box-shadow:var(--sh-lg);padding:clamp(24px,4vw,38px)}

/* ============================================================================
   ONBOARDING — one question at a time
   ----------------------------------------------------------------------------
   The same shape as the signup on the marketing site, on purpose: somebody
   who has just answered six questions out there should not arrive here and
   find a different kind of form. One question, its answer, and nothing else
   on the screen — because the alternative is a two-column setup wizard, and
   a two-column setup wizard on a phone is one column with the important half
   underneath the fold.
   ========================================================================== */
.ob{position:relative}
.ob-rail{height:3px;background:var(--line-soft);border-radius:var(--pill);overflow:hidden;
  margin:0 0 clamp(26px,4vw,40px)}
.ob-rail > i{display:block;height:100%;width:0;background:var(--brand);
  border-radius:var(--pill);transition:width var(--t-slow)}

.ob-step{display:none}
.ob-step.on{display:block;animation:obIn .44s cubic-bezier(.22,1,.36,1) both}
@keyframes obIn{from{opacity:0;transform:translateY(14px)}}

.ob-q{font-size:clamp(25px,3.6vw,34px);font-weight:400;letter-spacing:-.035em;
  line-height:1.12;color:var(--ink);margin:0 0 10px;text-wrap:balance}
.ob-sub{font-size:15px;color:var(--muted);margin:0 0 24px;max-width:46ch}
.ob-count{font-size:12px;font-weight:600;letter-spacing:.14em;text-transform:uppercase;
  color:var(--brand-deep);margin:0 0 12px}
.ob-act{display:flex;align-items:center;gap:12px;margin-top:26px;flex-wrap:wrap}
.ob-back{background:transparent;border:0;font:inherit;font-size:14px;font-weight:600;
  color:var(--muted);cursor:pointer;display:inline-flex;align-items:center;gap:6px;
  padding:10px 4px}
.ob-back:hover{color:var(--ink)}
.ob-act .btn{flex:1;min-width:150px}
@media (min-width:560px){ .ob-act .btn{flex:0 0 auto;min-width:190px} }

/* The plan choice. Two cards, and the one that cannot have branches says so
   on its face — not in a footnote, because that is the single difference
   somebody will discover three weeks later and be annoyed about. */
.plans{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr))}
.plan{position:relative;display:block;padding:20px;border:1.5px solid var(--line);
  border-radius:var(--r-lg);background:var(--surface);cursor:pointer;
  transition:border-color var(--t-fast),box-shadow var(--t-fast),transform var(--t-fast)}
.plan:hover{border-color:var(--brand-line);transform:translateY(-2px);box-shadow:var(--sh)}
.plan input{position:absolute;opacity:0;width:0;height:0}
.plan:has(input:checked){border-color:var(--brand);box-shadow:0 0 0 1px var(--brand),var(--sh)}
.plan:has(input:focus-visible){outline:2px solid var(--brand);outline-offset:3px}
.plan-top{display:flex;align-items:baseline;gap:8px;margin-bottom:4px}
.plan-top b{font-size:17px;font-weight:600;color:var(--ink);letter-spacing:-.025em}
.plan-price{font-size:clamp(28px,3.4vw,34px);font-weight:400;color:var(--ink);
  letter-spacing:-.04em;line-height:1.1;margin:8px 0 2px}
.plan-price small{font-size:14px;font-weight:500;color:var(--muted);letter-spacing:0}
.plan ul{list-style:none;margin:14px 0 0;padding:0;display:grid;gap:7px}
.plan li{display:flex;gap:8px;align-items:flex-start;font-size:13.5px;color:var(--muted)}
.plan li i{color:var(--brand);font-size:16px;margin-top:1px;flex-shrink:0}
.plan li.no{color:var(--faint)}
.plan li.no i{color:var(--faint)}
.plan-flag{position:absolute;top:-10px;right:18px;font-size:11.5px;font-weight:600;
  letter-spacing:.08em;text-transform:uppercase;background:var(--brand);color:#fff;
  padding:4px 11px;border-radius:var(--pill)}

/* A summary of what they said, shown on the last step. Hairline rows, label
   left, answer right — read back rather than re-asked. */
.recap{border-top:1px solid var(--line);margin-top:6px}
.recap div{display:flex;gap:16px;align-items:baseline;padding:11px 0;
  border-bottom:1px solid var(--line-soft);font-size:14.5px}
.recap dt{color:var(--muted);flex:0 0 38%;font-size:13.5px}
.recap dd{margin:0;flex:1;text-align:right;font-weight:600;color:var(--ink);
  letter-spacing:-.015em;overflow-wrap:anywhere}

/* The "building it" moment. Not a spinner with nothing to read — the four
   things actually happening, ticked off as they finish, because a shop
   owner's first impression of the product is this screen. */
.build{display:grid;gap:12px;margin:26px 0 0}
.build div{display:flex;align-items:center;gap:12px;font-size:15px;color:var(--faint);
  transition:color var(--t)}
.build div.on{color:var(--ink)}
.build .tick{width:26px;height:26px;border-radius:50%;border:2px solid var(--line);
  display:grid;place-items:center;flex-shrink:0;font-size:14px;color:transparent;
  transition:background var(--t),border-color var(--t),color var(--t)}
.build div.on .tick{background:var(--brand);border-color:var(--brand);color:#fff}

/* ============================================================================
   THE CARD, AS THE CUSTOMER SEES IT
   ----------------------------------------------------------------------------
   This is the only screen most people will ever see of this product, and they
   will see it standing at a counter with one hand. So: the card is the whole
   screen, it is the shop's colour and not ours, and it moves — because a card
   that turns over is the only thing on a phone that feels like a card.
   ========================================================================== */
.cardpage{min-height:100dvh;display:flex;flex-direction:column;
  background:
    radial-gradient(120% 80% at 50% -10%,var(--brand-soft),transparent 62%),
    var(--paper);
  padding:clamp(16px,4vw,32px);gap:clamp(14px,3vw,22px);align-items:center}
.cardpage-in{width:100%;max-width:440px;display:flex;flex-direction:column;
  gap:clamp(14px,3vw,22px)}

.shopline{display:flex;align-items:center;gap:11px;padding:2px}
.shopline .sq{width:38px;height:38px;border-radius:12px;flex-shrink:0;overflow:hidden;
  background:linear-gradient(145deg,var(--brand),var(--brand-deep));color:#fff;
  display:grid;place-items:center;font-weight:600;font-size:15px;letter-spacing:-.03em}
.shopline .sq img{width:100%;height:100%;object-fit:cover}
.shopline b{display:block;font-size:16px;font-weight:600;color:var(--ink);letter-spacing:-.025em}
.shopline span:not(.meter):not(.badge){display:block;font-size:12.5px;color:var(--muted)}

/* The rig. The stage is tall enough that the card can lift without the page
   reflowing under it. */
.cardstage{perspective:1500px;perspective-origin:50% 44%;padding:6px 0;
  touch-action:manipulation;cursor:pointer;-webkit-tap-highlight-color:transparent}
/* The turn is driven frame by frame from a spring in app.js, writing one
   number (--c-flip). The light and the cast shadow are derived from that
   same number in cards.css, so they move WITH the turn rather than being set
   once at the end of it. */
/* Settling in on first paint: the card arrives slightly turned and lands. */
.cardstage.arrive .card3d{animation:land 1.05s cubic-bezier(.19,1,.22,1) both}
@keyframes land{
  from{transform:rotateY(-26deg) rotateX(9deg) translateY(22px) scale(.93);opacity:0}
  60%{opacity:1}
  to{transform:rotateY(0) rotateX(0) translateY(0) scale(1);opacity:1}
}
.cardstage .hintline{text-align:center;font-size:12.5px;color:var(--muted);
  margin-top:14px;display:flex;align-items:center;justify-content:center;gap:6px}
.cardstage .hintline i{font-size:15px}
/* The hint breathes until the card has been turned once, then stops for good.
   An animation that never stops is an animation you stop seeing. */
.cardstage:not(.turned) .hintline{animation:breathe 2.6s ease-in-out infinite}
@keyframes breathe{0%,100%{opacity:.5}50%{opacity:1}}

/* The stamp landing is in cards.css (.lc-slot.just), so the landing page and
   the customer's card play the same one. */

/* The reward, once the card is full. The one moment in this product worth
   celebrating, so it gets the only gradient fill in the app. */
.won{background:linear-gradient(135deg,var(--brand),var(--brand-deep));color:#fff;
  border-radius:var(--r-lg);padding:22px;text-align:center;box-shadow:var(--sh-lg);
  animation:pop .6s cubic-bezier(.22,1,.36,1) both}
.won .label{color:rgba(255,255,255,.72)}
.won b{display:block;font-size:clamp(23px,4vw,29px);font-weight:500;letter-spacing:-.03em;
  margin:2px 0 6px}
.won p{color:rgba(255,255,255,.82);font-size:14px;margin:0}
.won .code{display:inline-block;margin-top:14px;font-family:var(--mono);font-size:19px;
  letter-spacing:.14em;background:rgba(255,255,255,.17);padding:9px 18px;
  border-radius:var(--pill);border:1px solid rgba(255,255,255,.26)}

/* The progress line under the card. */
/* ── Standing, on the customer's own card ────────────────────────────────
   Where they are and how far the next step is. The badge takes the metal of
   the tier — the same silver and gold as the chip on the card itself — and
   Member takes the shop's own colour, because Member is not yet a rank. */
.standing{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);
  padding:18px 20px}
.standing-top{display:flex;align-items:center;gap:13px}
.standing-top > div{flex:1;min-width:0}
.standing-top b{display:block;font-size:16px;font-weight:600;color:var(--ink);letter-spacing:-.02em}
.standing-top > div > span{display:block;font-size:13.5px;color:var(--muted);margin-top:1px}
.standing-badge{width:42px;height:42px;border-radius:50%;flex:none;display:grid;place-items:center;
  font-size:21px;background:var(--brand-soft);color:var(--brand-deep)}
.standing[data-tier="silver"] .standing-badge{color:#272B33;
  background:linear-gradient(135deg,#F6F7F9,#BCC1CA 42%,#ECEEF1 58%,#9DA3AE);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.85),0 3px 8px -3px rgba(0,0,0,.3)}
.standing[data-tier="gold"] .standing-badge{color:#473205;
  background:linear-gradient(135deg,#FFF3C9,#E3B94C 42%,#FFEBAD 58%,#B98A2C);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.85),0 3px 8px -3px rgba(0,0,0,.3)}
.standing .bar{margin-top:14px}
.standing > p{font-size:13.5px;color:var(--muted);margin:12px 0 0;line-height:1.5}
.standing > p b{color:var(--ink);font-weight:600}
/* Weeks in a row. Flat-out orange rather than the shop's colour: it is the
   one warm thing on the page and it should read as heat on any skin. */
.standing-top .streak{flex:none;display:inline-flex;align-items:center;gap:4px;margin:0;
  padding:5px 10px 5px 8px;border-radius:var(--pill);font-size:12.5px;font-weight:600;
  background:#FFF1E6;color:#B4480F}
.streak i{font-size:15px}

/* ── Along the way: the milestones on this card ──────────────────────────
   One row each. A reward that has been earned and not yet handed over is
   filled with the shop's colour, because it is the only thing on this page
   that asks the customer to do something. */
.miles{display:flex;flex-direction:column;gap:8px}
.mile{display:flex;align-items:center;gap:13px;padding:13px 16px;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r)}
.mile > div{flex:1;min-width:0}
.mile b{display:block;font-size:15px;font-weight:600;color:var(--ink);letter-spacing:-.015em}
.mile span:not(.mile-at):not(.code){display:block;font-size:13px;color:var(--muted);margin-top:1px}
.mile-at{width:34px;height:34px;border-radius:50%;flex:none;display:grid;place-items:center;
  font-size:14px;font-weight:600;border:1.5px dashed var(--brand-line);color:var(--brand-deep)}
.mile.used{opacity:.62}
.mile.used .mile-at,.mile.passed .mile-at{border-style:solid;border-color:var(--line);color:var(--muted)}
.mile.ready{background:linear-gradient(135deg,var(--brand),var(--brand-deep));border-color:transparent}
.mile.ready b{color:#fff}
.mile.ready span:not(.mile-at):not(.code){color:rgba(255,255,255,.82)}
.mile.ready .mile-at{border:0;background:rgba(255,255,255,.2);color:#fff}
.mile .code{flex:none;font-family:var(--mono);font-size:14px;letter-spacing:.06em;
  padding:6px 10px;border-radius:10px;background:rgba(255,255,255,.18);color:#fff}

.progress{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);
  padding:18px 20px;box-shadow:var(--sh-sm)}
.progress-top{display:flex;align-items:baseline;gap:10px;margin-bottom:12px}
.progress-top b{font-size:16px;font-weight:600;color:var(--ink);letter-spacing:-.02em}
.progress-top span{margin-left:auto;font-size:13px;color:var(--muted);
  font-variant-numeric:tabular-nums}

/* Where to use it. A shop with branches has to say which ones honour the
   card, or the customer finds out at the wrong counter. */
.branches{display:grid;gap:1px;background:var(--line-soft);border-radius:var(--r);
  overflow:hidden;border:1px solid var(--line)}
.branches div{background:var(--surface);padding:13px 16px;font-size:14px}
.branches b{display:block;font-weight:600;color:var(--ink);letter-spacing:-.015em}
.branches span:not(.meter):not(.badge){display:block;font-size:12.5px;color:var(--muted);margin-top:1px}

/* ============================================================================
   JOIN — the page behind the poster's QR
   ========================================================================== */
.join-hero{text-align:center;padding:4px 0 2px}
.join-hero .sq{width:62px;height:62px;border-radius:20px;margin:0 auto 16px;
  background:linear-gradient(145deg,var(--brand),var(--brand-deep));color:#fff;
  display:grid;place-items:center;font-size:26px;font-weight:600;letter-spacing:-.03em;
  overflow:hidden;box-shadow:var(--sh)}
.join-hero .sq img{width:100%;height:100%;object-fit:cover}
.join-hero h1{font-size:clamp(25px,5vw,33px);margin-bottom:8px}
.join-hero p{color:var(--muted);max-width:34ch;margin:0 auto}

/* The consent line. PDPA wants consent for marketing captured separately from
   consent to run the service, and it has to be a positive act — so it is an
   unticked box with its own sentence, never a pre-ticked one. */
.consent{display:flex;gap:11px;align-items:flex-start;padding:14px;border-radius:var(--r);
  background:var(--surface-2);font-size:13.5px;color:var(--muted);line-height:1.5;
  cursor:pointer}
.consent input{width:19px;height:19px;margin:1px 0 0;flex-shrink:0;accent-color:var(--brand)}

@media (max-width:600px){
  .card-pane{padding:24px 20px;border-radius:var(--r-lg)}
  .recap dt{flex:0 0 42%}
}

/* The product wordmark on the screens with no shell. The mark brings its own
   size from css/logo.css; .logo only has to place it. */

/* ════════════════════════════════════════════════════════════════════════
   THE CUSTOMER'S CARD — the header
   ------------------------------------------------------------------------
   This screen is opened one-handed, usually at a counter, usually with
   somebody waiting. It has one job: show the card. So the whole header is
   centred above it and sized to leave the card itself on the first screen
   of a phone.

   The mark is its own class rather than .sq. Inside .shopline, .sq was a
   <span> being caught by `.shopline span:not(.meter):not(.badge)`, which is
   MORE specific than `.shopline .sq` — so the shop's initial rendered in
   muted grey at 12.5px on a purple tile, which reads as an empty square.
   That is the "missing logo".
   ══════════════════════════════════════════════════════════════════════ */
.cardtop{display:flex;flex-direction:column;align-items:center;text-align:center;
  gap:0;padding:clamp(2px,1vh,10px) 0 clamp(8px,1.4vh,14px)}

/* The shop: mark and name on one line. */
.cardtop-shopline{display:flex;align-items:center;justify-content:center;
  gap:clamp(9px,2.5vw,12px);min-width:0;max-width:100%}
.cardtop-mark{width:clamp(34px,9vw,40px);aspect-ratio:1;border-radius:12px;
  flex:none;overflow:hidden;display:grid;place-items:center;
  background:linear-gradient(145deg,var(--brand),var(--brand-deep));
  color:#fff;font-weight:700;font-size:clamp(16px,4.2vw,19px);letter-spacing:-.03em;
  box-shadow:0 7px 18px -10px color-mix(in srgb,var(--brand) 70%,transparent)}
.cardtop-mark img{width:100%;height:100%;object-fit:cover}
.cardtop-shop{font-size:clamp(16px,4.3vw,19px);font-weight:600;letter-spacing:-.025em;
  color:var(--ink);line-height:1.2;min-width:0;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* The member's own name — the largest thing on the screen, because it is
   the only line here that is about the person reading it. */
.cardtop-who{font-size:clamp(24px,7vw,30px);font-weight:600;letter-spacing:-.03em;
  color:var(--ink);margin:clamp(8px,1.6vh,14px) 0 0;line-height:1.15}
.cardtop-since{font-size:11.5px;color:var(--faint);margin:3px 0 0;letter-spacing:.01em}

/* ── One screen on a phone ───────────────────────────────────────────────
   Every gap here is viewport-relative so the card, the progress and the
   first action land above the fold on a small handset rather than the
   customer scrolling to find out how many stamps they have. */
@media (max-height:760px){
  .cardpage-in{gap:clamp(8px,1.4vh,14px)}
  .cardtop{padding-top:0;padding-bottom:6px}
  .cardtop-who{font-size:clamp(22px,6.4vw,26px);margin-top:9px}
  .hintline{margin:5px 0 0;font-size:12px}
}
@media (max-height:640px){
  .cardtop-mark{width:32px;border-radius:10px}
  .cardtop-shop{font-size:15.5px}
  .cardtop-who{font-size:21px;margin-top:7px}
  .cardtop-since{display:none}       /* the least useful line, first to go */
}

/* ── The card page's foot ────────────────────────────────────────────────
   Two things, in order of who they are for: whose product this is, and
   what the customer can do about their own data. The second is the one
   that matters legally and it is deliberately NOT smaller than the first.
   ---------------------------------------------------------------------- */
.cardfoot{display:flex;flex-direction:column;align-items:center;gap:10px;
  padding:14px 0 4px;text-align:center}
.cardfoot-by{display:flex;align-items:center;justify-content:center;gap:7px;
  flex-wrap:wrap;margin:0;font-size:13px;color:var(--muted)}
.cardfoot-by a{display:inline-flex;line-height:0;opacity:.85;
  transition:opacity var(--t-fast)}
.cardfoot-by a:hover{opacity:1}
.cardfoot-wm{height:15px;width:auto;display:block}
.cardfoot-data{margin:0;font-size:12px;line-height:1.55;color:var(--faint);
  max-width:40ch}
.cardfoot-data a{color:var(--muted);text-decoration:underline}
.cardfoot-data a:hover{color:var(--ink)}
/* On a short phone the attribution goes before the data line does. */
@media (max-height:640px){
  .cardfoot{gap:7px;padding-top:10px}
  .cardfoot-by{font-size:12px}
}
