/* =========================================================
   The receipt printer (V37).

   A little thermal printer that whirrs, then feeds the receipt out one
   line at a time. Used on the "paid, thank you" pages and in the admin
   Test centre. Everything is drawn with CSS, so there's nothing to load
   and it works on a phone.
   Honours "reduce motion": the receipt is simply there, already printed.
   ========================================================= */
.rp{--rp-ink:#171512;--rp-paper:#fbf8f1;--rp-case:#2a2724;--rp-case-2:#3a3531;--rp-gold:#8E6918;
  display:flex;flex-direction:column;align-items:center;width:100%;max-width:420px;margin:28px auto 0;color:var(--rp-ink);isolation:isolate}
.rp *{box-sizing:border-box}

/* ---- the machine ---- */
.rp-machine{position:relative;z-index:3;width:100%;border-radius:26px;padding:14px 14px 30px;
  background:linear-gradient(177deg,var(--rp-case-2),var(--rp-case) 62%);
  border:1px solid #16130f;
  box-shadow:0 22px 40px -22px rgba(0,0,0,.55),0 8px 16px -10px rgba(0,0,0,.35),inset 0 1px 0 rgba(255,255,255,.14),inset 0 -1px 0 rgba(0,0,0,.5)}
.rp-machine::before{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;opacity:.5;
  background-image:radial-gradient(rgba(255,255,255,.05) 1px,transparent 1px);background-size:4px 4px}
