@import url("kiosk-motion.css");

/* Infinit self check-out kiosk — 1920×1080 touch screen.
   Colours, fonts and shape come from design-system/tokens.css; this file only sets the kiosk scale:
   bigger type and touch targets for reading at arm's length. */

:root {
  --k-header: 112px;
  --k-pad: 72px;
  --k-gap: 48px;
  --k-touch: 96px;
  --k-text: 24px;
  --k-lead: 32px;
  --k-title: 56px;
  --k-ease: cubic-bezier(.2, .7, .2, 1);
}

html, body { margin: 0; height: 100%; overflow: hidden; background: var(--surface); }
body { font-size: var(--k-text); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
button { font: inherit; color: inherit; }

.kiosk {
  position: relative;
  display: grid; grid-template-rows: var(--k-header) 1fr;
  width: 100vw; height: 100vh; overflow: hidden;
  outline: none;
}

/* ---------- Typography (kiosk scale of the DS styles) ---------- */
.k-eyebrow {
  margin: 0; font-weight: 700; font-size: 18px; line-height: 1.3; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--brand); text-align: center;
}
.k-eyebrow--left { text-align: left; }
.k-eyebrow--on-brand { color: var(--on-brand); }

/* Infinit face only for the big display headings. */
.k-display { margin: 0; font-family: var(--font-display); font-weight: 400; line-height: .9; color: inherit; font-size: 176px; }
.k-display--lg { font-size: 150px; }
.k-display--md { font-size: 112px; }

/* Amounts and counters: Soleil, not the display face — digits must read at a glance. */
.k-amount { font-family: var(--font-sans); font-weight: 500; font-size: 136px; line-height: 1; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }

/* A small label above a big headline needs air: the headline's accents (Ř, Č, Ž) reach up towards it. */
.k-eyebrow + .k-display, .k-eyebrow + .k-title { margin-top: 28px; }

.k-title { margin: 0; font-weight: 300; font-size: var(--k-title); line-height: 1.2; color: var(--brand); }
.k-title--sm { font-size: 44px; }
.k-lead { margin: 0; font-weight: 300; font-size: var(--k-lead); line-height: 1.45; color: var(--brand); max-width: 30em; }

/* ---------- Buttons: DS .btn at touch size ---------- */
.k-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--k-touch); padding: 0 56px;
  font-family: var(--font-sans); font-weight: 300; font-size: 20px; line-height: 1.2; letter-spacing: 0.2em; text-transform: uppercase;
  border: var(--border-width) solid var(--brand); border-radius: var(--radius-none);
  background: transparent; color: var(--brand); cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--k-press) ease, color var(--k-press) ease, transform var(--k-press) ease;
}
.k-btn:active { background: var(--brand-hover); color: var(--on-brand-hover); border-color: var(--brand-hover); transform: scale(.985); }
.k-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
/* Solid = the DS hover look kept on: the one action we want next. */
.k-btn--solid { background: var(--brand); color: var(--on-brand); font-weight: 500; }
.k-btn--solid:active { background: var(--brand-hover); }
.k-btn--solid-inverse { background: var(--surface); color: var(--brand); border-color: var(--surface); font-weight: 500; }
.k-btn--solid-inverse:active { background: var(--btn-inverse-hover-bg); color: var(--btn-inverse-hover-ink); }
.k-btn--inverse { color: var(--on-brand); border-color: var(--on-brand); }
.k-btn--xl { min-height: 120px; font-size: 24px; padding: 0 64px; }

/* ---------- Header ---------- */
.k-header {
  position: relative; z-index: 3;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--k-pad); background: var(--surface);
  border-bottom: var(--border-width) solid var(--line);
}
.k-header__left { display: flex; align-items: baseline; gap: 28px; font-size: 18px; letter-spacing: 0.15em; }
.k-header__date::first-letter { text-transform: uppercase; }
.k-header__time { font-weight: 500; }
.k-header__offline { font-size: 16px; letter-spacing: 0; color: var(--ink-muted); }
.k-header__logo { height: 64px; width: auto; display: block; }
.k-header__right { display: flex; justify-content: flex-end; align-items: center; gap: 40px; }
.k-lang { display: flex; gap: 0; padding: 0; border: var(--border-width) solid var(--brand); background: transparent; cursor: pointer; }
.k-lang span { display: block; min-width: 64px; padding: 16px 0; font-size: 16px; letter-spacing: 0.2em; text-align: center; }
.k-lang span.is-active { background: var(--brand); color: var(--on-brand); }

