html,
body,
#app {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  background: #010911;
}

.cashier-boot {
  --cashier-boot-image-half-height: max(28.125vw, 202.5px);
  display: block;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  overflow: hidden;
  color: #f4fafc;
  background: #010911;
  background: linear-gradient(
    to bottom,
    #010911 0,
    #010911 calc(50% - var(--cashier-boot-image-half-height)),
    #01070d calc(50% + var(--cashier-boot-image-half-height)),
    #01070d 100%
  );
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.cashier-boot__center {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
}

.cashier-boot__brand {
  position: relative;
  width: max(100vw, 720px);
  height: max(56.25vw, 405px);
  flex: 0 0 auto;
}

.cashier-boot__brand img {
  display: block;
  width: 100%;
  height: 100%;
  -webkit-mask-image: linear-gradient(to bottom, #000 57%, transparent 60%);
  mask-image: linear-gradient(to bottom, #000 57%, transparent 60%);
}

/* The source artwork includes a static loading ring; replace it with a real motion cue. */
.cashier-boot__brand-spinner {
  position: absolute;
  top: 63%;
  left: 50%;
  width: clamp(22px, 2.9vw, 56px);
  height: clamp(22px, 2.9vw, 56px);
  box-sizing: border-box;
  border: clamp(2px, 0.35vw, 7px) solid rgba(157, 175, 187, 0.58);
  border-top-color: #19c37d;
  border-radius: 50%;
  animation: cashier-brand-spin 0.9s linear infinite;
}

.cashier-boot__brand-loading {
  position: absolute;
  top: 69%;
  left: 50%;
  color: #9dafbb;
  font-size: clamp(12px, 1.55vw, 30px);
  line-height: 1.4;
  white-space: nowrap;
  transform: translateX(-50%);
}

.cashier-boot__card {
  position: absolute;
  width: 1px;
  height: 1px;
  box-sizing: border-box;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.cashier-boot[data-state="error"] .cashier-boot__center {
  padding: 24px;
  overflow: auto;
}

.cashier-boot[data-state="error"] .cashier-boot__brand {
  display: none;
}

.cashier-boot[data-state="error"] .cashier-boot__card {
  position: static;
  display: inline-block;
  width: 360px;
  height: auto;
  max-width: calc(100vw - 48px);
  padding: 24px;
  margin: 0;
  overflow: visible;
  clip: auto;
  border: 1px solid rgba(124, 171, 191, 0.24);
  border-radius: 12px;
  background: #081d2c;
  box-shadow: 0 14px 40px rgba(1, 13, 22, 0.32);
  white-space: normal;
}

.cashier-boot__spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  margin-bottom: 16px;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: #19c37d;
  border-radius: 50%;
  animation: cashier-bootstrap-spin 0.9s linear infinite;
}

.cashier-boot[data-state="error"] .cashier-boot__spinner {
  border-color: #f04454;
  animation: none;
}

.cashier-boot__title,
.cashier-boot__message {
  display: block;
}

.cashier-boot__title {
  margin-bottom: 8px;
  font-size: 20px;
}

.cashier-boot__message {
  color: #9dafbb;
  font-size: 13px;
  line-height: 1.5;
}

.cashier-boot__retry {
  min-height: 42px;
  margin-top: 18px;
  padding: 0 20px;
  border: 0;
  border-radius: 8px;
  color: #020a12;
  background: #19c37d;
  font: inherit;
  font-weight: 700;
}

.cashier-boot__retry[hidden] {
  display: none;
}

.terminal-debug-panel {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 2147483647;
  width: 360px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  padding: 10px 12px;
  overflow: auto;
  border: 1px solid #5f7d8c;
  border-radius: 6px;
  color: #f4fafc;
  background: #18252d;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.36);
  font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  pointer-events: none;
  white-space: pre-wrap;
}

@keyframes cashier-bootstrap-spin {
  to { transform: rotate(360deg); }
}

@keyframes cashier-brand-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@supports (height: 100dvh) {
  .cashier-boot {
    height: 100dvh;
    min-height: 100dvh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cashier-boot__spinner { animation: none; }
  .cashier-boot__brand-spinner {
    animation: none;
    transform: translate(-50%, -50%);
  }
}
