:root {
  --paper: #fff4f1;
  --ink: #202033;
  --coral: #fa8d84;
  --coral-deep: #ed706b;
}

*, *::before, *::after { box-sizing: border-box; }
html, body, #app { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  background: #211f29;
  color: var(--ink);
  font-family: "Hiragino Sans", "Yu Gothic", "YuGothic", sans-serif;
}

.b-presentation,
.b-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.b-stage {
  --presentation-scale: 1;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1920px;
  height: 1080px;
  overflow: hidden;
  isolation: isolate;
  transform: translate(-50%, -50%) scale(var(--presentation-scale));
  transform-origin: 50% 50%;
  background: var(--paper);
}

.b-master-image,
.b-mask-layer,
.b-motion-layer,
.b-page-layer,
.b-click-surface {
  position: absolute;
  inset: 0;
  width: 1920px;
  height: 1080px;
}

.b-master-image {
  z-index: 1;
  display: block;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}

.b-page-layer { z-index: 25; }
.b-mask-layer { z-index: 35; pointer-events: none; }
.b-motion-layer { z-index: 36; pointer-events: none; }
.b-click-surface {
  z-index: 40;
  border: 0;
  padding: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.b-mask {
  position: absolute;
  left: var(--mask-x);
  top: var(--mask-y);
  width: var(--mask-w);
  height: var(--mask-h);
  border-radius: var(--mask-radius);
  background: var(--mask-color);
  opacity: 1;
  transition: opacity 360ms ease;
}
.b-mask.is-revealed { opacity: 0; }

.b-motion-layer img,
.b-passed-card {
  position: absolute;
  pointer-events: none;
}
.b-road-patch {
  left: var(--motion-x);
  top: var(--motion-y);
  width: var(--motion-w);
  height: var(--motion-h);
}
.b-moving-car {
  left: var(--car-x);
  top: var(--car-y);
  width: var(--car-w);
  height: var(--car-h);
  object-fit: contain;
  filter: drop-shadow(0 3px 2px rgb(32 32 51 / .12));
}
.b-passed-card {
  left: var(--motion-x);
  top: var(--motion-y);
  width: var(--motion-w);
  height: var(--motion-h);
  border-radius: 28px;
  background: rgb(252 240 238 / .32);
}

.b-ui,
.b-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
}
.b-modal-layer { z-index: 220; }

.b-counter {
  position: absolute;
  right: 18px;
  bottom: 14px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgb(32 32 51 / .62);
  color: #fff;
  font-size: 13px;
  opacity: .75;
}
.b-nav {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  display: flex;
  justify-content: space-between;
  opacity: 0;
  transition: opacity 180ms ease;
}
.b-nav.is-visible { opacity: .78; }
.b-nav button {
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  pointer-events: auto;
  cursor: pointer;
}

