/* ============================================================================
   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}
.flow-card{width:100%;max-width:470px}
.flow-card.wide{max-width:720px}
.flow-foot{text-align:center;font-size:13.5px;color:var(--muted);
  padding:0 24px clamp(22px,4vw,34px);position:relative;z-index:2}

.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}
/* No transition on the rig: the turn is driven frame by frame in app.js so
   that the highlight and the cast shadow move WITH it. A transition animated
   the transform alone and left paint() to set the sheen and the shadow once,
   at the target — so the card turned over half a second while the light on it
   changed instantly, which is the sort of thing you feel before you see. */
.cardstage:active .card3d{transition:transform .12s}
/* 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}}

/* A stamp that has just landed. One pop, on the newest circle only. */
.lc-slot.just{animation:stamped .62s cubic-bezier(.3,1.6,.5,1) both}
@keyframes stamped{
  0%{transform:scale(.3);opacity:0}
  55%{transform:scale(1.18);opacity:1}
  100%{transform:scale(1);opacity:1}
}

/* 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. */
.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. */
