/* ACE Loyalty · cashier page. Same language as the ACE POS: Readex Pro, borderless white
   panels on #f4f5f7, tinted tiles, orange primary with dark text. */
:root {
  --bg: #f4f5f7; --panel: #ffffff; --ink: #14161a; --ink-2: #5d636e; --ink-3: #9aa0aa; --line: #e8eaee;
  --primary: #ff6b1a; --primary-ink: #1a0d04; --ok: #16a34a; --ok-bg: #e7f7ed; --warn: #b45309; --warn-bg: #fff4e5;
  --ease: cubic-bezier(.16, 1, .3, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink); font: 400 16px/1.55 'Readex Pro', system-ui, sans-serif; -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 10px; }
.wrap { width: min(520px, 100% - 28px); margin-inline: auto; padding: 14px 0 30px; }
.hidden { display: none !important; }

/* top */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 14px; }
.top b { font-size: 18px; font-weight: 700; display: block; line-height: 1.3; }
.top small { color: var(--ink-3); font-size: 13px; }
.icon-btn { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 21px; background: var(--panel); color: var(--ink-2); transition: transform .15s var(--ease); }
.icon-btn:active { transform: scale(.94); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { border-radius: 18px; padding: 12px 14px; }
.stat i { font-size: 20px; }
.stat b { display: block; font-size: 26px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; }
.stat--a { background: #fff1e8; color: #9a3a05; }
.stat--b { background: #eaf2ff; color: #1d4ed8; }
.stat--c { background: #eaf8ef; color: #15803d; }
.stat b.bump { animation: bump .5s var(--spring); }
@keyframes bump { 40% { transform: scale(1.25); } }

/* scanner */
.panel { background: var(--panel); border-radius: 22px; padding: 14px; margin-top: 12px; }
.scan { position: relative; aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: #0f1115; display: grid; place-items: center; }
.scan video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan__frame { position: absolute; inset: 18%; pointer-events: none; }
.scan__frame::before, .scan__frame::after { content: ""; position: absolute; inset: 0; border: 3px solid #fff; border-radius: 22px;
  -webkit-mask: conic-gradient(#000 0 0) top left / 28% 28% no-repeat, conic-gradient(#000 0 0) top right / 28% 28% no-repeat, conic-gradient(#000 0 0) bottom left / 28% 28% no-repeat, conic-gradient(#000 0 0) bottom right / 28% 28% no-repeat;
          mask: conic-gradient(#000 0 0) top left / 28% 28% no-repeat, conic-gradient(#000 0 0) top right / 28% 28% no-repeat, conic-gradient(#000 0 0) bottom left / 28% 28% no-repeat, conic-gradient(#000 0 0) bottom right / 28% 28% no-repeat; }
.scan__frame::after { border: 0; height: 2px; top: 50%; background: linear-gradient(90deg, transparent, var(--primary), transparent); -webkit-mask: none; mask: none; animation: sweep 2.2s ease-in-out infinite; }
@keyframes sweep { 0%, 100% { transform: translateY(-120px); } 50% { transform: translateY(120px); } }
.scan__idle { position: relative; z-index: 2; display: grid; justify-items: center; gap: 12px; color: #cfd3da; text-align: center; padding: 20px; }
.scan__idle i { font-size: 46px; color: #fff; }
.scan.is-live .scan__idle { display: none; }
.scan:not(.is-live) .scan__frame { display: none; }

.search { display: flex; gap: 8px; margin-top: 12px; }
.search input { flex: 1; min-width: 0; height: 52px; border-radius: 16px; border: 0; outline: 0; padding: 0 16px; font-size: 17px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); text-transform: uppercase; }
.search input:focus { box-shadow: inset 0 0 0 2px var(--primary); }
.search input::placeholder { text-transform: none; color: var(--ink-3); }

.btn { height: 52px; padding: 0 20px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; transition: transform .15s var(--ease), background-color .2s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn i { font-size: 20px; }
.btn--primary { background: var(--primary); color: var(--primary-ink); }
.btn--ok { background: var(--ok); color: #fff; }
.btn--soft { background: var(--bg); color: var(--ink); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--block { width: 100%; }
.btn--xl { height: 64px; font-size: 19px; border-radius: 18px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }

/* PIN */
.login { min-height: calc(100dvh - 60px); display: grid; align-content: center; justify-items: center; gap: 18px; text-align: center; }
.login .logo { width: 64px; height: 64px; border-radius: 20px; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 30px; }
.login h1 { margin: 0; font-size: 22px; }
.login p { margin: 0; color: var(--ink-2); }
.dots { display: flex; gap: 12px; height: 18px; }
.dots span { width: 14px; height: 14px; border-radius: 50%; background: var(--line); transition: background-color .15s, transform .2s var(--spring); }
.dots span.is-on { background: var(--ink); transform: scale(1.1); }
.dots.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 12px; direction: ltr; }   /* phone keypad order: 1 2 3 */
.pad button { height: 64px; border-radius: 20px; background: var(--panel); font-size: 24px; font-weight: 600; transition: transform .1s, background-color .15s; }
.pad button:active { transform: scale(.93); background: #e9ebef; }
.pad .go { background: var(--primary); color: var(--primary-ink); font-size: 22px; }
.err { color: #c2410c; min-height: 22px; font-size: 14px; }

/* result sheet */
.sheet-bg { position: fixed; inset: 0; z-index: 40; background: rgba(15,17,21,.45); opacity: 0; transition: opacity .25s; }
.sheet { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-width: 560px; margin-inline: auto; background: var(--panel);
  border-radius: 26px 26px 0 0; padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .4s var(--ease);
  box-shadow: 0 -18px 50px rgba(15,17,21,.25); }
.sheet.is-on { transform: none; }
.sheet-bg.is-on { opacity: 1; }
.grip { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 14px; }
.who { display: flex; align-items: center; gap: 14px; }
.who .av { width: 52px; height: 52px; border-radius: 16px; background: #fff1e8; color: #9a3a05; display: grid; place-items: center; font-size: 22px; font-weight: 700; flex: none; }
.who b { font-size: 20px; display: block; line-height: 1.3; }
.who small { color: var(--ink-3); font-size: 14px; direction: ltr; display: inline-block; }
.prog { margin: 16px 0 4px; display: flex; flex-wrap: wrap; gap: 7px; }
.prog span { width: 26px; height: 26px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line); }
.prog span.is-on { background: var(--primary); box-shadow: none; }
.prog span.is-new { animation: pop .5s var(--spring); }
@keyframes pop { 0% { transform: scale(1.8); opacity: 0; } 100% { transform: none; opacity: 1; } }
.prog-label { font-size: 15px; color: var(--ink-2); }
.prog-label b { color: var(--ink); font-variant-numeric: tabular-nums; }
.note { margin-top: 12px; padding: 10px 14px; border-radius: 14px; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.note--warn { background: var(--warn-bg); color: var(--warn); }
.note--ok { background: var(--ok-bg); color: var(--ok); }
.done { display: grid; justify-items: center; gap: 6px; padding: 12px 0 4px; text-align: center; }
.done .tick { width: 76px; height: 76px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 40px; animation: pop .5s var(--spring); }
.done b { font-size: 22px; }
.done span { color: var(--ink-2); }

/* join QR (full screen, to show customers) */
.qr-full { position: fixed; inset: 0; z-index: 50; background: #fff; display: grid; place-content: center; justify-items: center; gap: 16px; padding: 24px; text-align: center; }
.qr-full .box { width: min(78vw, 360px); aspect-ratio: 1; }
.qr-full .box svg { width: 100%; height: 100%; }
.qr-full h2 { margin: 0; font-size: 24px; }
.qr-full p { margin: 0; color: var(--ink-2); }

.toast { position: fixed; z-index: 60; left: 50%; top: calc(14px + env(safe-area-inset-top)); max-width: calc(100% - 28px); padding: 12px 18px; border-radius: 14px; background: var(--ink); color: #fff;
  box-shadow: 0 16px 40px -10px rgba(0,0,0,.4); opacity: 0; transform: translate(-50%, -14px); transition: opacity .25s, transform .35s var(--ease); font-size: 15px; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast--error { background: #c2410c; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
