/* PharmaLinea Trust — Light authentication portal. */

@font-face {
  font-family: "Plex Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/plex-sans.woff2") format("woff2");
}

@font-face {
  font-family: "Plex Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/assets/fonts/plex-mono.woff2") format("woff2");
}

@font-face {
  font-family: "Plex Serif";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fonts/plex-serif.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --pharma-base: #1a2b3c;
  --linea-teal: #00a0b0;
  --linea-teal-bright: #00acc1;
  --linea-teal-dark: #0097a7;
  --logo-green: #0e3424;
  --bg: #f9fafb;
  --surface: #ffffff;
  --surface-tint: #f3f4f6;
  --ink: var(--pharma-base);
  --ink-soft: #374151;
  --ink-mute: #6b7280;
  --ink-fade: #9ca3af;
  --hair: #e5e7eb;
  --hair-soft: #f3f4f6;
  --forest: var(--linea-teal);
  --forest-deep: var(--linea-teal-dark);
  --forest-dark: var(--logo-green);
  --forest-soft: #e6f8fa;
  --forest-mid: #c7f0f4;
  --mint: #8ee0e7;
  --silver: #d1d5db;
  --amber: #f59e0b;
  --amber-soft: #fffbeb;
  --crimson: #ef4444;
  --crimson-soft: #fef2f2;
  --shadow: 0 1px 3px rgba(26, 43, 60, 0.1), 0 20px 52px -34px rgba(26, 43, 60, 0.36);
  --radius: 15px;
  --radius-sm: 10px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

::selection {
  background: var(--forest);
  color: var(--surface);
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 20% -8%, rgba(0, 160, 176, 0.1), transparent 30rem),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 42%, #f3f4f6 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Plex Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", system-ui, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "kern", "ss01", "tnum";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: transparent;
}

.shell {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
  display: grid;
  gap: 10px;
}

/* ──────────── Topbar ──────────── */

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 1px 9px;
  min-width: 0;
}

.topbar .brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar .brand-mark {
  width: 44px;
  height: 44px;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 11px 16px rgba(0, 92, 53, 0.18));
  mix-blend-mode: multiply;
}

.topbar .brand-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.brand-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-family: "Plex Serif", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.16rem, 5vw, 1.45rem);
  letter-spacing: 0;
  color: var(--ink);
  white-space: nowrap;
  line-height: 1;
}

.brand-linea {
  color: var(--linea-teal);
}

.brand-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.45em;
  margin-left: 0.36em;
  font-family: "Plex Sans", sans-serif;
  font-weight: 700;
  font-size: 0.46rem;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--surface);
  background: var(--logo-green);
  padding: 0 0.55em;
  border-radius: 6px;
  line-height: 1;
  transform: translateY(0.07em);
}

.brand-subtitle {
  font-family: "Plex Sans", sans-serif;
  font-size: clamp(0.52rem, 2.3vw, 0.62rem);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.topbar .progress {
  display: grid;
  gap: 7px;
  align-items: center;
  justify-items: stretch;
  padding: 0;
  min-width: 94px;
}

.progress-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: "Plex Sans", sans-serif;
  font-size: 0.57rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  justify-content: center;
  padding: 6px 8px;
  background: rgba(239, 243, 240, 0.9);
  border-radius: var(--radius-pill);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  white-space: nowrap;
}

.progress-num {
  width: 21px;
  height: 21px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: var(--surface);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0;
}

.progress-bar {
  width: 100%;
  height: 5px;
  background: #d8dcd9;
  border-radius: var(--radius-pill);
  position: relative;
  overflow: hidden;
}

.progress-bar::before,
.progress-bar::after {
  content: none;
}

.progress-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--forest), var(--forest-deep));
  border-radius: inherit;
  position: relative;
  z-index: 1;
}

.progress-step-1 .progress-bar > span {
  width: 33%;
}

.progress-step-2 .progress-bar > span {
  width: 67%;
}

