/* gate_checkin_demo/assets/demo.css */
/* Gate check-in demo additions. Load this file after the bundled shared demo CSS. */
/* Adds: tablet (iPad) frame, new persona colours, scanner, dynamic QR, printer animation, */
/* scenario tabs, wizard dots, SMS bubble, and the split check-out layout. */
/* Static mock-up only; not connected to any backend. */

/* ════════════════════════════════════════════════════════════════
   PART A: INDEX CONTROLLER ADDITIONS
   ════════════════════════════════════════════════════════════════ */

/* ── Viewport-locked index layout ──
   The header stays at the top, the nav is pinned at the bottom, and the
   stage + context row stretches to fill the space between them. Both
   columns share one height, so the two cards always end on the same line. */
body.dx-body {
  height: 100vh;
  overflow: hidden;
}

.dx-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 14px 24px 16px;
  box-sizing: border-box;
}

.dx-header { flex-shrink: 0; }

.dx-main {
  flex: 1;
  min-height: 0;
  margin-top: 14px;
}

.dx-stage {
  height: auto;
  min-height: 0;
}

.dx-context {
  height: auto;
  max-height: none;
  min-height: 0;
}

.dx-nav {
  flex-shrink: 0;
  margin-top: 14px;
}

/* The browser frame is sized by JS (width and height together) so it
   never overflows the stage vertically. */
.dx-browser { width: auto; }

@media (max-width: 1080px) {
  body.dx-body { height: auto; overflow: auto; }
  .dx-shell { height: auto; }
  .dx-stage { min-height: 420px; }
}

/* ── Tablet frame (iPad landscape, gate kiosk) ── */
.dx-tablet {
  position: relative;
  width: 1120px;
  height: 840px;
  transform-origin: top left;
  background: linear-gradient(150deg, #2a2f3a, #14161d);
  border-radius: 40px;
  padding: 20px;
  box-shadow: 0 18px 44px -18px rgba(18, 21, 27, 0.4);
  z-index: 2;
}

.dx-tablet__cam {
  position: absolute;
  left: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3b4252;
  box-shadow: inset 0 0 2px #000;
  z-index: 4;
}

.dx-tablet__screen {
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
}

.dx-tablet iframe {
  width: 1080px;
  height: 800px;
  border: 0;
  background: #fff;
  display: block;
}

/* ── New persona side colours (guard + safety manager) ── */
.dx-persona__avatar.side-guard { background: #46536a; }
.dx-persona__avatar.side-safety { background: #7a2e1f; }
.persona-pill .a.side-guard { background: #46536a; }
.persona-pill .a.side-safety { background: #7a2e1f; }

/* System chip pair used in the context panel + closing page */
.sys-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.sys-chip--a { background: #eef2fb; border: 1px solid #c3d0e8; color: var(--ls-navy); }
.sys-chip--b { background: #ffe7e0; border: 1px solid var(--ls-orange); color: var(--ls-orange-dark); }

/* ════════════════════════════════════════════════════════════════
   PART B: PAGE PIECES (inside iframes)
   ════════════════════════════════════════════════════════════════ */

/* ── Tablet page shell (fixed 1080 × 800 design) ── */
.tab-page {
  width: 1080px;
  height: 800px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--ls-grey-1);
}

/* iPad Safari toolbar: the guard is logged into the portal in a browser,
   same visual language as the phone's browser chrome. */
.ipad-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  flex-shrink: 0;
  background: #f6f6f7;
  border-bottom: 1px solid #e3e5e8;
  position: relative;
  padding: 0 20px;
}
.ipad-toolbar__url {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #e9eaec;
  border-radius: 8px;
  padding: 6px 16px;
  font-size: 13px;
  color: #222;
  min-width: 280px;
  justify-content: center;
}
.ipad-toolbar__url svg { flex-shrink: 0; color: #3c3c43; }
.ipad-toolbar__side {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 18px;
  color: #0a84ff;
}
.ipad-toolbar__side.is-left { left: 20px; }
.ipad-toolbar__side.is-right { right: 20px; }
.ipad-toolbar__side svg { display: block; }

.tab-page__band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 26px;
  background: #fff;
  color: var(--ls-navy);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.tab-page__band .t-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 700;
}

.tab-page__band .t-title small {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--ls-grey-4);
  display: block;
}

.tab-page__band .t-clock {
  font-size: 13px;
  font-weight: 500;
  color: var(--ls-grey-4);
  white-space: nowrap;
}

.tab-page__body {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* Keep the mobile wizard top bar visible while the page scrolls (steps 2 to 7) */
.app__bar {
  position: sticky;
  top: 0;
  z-index: 20;
}

/* iOS-style SMS autofill suggestion bar (OTP page) */
.autofill-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #eef0f3;
  border: 1px solid var(--ls-grey-3);
  font-size: 13px;
  color: var(--ls-text);
  cursor: default;
}
.autofill-bar .af-key {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ls-navy);
  flex-shrink: 0;
}
.autofill-bar b { font-family: var(--mono); letter-spacing: 0.08em; }

/* ── Wizard progress dots (pre-registration flow) ── */
.wiz-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wiz-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
}
.wiz-dots span.is-done { background: #fff; }
.wiz-dots span.is-now { background: var(--ls-orange); box-shadow: 0 0 0 3px rgba(255, 56, 15, 0.3); }

/* ── SMS bubble (step 1 trigger) ── */
.sms-thread {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--card-shadow);
}
.sms-thread__from {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}
.sms-thread__from .a {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--troilus-copper);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}
.sms-bubble {
  background: var(--ls-grey-1);
  border: 1px solid var(--line);
  border-radius: 4px 14px 14px 14px;
  padding: 11px 13px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ls-text);
}
.sms-bubble a { color: var(--ls-navy); font-weight: 700; text-decoration: underline; }

