@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600&display=swap');

/* ========== DESIGN TOKENS ========== */
:root {
  --blue-900: #0B2E59;
  --blue-800: #0E3D74;
  --blue-700: #1256A3;
  --blue-600: #1B6FD0;
  --blue-500: #2E86F0;
  --blue-100: #E6F0FB;
  --blue-50: #F3F7FC;
  --ink-900: #0B1220;
  --ink-700: #2A3648;
  --ink-500: #5B6A80;
  --ink-400: #7B8AA0;
  --ink-300: #A6B2C4;
  --line: #E4E9F1;
  --surface: #FFFFFF;
  --canvas: #F5F7FB;
  --success: #0E9F6E;
  --success-bg: #E6F7EF;
  --warn: #B45309;
  --warn-bg: #FEF3E2;
  --danger: #C0342C;
  --danger-bg: #FDECEB;
  --shadow: 0 1px 2px rgba(11,34,89,.06), 0 8px 24px rgba(11,34,89,.06);
}

/* ========== RESET & BASE ========== */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: #E9ECF1;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
}
body {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
}

/* ========== DEVICE FRAME ========== */
.device {
  width: 422px;
  background: #0B1220;
  border-radius: 56px;
  padding: 16px;
  box-shadow: 0 40px 80px rgba(11,34,89,.25), 0 8px 20px rgba(11,34,89,.12), inset 0 0 0 1px #1a2332;
  position: relative;
}
.device::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 52px;
  border: 1.5px solid #2a3446;
  pointer-events: none;
}
.screen {
  width: 390px;
  background: var(--canvas);
  border-radius: 44px;
  overflow: hidden;
  overflow-y: auto;
  position: relative;
  min-height: 844px;
}

/* ========== STATUS BAR ========== */
.statusbar {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-900);
  position: relative;
  z-index: 5;
}
.statusbar .right { display: flex; align-items: center; gap: 6px; }
.island {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 118px;
  height: 34px;
  background: #0B1220;
  border-radius: 20px;
  z-index: 6;
}

/* ========== IN-APP CHROME (WhatsApp) ========== */
.in-app-chrome {
  background: #0B2E59;
  color: #CFE0F5;
  font-size: 12px;
  padding: 8px 20px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #082247;
}
.in-app-chrome .l { display: flex; align-items: center; gap: 8px; }
.wa-badge {
  width: 18px; height: 18px;
  border-radius: 5px;
  background: #25D366;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wa-badge svg { width: 12px; height: 12px; }
.in-app-chrome .url {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #8FB8E8;
}

/* ========== BRAND STRIP ========== */
.brand-strip {
  padding: 14px 20px 12px;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--blue-700), var(--blue-500));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 4px 10px rgba(27,111,208,.35);
}
.brand-txt { line-height: 1.05; }
.brand-txt .b1 { font-size: 13px; font-weight: 700; color: var(--ink-900); letter-spacing: .2px; }
.brand-txt .b2 { font-size: 10.5px; color: var(--ink-500); font-weight: 500; margin-top: 2px; }

/* ========== CONTENT AREA ========== */
.content { padding: 16px 16px 30px; }

/* ========== STATUS BANNER ========== */
.status-banner {
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 12px;
}
.status-banner.active {
  background: var(--success-bg);
  border: 1px solid #BFE9D6;
  color: #0A6E4F;
}
.status-banner.expired {
  background: #F0F2F5;
  border: 1px solid var(--line);
  color: var(--ink-500);
}
.status-banner.revoked {
  background: var(--danger-bg);
  border: 1px solid #F5C6C2;
  color: var(--danger);
}
.status-banner.checked-in {
  background: var(--success-bg);
  border: 1px solid #BFE9D6;
  color: #0A6E4F;
}
.status-banner .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-banner.active .dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(14,159,110,.15);
  animation: pulse 2s infinite;
}
.status-banner.expired .dot { background: var(--ink-400); }
.status-banner.revoked .dot { background: var(--danger); }
.status-banner.checked-in .dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(14,159,110,.15);
}
.status-banner strong { font-weight: 700; }
.status-banner .expiry {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 11.5px;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(14,159,110,.15); }
  50% { box-shadow: 0 0 0 7px rgba(14,159,110,.05); }
}