.progress-step-3 .progress-bar > span {
  width: 100%;
}

/* ──────────── Card (panel) ──────────── */

.panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: 20px 16px 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.product-panel::before {
  content: none;
}

.product-panel .hero::after,
.verify-panel .hero::after {
  content: "";
  position: absolute;
  top: -70px;
  right: -14px;
  width: 112px;
  height: 112px;
  opacity: 0.38;
  background-image: radial-gradient(circle, rgba(0, 122, 70, 0.2) 1.2px, transparent 1.8px);
  background-size: 16px 16px;
  mask-image: radial-gradient(circle at 56% 48%, #000 0 58%, transparent 78%);
  pointer-events: none;
}

/* ──────────── Header badge ──────────── */

.card-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Plex Sans", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest);
  margin: 0 0 14px;
}

.eyebrow-icon {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--forest-soft);
  color: var(--forest);
}

.eyebrow-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.eyebrow-icon-fill {
  background: linear-gradient(135deg, var(--forest), var(--forest-dark));
  color: var(--surface);
  box-shadow: 0 10px 20px -13px rgba(0, 92, 53, 0.8);
}

.eyebrow-icon-fill svg {
  width: 18px;
  height: 18px;
}

/* ──────────── Hero ──────────── */

.hero {
  position: relative;
  display: grid;
  gap: 20px;
}

.hero > :not(.hero-watermark) {
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin: 0;
  font-family: "Plex Serif", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.88rem, 8.8vw, 2.55rem);
  line-height: 1.02;
  letter-spacing: 0;
  color: var(--ink);
  text-wrap: balance;
  max-width: 8.5em;
  position: relative;
  z-index: 1;
}

.hero-watermark {
  position: absolute;
  top: -60px;
  right: -2px;
  width: 78px;
  height: 78px;
  opacity: 0.15;
  pointer-events: none;
  color: var(--forest);
  z-index: 0;
}

.hero-watermark svg {
  width: 100%;
  height: 100%;
}

/* ──────────── Metric cards ──────────── */

.metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 14px;
  position: relative;
  z-index: 1;
}

.metric {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  min-width: 0;
  border-bottom: 1px solid var(--hair);
}

.metric:last-child {
  border-bottom: 0;
}

.metric-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(234, 245, 239, 0.72)),
    var(--surface-tint);
  color: var(--forest);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.metric-icon svg {
  width: 21px;
  height: 21px;
  display: block;
}

.metric-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.metric-label {
  font-family: "Plex Sans", sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.metric-value {
  font-family: "Plex Sans", sans-serif;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--ink);
  letter-spacing: -0.005em;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ──────────── Alert banner ──────────── */

.alert {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: var(--surface-tint);
  border: 1px solid var(--hair-soft);
  border-radius: 12px;
  margin-top: 10px;
}

.alert-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--forest), var(--forest-dark));
  color: var(--surface);
}

.alert-icon svg {
  width: 23px;
  height: 23px;
}

.alert-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.43;
  color: var(--ink);
}

.alert-text strong {
  font-weight: 600;
}

/* ──────────── Product detail drawer ──────────── */

.product-details {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--hair);
}

.product-details summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--forest-deep);
  font-family: "Plex Sans", sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
}

.product-details summary::marker {
  color: var(--forest);
}

.product-details .metrics {
  margin-top: 8px;
}

.product-summary {
  display: grid;
  gap: 0;
  margin-top: 12px;
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 4px 14px;
}

.product-resource-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: stretch;
  gap: 0;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.product-resource-panel > * {
  min-width: 0;
}

