/* EasyPOS Display (web): the counter screen, the same look as the Android counter app. */
@font-face { font-family: Faruma; src: url(faruma.ttf) format("truetype"); font-display: swap; }

:root {
  --bg: #f6f7f9; --panel: #fff; --line: #e7e9ee; --ink: #0f172a; --ink2: #334155; --muted: #64748b;
  --teal: #0d9488; --teal-dark: #0f766e; --teal-soft: #e6f6f4; --paymv: #2b5ba0; --danger: #dc2626;
  --easy-blue: #1d5bd8;
  --enter: cubic-bezier(.05, .7, .1, 1); --exit: cubic-bezier(.3, 0, .8, .15);
  --reveal: cubic-bezier(.4, 0, .2, 1); --close: cubic-bezier(.4, 0, 1, 1); --pop: cubic-bezier(.34, 1.45, .64, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.thaana { font-family: Faruma, system-ui, sans-serif; direction: rtl; unicode-bidi: isolate; }
.noscript { padding: 24px; }

/* ---------------- customer display ----------------
   1rem = 16px on a 1600x900 landscape screen (or 820 wide portrait), scaled to fit any size. */
.display { position: fixed; inset: 0; display: flex; flex-direction: column; font-size: min(1vw, 1.778vh); padding: 1.5em 1.5em 0;
  user-select: none; -webkit-user-select: none; cursor: default; overflow: hidden; }
.display .row { flex: 1; display: flex; gap: 1.5em; min-height: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 2em; position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; padding: 1.75em; min-width: 0; min-height: 0; }
.panel.qr { flex: 1; }
.panel.qr.two { flex: 1.15; }
.panel.msg { flex: 1; }
.scanhead { display: flex; flex-direction: column; align-items: center; }
.scan { font-size: 2.125em; font-weight: 700; color: var(--teal-dark); margin: 0; }
.paymv { background: var(--paymv); color: #fff; font-size: .8125em; font-weight: 700; padding: .38em 1.1em; border-radius: 999px; margin-top: .5em; }
.qrarea { flex: 1; width: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; }
.qrone, .qrpair > div { display: flex; flex-direction: column; align-items: center; gap: .9em; min-width: 0; }
.qrpair { display: flex; align-items: stretch; justify-content: center; width: 100%; }
.qrpair > div { flex: 1; }
.qrpair > .sep { flex: 0 0 1px; background: var(--line); margin: 1.25em 0; }
canvas.qrc { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.acct { text-align: center; max-width: 100%; }
.acct b { display: block; font-size: 1.25em; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct span { font-size: 1em; letter-spacing: .06em; color: var(--ink2); }
.bank { font-size: .875em; font-weight: 700; padding: .3em .8em; border-radius: .5em; background: #e6f4f2; color: #0f766e; }
.bank.bml { background: #e8eef8; color: #1e3a8a; } .bank.mib { background: #e7f5ee; color: #166534; }
.hint { font-size: .875em; color: var(--muted); margin: 0; text-align: center; }
.waiting { color: var(--muted); font-size: 1.25em; text-align: center; max-width: 22em; line-height: 1.5; }
.footer { height: 3.75em; flex: none; display: flex; align-items: center; justify-content: center; }
.powered { font-size: .875em; color: var(--muted); display: flex; align-items: baseline; gap: .55em; }
.powered .logo { font-size: 1.45em; font-weight: 900; letter-spacing: -.02em; color: #111; }
.powered .logo i { font-style: normal; color: var(--easy-blue); }
.gear { position: absolute; top: .4em; right: .5em; width: 2.4em; height: 2.4em; border: 0; background: none; padding: .3em; color: #cbd5e1; cursor: pointer; border-radius: 50%; }
.gear svg { width: 100%; height: 100%; fill: currentColor; }
.gear:focus-visible { outline: 2px solid var(--teal); }

.msgbody { position: absolute; inset: 1.75em; display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; }
.panel.msg.has-problem .msgbody { bottom: 6.5em; }
.lines { display: flex; flex-direction: column; align-items: center; gap: 1.125em; }
.lines p { margin: 0; text-align: center; font-weight: 700; }
#welcomeLines p { font-size: 4em; line-height: 1.12; color: var(--teal-dark); }
#welcomeLines p.thaana { font-size: 3.6em; line-height: 1.55; }
.shoplogo { width: 8.75em; height: 8.75em; object-fit: contain; border-radius: 1.25em; }
.toqr { display: flex; align-items: center; gap: .6em; font-size: 1.5em; color: var(--ink2); }
.toqr svg { width: 1.3em; height: 1.3em; stroke: var(--teal); stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(-.5em); } }

.reveal { position: absolute; inset: 0; background: var(--teal); clip-path: circle(0 at 50% 24%); pointer-events: none; }
.reveal.open { clip-path: circle(150% at 50% 24%); transition: clip-path 620ms var(--reveal); }
.reveal.closing { clip-path: circle(0 at 50% 24%); transition: clip-path 520ms var(--close); }
.paidbody { color: #fff; }
.tick { width: 7.5em; height: 7.5em; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 .5em 1.5em rgba(0, 0, 0, .15);
  transform: scale(0); }
.tick svg { width: 3.5em; stroke: var(--teal); stroke-width: 3.6; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; }
.go .tick { animation: pop 560ms var(--pop) 300ms forwards; }
.go .tick svg { animation: draw 420ms cubic-bezier(.2, 0, 0, 1) 620ms forwards; }
@keyframes pop { to { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.paidmid { display: flex; flex-direction: column; align-items: center; gap: .5em; max-width: 100%; }
.what { font-size: 1.5em; opacity: .9; }
.amt { font-size: 4.75em; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; text-align: center; font-variant-numeric: tabular-nums; }
.from { font-size: 1.875em; font-weight: 500; margin-top: .4em; text-align: center; max-width: 100%; overflow-wrap: anywhere; }
.from.check { font-size: 1.5em; font-weight: 400; max-width: 18em; line-height: 1.4; }
#greetingLines p { font-size: 2.75em; line-height: 1.2; }
#greetingLines p.thaana { font-size: 2.5em; line-height: 1.6; }

/* Rise in: each piece fades and slides up after its own delay (--d). */
.rise { opacity: 0; transform: translateY(1.1em); }
.go .rise, .go.rise { animation: rise 520ms var(--enter) var(--d, 0ms) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
.leaving { animation: leave 180ms var(--exit) forwards !important; }
@keyframes leave { to { opacity: 0; transform: translateY(-.4em); } }

.problem { position: absolute; left: 1.75em; right: 1.75em; bottom: 1.75em; background: #fef2f2; color: #991b1b; border-radius: 1em;
  padding: .9em 1em; display: flex; gap: .6em; align-items: center; font-weight: 500; font-size: 1em; }
.problem svg { width: 1.4em; height: 1.4em; fill: var(--danger); flex: none; }

/* portrait: message on top, QR below */
.portrait-only { display: none !important; }
@media (orientation: portrait) {
  .display { font-size: min(1.95vw, 1.355vh); padding: 1em; }
  .display .row { flex-direction: column; gap: 1em; }
  .panel.msg { order: -1; flex: 1; }
  .panel.qr { flex: 1.35; }
  .panel.qr.two { flex: 1.5; }
  .display.two .panel.msg { flex: .8; }
  #welcomeLines p { font-size: 2.9em; } #welcomeLines p.thaana { font-size: 2.75em; }
  .shoplogo { width: 5.25em; height: 5.25em; }
  .toqr { font-size: 1.2em; }
  .toqr svg { animation-name: nudgedown; }
  .tick { width: 4.5em; height: 4.5em; } .tick svg { width: 2.2em; }
  .amt { font-size: 3.25em; } .what { font-size: 1.1em; } .from { font-size: 1.35em; }
  #greetingLines p { font-size: 1.9em; } #greetingLines p.thaana { font-size: 1.75em; }
  .lines { gap: .75em; }
  .landscape-only { display: none !important; }
  .portrait-only { display: revert !important; }
  .powered.portrait-only { display: flex !important; font-size: .8125em; }
  .reveal { clip-path: circle(0 at 50% 22%); }
  .reveal.open { clip-path: circle(150% at 50% 22%); }
  .reveal.closing { clip-path: circle(0 at 50% 22%); }
}
@keyframes nudgedown { 50% { transform: translateY(.5em); } }

@media (prefers-reduced-motion: reduce) {
  .toqr svg { animation: none; }
}

/* ---------------- tap to start ---------------- */
.veil { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: grid; place-items: center; z-index: 10; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.startcard { background: #fff; border-radius: 28px; padding: 40px 44px; width: min(560px, calc(100vw - 32px)); text-align: center; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
.startcard .icon { width: 84px; height: 84px; border-radius: 50%; background: var(--teal-soft); display: grid; place-items: center; margin: 0 auto 20px; }
.startcard .icon svg { width: 40px; fill: var(--teal-dark); }
.startcard h2 { font-size: 28px; margin: 0 0 8px; }
.startcard p { color: var(--ink2); font-size: 17px; line-height: 1.5; margin: 0 0 24px; }

/* ---------------- pages: setup, PIN, staff ---------------- */
.page { min-height: 100%; display: flex; flex-direction: column; }
.topbar { height: 72px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 24px; font-size: 22px; font-weight: 600; }
.topbar .sub { margin-left: auto; font-size: 14px; font-weight: 400; color: var(--muted); }
.iconbtn { width: 44px; height: 44px; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.iconbtn svg { width: 24px; stroke: var(--ink); stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn:hover { background: rgba(15, 23, 42, .06); }
.pagebody { flex: 1; padding: 8px 24px 32px; }
.pagebody.center { display: flex; justify-content: center; align-items: flex-start; }
.pagebody.split { display: flex; gap: 24px; align-items: flex-start; }
.pagebody.split .col { flex: 1; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.pagebody.split .payments { flex: 0 1 460px; }
@media (max-width: 900px) { .pagebody.split { flex-direction: column; align-items: stretch; } .pagebody.split .payments { flex: none; } }
.card { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 28px; }
.card.narrow { width: min(640px, 100%); }
.card.wide { width: min(1080px, 100%); }
.card h2 { font-size: 28px; margin: 0 0 8px; font-weight: 600; line-height: 1.25; }
.steps { display: flex; gap: 8px; margin-bottom: 20px; }
.steps span { height: 6px; flex: 1; border-radius: 3px; background: var(--line); }
.steps span.on { background: var(--teal-dark); }
.step-label { font-size: 14px; color: var(--muted); margin: 0 0 6px; }
.lead { font-size: 17px; color: var(--ink2); line-height: 1.5; margin: 0 0 24px; }
label.f { display: block; font-size: 14px; color: var(--ink2); margin: 0 0 6px; font-weight: 500; }
.input { display: block; width: 100%; height: 56px; border: 1px solid #cfd6de; border-radius: 14px; padding: 0 16px; font: inherit; font-size: 18px; margin: 0 0 18px; background: #fff; color: var(--ink); }
.input:focus { outline: 2px solid var(--teal-dark); outline-offset: 0; border-color: transparent; }
.input.code { font-size: 32px; letter-spacing: .4em; text-align: center; font-weight: 600; height: 72px; }
.btn { font: inherit; font-weight: 600; font-size: 17px; border: 0; border-radius: 14px; padding: 14px 28px; background: var(--teal-dark); color: #fff; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn:focus-visible { outline: 3px solid #99d5cf; outline-offset: 2px; }
.btn.ghost { background: transparent; color: var(--teal-dark); border: 1px solid #cfd6de; }
.btn.ghost:hover { background: var(--teal-soft); filter: none; }
.btn.small { padding: 9px 16px; font-size: 15px; }
.btn.danger { color: var(--danger); }
.btn.wide { width: 100%; }
.btnrow { display: flex; gap: 12px; margin-top: 12px; }
.linkbtn { display: block; margin: 16px auto 0; border: 0; background: none; color: var(--teal-dark); font: inherit; font-size: 15px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.note { font-size: 14px; color: var(--muted); line-height: 1.5; }
.error { color: #991b1b; background: #fef2f2; border-radius: 12px; padding: 12px 14px; font-size: 15px; line-height: 1.45; margin: 0 0 16px; }
.checkline { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 15px; margin: -6px 0 18px; }
.checkline::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.checkline.ok { color: #166534; } .checkline.bad { color: #991b1b; } .checkline.wait { color: var(--muted); }
ol.how { margin: 0; padding-left: 22px; font-size: 17px; line-height: 1.8; color: var(--ink2); }
ol.how b { color: var(--ink); }
.pairgrid { display: flex; gap: 48px; align-items: flex-start; }
.pairgrid > div:first-child { flex: 1; }
.pairqr { display: flex; flex-direction: column; align-items: center; gap: 12px; }
#pairQr { width: 360px; height: 360px; display: grid; place-items: center; }
@media (max-width: 860px) { .pairgrid { flex-direction: column-reverse; align-items: center; } #pairQr { width: 300px; height: 300px; } }
.peer { display: flex; align-items: center; gap: 12px; background: var(--teal-soft); border-radius: 14px; padding: 14px 16px; margin-bottom: 20px; color: var(--teal-dark); font-weight: 500; }
.peer svg { width: 22px; fill: var(--teal-dark); flex: none; }

.status { display: flex; gap: 14px; align-items: center; }
.status .dot { width: 14px; height: 14px; border-radius: 50%; background: #16a34a; flex: none; box-shadow: 0 0 0 5px rgba(22, 163, 74, .15); }
.status .dot.bad { background: var(--danger); box-shadow: 0 0 0 5px rgba(220, 38, 38, .12); }
.status .dot.wait { background: #d97706; box-shadow: 0 0 0 5px rgba(217, 119, 6, .14); }
.status b { font-size: 18px; font-weight: 500; display: block; }
.status span { color: var(--muted); font-size: 15px; }
.list { padding-top: 12px; padding-bottom: 12px; }
.list .item { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); cursor: default; }
.list .item:first-child { border-top: 0; }
.list label.item { cursor: pointer; }
.list .item.block { display: block; }
.itemrow { display: flex; align-items: center; gap: 16px; }
.list .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--teal-soft); display: grid; place-items: center; flex: none; }
.list .ic svg { width: 22px; fill: var(--teal-dark); }
.list .ic.danger { background: #fef2f2; } .list .ic.danger svg { fill: var(--danger); }
.list .t { flex: 1; min-width: 0; } .list .t b { display: block; font-size: 17px; font-weight: 500; } .list .t span { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
input.switch { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; border-radius: 14px; background: #cbd5e1; position: relative; cursor: pointer; flex: none; margin: 0; transition: background-color .15s; }
input.switch::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: transform .15s var(--enter); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
input.switch:checked { background: var(--teal-dark); }
input.switch:checked::after { transform: translateX(20px); }
input.switch:focus-visible { outline: 3px solid #99d5cf; outline-offset: 2px; }
input[type=range] { width: calc(100% - 60px); margin: 12px 0 4px 60px; accent-color: var(--teal-dark); }
h3.sec { font-size: 15px; color: var(--muted); font-weight: 500; margin: 0 0 12px; }
.pay { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 16px; }
.pay:first-child { border-top: 0; }
.pay span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { color: var(--muted); font-size: 15px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px; z-index: 20; max-width: calc(100vw - 32px); }