/* ========== PASS CARD ========== */
.pass {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.pass-head {
  background: linear-gradient(135deg, var(--blue-800) 0%, var(--blue-600) 100%);
  color: #fff;
  padding: 16px 18px 14px;
  position: relative;
  overflow: hidden;
}
.pass-head::after {
  content: "";
  position: absolute;
  right: -40px; top: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle at center, rgba(255,255,255,.12), transparent 60%);
}
.pass-head::before {
  content: "";
  position: absolute;
  left: -30px; bottom: -60px;
  width: 140px; height: 140px;
  background: radial-gradient(circle at center, rgba(255,255,255,.08), transparent 60%);
}
.pass-label {
  font-size: 10.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #B9D2F0;
  font-weight: 600;
  margin-bottom: 6px;
}
.pass-title { font-size: 19px; font-weight: 700; letter-spacing: .1px; }
.pass-sub { font-size: 12.5px; color: #CFE0F5; margin-top: 2px; font-weight: 500; }
.pass-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255,255,255,.25);
  font-size: 11.5px;
}
.pass-meta .k { color: #B9D2F0; font-weight: 500; }
.pass-meta .v {
  color: #fff;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: .3px;
}

/* ========== PERFORATION ========== */
.perf {
  height: 20px;
  background: #fff;
  position: relative;
}
.perf::before, .perf::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 20px; height: 20px;
  background: var(--canvas);
  border-radius: 50%;
}
.perf::before { left: -10px; }
.perf::after { right: -10px; }
.perf .line {
  position: absolute;
  left: 20px; right: 20px;
  top: 50%;
  height: 1px;
  background-image: linear-gradient(to right, var(--ink-300) 40%, transparent 40%);
  background-size: 8px 1px;
  background-repeat: repeat-x;
}

/* ========== QR AREA ========== */
.qr-wrap {
  padding: 20px 20px 6px;
  text-align: center;
  position: relative;
  background: #fff;
}
.qr-frame {
  width: 220px; height: 220px;
  margin: 0 auto;
  border-radius: 16px;
  background: #fff;
  padding: 12px;
  position: relative;
}
.qr-frame::before, .qr-frame::after,
.qr-frame > .c1, .qr-frame > .c2 {
  content: "";
  position: absolute;
  width: 22px; height: 22px;
  border: 3px solid var(--blue-700);
}
.qr-frame::before { top: 0; left: 0; border-right: none; border-bottom: none; border-top-left-radius: 6px; }
.qr-frame::after  { top: 0; right: 0; border-left: none; border-bottom: none; border-top-right-radius: 6px; }
.qr-frame .c1     { bottom: 0; left: 0; border-right: none; border-top: none; border-bottom-left-radius: 6px; }
.qr-frame .c2     { bottom: 0; right: 0; border-left: none; border-top: none; border-bottom-right-radius: 6px; }

.qr-img { width: 100%; height: 100%; position: relative; }
.qr-img svg { width: 100%; height: 100%; display: block; }
.qr-logo {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 38px; height: 38px;
  background: #fff;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(11,34,89,.15);
}
.qr-logo div {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--blue-700), var(--blue-500));
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-caption {
  font-size: 11.5px;
  color: var(--ink-500);
  margin: 10px 0 0;
  font-weight: 500;
}

/* QR dimmed state for expired/revoked */
.qr-dimmed { filter: grayscale(1); opacity: 0.35; }

/* QR fade-in animation */
.qr-fade-in {
  animation: qrFadeIn 300ms ease-out both;
}
@keyframes qrFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* ========== PIN BLOCK ========== */
.pin-block {
  margin: 14px 20px 0;
  background: var(--blue-50);
  border: 1px solid #D6E5F5;
  border-radius: 14px;
  padding: 14px 14px 12px;
  text-align: center;
}
.pin-label {
  font-size: 10.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--blue-700);
  font-weight: 700;
  margin-bottom: 8px;
}
.pin-digits {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.pin-digits span {
  width: 38px; height: 46px;
  background: #fff;
  border: 1.5px solid #C7D9EE;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 22px;
  color: var(--blue-900);
  box-shadow: 0 1px 0 rgba(11,34,89,.05);
}
.pin-help {
  font-size: 11px;
  color: var(--ink-500);
  margin-top: 9px;
  font-weight: 500;
}

/* ========== BUTTONS ========== */
.btn {
  height: 44px;
  border-radius: 11px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: var(--blue-700);
  color: #fff;
  box-shadow: 0 4px 12px rgba(18,86,163,.28);
}
.btn.primary:hover {
  background: var(--blue-800);
  box-shadow: 0 6px 16px rgba(18,86,163,.35);
}
.btn.ghost {
  background: #fff;
  color: var(--blue-700);
  border-color: #CFDFF3;
}
.btn.ghost:hover { background: var(--blue-50); }
.btn svg { width: 15px; height: 15px; }

.btn-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 14px 16px 6px;
}

/* ========== INFO CARD ========== */
.info-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-top: 14px;
  overflow: hidden;
}
.info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.info-row:last-child { border-bottom: none; }
.info-ic {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--blue-50);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-700);
  flex-shrink: 0;
}
.info-ic svg { width: 16px; height: 16px; }
.info-txt { flex: 1; min-width: 0; }
.info-k {
  font-size: 10.5px;
  color: var(--ink-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 2px;
}
.info-v {
  font-size: 13px;
  color: var(--ink-900);
  font-weight: 600;
  line-height: 1.3;
}
.info-v small {
  display: block;
  font-size: 11.5px;
  color: var(--ink-500);
  font-weight: 500;
  margin-top: 1px;
}

/* ========== SECTION TITLES ========== */
.sec-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-500);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin: 18px 4px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sec-title .count {
  color: var(--ink-400);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: .4px;
}

/* ========== INSTRUCTIONS STEPS ========== */
.steps {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px 4px;
}
.step {
  display: flex;
  gap: 12px;
  padding: 11px 14px;
}
.step-n {
  width: 24px; height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--blue-100);
  color: var(--blue-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}