.resource-preview {
  min-height: 238px;
  display: grid;
  place-items: center;
  padding: 12px;
  background:
    radial-gradient(circle at 42% 24%, rgba(0, 160, 176, 0.12), transparent 16rem),
    linear-gradient(180deg, #ffffff 0%, var(--surface-tint) 100%);
  border-right: 1px solid var(--hair);
}

.resource-preview img {
  display: block;
  width: min(100%, 206px);
  max-height: 318px;
  object-fit: contain;
  filter: drop-shadow(0 24px 26px rgba(26, 43, 60, 0.18));
}

.resource-copy {
  display: grid;
  align-content: center;
  gap: 9px;
  padding: 16px;
}

.resource-copy h2 {
  margin: 0;
  color: var(--ink);
  font-family: "Plex Serif", Georgia, serif;
  font-size: clamp(1.24rem, 5.5vw, 1.72rem);
  font-weight: 600;
  line-height: 1.04;
}

.resource-copy p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.48;
}

.resource-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: 2px;
}

.resource-action {
  min-height: 40px;
  font-size: 0.82rem;
}

.verify-lead {
  margin: -6px 0 0;
  max-width: 34ch;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.5;
}

/* ──────────── Procedure ──────────── */

.procedure {
  display: grid;
  gap: 14px;
}

.procedure-step {
  display: grid;
  gap: 12px;
}

.scan-step {
  padding-top: 18px;
  border-top: 1px solid var(--hair);
}

.scan-step-page {
  padding-top: 0;
  border-top: 0;
}

.scan-step-head {
  display: grid;
  gap: 6px;
}

.scan-step-head h1,
.scan-step-head h2 {
  margin: 0;
  font-family: "Plex Serif", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.46rem, 7vw, 1.9rem);
  line-height: 1.08;
  letter-spacing: 0;
  color: var(--ink);
}

.scan-step-head p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.step-pill-top {
  margin-bottom: 4px;
}

.proc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 14px;
  align-items: center;
}

.proc-illu {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: var(--surface-tint);
  display: grid;
  place-items: center;
  color: var(--forest);
}

.proc-illu svg {
  width: 42px;
  height: 42px;
}

.proc-foil {
  position: relative;
  align-self: start;
  overflow: hidden;
  background:
    radial-gradient(circle at 64% 63%, #ffffff 0 25%, transparent 26%),
    repeating-linear-gradient(35deg, rgba(255, 255, 255, 0.6) 0 4px, rgba(180, 186, 183, 0.34) 4px 8px),
    repeating-linear-gradient(-35deg, rgba(255, 255, 255, 0.32) 0 4px, rgba(162, 169, 165, 0.22) 4px 8px),
    #ced3d0;
  border: 1px solid rgba(6, 20, 28, 0.08);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.32), 0 14px 28px -22px rgba(6, 20, 28, 0.7);
}

.foil-target {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  color: var(--forest);
}

.foil-target svg {
  width: 38px;
  height: 38px;
}

.foil-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  text-align: center;
  font-family: "Plex Sans", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--forest);
}

.proc-text {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.step-pill {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--forest-soft);
  color: var(--forest);
  font-family: "Plex Sans", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.proc-text h2 {
  margin: 0;
  font-family: "Plex Serif", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.42rem, 6.8vw, 1.84rem);
  line-height: 1.06;
  letter-spacing: 0;
  color: var(--ink);
}

.proc-text p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.46;
  color: var(--ink-soft);
}

.plain-instruction {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--forest-soft);
  color: var(--forest-deep);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.42;
}

.label-guide {
  width: 118px;
  display: grid;
  gap: 5px;
  align-self: start;
  justify-self: center;
}

.label-qr {
  position: relative;
  min-height: 80px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 9px 7px 7px;
  border: 1px solid var(--hair);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.label-step {
  position: absolute;
  top: 7px;
  left: 7px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--forest-deep);
  color: var(--surface);
  font-size: 0.78rem;
  font-weight: 800;
}

.label-qr strong {
  color: var(--ink);
  font-size: 0.74rem;
  line-height: 1;
}

.label-symbol {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--ink);
  color: var(--surface);
}

.label-symbol svg {
  width: 25px;
  height: 25px;
}

