/* ------------------------------------------------------------------
   PREEN bay kiosk · base
   Reset, typography, page shell, backdrop, top bar.
   ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  line-height: 1.4;
  color: var(--k-fg);
  background: var(--k-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-slow) var(--ease-out), color var(--dur-base);
}

button, input {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button { cursor: pointer; }

img { display: block; max-width: 100%; }

h1, h2, h3, p { margin: 0; }

h1, h2, .k-display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.04;
  font-variation-settings: "opsz" 144;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 800; letter-spacing: -0.01em; }

.k-display { font-size: var(--fs-display); }
.k-lede { font-size: var(--fs-lg); color: var(--k-fg-muted); line-height: 1.45; max-width: 44ch; }
.k-muted { color: var(--k-fg-muted); }
.k-soft { color: var(--k-fg-soft); }
.k-eyebrow {
  font-size: var(--fs-xs);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--k-accent-text);
}
body[data-theme="dark"] .k-eyebrow { color: #cfe6ff; }

.k-num { font-variant-numeric: tabular-nums lining-nums; }

.k-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible {
  outline: 3px solid rgba(22, 119, 255, 0.55);
  outline-offset: 3px;
}
body[data-theme="dark"] :focus-visible { outline-color: rgba(255, 255, 255, 0.7); }

/* ---------- backdrop ---------- */
.k-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--k-bg);
}
.k-backdrop__photo {
  position: absolute;
  inset: -3%;
  width: 106%;
  height: 106%;
  max-width: none; /* the img reset above capped this at 100% and left a hard strip down the right edge */
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 720ms var(--ease-out), transform 12s linear;
}
.k-backdrop.has-photo .k-backdrop__photo { opacity: 1; transform: scale(1.06); }
.k-backdrop__scrim {
  position: absolute;
  inset: 0;
  background: var(--k-scrim);
  transition: background var(--dur-slow) var(--ease-out);
}
.k-backdrop__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  mix-blend-mode: screen;
  animation: k-drift 22s var(--ease-in-out) infinite alternate;
}
.k-backdrop__glow--a { width: 46vw; height: 46vw; left: -12vw; top: -14vw; background: #b9dcff; }
.k-backdrop__glow--b { width: 38vw; height: 38vw; right: -10vw; bottom: -12vw; background: #ffd9e8; animation-delay: -8s; }
body[data-theme="dark"] .k-backdrop__glow--a { background: #1d4e89; opacity: 0.7; }
body[data-theme="dark"] .k-backdrop__glow--b { background: #163d5a; opacity: 0.7; }
/* Tone glows are pastel and screen-blended, so they belong to the light theme. On the dark details and
   offer screens they put a beige haze behind the Pay panel; there a deep tint keeps the tone. */
body:not([data-theme="dark"])[data-tone="speedy"] .k-backdrop__glow--b { background: var(--tone-speedy-soft); }
body:not([data-theme="dark"])[data-tone="thorough"] .k-backdrop__glow--b { background: var(--tone-thorough-soft); }
body[data-theme="dark"][data-tone="speedy"] .k-backdrop__glow--b { background: #5a2a10; }

/* ---------- shell ---------- */
.k-shell {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
}

.k-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--page-y) var(--page-x) 0;
  min-height: 84px;
  color: var(--k-chrome-fg);
}

.k-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
}
.k-wordmark {
  flex: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: 0.30em;
  line-height: 1;
  padding-left: 0.1em;
}
.k-brand__divider {
  flex: none;
  width: 1px;
  height: 26px;
  background: var(--k-chrome-line);
}
.k-brand__context {
  min-width: 0;
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--k-fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* On the dark photo screens the top bar has no panel behind it: muted white fell to 3.7:1 there. */
body[data-theme="dark"] .k-brand__context { color: rgba(255, 255, 255, 0.92); }
.k-brand__context:empty, .k-brand__divider:has(+ .k-brand__context:empty) { display: none; }

.k-topbar__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--sp-3);
}
/* "Log out" and "Start again" never wrap inside their pills, and the badge never shrinks: the bay name
   is what gives way. */
.k-topbar__actions .k-btn { white-space: nowrap; }
.k-brand .k-badge { flex: none; }

/* steps — hidden until a customer flow starts */
.k-steps {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: var(--r-pill);
  background: var(--k-chrome-surface);
  border: 1px solid var(--k-chrome-line);
  backdrop-filter: blur(16px);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
body[data-step=""] .k-steps { opacity: 0; transform: translateY(-6px); pointer-events: none; }
.k-steps__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 10px;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: var(--fs-sm);
  color: var(--k-fg-muted);
  transition: background var(--dur-base), color var(--dur-base);
}
.k-steps__num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 900;
  background: var(--k-surface-2);
  color: var(--k-fg-muted);
  border: 1.5px solid var(--k-line);
  transition: background var(--dur-base), color var(--dur-base), border-color var(--dur-base);
}
.k-steps__item.is-current { background: var(--k-chrome-fg); color: var(--k-bg); }
.k-steps__item.is-current .k-steps__num { background: var(--k-accent-text); border-color: transparent; color: var(--k-accent-fg); }
body[data-theme="dark"] .k-steps__item.is-current { background: #fff; color: var(--p-ink); }
.k-steps__item.is-done .k-steps__num { background: var(--p-success-strong); border-color: transparent; color: #fff; }
/* A step this driver never went through (a free wash has no Pay): a dash, no tick, quieter label. */
.k-steps__item.is-skipped .k-steps__num { background: transparent; border-style: dashed; color: var(--k-fg-muted); }
.k-steps__item.is-skipped .k-steps__label { opacity: 0.75; }


/* ---------- stage ---------- */
.k-stage {
  position: relative;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
  padding: var(--page-y) var(--page-x) calc(var(--page-y) + 8px);
  display: grid;
}
.k-scene {
  grid-area: 1 / 1;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: var(--sp-5);
  will-change: transform, opacity;
}
.k-scene--center { align-content: center; justify-items: center; }
.k-scene--fill { grid-template-rows: auto minmax(0, 1fr); }

/* Two-column composition used by details, pay and queue */
.k-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: var(--sp-6);
  align-items: stretch;
  min-height: 0;
}

/* Up to 1440 px the brand takes its natural width first and the buttons never shrink, so the bay name is
   only cut when nothing else is left. Wider glass keeps the steps exactly centred (1fr auto 1fr). */
@media (max-width: 1440px) {
  .k-topbar { grid-template-columns: minmax(0, max-content) minmax(max-content, 1fr) max-content; }
  .k-steps { justify-self: center; }
}
/* A 1024 px tablet has no room for the step pill beside the bay name and the two buttons. The pay and
   queue panels name their step in their own eyebrow, as in portrait. */
@media (max-width: 1180px) {
  .k-topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .k-steps { display: none; }
}
@media (max-width: 980px) {
  .k-split { grid-template-columns: minmax(0, 1fr); }
  /* Portrait has height to spare and little width: the badge drops under the bay name instead of
     cutting it. */
  .k-brand { flex-wrap: wrap; row-gap: 6px; }
}