.step-t {
  font-size: 12.5px;
  color: var(--ink-700);
  line-height: 1.45;
  font-weight: 500;
}
.step-t b { color: var(--ink-900); font-weight: 600; }

/* ========== SECURITY FOOTER ========== */
.security {
  margin-top: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sec-ic {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: #EEF6EF;
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sec-ic svg { width: 14px; height: 14px; }
.sec-t { font-size: 11.5px; color: var(--ink-500); line-height: 1.4; }
.sec-t b { color: var(--ink-900); font-weight: 600; }

/* ========== LEGAL FOOTER ========== */
.legal {
  text-align: center;
  margin-top: 14px;
  font-size: 10.5px;
  color: var(--ink-400);
  line-height: 1.5;
  padding: 0 14px 12px;
}
.legal .logo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-500);
  font-weight: 600;
  margin-bottom: 4px;
}
.legal .logo svg { width: 12px; height: 12px; }

/* ========== HOME INDICATOR ========== */
.home-indicator {
  position: sticky;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  background: var(--ink-900);
  border-radius: 3px;
  opacity: .85;
  margin: 16px auto 8px;
}

/* ========== DEMO INDEX ========== */
.demo-header {
  text-align: center;
  padding: 20px 16px 8px;
}
.demo-header h1 {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-900);
  margin: 0 0 4px;
}
.demo-header p {
  font-size: 12.5px;
  color: var(--ink-500);
  margin: 0;
  font-weight: 500;
}
.demo-watermark {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 8px;
}
.demo-cards {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.demo-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 120ms ease, border-color 120ms ease;
}
.demo-card:hover {
  border-color: var(--blue-500);
  box-shadow: 0 4px 16px rgba(46,134,240,.12);
}
.demo-card-ic {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.demo-card-ic.blue   { background: var(--blue-100); color: var(--blue-700); }
.demo-card-ic.gray   { background: #F0F2F5; color: var(--ink-400); }
.demo-card-ic.red    { background: var(--danger-bg); color: var(--danger); }
.demo-card-ic.green  { background: var(--success-bg); color: var(--success); }
.demo-card-ic.orange { background: var(--warn-bg); color: var(--warn); }
.demo-card-ic svg { width: 20px; height: 20px; }
.demo-card-txt { flex: 1; }
.demo-card-txt .title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-900);
}
.demo-card-txt .sub {
  font-size: 11.5px;
  color: var(--ink-500);
  font-weight: 500;
  margin-top: 2px;
}
.demo-card .chevron {
  color: var(--ink-300);
  font-size: 18px;
  font-weight: 400;
}

/* ========== ENTRY RESULT ========== */
.result-wrap {
  text-align: center;
  padding: 40px 24px 16px;
}
.result-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: resultScaleIn 250ms cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes resultScaleIn {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}
.result-icon.confirmed {
  background: var(--success-bg);
  color: var(--success);
}
.result-icon.denied {
  background: var(--danger-bg);
  color: var(--danger);
}
.result-icon svg { width: 40px; height: 40px; }
.result-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
}
.result-title.confirmed { color: var(--success); }
.result-title.denied { color: var(--danger); }
.result-msg {
  font-size: 13.5px;
  color: var(--ink-500);
  line-height: 1.5;
  margin: 0 0 8px;
  font-weight: 500;
}
.result-ts {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-400);
  font-weight: 500;
}
.result-property-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-top: 20px;
  text-align: left;
}
.result-property-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 2px;
}
.result-property-loc {
  font-size: 12px;
  color: var(--ink-500);
  font-weight: 500;
}

/* ========== BACK LINKS ========== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--blue-700);
  text-decoration: none;
  padding: 10px 0;
}
.back-link:hover { text-decoration: underline; }
.back-link svg { width: 14px; height: 14px; }

/* ========== ERROR STATE ========== */
.error-wrap {
  text-align: center;
  padding: 60px 24px 16px;
}
.error-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--warn-bg);
  color: var(--warn);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.error-icon svg { width: 32px; height: 32px; }
.error-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-900);
  margin: 0 0 8px;
}
.error-msg {
  font-size: 13px;
  color: var(--ink-500);
  line-height: 1.5;
  margin: 0;
  font-weight: 500;
}

/* ========== MESSAGE CARDS (expired, revoked, checked-in) ========== */
.msg-card {
  border-radius: 12px;
  padding: 14px 16px;
  margin: 14px 20px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  font-weight: 500;
}
.msg-card.expired {
  background: #F0F2F5;
  border: 1px solid var(--line);
  color: var(--ink-700);
}
.msg-card.revoked {
  background: var(--danger-bg);
  border: 1px solid #F5C6C2;
  color: #8B201A;
}
.msg-card.checked-in {
  background: var(--success-bg);
  border: 1px solid #BFE9D6;
  color: #0A6E4F;
}
.msg-card svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

/* ========== UTILITY ========== */
.mt-16 { margin-top: 16px; }
.text-center { text-align: center; }
.pad-h-16 { padding-left: 16px; padding-right: 16px; }