.label-symbol-qr {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.label-hidden {
  border-color: rgba(0, 122, 70, 0.34);
  background: var(--forest-soft);
}

.foil-swatch {
  width: 46px;
  height: 46px;
  border-radius: 7px;
  border: 1px solid rgba(6, 20, 28, 0.1);
  background:
    repeating-linear-gradient(35deg, rgba(255, 255, 255, 0.72) 0 4px, rgba(180, 186, 183, 0.45) 4px 8px),
    #cfd4d1;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.34);
}

.label-connector {
  width: 2px;
  height: 11px;
  justify-self: center;
  border-radius: 2px;
  background: var(--forest-mid);
}

.scan-forward {
  display: grid;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--hair);
}

.scan-product-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-tint);
}

.scan-product-strip .metric-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface);
}

.scan-sku {
  align-self: center;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-soft);
  font-family: "Plex Sans", sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* ──────────── Feature pills ──────────── */

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 18px 0 10px;
  border-top: 1px solid var(--hair);
}

.feature {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
  justify-items: center;
  text-align: center;
  min-width: 0;
  padding: 0 8px;
  border-right: 1px solid var(--hair);
}

.feature:last-child {
  border-right: 0;
}

.feature-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--surface-tint);
  color: var(--forest);
}

.feature-icon svg {
  width: 19px;
  height: 19px;
}

.feature-text {
  font-family: "Plex Sans", sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.27;
  color: var(--ink);
  letter-spacing: 0;
}

/* ──────────── CTA ──────────── */

.scan-actions,
.scan-step {
  display: grid;
  gap: 10px;
}

.primary-action,
.secondary-action {
  appearance: none;
  cursor: pointer;
  text-decoration: none;
  font-family: "Plex Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(0.96rem, 4.4vw, 1.14rem);
  letter-spacing: 0;
  border-radius: var(--radius-sm);
  transition: background 200ms ease, transform 120ms ease, box-shadow 200ms ease;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 64px;
  padding: 0 16px;
  position: relative;
  width: 100%;
}

.secondary-action {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--ink);
}

.secondary-action:hover {
  background: var(--ink);
  color: var(--surface);
}

.primary-action {
  background: var(--forest-deep);
  color: var(--surface);
  border: 1px solid var(--forest-deep);
  box-shadow: none;
}

.primary-action:hover {
  background: var(--forest-dark);
  border-color: var(--forest-dark);
}

.primary-action:active,
.secondary-action:active {
  transform: translateY(1px);
}

.primary-action:disabled {
  cursor: wait;
  background: var(--ink-mute);
  border-color: var(--ink-mute);
  box-shadow: none;
}

.btn-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
}

.btn-icon svg {
  width: 100%;
  height: 100%;
}

.btn-arrow {
  margin-left: auto;
  width: 30px;
  height: 30px;
}

.cta-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 8px auto 0;
  font-family: "Plex Sans", sans-serif;
  font-size: 0.91rem;
  color: var(--ink-mute);
}

.reward-login-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.reward-login-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--forest-soft);
  color: var(--forest-deep);
}

.reward-login-icon svg {
  width: 20px;
  height: 20px;
}

.reward-login-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.reward-login-copy strong,
.reward-login-copy small {
  display: block;
}

.reward-login-copy strong {
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.18;
}

.reward-login-copy small {
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.34;
}

.reward-login-link {
  grid-column: 1 / -1;
  justify-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.reward-login-panel-connected {
  border-color: var(--forest-mid);
  background: var(--forest-soft);
}

.cta-note svg {
  width: 18px;
  height: 18px;
  color: var(--ink-mute);
}

/* ──────────── Camera ──────────── */

.camera-scanner {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.camera-scanner[hidden] {
  display: none;
}

.scan-hint {
  margin: 0;
  padding: 12px 14px;
  background: var(--forest-soft);
  border-left: 3px solid var(--forest);
  border-radius: 6px;
  font-size: 0.94rem;
  line-height: 1.5;
  color: var(--forest-deep);
}

.scan-feedback {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--amber-soft);
  border-radius: 8px;
  background: #fff8eb;
  color: var(--ink);
}

.scan-feedback[hidden] {
  display: none;
}

.feedback-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--amber-soft);
  color: var(--amber);
}

