/* PharmaCheck - Mobile-first verification UI */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --purple: #7c3aed;
  --purple-dark: #6d28d9;
  --purple-light: #a78bfa;
  --green: #059669;
  --green-light: #10b981;
  --green-50: #f0fdf4;
  --green-200: #b9f8cf;
  --green-600: #00a544;
  --green-700: #008138;
  --green-900: #0d542b;
  --red: #dc2626;
  --red-light: #fef2f2;
  --yellow: #f59e0b;
  --yellow-bg: #fffbeb;
  --yellow-border: #fcd34d;
  --blue: #155dfc;
  --blue-50: #eff6ff;
  --blue-200: #bedbff;
  --blue-600: #155dfc;
  --blue-700: #1447e6;
  --blue-900: #1c398e;
  --orange: #ea580c;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5dc;
  --gray-400: #99a1af;
  --gray-500: #6a7282;
  --gray-600: #4a5565;
  --gray-700: #364153;
  --gray-900: #101828;
  --radius: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,.08);
}

html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.5;
  min-height: 100dvh;
}

a { color: var(--blue-600); text-decoration: none; }
.home-brand { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

.page { min-height: 100dvh; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: .5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, opacity .15s;
}
.btn-primary {
  background: var(--blue-600); color: #fff; width: 100%;
}
.btn-primary:hover { background: var(--blue-700); }
.btn-open {
  display: inline-block;
  background: #a855f7;
  color: #fff;
  border-radius: 9999px;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  padding: 16px 64px;
  white-space: nowrap;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1);
  transition: background-color .15s, transform .15s;
}
.btn-open:hover {
  background: #c084fc;
  opacity: 1;
  transform: scale(1.05);
}
.btn-danger { background: #e40014; color: #fff; }
.btn-danger:hover { background: #bf000f; }
.btn-block { display: flex; width: 100%; margin: 12px 0; }
.btn-sm { padding: 8px 16px; font-size: .875rem; width: auto; }
.btn-danger-outline { background: transparent; color: var(--red); border: 1px solid var(--red); }
.icon-inline { width: 18px; height: 18px; flex-shrink: 0; }

/* Home — matches qr.phamarcheck.com */
.home-page {
  min-height: 100dvh;
  background: linear-gradient(to bottom right, var(--blue-50), #fff 50%, #faf5ff);
  padding: 16px;
}
.home-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-100);
}
.home-nav-inner {
  max-width: 80rem; margin: 0 auto;
  padding: 0 16px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.home-brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.25rem; font-weight: 700; color: var(--gray-900);
  text-decoration: none;
}
.home-nav-link {
  font-size: .875rem; color: var(--gray-600); text-decoration: none;
  transition: color .15s;
}
.home-nav-link:hover { color: var(--gray-900); }
.icon-qr-nav { width: 32px; height: 32px; color: var(--blue-600); flex-shrink: 0; }
.home-container {
  max-width: 42rem; margin: 0 auto;
  padding: 128px 0 64px;
}
.home-hero { text-align: center; margin-bottom: 48px; }
.home-hero-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 80px; height: 80px; margin-bottom: 24px;
  background: linear-gradient(to bottom right, #3080ff, #9810fa);
  border-radius: 1rem;
}
.icon-qr-hero { width: 40px; height: 40px; color: #fff; }
.home-hero h1 {
  font-size: 2.25rem; font-weight: 700; color: var(--gray-900);
  margin-bottom: 16px; line-height: 1.2;
}
.home-lead { font-size: 1.25rem; color: var(--gray-600); margin-bottom: 8px; }
.home-hint { color: var(--gray-500); font-size: 1rem; }
.verify-form {
  background: #fff; padding: 24px; border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.1);
  margin-bottom: 32px;
  overflow: hidden;
}
.verify-form label {
  display: block; font-weight: 600; font-size: .875rem;
  color: var(--gray-700); margin-bottom: 12px;
}
.verify-form-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}
.verify-form input {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gray-300);
  border-radius: .5rem;
  font-size: 1rem;
  text-transform: uppercase;
}
.verify-form input:focus {
  outline: none; border-color: transparent;
  box-shadow: 0 0 0 2px #3080ff;
}
.btn-verify {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-600); color: #fff;
  padding: 12px 20px; border-radius: .5rem;
  font-size: 1rem;
  font-weight: 600; border: none; cursor: pointer;
  white-space: nowrap; transition: background .15s;
  width: auto;
}
.btn-verify:hover { background: var(--blue-700); }
@media (min-width: 480px) {
  .verify-form { padding: 32px; }
  .btn-verify { padding: 12px 32px; }
}
@media (max-width: 379px) {
  .verify-form-row { flex-direction: column; }
  .btn-verify { width: 100%; }
}
.info-cards {
  display: grid; gap: 16px; margin-bottom: 32px;
}
@media (min-width: 768px) {
  .info-cards { grid-template-columns: 1fr 1fr; }
  .home-hero h1 { font-size: 3rem; }
  .home-nav-inner { padding: 0 24px; }
}
.info-card {
  display: flex; gap: 12px; padding: 16px;
  border-radius: .75rem; border: 1px solid;
}
.info-card-green { background: var(--green-50); border-color: var(--green-200); }
.info-card-blue { background: var(--blue-50); border-color: var(--blue-200); }
.info-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.info-card-green h3 { color: var(--green-900); }
.info-card-blue h3 { color: var(--blue-900); }
.info-card p { font-size: .875rem; line-height: 1.5; }
.info-card-green p { color: var(--green-700); }
.info-card-blue p { color: var(--blue-700); }
.icon-check-green { width: 24px; height: 24px; color: var(--green-600); flex-shrink: 0; margin-top: 4px; }
.icon-info-blue { width: 24px; height: 24px; color: var(--blue-600); flex-shrink: 0; margin-top: 4px; }
.demo-section {
  background: #fff; padding: 32px; border-radius: 1rem;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
}
.demo-section h2 {
  font-size: 1.125rem; font-weight: 700; color: var(--gray-900);
  margin-bottom: 16px;
}
.demo-list { display: flex; flex-direction: column; gap: 12px; }
.demo-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; border: 2px solid var(--gray-200); border-radius: .5rem;
  text-decoration: none; color: inherit; transition: border-color .15s, background .15s;
}
.demo-item:hover {
  border-color: var(--blue-600); background: var(--blue-50);
}
.demo-item:hover .demo-code-line { color: var(--blue-600); }
.demo-item:hover .demo-arrow { color: var(--blue-600); }
.demo-code-line { font-weight: 600; color: var(--gray-900); margin-bottom: 4px; transition: color .15s; }
.demo-code-mono { font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace; }
.demo-hint { font-size: .875rem; color: var(--gray-600); }
.demo-arrow { color: var(--gray-400); font-size: 1.25rem; transition: color .15s; }
.home-footer {
  margin-top: 48px; text-align: center;
  color: var(--gray-600); font-size: .875rem;
}
.home-footer a { color: var(--blue-600); text-decoration: none; }
.home-footer a:hover { text-decoration: underline; }
.home-copyright { margin-top: 8px; }