/* ── OTP boxes ── */
.otp-row { display: flex; gap: 8px; }
.otp-box {
  flex: 1;
  height: 46px;
  border: 1.5px solid var(--ls-grey-3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--ls-navy);
  background: #fff;
}
.otp-box.is-filled { border-color: var(--ls-success); background: #f2fbf5; }

/* Simple form field used on mobile wizard pages */
.f-field { display: grid; gap: 6px; }
.f-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ls-grey-4);
}
.f-input {
  height: 44px;
  border: 1.5px solid var(--ls-grey-3);
  border-radius: 8px;
  background: #fff;
  padding: 0 13px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ls-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.f-input .caret { color: var(--ls-grey-4); font-size: 11px; }
.f-input.is-ok { border-color: var(--ls-success); }

/* Toggle pill */
.toggle {
  position: relative;
  width: 44px;
  height: 25px;
  border-radius: 999px;
  background: var(--ls-grey-3);
  flex-shrink: 0;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: left 0.2s ease;
}
.toggle.is-on { background: var(--ls-success); }
.toggle.is-on::after { left: 22px; }

/* Signature strip */
.sig-strip {
  height: 74px;
  border: 1.5px dashed var(--ls-grey-3);
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.sig-strip svg { color: var(--ls-navy); }
.sig-strip .sig-lbl {
  position: absolute;
  bottom: 5px;
  right: 9px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--ls-grey-4);
  text-transform: uppercase;
}

/* ── Dynamic QR pass (step 5) ── */
.gate-pass {
  background: linear-gradient(160deg, #1c3160, #0d1426);
  border-radius: 16px;
  padding: 22px 18px 18px;
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.gate-pass__qr {
  width: 210px;
  height: 210px;
  margin: 0 auto;
  background: #fff;
  border-radius: 14px;
  padding: 13px;
  box-shadow: 0 10px 26px -8px rgba(0, 0, 0, 0.55);
  position: relative;
}
.gate-pass__qr svg { display: block; width: 100%; height: 100%; }
.gate-pass__qr.is-refreshing { animation: qr-flash 0.55s ease; }
@keyframes qr-flash {
  0% { box-shadow: 0 0 0 0 rgba(255, 56, 15, 0.7); }
  50% { box-shadow: 0 0 0 10px rgba(255, 56, 15, 0); transform: scale(0.97); }
  100% { transform: scale(1); }
}
.gate-pass__timer {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.gate-pass__timer .t { font-size: 16px; font-weight: 700; color: #fff; }

/* Fallback rows under the pass */
.fallback-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ls-grey-4);
}
.fallback-row:first-child { border-top: none; padding-top: 0; }
.fallback-row .fb-ic {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--ls-grey-1);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ls-navy);
  flex-shrink: 0;
}
.fallback-row b { color: var(--ls-text); }

/* ── Kiosk camera scan module (step 6, left column) ── */
.scan-cam {
  background: linear-gradient(160deg, #10182c, #0a0f1d);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}
.scan-cam__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 60% at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
}
.scan-cam__qr {
  background: #fff;
  padding: 12px;
  border-radius: 10px;
  width: 172px;
  height: 172px;
  position: relative;
  z-index: 1;
}
.scan-cam__qr svg { display: block; width: 100%; height: 100%; }
.scan-cam .qr-scanline { z-index: 3; }
.scan-cam__status {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 9px;
  background: rgba(27, 164, 79, 0.16);
  border: 1px solid rgba(27, 164, 79, 0.55);
  color: #6fe3a1;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  z-index: 4;
  opacity: 0;
  animation: scan-lock 0.5s ease 1.6s forwards;
}
@keyframes scan-lock { to { opacity: 1; } }

/* Verification checklist grid (step 6, right column) */
.verify-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Signal bar: gate check-in → loadshift.ca */
.signal-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 10px;
  background: #fff7f3;
  border: 1px dashed var(--ls-orange);
}
.signal-bar__pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ls-orange);
  flex-shrink: 0;
  animation: dx-pulse 1.8s infinite;
}
.signal-bar b { color: var(--ls-orange-dark); }