.feedback-icon svg {
  width: 22px;
  height: 22px;
}

.scan-feedback strong {
  display: block;
  font-size: 0.94rem;
}

.scan-feedback p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.4;
}

.camera-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #0d1410;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
}

.camera-frame video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.scan-reticle {
  position: absolute;
  inset: 18%;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 6px;
  box-shadow: 0 0 0 9999px rgba(13, 20, 16, 0.55);
}

.scan-reticle::before,
.scan-reticle::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--mint);
}

.scan-reticle::before {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}

.scan-reticle::after {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}

.is-scanning .camera-frame::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(126, 216, 179, 0.95), transparent);
  filter: drop-shadow(0 0 4px rgba(126, 216, 179, 0.55));
  animation: sweep 1.8s ease-in-out infinite;
}

@keyframes sweep {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  50% {
    transform: translateY(420%);
    opacity: 1;
  }
}

.camera-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.scanner-active .scan-panel {
  padding-top: 18px;
}

.scanner-active .scan-panel .card-eyebrow,
.scanner-active .scan-product-strip,
.scanner-active .scan-step > .step-pill,
.scanner-active .scan-step-head,
.scanner-active .scan-step > .label-guide,
.scanner-active .scan-step > .primary-action,
.scanner-active .scan-step > .cta-note {
  display: none;
}

.scanner-active .scan-step {
  gap: 0;
}

.scanner-active .camera-scanner {
  gap: 10px;
  margin-top: 0;
}

.scanner-active .scan-hint {
  font-size: 0.86rem;
  padding: 10px 12px;
}

.scanner-active .camera-frame {
  aspect-ratio: auto;
  height: min(66svh, 620px);
  min-height: 430px;
}

.scan-status {
  margin: 0;
  font-family: "Plex Sans", sans-serif;
  font-size: 13px;
  color: var(--forest-deep);
  min-height: 20px;
}

.scan-step[data-scan-state="wrong-public"] .scan-status,
.scan-step[data-scan-state="wrong-other"] .scan-status {
  color: var(--amber);
  font-weight: 700;
}

.scan-step[data-scan-state="found"] .scan-status {
  color: var(--forest-deep);
  font-weight: 700;
}

.text-button {
  appearance: none;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--hair);
  background: var(--surface);
  color: var(--ink-soft);
  font-family: "Plex Sans", sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-pill);
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.text-button:hover {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}

.rescue-panel {
  border-top: 1px solid var(--hair);
  padding-top: 10px;
}

.rescue-panel summary {
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 700;
}

.rescue-panel ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.55;
}

/* ──────────── Verify form ──────────── */

.verify-form {
  display: grid;
  gap: 16px;
  margin-top: 6px;
}

.auto-verify {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border-radius: 10px;
  background: var(--forest-soft);
  color: var(--forest-deep);
}

.auto-verify > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
}

.auto-verify svg {
  width: 21px;
  height: 21px;
}

.auto-verify strong {
  display: block;
  font-size: 0.98rem;
}

.auto-verify small {
  display: block;
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.verify-form.is-submitting .auto-verify > span {
  animation: soft-pulse 1.1s ease-in-out infinite;
}

@keyframes soft-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(0, 122, 70, 0.18);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(0, 122, 70, 0);
  }
}

.turnstile-wrap {
  min-height: 78px;
  display: grid;
  place-items: center;
  padding: 14px;
  background: var(--surface-tint);
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
}

/* ──────────── Operator scan ──────────── */

.operator-panel {
  display: grid;
  gap: 18px;
}