.rp-head{position:relative;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:10px;height:40px;padding:0 4px}
.rp-head img{height:17px;width:auto;display:block;opacity:.95}
.rp-head b{font:500 10px/1 var(--mono,ui-monospace,Menlo,monospace);letter-spacing:.18em;text-transform:uppercase;color:#cfc6b2}
.rp-led{width:7px;height:7px;border-radius:50%;background:#6ee7a8;box-shadow:0 0 8px #6ee7a8;animation:rp-blink 1.4s infinite}
.rp[data-stage=complete] .rp-led{animation:none}
@keyframes rp-blink{50%{opacity:.25;box-shadow:none}}
.rp-screen{position:relative;z-index:1;border-radius:14px;padding:16px;background:#141210;color:#f4efe3;
  box-shadow:inset 0 0 26px 5px rgba(0,0,0,.55),inset 0 1px 0 rgba(255,255,255,.06)}
.rp-screen .rp-row{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;font:14px/1.4 var(--sans,system-ui,sans-serif)}
.rp-screen .rp-row small{display:block;color:#9c9484;font-size:12px;margin-top:2px}
.rp-screen strong{font:600 16px/1.2 var(--sans,system-ui,sans-serif);white-space:nowrap}
.rp-status{display:flex;align-items:center;gap:9px;margin-top:14px;font:500 12px/1 var(--sans,system-ui,sans-serif);color:#b8b0a0;min-height:18px}
.rp-spin{width:15px;height:15px;border-radius:50%;border:2px solid rgba(255,255,255,.25);border-top-color:#e9e2d2;animation:rp-spin .8s linear infinite}
.rp[data-stage=complete] .rp-spin{border:0;animation:none;background:#2f9e5f;position:relative}
.rp[data-stage=complete] .rp-spin::after{content:"";position:absolute;left:4.5px;top:1.5px;width:4px;height:8px;border:2px solid #fff;border-top:0;border-left:0;transform:rotate(42deg)}
@keyframes rp-spin{to{transform:rotate(360deg)}}
/* the slot the paper comes out of */
.rp-slot{position:absolute;left:22px;right:22px;bottom:14px;height:9px;border-radius:4px;background:#0c0a08;
  box-shadow:inset 0 2px 4px rgba(0,0,0,.9),0 1px 0 rgba(255,255,255,.07)}

/* ---- the paper ---- */
.rp-out{position:relative;z-index:1;width:calc(100% - 46px);margin-top:-16px;overflow:hidden;min-height:0;transition:height .3s ease}
.rp-paper{position:relative;padding:22px 20px 26px;background:var(--rp-paper);color:var(--rp-ink);
  font:13px/1.55 var(--mono,ui-monospace,Menlo,monospace);
  box-shadow:0 10px 26px -14px rgba(0,0,0,.45);
  clip-path:polygon(0 0,100% 0,100% calc(100% - 5px),98.75% 100%,97.5% calc(100% - 5px),96.25% 100%,95% calc(100% - 5px),93.75% 100%,92.5% calc(100% - 5px),91.25% 100%,90% calc(100% - 5px),88.75% 100%,87.5% calc(100% - 5px),86.25% 100%,85% calc(100% - 5px),83.75% 100%,82.5% calc(100% - 5px),81.25% 100%,80% calc(100% - 5px),78.75% 100%,77.5% calc(100% - 5px),76.25% 100%,75% calc(100% - 5px),73.75% 100%,72.5% calc(100% - 5px),71.25% 100%,70% calc(100% - 5px),68.75% 100%,67.5% calc(100% - 5px),66.25% 100%,65% calc(100% - 5px),63.75% 100%,62.5% calc(100% - 5px),61.25% 100%,60% calc(100% - 5px),58.75% 100%,57.5% calc(100% - 5px),56.25% 100%,55% calc(100% - 5px),53.75% 100%,52.5% calc(100% - 5px),51.25% 100%,50% calc(100% - 5px),48.75% 100%,47.5% calc(100% - 5px),46.25% 100%,45% calc(100% - 5px),43.75% 100%,42.5% calc(100% - 5px),41.25% 100%,40% calc(100% - 5px),38.75% 100%,37.5% calc(100% - 5px),36.25% 100%,35% calc(100% - 5px),33.75% 100%,32.5% calc(100% - 5px),31.25% 100%,30% calc(100% - 5px),28.75% 100%,27.5% calc(100% - 5px),26.25% 100%,25% calc(100% - 5px),23.75% 100%,22.5% calc(100% - 5px),21.25% 100%,20% calc(100% - 5px),18.75% 100%,17.5% calc(100% - 5px),16.25% 100%,15% calc(100% - 5px),13.75% 100%,12.5% calc(100% - 5px),11.25% 100%,10% calc(100% - 5px),8.75% 100%,7.5% calc(100% - 5px),6.25% 100%,5% calc(100% - 5px),3.75% 100%,2.5% calc(100% - 5px),1.25% 100%,0 calc(100% - 5px))}
.rp-paper::after{content:"";position:absolute;inset:0;pointer-events:none;opacity:.55;
  background:repeating-linear-gradient(180deg,rgba(23,21,18,.035) 0 1px,transparent 1px 3px)}
.rp[data-stage=processing] .rp-out{height:0}
.rp-out{transition:height .09s linear}
.rp[data-stage=complete] .rp-out{transition:none}
/* a shadow where the paper leaves the machine */
.rp-out::before{content:"";position:absolute;left:0;right:0;top:0;height:10px;z-index:4;pointer-events:none;
  background:linear-gradient(rgba(0,0,0,.42),transparent);opacity:0;transition:opacity .25s}
.rp:not([data-stage=processing]) .rp-out::before{opacity:1}

/* what's printed on it */
.rp-paper h2{margin:0 0 2px;font:600 15px/1.3 var(--mono,ui-monospace,Menlo,monospace);letter-spacing:.14em;text-transform:uppercase}
.rp-paper .rp-sub{margin:0 0 14px;font-size:11.5px;letter-spacing:.08em;text-transform:uppercase;color:#6e695a}
.rp-paper hr{border:0;border-top:1px dashed rgba(23,21,18,.35);margin:12px 0}
.rp-paper dl{margin:0;display:grid;grid-template-columns:1fr auto;gap:4px 12px}
.rp-paper dt{margin:0}
.rp-paper dd{margin:0;text-align:right;white-space:nowrap}
.rp-paper .rp-total{font-weight:700;font-size:15px}
.rp-paper .rp-small{font-size:11.5px;line-height:1.5;color:#6e695a;margin:10px 0 0}
.rp-paper .rp-thanks{margin:14px 0 0;font:italic 15px/1.4 Georgia,serif;text-align:center}
.rp-sign{display:block;margin:6px auto 0;width:118px;height:46px}
.rp-sign path{fill:none;stroke:var(--rp-ink);stroke-width:2.1;stroke-linecap:round;stroke-linejoin:round;
  stroke-dasharray:var(--len,420);stroke-dashoffset:var(--len,420)}
.rp[data-stage=complete] .rp-sign path{animation:rp-write .62s .15s ease-out forwards}
@keyframes rp-write{to{stroke-dashoffset:0}}
.rp-barcode{display:flex;gap:2px;justify-content:center;align-items:flex-end;height:34px;margin:14px 0 6px}
.rp-barcode i{display:block;width:2px;background:var(--rp-ink);height:100%}
.rp-paper .rp-code{text-align:center;font-size:11px;letter-spacing:.3em;color:#6e695a;margin:0}

@media (prefers-reduced-motion:reduce){
  .rp[data-stage] .rp-paper{animation:none!important;transform:translateY(0)}
  .rp[data-stage=processing] .rp-out{height:auto}
  .rp-led,.rp-spin{animation:none}
  .rp-sign path{stroke-dashoffset:0;animation:none!important}
}
/* the printable copy (and what people with no JavaScript see) */
.pay-receipt-print{max-width:600px;margin:26px auto 0}
.rp + .pay-after{margin-top:26px}
@media print{
  body.order-page>*{display:none!important}
  body.order-page .pay-receipt-print{display:block!important;margin:0}
  .pay-receipt-print table{border:0!important}
}

/* the thank-you the printer sits in (shop and order pages) */
.order-done{position:fixed;inset:0;z-index:300;display:flex;align-items:flex-start;justify-content:center;overflow:auto;
  background:rgba(12,11,9,.72);backdrop-filter:blur(3px);padding:24px 16px 40px;animation:rp-fade .3s ease}
@keyframes rp-fade{from{opacity:0}}
body.order-done-open{overflow:hidden}
.order-done-in{width:100%;max-width:430px}
.order-done .rp{margin-top:0}
.order-done-say{margin:22px 0 0;padding:22px;border-radius:16px;background:var(--bg,#F7F5EF);color:var(--fg,#171512);text-align:center}
.order-done-say h2{margin:0 0 8px;font:400 22px/1.25 var(--display,Georgia,serif)}
.order-done-say p{margin:0 0 14px;font-size:14.5px;line-height:1.6;color:var(--soft,#5C574E)}
.order-done-say p:last-child{margin:0}
@media (max-width:480px){.order-done{padding:14px 10px 30px}}
