/* Forte Booth kiosk. Pop style from the logo: cream paper, ink outlines, hard shadows.
   Safari 12+ safe: no flex gap, no aspect-ratio, no inset, no clamp(). */
@font-face { font-family: SpaceGrotesk; src: url(fonts/SpaceGrotesk-Bold.ttf); font-weight: 700; font-display: swap; }
@font-face { font-family: SpaceGrotesk; src: url(fonts/SpaceGrotesk-Medium.ttf); font-weight: 500; font-display: swap; }
@font-face { font-family: DMSans; src: url(fonts/DMSans-Regular.ttf); font-weight: 400; font-display: swap; }
@font-face { font-family: DMSans; src: url(fonts/DMSans-Bold.ttf); font-weight: 700; font-display: swap; }

:root {
  --ink: #141414; --cream: #fff8e7; --paper: #fffdf6; --yellow: #ffe45c; --sky: #8ccfff;
  --coral: #ff6b57; --lime: #b8f15a; --muted: #6b6457; --line: 3px;
  --shadow: 5px 5px 0 var(--ink); --shadow-sm: 3px 3px 0 var(--ink); --r: 18px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--cream); color: var(--ink); }
body {
  font-family: DMSans, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: calc(11px + 0.55vmin); line-height: 1.4;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  background-image: radial-gradient(rgba(20,20,20,.07) 1px, transparent 1.4px); background-size: 18px 18px;
}
input, select, textarea { -webkit-user-select: text; user-select: text; font: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, .title { font-family: SpaceGrotesk, DMSans, sans-serif; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
p { margin: .4em 0; }
.muted { color: var(--muted); } .small { font-size: .85em; }
[hidden] { display: none !important; }

#app { position: fixed; top: 0; left: 0; right: 0; bottom: 0; overflow: auto; -webkit-overflow-scrolling: touch;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.boot { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.boot img { width: 38vmin; margin-bottom: 20px; }

/* video parking: kept in the DOM (iOS needs that to keep frames flowing), but invisible */
#cam-park { position: fixed; left: -10px; top: -10px; width: 2px; height: 2px; overflow: hidden; opacity: 0; pointer-events: none; }
#cam { width: 100%; height: 100%; object-fit: cover; background: #222; display: block; }

.status { position: fixed; right: 10px; bottom: 8px; font-size: 11px; padding: 3px 9px; border-radius: 99px; background: rgba(255,255,255,.8);
  border: 1px solid rgba(20,20,20,.25); z-index: 5; pointer-events: none; }
.status.off { background: var(--coral); color: #fff; border-color: var(--ink); }
.status:before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #2bb24c; margin-right: 6px; vertical-align: 1px; }
.status.off:before { background: #fff; }

/* ---------- layout scaffold ---------- */
.screen { height: 100%; display: flex; flex-direction: column; padding: 2.2vmin 3vmin; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.6vmin; }
.body { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; }
.steps { list-style: none; display: flex; margin: 0; padding: 0; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; margin-right: 1.4vmin; color: var(--muted); font-weight: 700; font-size: .9em; }
.steps li b { width: 1.9em; height: 1.9em; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  border: 2px solid currentColor; margin-right: .4em; font-family: SpaceGrotesk; }
.steps li.cur { color: var(--ink); } .steps li.cur b { background: var(--yellow); border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.steps li.done { color: var(--ink); } .steps li.done b { background: var(--ink); color: #fff; border-color: var(--ink); }
.help-btn { margin-left: auto; background: #fff; border: 2px solid var(--ink); border-radius: 99px; padding: .5em 1.1em; font-weight: 700; box-shadow: var(--shadow-sm); }
.help-btn span { display: inline-block; width: 1.4em; height: 1.4em; border-radius: 50%; background: var(--sky); border: 2px solid var(--ink); line-height: 1.15em; text-align: center; margin-right: .3em; }

.card { background: var(--paper); border: var(--line) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); }
.card.pad { padding: 2.4vmin; }
.title { font-size: 2.3em; margin-bottom: .3em; } .title.sm { font-size: 1.35em; margin: .2em 0 .5em; }
.row { display: flex; align-items: center; flex-wrap: wrap; margin: -6px; } .row > * { margin: 6px; }
.row.wrap { margin-top: 6px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: .55em 1.3em; border-radius: 14px;
  border: var(--line) solid var(--ink); background: #fff; font-weight: 700; font-size: 1.05em; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow-sm); transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--yellow); }
.btn-accent { background: var(--lime); }
.btn-danger { background: var(--coral); color: #fff; }
.btn-ghost { background: #fff; }
.btn-text { border-color: transparent; box-shadow: none; background: transparent; text-decoration: underline; }
.btn-xl { min-height: 68px; font-size: 1.35em; padding: .5em 1.8em; border-radius: 18px; }
.btn-hero { min-height: 13vmin; font-size: 3.6vmin; padding: 0 9vmin; border-radius: 26px; font-family: SpaceGrotesk; letter-spacing: .02em;
  box-shadow: 8px 8px 0 var(--ink); animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-1deg); } }

.actionbar { flex: none; display: flex; align-items: center; justify-content: space-between; padding-top: 2vmin; margin-top: auto; }
.actionbar > * { margin-left: 10px; } .actionbar > *:first-child { margin-left: 0; }
.total { margin-left: auto !important; margin-right: 14px; text-align: right; line-height: 1.1; }
.total small { display: block; color: var(--muted); } .total b { font-family: SpaceGrotesk; font-size: 1.9em; }

/* ---------- welcome ---------- */
.screen-welcome .body { align-items: center; justify-content: center; text-align: center; }
.welcome { display: flex; flex-direction: column; align-items: center; }
.welcome .logo { width: 52vmin; max-width: 560px; transform: rotate(-2deg); }
.welcome .event { font-size: 4.4vmin; margin: 1.5vmin 0 2.5vmin; background: var(--ink); color: var(--yellow); padding: .15em .7em; border-radius: 12px; transform: rotate(1deg); }
.how { display: flex; flex-wrap: wrap; justify-content: center; margin-bottom: 4vmin; }
.how span { margin: 6px 10px; font-weight: 700; font-size: 1.15em; }
.how b { display: inline-block; width: 1.8em; height: 1.8em; line-height: 1.6em; border-radius: 50%; background: var(--sky); border: 2px solid var(--ink); margin-right: .4em; }
.from { margin-top: 2.2vmin; font-weight: 700; color: var(--muted); }
.resume { margin-top: 3vmin; padding: 16px 20px; display: flex; align-items: center; text-align: left; background: var(--lime); max-width: 760px; }
.resume > div { margin-right: 16px; }

/* ---------- center cards ---------- */
.center-card { max-width: 640px; margin: auto; padding: 4vmin; text-align: center; }
.center-card .row { justify-content: center; margin-top: 10px; }
.emoji { font-size: 7vmin; line-height: 1; margin-bottom: 1vmin; } .emoji.big { font-size: 12vmin; }

/* ---------- packages ---------- */
.pkg-layout { display: grid; grid-template-columns: 1.7fr 1fr; grid-gap: 3vmin; flex: 1; }
.pkgs { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 2vmin; }
.pkg { text-align: left; padding: 2.4vmin; display: flex; flex-direction: column; min-height: 30vmin; position: relative; }
.pkg h3 { font-size: 1.5em; margin: .3em 0 .2em; } .pkg p { color: var(--muted); flex: 1; }
.pkg .price { font-family: SpaceGrotesk; font-weight: 700; font-size: 1.8em; }
.pkg-icons i { font-style: normal; font-size: 1.8em; margin-right: .2em; }
.pkg.sel, .layout.sel, .frame.sel { background: var(--yellow); transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.pkg.sel:after { content: '✓'; position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; text-align: center; line-height: 34px; font-weight: 700; }
.layouts { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 1.6vmin; margin-bottom: 2vmin; }
.layout { padding: 1.6vmin 1vmin; display: flex; flex-direction: column; align-items: center; }
.layout b { margin-top: .5em; }
.mini { display: grid; width: 5.4vmin; height: 8.1vmin; grid-gap: 2px; padding: 3px; background: #fff; border: 2px solid var(--ink); border-radius: 4px; }
.mini i { background: var(--sky); border-radius: 2px; }
.mini.six { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, 1fr); }
.mini.eight { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(4, 1fr); }
.mini.one { grid-template-rows: 1fr 1.4fr 1fr; } .mini.one i { grid-row: 2; }
.stepper { display: flex; align-items: center; }
.stepper .btn { width: 60px; font-size: 1.6em; padding: 0; }
.extra-n { font-family: SpaceGrotesk; font-weight: 700; font-size: 2em; width: 2.2em; text-align: center; }
.stepper small { margin-left: 14px; color: var(--muted); }

/* ---------- payment ---------- */
.pay-layout { display: grid; grid-template-columns: 1fr auto; grid-gap: 4vmin; align-items: center; flex: 1; }
.amount { display: inline-block; padding: 1.6vmin 2.6vmin; margin: 1vmin 0 2vmin; background: var(--yellow); }
.amount small { display: block; font-weight: 700; } .amount b { font-family: SpaceGrotesk; font-size: 3.2em; line-height: 1.05; display: block; }
.amount span { color: var(--ink); font-weight: 700; }
.wait { display: flex; align-items: center; margin-bottom: 1vmin; } .wait > div:last-child { margin-left: 14px; }
.pulse { width: 22px; height: 22px; border-radius: 50%; background: var(--lime); border: 2px solid var(--ink); animation: pulse 1.2s infinite; flex: none; }
@keyframes pulse { 50% { transform: scale(1.35); background: var(--yellow); } }
.pay-qr { padding: 2.4vmin; text-align: center; background: #fff; }
.qr { display: block; width: 52vmin; height: 52vmin; max-width: 560px; max-height: 560px; object-fit: contain; image-rendering: pixelated; margin: 0 auto; }
img.qr { image-rendering: auto; }
.qr-missing { display: flex; align-items: center; justify-content: center; font-weight: 700; background: var(--cream); border: 2px dashed var(--ink); border-radius: 12px; padding: 20px; }
.qr-note { margin: .8em 0 0; }

/* ---------- camera ---------- */
.cam-layout { display: grid; grid-template-columns: 1fr 30vmin; grid-template-rows: minmax(0, 1fr); grid-gap: 3vmin; flex: 1; min-height: 0; }
.viewfinder { display: flex; align-items: center; justify-content: center; min-height: 0; }
.vf-box { position: relative; width: 100%; max-width: calc((100vh - 22vmin) * 4 / 3); border: 4px solid var(--ink); border-radius: 22px; overflow: hidden; background: #222;
  box-shadow: 8px 8px 0 var(--ink); }
.vf-box:before { content: ''; display: block; padding-top: 75%; } /* 4:3, matches the captured photo */
.vf-box video, .vf-box > .count, .vf-box > .flash, .vf-box > .vf-msg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.vf-box.small { max-width: 520px; }
.count { display: flex; align-items: center; justify-content: center; font-family: SpaceGrotesk; font-weight: 700; font-size: 30vmin; color: #fff;
  text-shadow: 0 0 0 transparent, 6px 6px 0 var(--ink); -webkit-text-stroke: 4px var(--ink); z-index: 2; pointer-events: none; }
.count.pop { animation: pop .9s ease-out; }
@keyframes pop { 0% { transform: scale(1.6); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 100% { opacity: .85; } }
.flash { background: #fff; opacity: 0; pointer-events: none; z-index: 3; }
.flash.go { animation: flash .45s ease-out; }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }
.vf-msg { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; z-index: 4;
  background: rgba(20,20,20,.72); color: #fff; font-weight: 700; font-size: 1.2em; }
.vf-msg .btn { margin-top: 14px; }
.vf-msg .next { font-family: SpaceGrotesk; font-size: 2em; color: var(--yellow); }
.cam-side { display: flex; flex-direction: column; }
.cam-side .btn-xl { margin-top: auto; }
.thumbs { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 1.2vmin; margin: 1.2vmin 0 2vmin; }
.thumbs.n1 { grid-template-columns: 1fr; }
.th { position: relative; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; background: #fff; }
.th:before { content: ''; display: block; padding-top: 75%; }
.th img, .th span { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.th span { display: flex; align-items: center; justify-content: center; font-family: SpaceGrotesk; font-weight: 700; color: var(--muted); }
.th.active { outline: 4px solid var(--coral); outline-offset: 1px; }
.th.fresh img { animation: fresh .5s ease-out; }
@keyframes fresh { from { transform: scale(1.3); opacity: 0; } }

/* ---------- review ---------- */
.review-layout { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.grid { display: grid; grid-gap: 2vmin; grid-template-columns: repeat(4, 1fr); margin-top: 1vmin; }
.grid.n6 { grid-template-columns: repeat(3, 1fr); } .grid.n1 { grid-template-columns: minmax(0, 60vmin); justify-content: center; }
.ph { position: relative; padding: 0; overflow: hidden; display: block; }
.ph:before { content: ''; display: block; padding-top: 75%; }
.ph img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.ph .tag { position: absolute; top: 8px; left: 8px; background: var(--yellow); border: 2px solid var(--ink); border-radius: 8px; padding: 0 8px; font-weight: 700; }
.ph .redo { position: absolute; right: 8px; bottom: 8px; background: #fff; border: 2px solid var(--ink); border-radius: 99px; padding: 4px 12px; font-weight: 700; }
.ph.locked .redo { display: none; } .ph.fresh { box-shadow: 0 0 0 5px var(--lime), var(--shadow); }

/* ---------- design ---------- */
.design-layout { display: grid; grid-template-columns: auto 1fr; grid-template-rows: minmax(0, 1fr); grid-gap: 3vmin; flex: 1; min-height: 0; }
.sheet-wrap { padding: 1.4vmin; text-align: center; background: #fff; align-self: start; }
#sheet { display: block; height: calc(100vh - 34vmin); max-height: 760px; width: auto; border-radius: 6px; background: #eee; }
.design-side { min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; padding: 4px 8px 8px 4px; }
.frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(15vmin, 1fr)); grid-gap: 1.6vmin; margin-bottom: 2vmin; }
.frame { padding: 8px; display: flex; flex-direction: column; align-items: center; }
.frame img { width: 100%; height: auto; border-radius: 6px; border: 1px solid rgba(0,0,0,.15); background: #ddd; }
.frame .plain { padding: 10px; } .frame b { margin-top: 6px; font-size: .9em; }
.filters { display: flex; flex-wrap: wrap; margin: -5px; }
.chip { margin: 5px; display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px 0 8px; border: 2px solid var(--ink); border-radius: 99px; background: #fff; font-weight: 700; }
.chip i { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink); margin-right: 8px; }
.chip.sel { background: var(--ink); color: #fff; }

/* ---------- done ---------- */
.done-layout { display: grid; grid-template-columns: auto 1fr; grid-gap: 4vmin; flex: 1; align-items: start; }
.done-sheet { padding: 1.2vmin; background: #fff; transform: rotate(-1.5deg); }
.done-sheet img { display: block; height: calc(100vh - 34vmin); max-height: 780px; width: auto; }
.done-side .note { padding: 16px 18px; margin-bottom: 2vmin; }
.done-side .note .btn { margin-top: 6px; }
.qr-card { display: flex; align-items: center; } .qr-card canvas { width: 24vmin; height: 24vmin; margin-right: 18px; flex: none; image-rendering: pixelated; }
.email-row { display: flex; margin-top: 10px; } .email-row input { flex: 1; min-width: 0; min-height: 52px; border: 2px solid var(--ink); border-radius: 12px; padding: 0 14px; margin-right: 8px; }

/* ---------- setup ---------- */
.setup { max-width: 1100px; margin: 0 auto; width: 100%; }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 2vmin; margin: 2vmin 0; }
.setup label { display: block; font-weight: 700; margin-bottom: 14px; }
.setup input:not([type=checkbox]), .setup select { display: block; width: 100%; min-height: 50px; margin-top: 6px; border: 2px solid var(--ink); border-radius: 12px; padding: 0 12px; background: #fff; }
.setup .check input { width: 24px; height: 24px; vertical-align: middle; margin-right: 8px; }

/* ---------- modal / toast ---------- */
.modal-wrap { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(20,20,20,.55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal { background: var(--paper); border: var(--line) solid var(--ink); border-radius: 22px; box-shadow: 8px 8px 0 var(--ink); padding: 3.4vmin 4vmin; max-width: 620px; width: 100%; text-align: center;
  animation: modal .22s ease-out; max-height: 100%; overflow: auto; }
@keyframes modal { from { transform: translateY(14px) scale(.97); opacity: 0; } }
.modal h2 { font-size: 1.8em; margin-bottom: .3em; }
.modal .row { justify-content: center; margin-top: 12px; }
.modal.ok { background: var(--lime); }
.big-count { font-family: SpaceGrotesk; font-size: 5em; font-weight: 700; line-height: 1; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 12px; margin: 16px 0 8px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 10px; max-width: 340px; margin: 10px auto; }
.keypad .btn { min-height: 64px; font-size: 1.5em; }
.pin-dots { font-size: 2em; letter-spacing: .3em; min-height: 1.4em; }
.pin-err { color: #c0321f; font-weight: 700; min-height: 1.4em; }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 6px solid rgba(20,20,20,.15); border-top-color: var(--ink); animation: spin .8s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 5vmin; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 14px 22px; border-radius: 14px; font-weight: 700; z-index: 60; max-width: 90vw; text-align: center; transition: opacity .4s; }
.toast.ok { background: #1d7a35; } .toast.err { background: #c0321f; } .toast.out { opacity: 0; }

/* ---------- portrait iPad / narrow laptops ---------- */
@media (orientation: portrait), (max-width: 820px) {
  .design-layout, .cam-layout { grid-template-rows: auto; }
  body { font-size: calc(10px + 0.8vmin); }
  .pkg-layout, .pay-layout, .cam-layout, .design-layout, .done-layout, .setup-grid { grid-template-columns: 1fr; }
  .pkgs { grid-template-columns: 1fr; } .pkg { min-height: 0; }
  .pay-qr { order: -1; }
  .qr { width: 60vmin; height: 60vmin; }
  .vf-box { max-width: none; }
  .thumbs { grid-template-columns: repeat(4, 1fr); } .thumbs.n6 { grid-template-columns: repeat(6, 1fr); }
  .grid, .grid.n6 { grid-template-columns: repeat(2, 1fr); }
  #sheet { height: auto; width: 100%; max-height: none; } .sheet-wrap { max-width: 70vmin; margin: 0 auto; }
  .done-sheet img { height: auto; width: 100%; max-height: none; } .done-sheet { max-width: 60vmin; margin: 0 auto; }
  .steps li span { display: none; }
}
@media (max-height: 560px) { .btn-hero { min-height: 60px; } .welcome .logo { width: 40vmin; } }

/* ---------- printing: only the 4R pages ---------- */
#print-area { display: none; }
@media print {
  @page { size: 4in 6in; margin: 0; }
  html, body { height: auto; overflow: visible; background: #fff; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; }
  #print-area .page { width: 4in; height: 6in; page-break-after: always; break-after: page; overflow: hidden; }
  #print-area .page:last-child { page-break-after: auto; break-after: auto; }
  #print-area img { width: 4in; height: 6in; display: block; object-fit: cover; }
}
