/* ValSolution QR Code Scanner — Lightweight, privacy-safe, scoped to preserve shared header/footer */
.qrs-page {
  --qrs-ink: #193b35;
  --qrs-text: #4d6761;
  --qrs-accent: #276653;
  --qrs-accent-hover: #1e5242;
  --qrs-line: #dfe9e3;
  --qrs-panel: #ffffff;
  --qrs-soft: #f0f5ec;
  --qrs-stage: #0f1f1b;
  --qrs-stage-ink: #edf6f2;
  --qrs-stage-sub: #a9c6bc;
  --qrs-danger: #b42318;
  color: var(--qrs-ink);
  font-family: var(--font-body, Inter, system-ui, -apple-system, Arial, sans-serif);
  background:
    radial-gradient(ellipse at 12% 4%, #dcf1eb 0, transparent 36%),
    radial-gradient(ellipse at 92% 9%, #e7edce 0, transparent 32%),
    #f8faf6;
  padding-bottom: 12px;
}

.qrs-page * { box-sizing: border-box; }
.qrs-page [hidden] { display: none !important; }
.qrs-page :where(h1, h2, p) { margin: 0; }
.qrs-page :where(button, input, select) { font: inherit; }
.qrs-page :where(button, a, input, select, summary):focus-visible {
  outline: 3px solid #6ab89f;
  outline-offset: 3px;
}
.qrs-page a { color: var(--qrs-accent); }

.qrs-shell {
  width: min(1040px, calc(100% - 48px));
  margin: 0 auto;
  padding: 46px 0 64px;
}

/* Hero */
.qrs-hero {
  max-width: 760px;
  margin: 0 auto 32px;
  text-align: center;
}
.qrs-kicker {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--qrs-line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--qrs-accent);
  background: var(--qrs-panel);
}
.qrs-hero h1 {
  font-family: var(--font-display, inherit);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.15;
  letter-spacing: -1.4px;
  margin: 16px 0 12px;
  color: var(--qrs-ink);
}
.qrs-hero h1 span {
  display: block;
  margin-top: 6px;
  font-size: 0.54em;
  letter-spacing: -0.4px;
  font-weight: 450;
  color: var(--qrs-text);
}
.qrs-hero p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--qrs-text);
}
.qrs-perks {
  display: flex;
  justify-content: center;
  gap: 18px 24px;
  flex-wrap: wrap;
  margin-top: 16px;
  font-size: 12px;
  color: var(--qrs-text);
}
.qrs-perks span::before {
  content: '✓';
  margin-right: 6px;
  color: var(--qrs-accent);
  font-weight: 700;
}

/* Main Scanner Card */
.qrs-card {
  max-width: 720px;
  margin: 0 auto;
  background: var(--qrs-panel);
  border: 1px solid var(--qrs-line);
  border-radius: 24px;
  box-shadow: 0 22px 60px -32px rgba(25, 59, 53, 0.25);
  overflow: hidden;
  padding: 20px;
}

.qrs-view {
  position: relative;
  width: 100%;
  min-height: 360px;
  aspect-ratio: 16 / 10;
  background: radial-gradient(circle at 50% 35%, #19362e 0%, var(--qrs-stage) 75%);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.qrs-view.is-dragging {
  border-color: #6ab89f;
  box-shadow: inset 0 0 0 3px rgba(106, 184, 159, 0.35);
}
.qrs-view video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Launcher ("Scan QR or Pick QR") */
.qrs-launcher {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 22px;
  gap: 12px;
  max-width: 480px;
  color: var(--qrs-stage-ink);
}
.qrs-badge-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: rgba(106, 184, 159, 0.14);
  border: 1px solid rgba(106, 184, 159, 0.3);
  color: #8ee0c5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.qrs-launcher-title {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #ffffff;
}
.qrs-launcher-sub {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--qrs-stage-sub);
}
.qrs-launcher-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
  width: 100%;
}
.qrs-drop-hint {
  font-size: 12px;
  color: rgba(200, 226, 217, 0.72);
  margin-top: 4px;
}