/* Reveal-on-action utility (check-in confirmation, award sequence) */
.reveal { opacity: 0; transform: translateY(6px); transition: opacity 0.45s ease, transform 0.45s ease; }
.reveal.is-shown { opacity: 1; transform: none; }

/* ── Printer animation (step 7) ── */
.print-unit { text-align: center; }

/* Centre the two printer columns vertically inside the kiosk floor,
   so the layout stays balanced before and after printing. */
.print-floor { align-content: center; }
.print-unit__slot {
  position: relative;
  height: 185px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}
.print-card {
  position: absolute;
  top: 0;
  left: 50%;
  width: 330px;
  transform: translate(-50%, -104%);
  transition: transform 1.6s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1;
}
.print-unit.is-printed .print-card { transform: translate(-50%, 0); }
.print-slot-hint {
  position: absolute;
  top: 10px;
  left: calc(50% - 172px);
  width: 344px;
  height: 128px;
  border: 1.5px dashed var(--ls-grey-3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ls-grey-4);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  z-index: 0;
  transition: opacity 0.4s ease;
}
.print-unit.is-printed .print-slot-hint,
.print-unit.is-printing .print-slot-hint { opacity: 0; }
.print-unit__printer { position: relative; z-index: 2; }
.print-unit__printer svg { display: block; margin: 0 auto; }
.print-led { fill: #5c6370; }
.print-unit.is-printing .print-led { animation: led-blink 0.5s linear infinite; }
.print-unit.is-printed .print-led { fill: #1ba44f; animation: none; }
@keyframes led-blink { 0%, 100% { fill: #f5a623; } 50% { fill: #5c6370; } }
.print-unit__state {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ls-grey-4);
}
.print-unit.is-printed .print-unit__state { color: var(--ls-success); font-weight: 700; }

/* Physical badge card faces */
.badge-card {
  background: #fff;
  border: 1px solid var(--ls-grey-3);
  border-radius: 12px;
  box-shadow: 0 8px 20px -10px rgba(13, 20, 38, 0.45);
  overflow: hidden;
  text-align: left;
}
.badge-card__band {
  padding: 9px 14px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
}
.badge-card__band--person { background: var(--ls-navy); }
.badge-card__band--vehicle { background: var(--troilus-copper); }
.badge-card__body { padding: 12px 14px; display: flex; gap: 12px; align-items: center; }
.badge-card__qr { width: 64px; height: 64px; flex-shrink: 0; }
.badge-card__qr svg { display: block; width: 100%; height: 100%; }

/* ── Scenario tabs (step 8) ── */
.scene-tabs {
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 4px;
  gap: 4px;
}
.scene-tab {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--ls-grey-4);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}
.scene-tab.is-active { background: var(--ls-navy); color: #fff; }

/* Mini horizontal status timeline inside a table row */
.mini-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11.5px;
  font-weight: 700;
}
.mini-line .st { display: inline-flex; align-items: center; gap: 5px; color: var(--ls-success); }
.mini-line .st.is-pending { color: var(--ls-grey-4); font-weight: 500; }
.mini-line .sep { color: var(--ls-grey-3); }

/* Anomaly alert bar */
.anomaly-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-radius: 10px;
  background: #fdf1ec;
  border: 1px solid #eec4b3;
  border-left: 4px solid var(--ls-danger);
}
.anomaly-bar .a-ic {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--ls-danger);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Split check-out layout (step 11) ── */
.split-2 {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* Phone-style column embedded on a desktop page.
   Fixed width and a minimum screen height keep the phone proportions
   (~2:1) instead of collapsing to the content height. */
.embed-phone {
  width: 340px;
  margin: 0 auto;
  background: linear-gradient(150deg, #2a2f3a, #14161d);
  border-radius: 38px;
  padding: 11px;
  box-shadow: 0 14px 34px -16px rgba(18, 21, 27, 0.45);
}
.embed-phone__screen {
  background: var(--ls-grey-1);
  border-radius: 29px;
  overflow: hidden;
  min-height: 660px;
  display: flex;
  flex-direction: column;
}
.embed-phone__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  gap: 12px;
  padding: 16px;
}

/* ── Registration-complete sync connector (step 4) ── */
.sync-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ls-grey-4);
  margin: 2px 0;
}
.sync-link::before,
.sync-link::after {
  content: "";
  width: 2px;
  height: 16px;
  background: repeating-linear-gradient(180deg, var(--ls-grey-3) 0 4px, transparent 4px 8px);
}
.slide-in { animation: slide-in 0.6s ease both; }
.slide-in.d2 { animation-delay: 0.35s; }
.slide-in.d3 { animation-delay: 0.7s; }
@keyframes slide-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ── Wrap hygiene ─────────────────────────────────────────────────────────
   Headings and bullets split evenly instead of orphaning a single word;
   body text avoids one-word last lines. */