/* Shared flow layout */
.flow-page {
  min-height: 100dvh;
  background: linear-gradient(to bottom right, var(--blue-50), #fff 50%, #faf5ff);
  padding-bottom: 48px;
}
.flow-container {
  max-width: 42rem; margin: 0 auto;
  padding: 88px 16px 0;
}
.flow-main { padding: 0 0 24px; }
.flow-footer {
  text-align: center; margin-top: 24px;
  font-size: .875rem; color: var(--gray-600);
}
.flow-footer a { color: var(--blue-600); text-decoration: none; }
.flow-footer a:hover { text-decoration: underline; }

.home-brand { text-decoration: none; color: var(--gray-900); }

.icon-inline { width: 18px; height: 18px; }

/* Verify (Scan #1) — purple card + OPEN HERE (qr.phamarcheck.com/verify) */
.verify-page {
  min-height: 100dvh;
  padding: 32px 16px;
  background: linear-gradient(to bottom right, #faf5ff, #eff6ff 50%, #faf5ff);
}
.verify-shell {
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
}
.verify-card {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25);
  background: #fff;
}
.verify-header {
  background: linear-gradient(to bottom right, #9333ea, #4338ca);
  padding: 24px;
  color: #fff;
  text-align: center;
}
.verify-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
}
.verify-brand-block {
  min-width: 0;
}
.verify-brand-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.icon-factory-white {
  width: 20px;
  height: 20px;
  color: #fff;
  flex-shrink: 0;
}
.verify-brand-name {
  font-size: .875rem;
  line-height: 1.25rem;
  opacity: .9;
}
.verify-product-name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.75rem;
  word-break: break-word;
}
.verify-badges {
  text-align: right;
  flex-shrink: 0;
}
.verify-badge {
  display: block;
  font-size: .75rem;
  line-height: 1rem;
  opacity: .75;
}
.verify-hero {
  background: linear-gradient(to bottom right, #9333ea, #3730a3);
  padding: 48px 32px;
  text-align: center;
}
.verify-lock-wrap {
  width: 160px;
  height: 160px;
  margin: 0 auto 24px;
  background: #fff;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25);
}
.icon-lock-purple {
  width: 96px;
  height: 96px;
  color: #9333ea;
}
.verify-status-card {
  display: inline-block;
  background: #fff;
  border-radius: 16px;
  padding: 16px 32px;
  margin-bottom: 24px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);
  max-width: 100%;
}
.verify-status-title {
  margin: 0 0 4px;
  color: #06b6d4;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 2rem;
}
.verify-status-desc {
  margin: 8px 0 0;
  color: #6b7280;
  font-size: .75rem;
  line-height: 1rem;
}
.verify-image {
  background: #fff;
  padding: 32px;
}
.verify-product-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);
}
.verify-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: #f9fafb;
  border-radius: 12px;
  color: #9ca3af;
}
.verify-bottom {
  background: #fff;
  padding: 24px;
}
.btn-verify-home {
  display: block;
  width: 100%;
  text-align: center;
  background: #9333ea;
  color: #fff;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: 8px;
  transition: background-color .15s;
}
.btn-verify-home:hover {
  background: #7e22ce;
  opacity: 1;
}
.verify-help {
  margin-top: 32px;
  text-align: center;
  font-size: .875rem;
  color: #4b5563;
}
.verify-help a {
  color: #9333ea;
  text-decoration: none;
}
.verify-help a:hover { text-decoration: underline; }