/* Buttons */
.qrs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  touch-action: manipulation;
  white-space: nowrap;
}
.qrs-btn:active { transform: scale(0.98); }
.qrs-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.qrs-btn-primary {
  background: #2e8b6e;
  border-color: #2e8b6e;
  color: #ffffff !important;
}
.qrs-btn-primary:hover {
  background: #25735a;
  border-color: #25735a;
}

.qrs-launcher .qrs-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}
.qrs-launcher .qrs-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
}

.qrs-modal .qrs-btn-secondary {
  background: var(--qrs-soft);
  border-color: var(--qrs-line);
  color: var(--qrs-ink);
}
.qrs-modal .qrs-btn-secondary:hover {
  border-color: var(--qrs-accent);
}

.qrs-btn-ghost {
  background: transparent;
  border-color: var(--qrs-line);
  color: var(--qrs-text);
}
.qrs-btn-ghost:hover {
  background: var(--qrs-soft);
  color: var(--qrs-ink);
}

/* Live Scan Reticle */
.qrs-reticle {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 48px;
}
.qrs-frame {
  position: relative;
  width: min(220px, 56vw);
  height: min(220px, 56vw);
  box-shadow: 0 0 0 9999px rgba(8, 18, 15, 0.42);
  border-radius: 16px;
}
.qrs-frame span {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 3.5px solid #6ee7b7;
}
.qrs-frame span:nth-child(1) { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.qrs-frame span:nth-child(2) { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
.qrs-frame span:nth-child(3) { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
.qrs-frame span:nth-child(4) { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }

.qrs-laser {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #6ee7b7, transparent);
  box-shadow: 0 0 10px #6ee7b7;
  animation: qrs-sweep 2.1s ease-in-out infinite;
}
@keyframes qrs-sweep {
  0%, 100% { top: 14px; opacity: 0.4; }
  50% { top: calc(100% - 16px); opacity: 1; }
}
.qrs-reticle-tip {
  margin-top: 14px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(15, 31, 27, 0.72);
  color: #e6f7f0;
  font-size: 12px;
  font-weight: 500;
}

/* Camera Floating Controls */
.qrs-cam-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(15, 31, 27, 0.82);
  backdrop-filter: blur(8px);
}
.qrs-cam-select {
  flex: 1 1 140px;
  min-width: 0;
  min-height: 38px;
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 12.5px;
}
.qrs-cam-select option {
  background: #132520;
  color: #ffffff;
}
.qrs-bar-btn {
  min-height: 38px;
  padding: 6px 13px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.qrs-bar-btn:hover { background: rgba(255, 255, 255, 0.22); }
.qrs-bar-btn[aria-pressed="true"] {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #111827;
}
.qrs-bar-stop {
  background: rgba(220, 38, 38, 0.85);
  border-color: rgba(248, 113, 113, 0.5);
}
.qrs-bar-stop:hover { background: #dc2626; }

/* Card Footer */
.qrs-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 4px 2px;
}
.qrs-status {
  font-size: 13px;
  line-height: 1.5;
  color: var(--qrs-text);
  overflow-wrap: anywhere;
}
.qrs-status[data-error="true"] {
  color: var(--qrs-danger);
  font-weight: 550;
}
.qrs-generator {
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.qrs-generator:hover { text-decoration: underline; }

/* Guide & FAQ */
.qrs-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 36px 0;
}
.qrs-guide article {
  padding: 22px;
  border: 1px solid var(--qrs-line);
  border-radius: 16px;
  background: var(--qrs-panel);
}
.qrs-eyebrow {
  display: block;
  color: var(--qrs-accent);
  font-size: 10.5px;
  letter-spacing: 1.3px;
  font-weight: 750;
  margin-bottom: 8px;
}
.qrs-guide h2 {
  font-size: 17px;
  line-height: 1.35;
  color: var(--qrs-ink);
}
.qrs-guide p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--qrs-text);
  margin-top: 8px;
}

.qrs-faq {
  max-width: 760px;
  margin: 40px auto 0;
}
.qrs-faq > h2 {
  font-size: 21px;
  margin-bottom: 14px;
  color: var(--qrs-ink);
}
.qrs-faq details {
  border-bottom: 1px solid var(--qrs-line);
  padding: 15px 0;
}
.qrs-faq summary {
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
.qrs-faq details p {
  padding-top: 10px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--qrs-text);
}
.qrs-help {
  font-size: 12px;
  line-height: 1.7;
  color: var(--qrs-text);
  margin-top: 14px !important;
}

/* Result Popup Modal */
.qrs-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.qrs-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 24, 20, 0.65);
  backdrop-filter: blur(4px);
}
.qrs-modal-card {
  position: relative;
  z-index: 1;
  width: min(490px, 100%);
  max-height: min(86vh, 660px);
  overflow-y: auto;
  background: var(--qrs-panel);
  border: 1px solid var(--qrs-line);
  border-radius: 20px;
  box-shadow: 0 28px 70px -20px rgba(0, 0, 0, 0.45);
  padding: 22px;
  animation: qrs-pop 0.18s ease-out;
}
@keyframes qrs-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.qrs-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.qrs-modal-meta h2 {
  font-size: 19px;
  line-height: 1.3;
  margin-top: 6px;
  color: var(--qrs-ink);
}
.qrs-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--qrs-soft);
  border: 1px solid var(--qrs-line);
  color: var(--qrs-accent);
}
.qrs-modal-x {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--qrs-line);
  background: var(--qrs-panel);
  color: var(--qrs-text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.qrs-modal-x:hover { background: var(--qrs-soft); color: var(--qrs-ink); }

.qrs-fields {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--qrs-soft);
  border: 1px solid var(--qrs-line);
}
.qrs-field-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  line-height: 1.5;
}
.qrs-field-key {
  color: var(--qrs-text);
  font-weight: 600;
  flex-shrink: 0;
}
.qrs-field-val {
  color: var(--qrs-ink);
  font-weight: 550;
  text-align: right;
  word-break: break-word;
}

