/* Loyalty card web app. Colours are filled in by build.py. */
:root {
  --brand: #7A3E1D;
  --on-brand: #FFFFFF;
  --brand-ink: #7A3E1D;
  --tint: #F3EEEB;
  --ink: #1b1b1b;
  --muted: #4a4f57;
  --line: #c9ced6;
  --bg: #ffffff;
  --ok: #0f6b3a;
  --bad: #a4161a;
  --tabs-h: 64px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px));
}
.sprite { position: absolute; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; color: var(--ink); padding: 10px 14px; z-index: 20; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.top :focus-visible { outline-color: var(--on-brand); }
.ribbon :focus-visible { outline-color: #fff; }

.ribbon { margin: 0; padding: 8px 16px; background: #1b1b1b; color: #fff; font-size: 14px; text-align: center; }
.ribbon a { color: #fff; font-weight: 700; white-space: nowrap; display: inline-block; padding: 4px 0; }
/* The header's own colour fills the space beside a phone's notch or status bar. */
header { background: var(--brand); padding-top: env(safe-area-inset-top, 0px); }
header.example { background: #1b1b1b; }
.top {
  display: flex; align-items: center; gap: 12px;
  background: var(--brand); color: var(--on-brand);
  padding: 12px 16px;
}
.logo { border-radius: 10px; display: block; }
.top p { margin: 0; }
.biz { font-size: 20px; font-weight: 700; line-height: 1.2; }
.sub { font-size: 15px; }

main { max-width: 560px; margin: 0 auto; padding: 18px 16px 28px; }
main:focus { outline: none; }
h1 { font-size: 24px; line-height: 1.2; margin: 0 0 14px; }
h2 { font-size: 19px; margin: 22px 0 8px; }
p { margin: 0 0 12px; }
a { color: var(--brand-ink); }

.card { background: var(--tint); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.progress { font-size: 19px; font-weight: 700; margin-bottom: 14px; }
.stamps { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.slot {
  aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  border: 2px dashed #6b717b; color: #4a4f57; font-weight: 700; font-size: 15px; background: #fff;
}
.slot svg { width: 60%; height: 60%; }
.slot.filled { border: 2px solid var(--brand); background: var(--brand); color: var(--on-brand); }
.slot.reward { border-style: solid; border-color: var(--brand); color: var(--brand-ink); }
.slot.reward.ready { background: var(--brand); color: var(--on-brand); }
.slot.new { animation: pop .5s ease-out; }
@keyframes pop { 0% { transform: scale(.4); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .slot.new { animation: none; } }
.earn { margin: 0; color: var(--muted); font-size: 16px; }

.status { min-height: 1.45em; margin: 14px 0 10px; font-weight: 700; }
.status.ok { color: var(--ok); }
.status.bad { color: var(--bad); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border-radius: 12px;
  border: 2px solid var(--brand-ink); background: #fff; color: var(--brand-ink);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn.primary { width: 100%; background: var(--brand); color: var(--on-brand); border-color: var(--brand); font-size: 18px; min-height: 54px; }
.btn.ghost { border-color: var(--line); color: var(--ink); }
.btn.small { min-height: 44px; padding: 6px 14px; font-size: 16px; }
.btn[disabled] { opacity: .55; cursor: default; }
.hint { color: var(--muted); font-size: 16px; margin: 12px 0 0; }
.demo { margin-top: 14px; color: var(--ink); background: #fff7d6; border: 1px solid #8a6d00; border-radius: 10px; padding: 12px; }
.demo p { margin: 0 0 10px; }
.demo .btn { background: #fff; border-color: var(--ink); color: var(--ink); }
.demo .status { margin: 10px 0 0; min-height: 0; }
.demo .status:empty { display: none; }
.cardno { color: var(--muted); font-size: 15px; margin-top: 14px; }

.tip { margin-bottom: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.tip p { margin-bottom: 10px; }
.tip-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.notice { background: var(--tint); border-left: 5px solid var(--brand); padding: 10px 12px; border-radius: 6px; }
.hours { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.hours dt { font-weight: 700; }
.hours dd { margin: 0; }
address { font-style: normal; margin-bottom: 12px; }
.contact a { display: block; padding: 8px 0; font-weight: 700; }

details { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; }
summary { cursor: pointer; padding: 14px 16px; font-weight: 700; min-height: 48px; }
.inner { padding: 0 16px 14px; }
.inner h2 { font-size: 17px; margin: 16px 0 6px; }
.inner ol, .inner ul { padding-left: 22px; margin: 0 0 12px; }
.inner li { margin-bottom: 8px; }
.ico { width: 20px; height: 20px; vertical-align: -4px; }
.plain { background: var(--tint); padding: 10px 12px; border-radius: 8px; }
.credit { color: var(--muted); font-size: 15px; text-align: center; margin-top: 18px; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabs a {
  min-height: var(--tabs-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 700;
}
.tabs svg { width: 26px; height: 26px; }
.tabs a[aria-current="page"] { color: var(--brand-ink); box-shadow: inset 0 3px 0 var(--brand); }

dialog { border: 0; border-radius: 18px; padding: 20px; width: min(92vw, 380px); color: var(--ink); }
dialog::backdrop { background: rgba(0, 0, 0, .55); }
dialog h2 { margin: 0 0 4px; font-size: 22px; }
.kp-what { color: var(--muted); margin-bottom: 10px; }
.kp-demo { background: #fff7d6; border: 1px solid #8a6d00; border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; font-weight: 700; }
.dots { display: flex; justify-content: center; gap: 12px; min-height: 22px; margin: 6px 0; }
.dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink); }
.dots span.on { background: var(--ink); }
.kp-msg { min-height: 2.9em; margin: 6px 0; color: var(--bad); font-weight: 700; text-align: center; }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.keys button {
  min-height: 58px; border-radius: 12px; border: 1px solid var(--line); background: #f3f4f6; color: var(--ink);
  font: inherit; font-size: 24px; font-weight: 700; cursor: pointer;
}
.keys button.word { font-size: 16px; }
.keys button[disabled] { opacity: .45; }
dialog .btn.ghost { width: 100%; }

/* On a wide screen (a laptop, or a tablet on its side) the web app sits in a phone-wide column,
   so it looks the way it does on a phone. Phones are not changed. */
@media (min-width: 720px) {
  html { background: #e7e9ee; }
  body:not(.manage) { max-width: 440px; min-height: 100vh; margin: 0 auto; box-shadow: 0 0 0 1px var(--line), 0 18px 50px rgba(20, 24, 40, .16); }
  .tabs { left: 50%; right: auto; width: 440px; transform: translateX(-50%); }
}