/* ---------- Stage + screen transitions ---------- */
.k-stage { position: relative; overflow: hidden; }
.k-screen { position: absolute; inset: 0; animation: k-enter var(--k-screen-in) var(--k-ease) both; }
@keyframes k-enter { from { opacity: 0; transform: translateY(var(--k-screen-rise)); } to { opacity: 1; transform: none; } }
@keyframes k-fade { from { opacity: 0; } to { opacity: 1; } }

.scr { position: relative; height: 100%; padding: 56px var(--k-pad) 0; color: var(--brand); }

/* Indeterminate progress: a short brand segment travelling along a hairline. */
.k-progress { position: relative; width: 420px; height: 3px; margin-top: 40px; background: var(--line); overflow: hidden; }
.k-progress::after { content: ''; position: absolute; top: 0; left: 0; width: 30%; height: 100%; background: var(--brand); animation: k-progress var(--k-progress-loop) ease-in-out infinite; }
@keyframes k-progress { from { transform: translateX(-100%); } to { transform: translateX(340%); } }

/* ---------- Edge pointer: arrows from the screen to the device below ---------- */
.edge-pointer {
  position: absolute; bottom: 12px; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  transform: translateX(-50%); color: var(--brand); pointer-events: none;
}
.edge-pointer--left { left: 16%; }
.edge-pointer--center { left: 50%; }
.edge-pointer--right { left: 84%; }
/* A device on the right points out of the payment panel there. */
.due ~ .edge-pointer--right { color: var(--on-brand); }
.edge-pointer__label { white-space: nowrap; font-size: 16px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; }
.edge-pointer__chevrons { width: 48px; height: 72px; fill: none; stroke: currentColor; stroke-width: 3; }
.edge-pointer__chevrons polyline { animation: k-chevron var(--k-pointer-loop) ease-in-out infinite; opacity: .15; }
.edge-pointer__chevrons polyline:nth-child(2) { animation-delay: .2s; }
.edge-pointer__chevrons polyline:nth-child(3) { animation-delay: .4s; }
.edge-pointer.is-strong .edge-pointer__chevrons { width: 64px; height: 96px; }
.edge-pointer.is-strong .edge-pointer__label { font-size: 18px; }
@keyframes k-chevron { 0%, 100% { opacity: .15; } 35% { opacity: 1; } }

/* ---------- Timed button: fills up, then presses itself ---------- */
.k-timed { position: relative; overflow: hidden; isolation: isolate; }
.k-timed__label { position: relative; z-index: 1; }
.k-timed__fill {
  position: absolute; inset: 0; z-index: 0; transform-origin: left; transform: scaleX(0);
  background: color-mix(in srgb, var(--brand) 22%, transparent);
  border-bottom: 6px solid var(--brand);
  will-change: transform;
  animation: k-timed-fill var(--k-timed, 10s) linear var(--k-timed-start) forwards;
}
.k-btn--solid .k-timed__fill { background: var(--highlight-inverse); border-bottom-color: var(--on-brand); }
@keyframes k-timed-fill { to { transform: scaleX(1); } }

/* ---------- Illustrations: thin line art in brand ---------- */
.ill { display: block; fill: none; stroke: var(--brand); stroke-width: 3; stroke-linejoin: round; overflow: visible; }
.ill .ill-face, .ill .ill-strap { fill: var(--surface); }
.ill .ill-fill { fill: var(--brand); stroke: none; }
.ill .ill-device { fill: var(--surface); }
.ill .ill-led { fill: var(--line); stroke: none; }
.ill .ill-slot { fill: var(--brand); stroke: none; }
.ill .ill-screen { fill: var(--table-row); }
/* The chip wristband: housing and silicone strap in solid brand, the chip disc light. */
.ill .ill-solid { fill: var(--brand); }
.ill .ill-disc { fill: var(--line); stroke: none; }
.ill .ill-contactless path { stroke-width: 4; stroke-linecap: round; }
.ill .ill-contactless--card path { stroke-width: 2.5; }

/* Chip tap: the wristband comes down onto the pad, the pad answers with rings and its light comes on. */
.ill--chip-tap { width: 560px; height: auto; overflow: hidden; }
/* Gentle start and soft landing both ways (ease-in-out), so it glides instead of jerking down and up. */
.ill--chip-tap .ill-band { animation: chip-tap var(--k-chip-tap-loop) cubic-bezier(.45, 0, .3, 1) infinite; }
.ill--chip-tap .ill-waves ellipse { opacity: 0; animation: chip-tap-wave var(--k-chip-tap-loop) ease-out infinite; }
.ill--chip-tap .ill-waves ellipse:nth-child(2) { animation-delay: .15s; }
.ill--chip-tap .ill-led { animation: chip-led var(--k-chip-tap-loop) step-end infinite; }
/* Each cycle first rests with the wristband above the reader (0–36 %, about 1.7 s of the default 4.6 s), then it comes
   down, the reader answers, and it lifts back up. */