.qrs-raw-wrap { margin-bottom: 12px; }
.qrs-raw-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--qrs-text);
  margin-bottom: 6px;
}
.qrs-raw-box {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--qrs-line);
  background: var(--qrs-soft);
  color: var(--qrs-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: all;
}
.qrs-modal-safety {
  font-size: 12px;
  line-height: 1.5;
  color: var(--qrs-text);
  margin-bottom: 18px;
}
.qrs-modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.qrs-modal-actions .qrs-btn {
  flex: 1 1 110px;
}

/* Dark Theme Support */
[data-theme="dark"] .qrs-page {
  --qrs-ink: #e2f0e6;
  --qrs-text: #a9c2b5;
  --qrs-accent: #7dd3b0;
  --qrs-line: #2f4a3c;
  --qrs-panel: #16261e;
  --qrs-soft: #1f352a;
  --qrs-danger: #ffb4a8;
  background: #101c16;
}
[data-theme="dark"] .qrs-btn-primary {
  background: #2e8b6e;
  border-color: #2e8b6e;
  color: #ffffff !important;
}

/* Responsive */
@media (max-width: 820px) {
  .qrs-shell { width: calc(100% - 28px); padding-top: 32px; }
  .qrs-guide { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .qrs-shell { width: calc(100% - 20px); }
  .qrs-card { padding: 14px; border-radius: 20px; }
  .qrs-view { min-height: 330px; aspect-ratio: 4 / 5; }
  .qrs-launcher-actions .qrs-btn { flex: 1 1 100%; }
  .qrs-modal-card { padding: 18px; }
}