.b-menu {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(32 32 51 / .93);
  pointer-events: auto;
}
.b-menu__panel { width: min(1180px, 84vw); }
.b-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  color: #fff;
}
.b-menu__header h2 { margin: 0; font-size: 30px; }
.b-menu__customer { color: #ffd6ce; font-weight: 800; }
.b-menu__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}
.b-menu button {
  min-height: 88px;
  border: 0;
  border-radius: 13px;
  padding: 13px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.b-menu button b { display: block; margin-bottom: 5px; color: var(--coral); font-size: 22px; }
.b-menu__actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 18px; }
.b-menu__actions button { min-height: 0; border-radius: 999px; padding: 12px 20px; }
.b-menu__actions .b-new-deal { background: #ff5a82; color: #fff; font-weight: 800; }

.b-confirm {
  width: min(510px, 90vw);
  margin: auto;
  padding: 30px;
  border: 0;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 18px 60px rgb(0 0 0 / .36);
  pointer-events: auto;
}
.b-confirm h2 { margin: 0 0 12px; font-size: 28px; }
.b-confirm p { margin: 0 0 22px; color: #6f6d78; font-size: 18px; line-height: 1.6; }
.b-confirm__actions { display: flex; justify-content: flex-end; gap: 10px; }
.b-confirm button { border: 0; border-radius: 999px; padding: 11px 18px; font: inherit; font-weight: 800; cursor: pointer; }
.b-confirm [data-confirm-new-deal] { background: #ff5a82; color: #fff; }

.b-start-screen {
  position: absolute;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 78% 18%, rgb(250 141 132 / .14), transparent 290px),
    var(--paper);
  pointer-events: auto;
}
.b-start-card {
  width: 650px;
  padding: 58px 66px 62px;
  border-radius: 38px;
  background: #fff;
  box-shadow: 0 18px 54px rgb(32 32 51 / .10);
}
.b-start-card__eyebrow { margin: 0 0 14px; color: var(--coral-deep); font-size: 18px; font-weight: 900; letter-spacing: .14em; }
.b-start-card h1 { margin: 0 0 13px; font-size: 46px; line-height: 1.25; }
.b-start-card__lead { margin: 0 0 32px; color: #6f6d78; font-size: 19px; line-height: 1.7; }
.b-start-card label { display: block; color: #545166; font-size: 17px; font-weight: 800; }
.b-start-card input {
  width: 100%;
  margin-top: 9px;
  padding: 17px 20px;
  border: 2px solid #eadedb;
  border-radius: 16px;
  outline: 0;
  color: var(--ink);
  font: inherit;
  font-size: 27px;
  font-weight: 800;
}
.b-start-card input:focus { border-color: var(--coral); box-shadow: 0 0 0 5px rgb(250 141 132 / .15); }
.b-start-card button {
  width: 100%;
  margin-top: 20px;
  padding: 16px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font: inherit;
  font-size: 21px;
  font-weight: 900;
  cursor: pointer;
}
.b-start-error { min-height: 25px; margin: 10px 0 -5px; color: #c64258; font-size: 15px; font-weight: 700; }

.b-customer-context {
  position: absolute;
  z-index: 65;
  right: 68px;
  top: 45px;
  color: #545166;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .04em;
  pointer-events: none;
}
.b-customer-context strong { color: var(--coral-deep); font-size: 25px; }

/* Slots stay in the DOM for one renderer/state source, but cannot capture a
   presentation click until their original step card has been revealed. */
.b-stage[data-page="8"][data-step="0"] [data-slot="step2TestCenter"],
.b-stage[data-page="8"][data-step="0"] [data-slot="step3School"],
.b-stage[data-page="8"][data-step="0"] [data-slot="step4TestCenterDisplay"],
.b-stage[data-page="8"][data-step="1"] [data-slot="step2TestCenter"],
.b-stage[data-page="8"][data-step="1"] [data-slot="step3School"],
.b-stage[data-page="8"][data-step="1"] [data-slot="step4TestCenterDisplay"],
.b-stage[data-page="8"][data-step="2"] [data-slot="step3School"],
.b-stage[data-page="8"][data-step="2"] [data-slot="step4TestCenterDisplay"],
.b-stage[data-page="8"][data-step="3"] [data-slot="step4TestCenterDisplay"],
.b-stage[data-page="9"][data-step="0"] [data-slot="step2TestCenter"],
.b-stage[data-page="9"][data-step="0"] [data-slot="step3School"],
.b-stage[data-page="9"][data-step="0"] [data-slot="step4TestCenterDisplay"],
.b-stage[data-page="9"][data-step="1"] [data-slot="step2TestCenter"],
.b-stage[data-page="9"][data-step="1"] [data-slot="step3School"],
.b-stage[data-page="9"][data-step="1"] [data-slot="step4TestCenterDisplay"],
.b-stage[data-page="9"][data-step="2"] [data-slot="step3School"],
.b-stage[data-page="9"][data-step="2"] [data-slot="step4TestCenterDisplay"],
.b-stage[data-page="9"][data-step="3"] [data-slot="step4TestCenterDisplay"] {
  pointer-events: none;
}

.b-qa-mode .b-ui,
.b-qa-mode .b-modal-layer { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

@media (max-width: 760px) {
  .b-menu__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .b-mask, .b-nav { transition-duration: 1ms; }
}