@keyframes chip-tap { 0%, 36% { transform: translateY(-150px); } 55%, 80% { transform: translateY(0); } 100% { transform: translateY(-150px); } }
@keyframes chip-tap-wave { 0%, 55% { opacity: 0; } 60% { opacity: 1; } 78%, 100% { opacity: 0; } }
@keyframes chip-led { 0% { fill: var(--line); } 56% { fill: var(--brand); } 80% { fill: var(--line); } }
@keyframes chip-wave { 0%, 30% { opacity: 0; } 38% { opacity: 1; } 66%, 100% { opacity: 0; } }

/* Card tap on a contactless terminal. */
.ill--card-tap { width: 420px; height: auto; }
.ill--card-tap .ill-keys rect { stroke-width: 2; }
.ill--card-tap .ill-card { animation: card-tap var(--k-card-tap-loop) var(--k-ease) infinite; }
.ill--card-tap .ill-waves path { opacity: 0; animation: chip-wave var(--k-card-tap-loop) ease-out infinite; stroke-linecap: round; }
.ill--card-tap .ill-waves path:nth-child(2) { animation-delay: .15s; }
.ill--card-tap .ill-waves path:nth-child(3) { animation-delay: .3s; }
@keyframes card-tap { 0% { transform: translate(80px, -90px) rotate(10deg); } 32%, 66% { transform: none; } 100% { transform: translate(80px, -90px) rotate(10deg); } }

/* Chip drop: the wristband goes down into the opening of the box. */
.ill--chip-drop { width: 400px; height: auto; overflow: hidden; }
/* One continuous fall, accelerating: it starts with a small, slow movement the eye can catch, then drops
   in (ease-in on the whole fall; the fade-in has its own easing so it doesn't split the movement). */
.ill--chip-drop .ill-band { animation: chip-drop var(--k-chip-drop-loop) linear infinite; }
@keyframes chip-drop {
  0% { transform: translateY(-80px); animation-timing-function: cubic-bezier(.4, 0, .85, .3); }
  85%, 100% { transform: translateY(240px); }
}
/* The fade-in sits on the clipping group around the wristband, in step with the fall. */
.ill--chip-drop > g { animation: chip-drop-in var(--k-chip-drop-loop) linear infinite; }
@keyframes chip-drop-in { 0% { opacity: 0; } 12%, 100% { opacity: 1; } }