.dx-eyebrow,
.dx-title,
.dx-persona__meta .name,
.dx-persona__meta .role {
  text-wrap: balance;
}
.dx-features li span {
  text-wrap: balance;
}
.dx-story,
.dx-desc,
.dx-impact p {
  text-wrap: pretty;
}

/* Use the full display width: the shared stylesheet caps the shell at
   1480px, which left dead space around the browser frame on large monitors.
   The stage grows; the context panel stays fixed at 384px. */
.dx-shell {
  max-width: none;
}

/* Keep the header height constant across steps: on the cover the part chip
   is hidden but must still reserve its space, otherwise the stage shifts
   by a few pixels when stepping into Part 1 (visible as a bounce). */
#dx-part-chip.is-hidden {
  display: inline-flex !important;
  visibility: hidden;
}

/* ── Device screens must not shift when a page happens to scroll ──
   A visible scrollbar steals viewport width, which nudges centred
   layouts sideways between steps. Real phones and tablets overlay
   their scrollbars, so hide them inside every demo screen. */
body.demo-page { scrollbar-width: none; -ms-overflow-style: none; }
body.demo-page::-webkit-scrollbar,
body.demo-page *::-webkit-scrollbar { width: 0; height: 0; display: none; }
body.demo-page * { scrollbar-width: none; }

/* Same rule for the shell: a scrollbar appearing on a long right panel
   narrows the column and reflows the copy between steps. */
body.dx-body, .dx-context { scrollbar-width: none; -ms-overflow-style: none; }
body.dx-body::-webkit-scrollbar,
.dx-context::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* Driver persona on the internal return-load steps (no tier colouring) */
.dx-persona__avatar.side-driver { background: var(--ls-navy); }
.persona-pill .a.side-driver { background: var(--ls-navy); }