.status-card {
  background: #fff; border-radius: 1rem; padding: 28px 24px;
  text-align: center; width: 100%;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,.12);
}
.status-card-top { margin-bottom: 16px; }
.status-icon-wrap {
  width: 56px; height: 56px; margin: 0 auto 12px;
  border-radius: 50%; background: #eff6ff;
  display: flex; align-items: center; justify-content: center;
}
.status-icon-sm { width: 44px; height: 44px; }
.icon-shield-status { width: 28px; height: 28px; color: var(--blue-600); }
.status-title { color: var(--blue-600); font-size: 1.35rem; font-weight: 700; margin-bottom: 8px; }
.status-desc { color: var(--gray-500); font-size: .9rem; }

@media (max-width: 420px) {
  .verify-hero { padding: 40px 20px; }
  .btn-open {
    display: block;
    width: 100%;
    padding: 16px 24px;
    box-sizing: border-box;
  }
  .verify-status-card { padding: 16px 20px; }
  .verify-status-title { font-size: 1.25rem; line-height: 1.75rem; }
  .verify-lock-wrap { width: 128px; height: 128px; }
  .icon-lock-purple { width: 72px; height: 72px; }
}

/* Detail — centered card (green header + info grid) */
.detail-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: linear-gradient(to bottom right, #eff6ff, #fff 45%, #faf5ff);
}
.detail-card {
  width: 100%;
  max-width: 42rem;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(5, 150, 105, .2);
  background: #fff;
}
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 20px;
  color: #fff;
  background: linear-gradient(135deg, #00a544, #008138);
}
.detail-header-left {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
  flex: 1;
}
.detail-check-badge {
  width: 40px; height: 40px;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.detail-product-name {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
}
.detail-brand-name {
  font-size: .8rem;
  opacity: .9;
  margin-top: 2px;
}
.detail-header-right {
  text-align: right;
  flex-shrink: 0;
  line-height: 1.25;
}
.detail-verified-label {
  display: block;
  font-size: .75rem;
  opacity: .9;
}
.detail-scan-count {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 2px;
}
.detail-image {
  background: #fff;
  border-bottom: 1px solid var(--gray-100);
}
.detail-product-img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  background: #fff;
}
.detail-img-placeholder {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
}
.icon-package-muted { width: 48px; height: 48px; color: var(--gray-400); }
.detail-body {
  padding: 20px;
  background: var(--gray-50);
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.detail-info {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid var(--gray-100);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.detail-info-blue { border-color: var(--blue-200); }
.detail-info-orange { border-color: #fed7aa; }
.detail-info-purple { border-color: #e9d5ff; }
.detail-info-green { border-color: var(--green-200); }
.detail-info-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--gray-600);
}
.detail-info-blue .detail-info-label { color: var(--blue-600); }
.detail-info-orange .detail-info-label { color: var(--orange); }
.detail-info-purple .detail-info-label { color: #9810fa; }
.detail-info-green .detail-info-label { color: var(--green-600); }
.icon-label, .icon-label-orange, .icon-label-warn {
  width: 14px; height: 14px; flex-shrink: 0;
}
.icon-label-warn { color: #cd8900; }
.detail-info-value {
  font-size: .95rem;
  font-weight: 700;
  word-break: break-word;
  color: var(--gray-900);
  line-height: 1.35;
}
.detail-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--gray-100);
}
.detail-section h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .95rem;
  margin-bottom: 10px;
  color: var(--gray-900);
}
.detail-section p {
  font-size: .875rem;
  color: var(--gray-700);
  line-height: 1.6;
}
.detail-warn {
  background: var(--yellow-bg);
  border-color: var(--yellow-border);
  border-left: 4px solid var(--yellow);
}
.detail-warn ul {
  padding-left: 18px;
  font-size: .875rem;
  color: #874b00;
}
.detail-warn li { margin-bottom: 6px; }
.detail-code {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  margin-bottom: 12px;
}
.code-label { font-size: .8rem; color: var(--gray-500); margin-bottom: 4px; }
.code-value {
  font-size: 1.35rem; font-weight: 800; color: var(--blue-900);
  letter-spacing: 1px;
  font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
  word-break: break-all;
}
.detail-home-btn {
  background: #7c3aed;
  color: #fff;
  margin: 4px 0 0;
}
.detail-home-btn:hover { background: #6d28d9; }
.detail-help {
  margin-top: 20px;
  font-size: .85rem;
  color: var(--gray-500);
  text-align: center;
}
.detail-help a { color: var(--blue-600); }
.detail-help a:hover { text-decoration: underline; }

@media (max-width: 520px) {
  .detail-grid { grid-template-columns: 1fr; }
}

/* Shared data cards (warning / counterfeit / COA) */
.data-card {
  background: #fff; border-radius: 1rem; padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
  border: 1px solid var(--gray-100);
}
.data-card-blue { border-color: var(--blue-200); }
.data-card-purple { border-color: #e9d5ff; }
.data-card-orange { border-color: #fed7aa; }
.data-card-warn {
  background: var(--yellow-bg);
  border-color: var(--yellow-border);
  border-left: 4px solid var(--yellow);
}
.card-label {
  display: flex; align-items: center; gap: 6px;
  font-size: .8rem; font-weight: 600; margin-bottom: 8px;
  color: var(--gray-600);
}
.data-card-blue .card-label { color: var(--blue-600); }
.data-card-purple .card-label { color: #9810fa; }
.data-card-orange .card-label { color: var(--orange); }
.card-value { font-size: 1.25rem; font-weight: 700; word-break: break-all; color: var(--gray-900); }
.data-card h3 {
  display: flex; align-items: center; gap: 6px;
  font-size: 1rem; margin-bottom: 12px; color: var(--gray-900);
}
.data-card p { font-size: .9rem; color: var(--gray-700); line-height: 1.6; }
.data-card-warn ul { padding-left: 20px; font-size: .875rem; color: #874b00; }
.data-card-warn li { margin-bottom: 8px; }

.code-display {
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: 1rem; padding: 20px;
  text-align: center; margin: 16px 0;
}

/* COA — product image then certificate image (live site layout) */
.coa-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 40px;
  background: linear-gradient(to bottom right, #f0fdf4, #f3f4f6 45%, #eff6ff);
}
.coa-shell {
  width: 100%;
  max-width: 42rem;
}
.coa-card {
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .15);
}
.coa-header {
  background: linear-gradient(135deg, #00a544, #008138);
  padding: 20px;
  color: #fff;
  margin-top: 0;
}
.coa-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.coa-header-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.coa-check-badge {
  width: 40px; height: 40px; background: rgba(255,255,255,.2);
  border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.icon-check-white { width: 22px; height: 22px; color: #fff; }
.coa-header-text { min-width: 0; }
.brand-small { font-size: .8rem; opacity: .9; margin-top: 2px; }
.product-big { font-size: 1.1rem; font-weight: 700; word-break: break-word; line-height: 1.3; }
.scan-info { text-align: right; flex-shrink: 0; line-height: 1.25; }
.verified-text { display: block; font-size: .75rem; opacity: .9; }
.scan-count { display: block; font-size: 1.05rem; font-weight: 700; margin-top: 2px; }
.coa-product-wrap {
  padding: 20px 20px 8px;
  background: #fff;
}
.coa-product-img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  border-radius: .75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);
  display: block;
}
.coa-img-placeholder {
  height: 160px; display: flex; align-items: center; justify-content: center;
  background: var(--gray-50);
  border-radius: .75rem;
}
.coa-body {
  padding: 16px 20px 24px;
  background: var(--gray-50);
}
.coa-title {
  font-size: .8rem;
  font-weight: 700;
  color: var(--gray-600);
  margin: 8px 0 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.coa-cert-wrap {
  background: #fff;
  border-radius: .75rem;
  padding: 12px;
  margin-bottom: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
}
.coa-cert-img {
  width: 100%;
  height: auto;
  border-radius: .5rem;
  margin-top: 0;
  display: block;
}
.coa-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; padding: 40px 16px;
  background: var(--gray-50); border-radius: .5rem;
  font-size: .9rem; color: var(--gray-500);
}
.icon-file-muted { width: 40px; height: 40px; color: var(--gray-400); }
.coa-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.coa-meta {
  background: #fff;
  border-radius: .75rem;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.coa-meta-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.coa-meta-blue .coa-meta-label { color: var(--blue-600); }
.coa-meta-orange .coa-meta-label { color: var(--orange); }
.coa-meta-purple .coa-meta-label { color: #9810fa; }
.coa-meta-green .coa-meta-label { color: var(--green-600); }
.coa-meta-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  word-break: break-word;
  line-height: 1.35;
}
.coa-section {
  background: #fff;
  border-radius: .75rem;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.coa-section h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
}
.coa-section p {
  font-size: .875rem;
  color: var(--gray-600);
  line-height: 1.6;
}
.coa-precautions {
  background: #fefce8;
  border-left: 4px solid #facc15;
}
.coa-precautions h3 { color: #854d0e; }
.coa-precautions ul {
  padding-left: 18px;
  font-size: .875rem;
  color: #a16207;
}
.coa-precautions li { margin-bottom: 6px; }
.coa-code {
  background: var(--gray-100);
  border-radius: .75rem;
  padding: 16px;
  text-align: center;
  margin-bottom: 16px;
}
.coa-code-label {
  font-size: .75rem;
  color: var(--gray-600);
  margin-bottom: 4px;
}
.coa-code-value {
  font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  word-break: break-all;
}
.btn-coa-home {
  display: block;
  width: 100%;
  background: #9333ea;
  color: #fff;
  padding: 12px 16px;
  border-radius: .5rem;
  font-weight: 600;
  text-align: center;
}
.btn-coa-home:hover { background: #7e22ce; }
.coa-help {
  margin-top: 24px;
  text-align: center;
  font-size: .875rem;
  color: var(--gray-600);
}
.coa-help a { color: #9333ea; }
.coa-help a:hover { text-decoration: underline; }

@media (max-width: 520px) {
  .coa-meta-grid { grid-template-columns: 1fr; }
  .coa-product-wrap { padding: 16px 16px 4px; }
  .coa-body { padding: 12px 16px 20px; }
}

/* Warning (Scan #2) — green header card + yellow banner */
.warn-page {
  min-height: 100dvh;
  padding: 32px 16px;
  background: linear-gradient(to bottom right, #faf5ff, #eff6ff 50%, #faf5ff);
}
.warn-shell {
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
}
.warn-card {
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25);
}
.warn-header {
  padding: 24px;
  color: #fff;
  background: linear-gradient(to bottom right, #16a34a, #047857);
}
.warn-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.warn-brand-block {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.icon-check-warn-header {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  color: #fff;
  margin-top: 2px;
}
.warn-product-name {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}
.warn-brand-name {
  font-size: .875rem;
  opacity: .9;
  margin-top: 2px;
}
.warn-header-right {
  text-align: right;
  flex-shrink: 0;
  line-height: 1.25;
}
.warn-verified-label {
  display: block;
  font-size: .75rem;
  opacity: .75;
}
.warn-scan-count {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  margin-top: 2px;
}
.warn-image {
  padding: 32px;
  background: #fff;
}
.warn-product-img {
  width: 100%;
  height: auto;
  border-radius: .75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);
}
.warn-img-placeholder {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
  border-radius: .75rem;
}
.warn-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 32px 16px;
  padding: 16px;
  background: #fefce8;
  border: 2px solid #fde047;
  border-radius: .5rem;
}
.icon-alert-warn-banner {
  width: 24px;
  height: 24px;
  color: #ca8a04;
  flex-shrink: 0;
  margin-top: 4px;
}
.warn-banner-title {
  font-weight: 700;
  color: #854d0e;
  margin-bottom: 4px;
}
.warn-banner-desc {
  font-size: .875rem;
  color: #a16207;
}
.warn-body {
  padding: 32px;
  background: var(--gray-50);
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.warn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.warn-info {
  background: #fff;
  border-radius: .75rem;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 1px 2px rgba(0, 0, 0, .06);
}
.warn-info-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .875rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.warn-label-blue { color: var(--blue-600); }
.warn-label-orange { color: #ea580c; }
.warn-label-purple { color: #9333ea; }
.warn-label-green { color: #16a34a; }
.warn-info-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  word-break: break-word;
  line-height: 1.35;
}
.warn-value-lg {
  font-size: 1.5rem;
  font-weight: 700;
}
.warn-value-mono {
  font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
}
.warn-section {
  background: #fff;
  border-radius: .75rem;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 1px 2px rgba(0, 0, 0, .06);
}
.warn-section h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
}
.warn-section p {
  color: var(--gray-600);
  line-height: 1.625;
}
.warn-precautions {
  background: #fefce8;
  border-left: 4px solid #facc15;
  border-radius: .25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 1px 2px rgba(0, 0, 0, .06);
}
.warn-precautions h3 {
  color: #854d0e;
}
.warn-precautions ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.warn-precautions li {
  display: flex;
  gap: 8px;
  font-size: .875rem;
  color: #a16207;
}
.warn-precautions li span:first-child {
  font-weight: 700;
  flex-shrink: 0;
}
.warn-code {
  background: var(--gray-100);
  border-radius: .75rem;
  padding: 16px;
  text-align: center;
}
.warn-code-label {
  font-size: .75rem;
  color: var(--gray-600);
  margin-bottom: 4px;
}
.warn-code-value {
  font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  word-break: break-all;
}
.warn-bottom {
  padding: 24px;
  background: #fff;
}
.btn-warn-home {
  display: block;
  width: 100%;
  background: #9333ea;
  color: #fff;
  padding: 12px 16px;
  border-radius: .5rem;
  font-weight: 600;
  text-align: center;
  transition: background .15s;
}
.btn-warn-home:hover { background: #7e22ce; }
.warn-help {
  margin-top: 32px;
  text-align: center;
  font-size: .875rem;
  color: var(--gray-600);
}
.warn-help a {
  color: #9333ea;
}
.warn-help a:hover { text-decoration: underline; }

@media (max-width: 700px) {
  .warn-grid { grid-template-columns: 1fr; gap: 16px; }
  .warn-product-name { font-size: 1.25rem; }
  .warn-image { padding: 20px; }
  .warn-banner { margin: 0 16px 16px; }
  .warn-body { padding: 20px; gap: 16px; }
}

/* Verifying interstitial (QR scan loading) */
.verifying-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background: #f3f4f6;
}
.verifying-card {
  width: 100%;
  max-width: 22rem;
  background: #fff;
  border-radius: 1rem;
  padding: 36px 28px 32px;
  text-align: center;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .08), 0 4px 6px -4px rgba(0, 0, 0, .06);
}
.verifying-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 3px solid #bfdbfe;
  border-top-color: #3b82f6;
  animation: verifying-spin .75s linear infinite;
}
.verifying-text {
  margin: 0;
  font-size: .95rem;
  line-height: 1.5;
  color: #4b5563;
  font-weight: 400;
}
@keyframes verifying-spin {
  to { transform: rotate(360deg); }
}

/* Counterfeit (Scan #3+) — centered red alert card */
.counterfeit-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: linear-gradient(to bottom right, #fef2f2, #fff7ed);
}
.counterfeit-card {
  width: 100%;
  max-width: 28rem;
  background: #fff;
  border: 4px solid #ef4444;
  border-radius: 1rem;
  padding: 32px;
  text-align: center;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.1);
}
.icon-alert-pulse {
  width: 80px;
  height: 80px;
  color: #dc2626;
  display: block;
  margin: 0 auto 16px;
  animation: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}
.counterfeit-card h1 {
  color: #dc2626;
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 8px;
}
.counterfeit-sub {
  color: var(--gray-600);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.55;
  margin-bottom: 16px;
}
.counterfeit-box {
  background: #fef2f2;
  border: 2px solid #fca5a5;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  text-align: center;
}
.counterfeit-box-title {
  color: #b91c1c;
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.55;
}
.counterfeit-box-desc {
  color: #dc2626;
  font-size: .875rem;
  line-height: 1.45;
}
.counterfeit-box-desc strong { font-weight: 700; }
.counterfeit-advice {
  color: var(--gray-600);
  font-size: 1rem;
  margin-bottom: 24px;
  line-height: 1.5;
}
.counterfeit-home-btn {
  display: inline-block;
  width: auto;
  background: #dc2626;
  color: #fff;
  padding: 8px 24px;
  border-radius: 8px;
  font-size: 1rem;
}
.counterfeit-home-btn:hover { background: #b91c1c; }

/* Not Verified / Not Found */
.notfound-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: linear-gradient(to bottom right, #fef2f2, #fff7ed);
}
.notfound-card {
  width: 100%;
  max-width: 28rem;
  background: #fff;
  border-radius: 1rem;
  padding: 32px;
  text-align: center;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.1);
}
.icon-circle-alert-red {
  width: 64px;
  height: 64px;
  color: #dc2626;
  display: block;
  margin: 0 auto 16px;
}
.notfound-card h1 {
  color: #dc2626;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
}
.notfound-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
  text-align: center;
}
.notfound-box p {
  color: #b91c1c;
  font-size: .875rem;
  line-height: 1.45;
}
.notfound-box strong { font-weight: 700; }
.notfound-home-btn {
  display: inline-block;
  width: auto;
  background: #dc2626;
  color: #fff;
  padding: 8px 24px;
  border-radius: 8px;
  font-size: 1rem;
}
.notfound-home-btn:hover { background: #b91c1c; }

/* Admin (shared components) */
.admin-page { background: var(--gray-100); min-height: 100dvh; }

.form-grid { display: grid; gap: 12px; }
.form-grid label { font-size: .85rem; font-weight: 600; display: block; margin-bottom: 4px; }
.form-grid input, .form-grid textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--gray-200);
  border-radius: 8px; font-size: .9rem;
}
.form-grid textarea { min-height: 80px; resize: vertical; }
.form-actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

.codes-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.codes-table th, .codes-table td { padding: 12px 8px; text-align: left; border-bottom: 1px solid var(--gray-200); }
.codes-table th { font-weight: 600; color: var(--gray-500); font-size: .75rem; text-transform: uppercase; }
.codes-table tr:hover { background: var(--gray-50); }
.code-tag { font-family: monospace; font-weight: 700; color: var(--purple); }
.qr-thumb { width: 48px; height: 48px; border-radius: 4px; }
.actions-cell { display: flex; gap: 8px; flex-wrap: wrap; }
.toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--gray-900); color: #fff;
  padding: 12px 20px; border-radius: 8px; font-size: .875rem; opacity: 0;
  transition: opacity .3s; pointer-events: none; z-index: 100;
}
.toast.show { opacity: 1; }
.empty-state { text-align: center; padding: 40px; color: var(--gray-500); }
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none;
  align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius); padding: 24px;
  max-width: 400px; width: 100%; text-align: center;
}
.modal img { margin: 16px auto; border-radius: 8px; }
.modal .verify-url { font-size: .8rem; word-break: break-all; color: var(--gray-500); margin: 12px 0; }
.modal-wide { max-width: 720px; text-align: left; max-height: 90vh; overflow-y: auto; }
.modal-wide h3 { text-align: center; margin-bottom: 16px; }
.table-wrap { overflow-x: auto; }
.batch-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.batch-row input[type=number] { width: 100px; padding: 10px; border: 1px solid var(--gray-200); border-radius: 8px; }
.hint-text { font-size: .8rem; color: var(--gray-500); margin-top: 8px; }
.scan-summary { display: flex; gap: 24px; padding: 12px 16px; background: var(--gray-100); border-radius: 8px; margin-bottom: 12px; font-size: .9rem; }
.scan-summary strong { color: var(--purple); }
.modal-wide h4 { font-size: .9rem; color: var(--gray-700); margin-bottom: 8px; }
.btn-secondary { background: #6366f1; color: #fff; }

@media (min-width: 640px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .full { grid-column: 1 / -1; }
}