/* ---------- Idle ---------- */
.scr--idle { display: flex; flex-direction: column; align-items: center; padding-top: 64px; text-align: center; }
.idle__copy { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.scr--idle .k-display { font-size: 176px; }
.scr--idle .k-lead { max-width: 34em; }
.scr--idle .ill--chip-tap { width: 380px; margin-top: 8px; }
.idle__note { position: absolute; left: var(--k-pad); bottom: 40px; max-width: 520px; margin: 0; font-size: 18px; line-height: 1.5; text-align: left; }
.idle__note--right { left: auto; right: var(--k-pad); text-align: right; }

/* ---------- Chip read: everything fades except the wristband, which flies to the middle ---------- */
.scr--idle > .idle__copy, .scr--idle > .ill--chip-tap, .scr--idle > .idle__note, .scr--idle > .edge-pointer { transition: opacity var(--k-start-fade-out) ease; }
.scr--idle.is-reading > .idle__copy, .scr--idle.is-reading > .ill--chip-tap,
.scr--idle.is-reading > .idle__note, .scr--idle.is-reading > .edge-pointer { opacity: 0; }
/* The animated wristband hands over to the standalone one at once. */
.scr--idle.is-reading .ill--chip-tap .ill-band { visibility: hidden; }
.arrival {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 48px; padding-bottom: 80px; pointer-events: none;
}
.arrival__chip { width: 480px; will-change: transform; }
.ill--wristband { width: 100%; height: auto; overflow: visible; }
/* Blank until the load is noticeably slow, then the text and bar fade in lazily (and the bar moves calmly). */
.arrival__loading { display: flex; flex-direction: column; align-items: center; gap: 0; animation: k-fade var(--k-loading-fade-in) ease-in-out var(--k-loading-delay, 1500ms) both; }
.arrival__loading .k-progress::after { animation-duration: var(--k-loading-bar-loop); }

/* ---------- Summary: items left, payment right ---------- */
/* minmax(0, …): long content wraps inside the left column instead of pushing the panel off the screen. */
.scr--summary, .scr--payment { display: grid; grid-template-columns: minmax(0, 1fr) 680px; padding: 0; }
.bill { display: grid; grid-template-rows: auto 1fr; min-height: 0; padding: 32px var(--k-pad) 0; }
.bill__client { display: flex; flex-direction: column; align-items: flex-end; margin: 0 0 0 auto; line-height: 1.3; text-align: right; }
.bill__name { font-size: 22px; font-weight: 500; }
.bill__meta { font-size: 18px; letter-spacing: .05em; }
.bill__meta strong { font-weight: 700; }
.bill__list {
  min-height: 0; overflow-y: auto; padding: 0 8px 64px 0; outline: none;
  -webkit-mask-image: linear-gradient(to bottom, var(--brand) calc(100% - 56px), transparent);
          mask-image: linear-gradient(to bottom, var(--brand) calc(100% - 56px), transparent);
}
.bill__group {
  margin: 32px 0 0; padding-bottom: 10px; border-bottom: var(--border-width) solid var(--brand);
  font-size: 16px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
}

/* "Close without paying" — and, after a quiet while, "Are you still there?" growing out of the same row. */
.still {
  display: flex; align-items: center; gap: 24px; min-height: 72px;
  margin: 0 calc(-1 * var(--k-pad) / 2); padding: 0 calc(var(--k-pad) / 2);
  transition: background-color .3s ease, padding .3s var(--k-ease);
}
.still .k-btn { min-height: 72px; padding: 0 36px; font-size: 18px; }
.still.is-warning {
  padding-top: 24px; padding-bottom: 24px;
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
  border-bottom: var(--border-width) solid var(--brand);
  animation: still-in var(--k-still-in) var(--k-ease) both;
}
.still.is-warning .k-btn { min-height: 96px; font-size: 20px; }
.still__title { flex: 1; margin: 0; font-size: 36px; font-weight: 500; line-height: 1.2; }
.still.is-warning .still__close { order: 3; }
@keyframes still-in { from { opacity: .3; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

.line {
  display: grid; grid-template-columns: 1fr 170px 180px; align-items: baseline; gap: 24px;
  padding: 16px 0; border-bottom: var(--border-width) solid var(--line);
  animation: k-enter var(--k-line-in) var(--k-ease) both;
}
.line__main { display: flex; flex-direction: column; gap: 4px; }
.line__name { font-size: 26px; line-height: 1.3; }
.line--stay .line__name { font-weight: 500; }
.line--stay .line__detail { font-size: 22px; font-weight: 500; }
.line__detail { font-size: 19px; line-height: 1.4; letter-spacing: .02em; }
.line__qty { font-size: 20px; text-align: right; white-space: nowrap; }
.line__total { font-size: 26px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.line--included .line__total { font-size: 20px; }
.bill__list .line:nth-of-type(n+4) { animation-delay: var(--k-line-stagger); }
.bill__list .line:nth-of-type(n+8) { animation-delay: calc(2 * var(--k-line-stagger)); }

.due {
  display: flex; flex-direction: column; gap: 16px;
  padding: 44px 64px 40px; background: var(--brand); color: var(--on-brand);
}
.due__table { display: flex; flex-direction: column; margin: 0; }
.due__table > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 24px;
  padding: 12px 0; border-bottom: var(--border-width) solid var(--highlight-inverse); font-size: 24px; line-height: 1.25;
  transition: opacity .3s ease;
}
.due__table dt, .due__table dd { margin: 0; }
.due__table dd { white-space: nowrap; font-variant-numeric: tabular-nums; }
.due__table dt small { display: block; margin-top: 4px; font-size: 17px; letter-spacing: .03em; }
.due__table > div.due__total { padding-top: 16px; border-bottom: 0; font-size: 34px; font-weight: 500; }
.due__pay-label { margin-top: 24px; }
.due__table--pay > div { font-size: 30px; }
.due__table--pay > div:last-child { font-weight: 500; border-bottom: 0; }
.due__table--pay dd { font-size: 40px; }
.due__table--pay > div.is-done dt small::before { content: '✓ '; }
.due__table--pay > div.due__balance { font-size: 24px; font-weight: 300; border-top: var(--border-width) solid var(--highlight-inverse); }
.due__table--pay > div.due__balance dd { font-size: 30px; }
.due__cta { margin-top: auto; width: 100%; min-height: 120px; font-size: 26px; }

/* ---------- Payment: terminal → paid + receipt, overview on the right ---------- */
.pay { position: relative; display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 48px; align-content: start; padding: 72px var(--k-pad) 0; }
.pay__copy { display: flex; flex-direction: column; gap: 24px; }
/* The picture on the left, text and actions beside it (the pointer below shows where the terminal really is).
   Top-aligned at its own size: the terminal stays put whatever the text beside it. */
.pay__visual { order: -1; display: flex; align-items: flex-start; justify-content: flex-start; padding-top: 24px; }
/* Two buttons share the width; when they don't fit side by side (longer language) they stack. */
.pay__actions { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 16px; }
.pay__actions > .k-btn--xl { flex: 1 1 0; padding-inline: 24px; }

/* ---------- Paid: centred summary + receipt question ---------- */
.scr--paid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 36px; padding-bottom: 80px; text-align: center; }
.paid__rows, .paid__balance { display: flex; flex-direction: column; width: 560px; margin: 0; }
.paid__rows > div, .paid__balance > div { display: flex; justify-content: space-between; align-items: baseline; }
.paid__rows dt, .paid__rows dd, .paid__balance dt, .paid__balance dd { margin: 0; }
.paid__rows dd, .paid__balance dd { font-variant-numeric: tabular-nums; }
/* What was paid: small and tight, one group. */
.paid__rows { gap: 6px; margin-top: -8px; font-size: 22px; }
/* The credit left: set apart and larger. */
.paid__balance { padding-top: 20px; border-top: var(--border-width) solid var(--brand); font-size: 28px; }
.paid__balance dd { font-size: 44px; font-weight: 500; }
.paid__ask { margin-top: 24px; }
.ask__buttons { display: flex; gap: 24px; }
.k-btn--choice { min-width: 380px; min-height: 128px; font-size: 24px; }

/* ---------- Deposit (last screen): centred like the start screen, animation above the arrow ---------- */
.scr--deposit { display: flex; flex-direction: column; align-items: center; justify-content: center; padding-bottom: 120px; text-align: center; }
.deposit__copy { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.deposit__receipt { margin: 0; font-size: 26px; font-weight: 500; }
.deposit__thanks { margin: 8px 0 0; font-size: 36px; font-weight: 300; }
.deposit__done { min-width: 380px; margin-top: 8px; }
.deposit__visual { position: absolute; bottom: 168px; width: 230px; transform: translateX(-50%); }
.deposit__visual--left { left: 16%; }
.deposit__visual--center { left: 50%; }
.deposit__visual--right { left: 84%; }
.deposit__visual .ill--chip-drop { width: 100%; }

/* ---------- Simple message screens ---------- */
.scr--message { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px; padding-bottom: 80px; text-align: center; }
.scr--message .k-lead { max-width: 26em; }
.scr__ok { margin-top: 24px; min-width: 380px; }

/* ---------- Dev hint (H toggles) ---------- */
.k-devhint { position: absolute; right: 16px; top: calc(var(--k-header) + 8px); z-index: 6; font-size: 13px; letter-spacing: .05em; color: var(--ink-muted); opacity: .6; pointer-events: none; }

/* ---------- Dev: loading delay dialog (L) ---------- */
.dev-modal { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: var(--overlay-search); }
.dev-modal__panel { display: flex; flex-direction: column; gap: 20px; width: 900px; padding: 40px 48px; background: var(--surface); border: var(--border-width) solid var(--brand); color: var(--ink-black); font-size: 22px; }
.dev-modal__title { margin: 0; font-size: 30px; font-weight: 500; color: var(--brand); }
.dev-modal__option { display: flex; align-items: flex-start; gap: 16px; cursor: pointer; }
.dev-modal__option input { width: 26px; height: 26px; margin-top: 4px; accent-color: var(--brand); }
.dev-modal__option span { display: flex; flex-direction: column; }
.dev-modal__option strong { font-weight: 500; }
.dev-modal__option small { font-size: 17px; color: var(--ink); }
.dev-modal__fixed { display: flex; align-items: center; gap: 12px; margin-left: 42px; }
.dev-modal__input { width: 220px; padding: 12px 16px; font: inherit; color: var(--ink-black); border: var(--border-width) solid var(--brand); border-radius: var(--radius-none); }
.dev-modal__presets { display: flex; flex-wrap: wrap; gap: 8px; margin-left: 42px; }
.dev-modal .k-btn { min-height: 56px; padding: 0 20px; font-size: 16px; }
.dev-modal .dev-modal__preset.is-on, .dev-modal .dev-modal__preset.is-on:active { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.dev-modal__actions { display: flex; gap: 12px; margin-top: 8px; }
.dev-modal__actions .k-btn { min-width: 180px; }
.dev-modal__note { margin: 0; font-size: 16px; color: var(--ink); }

#blazor-error-ui { display: none; }
