:root {
  --color-blue: #3d6d95;
  --color-blue-dark: #2f5679;
  --color-blue-darker: #1f3a52;
  --color-gold: #f0b429;
  --color-gold-dim: #d9d9d9;
  --color-text: #1c2733;
  --color-text-soft: #5b6b78;
  --color-border: #e6e9ec;
  --color-bg: #ffffff;
  --color-bg-soft: #f7f8f9;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-full: 999px;
  --shadow-card: 0 1px 3px rgba(20, 30, 40, 0.08);
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --scan-accent: #4fd1ff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--color-bg-soft);
  color: var(--color-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hidden { display: none !important; }

button {
  font-family: inherit;
  cursor: pointer;
}

/* ===================== QR SCANNER (logo button) =====================
   Same rules as the real lot-detail page's scanner card — unchanged so
   scripfac.js's positioning math still lines up with the "o" in the logo. */

#qr-scanner-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: fit-content;
  max-width: 350px;
  margin: 0 auto;
  padding: 28px 32px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.qr-hint {
  color: #777;
  font-size: 14px;
  text-align: center;
  margin: 0;
}

/* Wraps the logo image so the button can sit exactly on top of it. */
#logo-wrap {
  position: relative;
  display: inline-block;
  width: 240px;
  max-width: 90vw;
  margin: 0 auto;
}
#qcow-logo {
  display: block;
  width: 100%;
  height: auto;
  margin-top : 20px;
}

#qcow-arrow {
  margin-left: 30px;
}

/* Invisible clickable circle sitting on top of the "o".
   JS (setupQrScanner -> positionButton) sets precise inline width/height/
   left/top once the logo has actually finished laying out. The values
   below are just a same-shape fallback for the brief instant before JS runs. */
#qr-btn {
  position: absolute;
  width: 38px;
  height: 38px;
  left: 75px;
  top: 3px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  border-radius: 50%;
  padding: 0;
  z-index: 2;
}
#qr-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4) inset;
}
#qr-btn svg {
  width: 55%;
  height: 55%;
  opacity: 0;
  transition: opacity 0.15s ease;
}
#qr-btn:hover svg {
  opacity: 0.9;
}

/* ===================== SCAN FRAME GRAPHIC =====================
   Purely decorative viewfinder brackets + sweeping line wrapped around
   #logo-wrap. Sized a bit larger than the logo so the corners frame it
   with breathing room, rather than touching the artwork directly. */
.scan-frame {
  position: relative;
  padding: 22px 26px;
}

.scan-frame .corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 3px solid var(--scan-accent);
}
.scan-frame .corner.tl {
  top: 0; left: 0;
  border-right: none;
  border-bottom: none;
  border-top-left-radius: 6px;
}
.scan-frame .corner.tr {
  top: 0; right: 0;
  border-left: none;
  border-bottom: none;
  border-top-right-radius: 6px;
}
.scan-frame .corner.bl {
  bottom: 0; left: 0;
  border-right: none;
  border-top: none;
  border-bottom-left-radius: 6px;
}
.scan-frame .corner.br {
  bottom: 0; right: 0;
  border-left: none;
  border-top: none;
  border-bottom-right-radius: 6px;
}

.scan-frame .scan-line {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--scan-accent), transparent);
  animation: scan-move 2.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes scan-move {
  0%   { top: 6px; opacity: 0.15; }
  50%  { top: calc(100% - 6px); opacity: 1; }
  100% { top: 6px; opacity: 0.15; }
}

/* ===== Scanner modal ===== */
#scanner-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
#scanner-modal.hidden { display: none; }

#scanner-panel {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  width: 90%;
  max-width: 420px;
  text-align: center;
}
#qr-reader { width: 100%; }
#scanner-close-btn {
  margin-top: 14px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: #3a6f96;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}
#qr-result {
  margin-top: 10px;
  font-size: 14px;
  color: #333;
  word-break: break-all;
}