.operator-session {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.operator-session .card-eyebrow {
  margin-bottom: 0;
}

.operator-logout {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.operator-logout svg {
  width: 16px;
  height: 16px;
}

.operator-hero {
  display: grid;
  gap: 8px;
}

.operator-hero h1 {
  margin: 0;
  max-width: 9em;
  font-family: "Plex Serif", Georgia, serif;
  font-size: clamp(2rem, 8vw, 2.68rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: 0;
  color: var(--ink);
}

.operator-hero p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.45;
}

.operator-form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field > span {
  font-family: "Plex Sans", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.field input,
.field textarea {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  background: var(--surface-tint);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  padding: 13px 14px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field textarea {
  min-height: 88px;
  resize: vertical;
  font-family: "Plex Mono", ui-monospace, monospace;
  font-size: 0.88rem;
  line-height: 1.45;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--forest);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(0, 122, 70, 0.12);
}

.operator-location-row {
  display: grid;
  grid-template-columns: minmax(136px, 0.46fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.operator-gps {
  min-height: 52px;
  font-size: 0.95rem;
}

.operator-submit {
  margin-top: 2px;
}

.operator-alert,
.operator-result {
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hair);
  background: var(--surface-tint);
}

.operator-alert-error,
.operator-result.result-invalid {
  border-color: var(--crimson-soft);
  background: var(--crimson-soft);
  color: var(--crimson);
}

.operator-result.result-valid {
  border-color: var(--forest-mid);
  background: var(--forest-soft);
  color: var(--forest-deep);
}

.operator-result.result-warning {
  border-color: var(--amber-soft);
  background: var(--amber-soft);
  color: var(--amber);
}

.operator-result strong,
.operator-result p,
.operator-result small {
  display: block;
  margin: 0;
}

.operator-result strong {
  font-size: 1rem;
}

.operator-result p {
  margin-top: 3px;
  color: inherit;
  opacity: 0.86;
}

.operator-result small {
  margin-top: 8px;
  font-family: "Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  line-height: 1.35;
  opacity: 0.78;
  text-transform: uppercase;
}

.operator-scan-panel.is-scanning > .operator-session,
.operator-scan-panel.is-scanning > .operator-hero,
.operator-scan-panel.is-scanning .field,
.operator-scan-panel.is-scanning .operator-location-row,
.operator-scan-panel.is-scanning [data-operator-scan-start],
.operator-scan-panel.is-scanning .operator-submit,
.operator-scan-panel.is-scanning .operator-result {
  display: none;
}

.operator-scan-panel.is-scanning {
  padding-top: 18px;
}

.result-box {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hair);
  background: var(--surface);
}

.result-box h2 {
  margin: 0;
  font-family: "Plex Serif", Georgia, serif;
  font-size: clamp(1.42rem, 6vw, 1.9rem);
  line-height: 1.08;
}

.result-box p {
  margin: 0;
  color: var(--ink-soft);
}

.result-box.result-valid {
  color: var(--surface);
  background: var(--forest);
  border-color: var(--forest);
}

.result-box.result-valid p {
  color: rgba(255, 255, 255, 0.82);
}

.result-box.result-warning {
  border-color: var(--amber-soft);
  background: #fff8eb;
}

.result-box.result-invalid {
  border-color: var(--crimson-soft);
  background: #fff6f6;
}

.reward-result {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--hair);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.reward-result strong,
.reward-result span {
  display: block;
}

.reward-result span {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.4;
}

.reward-result-action {
  min-height: 44px;
  margin-top: 4px;
  font-size: 0.95rem;
}

/* ──────────── Result ──────────── */

.result-panel {
  padding: 0;
  overflow: hidden;
  display: grid;
}

.result-frame {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  padding: 40px 28px 36px;
  text-align: center;
}

.result-mark {
  margin: 0 0 6px;
}

.result-mark .glyph {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--surface);
  font-family: "Plex Sans", sans-serif;
  font-weight: 600;
  font-size: 48px;
  line-height: 1;
  box-shadow: 0 18px 40px -18px rgba(19, 22, 23, 0.35);
  animation: glyph-pop 520ms cubic-bezier(0.18, 1.4, 0.3, 1) both;
}

@keyframes glyph-pop {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.result-headline {
  margin: 4px 0 6px;
  font-family: "Plex Serif", Georgia, serif;
  font-weight: 500;
  font-size: clamp(2rem, 7vw, 2.6rem);
  line-height: 1.04;
  letter-spacing: -0.022em;
  color: inherit;
  text-wrap: balance;
}

.result-message {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: inherit;
  opacity: 0.78;
  max-width: 36ch;
}

.result-stamp {
  margin: 22px 0 0;
  padding-top: 16px;
  display: grid;
  gap: 4px;
  justify-items: center;
  border-top: 1px solid currentColor;
  border-color: rgba(0, 0, 0, 0.12);
  color: inherit;
  min-width: min(220px, 80%);
}

.result-stamp .stamp-label {
  font-family: "Plex Sans", sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.6;
}

.result-stamp .stamp-date {
  font-family: "Plex Serif", Georgia, serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.005em;
  opacity: 0.95;
}

.result-panel.result-valid {
  background: var(--forest);
  color: var(--surface);
  border-color: var(--forest);
}

.result-panel.result-valid .result-mark .glyph {
  background: var(--mint);
  color: var(--forest-deep);
  box-shadow: 0 18px 40px -16px rgba(13, 44, 32, 0.5);
}

.result-panel.result-valid .result-stamp {
  border-color: rgba(255, 255, 255, 0.18);
}

.result-panel.result-valid .result-stamp .stamp-label {
  opacity: 0.7;
}

.result-panel.result-warning {
  background: var(--surface);
  border-color: var(--amber-soft);
  color: var(--ink);
}

.result-panel.result-warning .result-mark .glyph {
  background: var(--amber);
  box-shadow: 0 16px 36px -18px rgba(181, 111, 10, 0.45);
}

.result-panel.result-invalid {
  background: var(--surface);
  border-color: var(--crimson-soft);
  color: var(--ink);
}

.result-panel.result-invalid .result-mark .glyph {
  background: var(--crimson);
  box-shadow: 0 16px 36px -18px rgba(160, 42, 42, 0.45);
}

.result-panel.result-neutral .result-mark .glyph {
  background: var(--ink-mute);
  color: var(--surface);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 18px;
  font-family: "Plex Sans", sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  color: currentColor;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease;
}

.text-link::after {
  content: "↗";
  transition: transform 200ms ease;
}

.text-link:hover {
  background: currentColor;
}

.text-link:hover * {
  color: var(--surface);
}

.result-panel.result-valid .text-link:hover {
  background: var(--mint);
  color: var(--forest-deep);
}

/* ──────────── Footer ──────────── */

.footer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 4px 4px;
  border-top: 1px solid var(--hair);
  font-family: "Plex Sans", sans-serif;
  font-size: 12px;
  color: var(--ink-mute);
}

.footer .legal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer .legal svg {
  width: 13px;
  height: 13px;
  color: var(--forest);
}

.footer .copy {
  color: var(--ink-mute);
  letter-spacing: -0.005em;
}

/* ──────────── Misc ──────────── */

.is-hidden {
  display: none;
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 374px) {
  .shell {
    padding-left: 10px;
    padding-right: 10px;
  }
  .topbar .brand-mark {
    width: 42px;
    height: 42px;
  }
  .brand-wordmark {
    font-size: 1.22rem;
  }
  .brand-tag {
    font-size: 0.46rem;
  }
  .brand-subtitle {
    font-size: 0.5rem;
    letter-spacing: 0.13em;
  }
  .topbar .progress {
    min-width: 92px;
  }
  .progress-bar {
    height: 5px;
  }
  .progress-row {
    gap: 5px;
    padding: 6px 8px;
    font-size: 0.58rem;
  }
  .progress-num {
    width: 21px;
    height: 21px;
    font-size: 0.74rem;
  }
  .hero h1 {
    font-size: 1.74rem;
  }
  .hero-watermark {
    width: 62px;
    height: 62px;
  }
  .proc-row {
    grid-template-columns: minmax(0, 1fr) 96px;
  }
  .proc-illu {
    width: 96px;
    height: 96px;
  }
  .label-guide {
    width: 96px;
  }
  .label-qr {
    min-height: 78px;
    padding: 9px 6px 7px;
  }
  .label-symbol {
    width: 36px;
    height: 36px;
  }
  .label-symbol svg {
    width: 22px;
    height: 22px;
  }
  .foil-swatch {
    width: 38px;
    height: 38px;
  }
  .label-qr strong {
    font-size: 0.68rem;
  }
  .foil-label {
    bottom: 12px;
    font-size: 0.62rem;
  }
  .proc-text h2 {
    font-size: 1.76rem;
  }
  .feature {
    padding: 0 5px;
  }
  .feature-icon {
    width: 36px;
    height: 36px;
  }
  .feature-text {
    font-size: 0.68rem;
  }
  .primary-action,
  .secondary-action {
    min-height: 54px;
    font-size: 0.94rem;
  }
}

@media (min-width: 430px) {
  .topbar {
    gap: 10px;
  }
  .topbar .brand {
    gap: 10px;
  }
  .topbar .brand-mark {
    width: 48px;
    height: 48px;
  }
  .brand-wordmark {
    font-size: 1.45rem;
  }
  .brand-tag {
    font-size: 0.5rem;
  }
  .brand-subtitle {
    font-size: 0.66rem;
    letter-spacing: 0.18em;
  }
  .topbar .progress {
    min-width: 110px;
    gap: 9px;
  }
  .progress-row {
    gap: 7px;
    font-size: 0.64rem;
    padding: 7px 10px;
  }
  .progress-num {
    width: 24px;
    height: 24px;
    font-size: 0.82rem;
  }
}

@media (min-width: 520px) {
  .shell {
    width: min(100%, 620px);
    padding-left: 16px;
    padding-right: 16px;
    gap: 12px;
  }
  .topbar .brand-mark {
    width: 56px;
    height: 56px;
  }
  .topbar .progress {
    min-width: 138px;
  }
  .panel {
    padding: 24px 22px 20px;
  }
  .hero h1 {
    font-size: clamp(2.16rem, 6vw, 2.86rem);
  }
  .hero-watermark {
    width: 96px;
    height: 96px;
  }
  .metrics {
    grid-template-columns: 1fr;
  }
  .proc-row {
    grid-template-columns: minmax(0, 1fr) 156px;
    gap: 18px;
  }
  .proc-illu {
    width: 156px;
    height: 156px;
  }
  .label-guide {
    width: 144px;
  }
  .label-qr {
    min-height: 92px;
  }
  .label-symbol {
    width: 48px;
    height: 48px;
  }
  .label-symbol svg {
    width: 28px;
    height: 28px;
  }
  .foil-swatch {
    width: 54px;
    height: 54px;
  }
  .foil-target svg {
    width: 52px;
    height: 52px;
  }
  .foil-label {
    bottom: 22px;
    font-size: 0.84rem;
  }
  .footer {
    font-size: 0.86rem;
  }
}

@media (max-width: 430px) {
  .product-resource-panel {
    grid-template-columns: 1fr;
  }
  .resource-preview {
    min-height: 240px;
    border-right: 0;
    border-bottom: 1px solid var(--hair);
  }
  .resource-preview img {
    width: min(100%, 200px);
    max-height: 310px;
  }
  .resource-copy {
    padding: 16px;
  }
  .result-headline {
    font-size: clamp(1.85rem, 8vw, 2.3rem);
  }
  .result-mark .glyph {
    width: 84px;
    height: 84px;
    font-size: 42px;
  }
  .result-frame {
    padding: 32px 22px 30px;
  }
}

@media (prefers-contrast: more) {
  :root {
    --hair: #999;
    --ink-mute: #2a2e30;
  }
}
