:root {
  --ink: #0f1b3d;
  --ink-soft: #5a6485;
  --line: #e7ebf5;
  --bg: #eef1f8;
  --card: #ffffff;
  --brand: #2f5bff;
  --brand-2: #6a8bff;
  --brand-deep: #0f1b3d;
  --ok: #16a34a;
  --ok-bg: #e7f7ec;
  --warn: #d97706;
  --warn-bg: #fdf0dd;
  --bad: #dc2626;
  --bad-bg: #fdeaea;
  --radius: 20px;
  --shadow: 0 14px 40px rgba(15, 27, 61, 0.10);
  --shadow-sm: 0 4px 14px rgba(15, 27, 61, 0.07);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Verify / public pages ---------- */
body.verify {
  background:
    radial-gradient(1200px 480px at 50% -160px, #dbe4ff 0%, rgba(219, 228, 255, 0) 70%),
    var(--bg);
  min-height: 100vh;
}

.page {
  max-width: 440px;
  margin: 0 auto;
  padding: 18px 16px 36px;
}
.page--center { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  box-shadow: 0 6px 16px rgba(47, 91, 255, 0.35);
}
.brand-mark::before {
  content: "";
  width: 70%; height: 70%;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'><rect x='7' y='15' width='34' height='18' rx='3.6' fill='%23fff'/><rect x='10.8' y='18.4' width='10.4' height='11.2' rx='2.2' fill='%232f5bff'/><rect x='24.5' y='19.2' width='12.5' height='2.2' rx='1.1' fill='%232f5bff'/><rect x='24.5' y='22.9' width='13.5' height='2.2' rx='1.1' fill='%232f5bff'/><rect x='24.5' y='26.6' width='10' height='2.2' rx='1.1' fill='%232f5bff'/></svg>") center / contain no-repeat;
}
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: -0.2px; color: var(--ink); }
.brand-name b { font-weight: 800; color: var(--brand); }
.brand--light .brand-name, .brand--light .brand-name b { color: #fff; }
.brand--light .brand-mark { background: rgba(255,255,255,0.16); box-shadow: none; }

.lang { display: inline-flex; gap: 4px; background: #fff; padding: 3px; border-radius: 10px; box-shadow: var(--shadow-sm); }
.lang-btn {
  border: 0; background: transparent; cursor: pointer;
  font-size: 12px; font-weight: 700; color: var(--ink-soft);
  padding: 5px 9px; border-radius: 7px;
}
.lang-btn.is-active { background: var(--brand); color: #fff; }

/* status banner */
.status {
  display: flex; align-items: center; gap: 13px;
  border-radius: 16px; padding: 14px 16px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.status--ok { background: var(--ok-bg); }
.status--bad { background: var(--bad-bg); }
.status-ic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 50%; color: #fff; }
.status--ok .status-ic { background: var(--ok); }
.status--bad .status-ic { background: var(--bad); }
.status-ic svg { width: 22px; height: 22px; }
.status-title { font-weight: 800; font-size: 16px; }
.status--ok .status-title { color: #11823a; }
.status--bad .status-title { color: #b91c1c; }
.status-sub { font-size: 13px; color: var(--ink-soft); margin-top: 1px; }

/* card primitive */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}

/* hero */
.hero-top { display: flex; gap: 15px; align-items: center; }
.avatar {
  width: 76px; height: 76px; border-radius: 20px; flex: none; object-fit: cover;
  box-shadow: 0 8px 22px rgba(15, 27, 61, 0.18);
}
.avatar--initials {
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand) 0%, #8aa2ff 100%);
  color: #fff; font-weight: 800; font-size: 28px; letter-spacing: 0.5px;
}
.hero-id { min-width: 0; }
.name { font-size: 21px; font-weight: 800; margin: 0 0 2px; letter-spacing: -0.3px; line-height: 1.15; }
.position { font-size: 14px; color: var(--ink-soft); margin-bottom: 9px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip--active { color: var(--ok); background: var(--ok-bg); }
.chip--inactive { color: var(--ink-soft); background: #eef1f8; }
.chip--suspended { color: var(--warn); background: var(--warn-bg); }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.fact { display: flex; flex-direction: column; gap: 3px; }
.fact-k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--ink-soft); font-weight: 600; }
.fact-v { font-size: 15px; font-weight: 600; }

/* employer */
.block-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-soft); font-weight: 700; margin-bottom: 12px; }
.block-title--pad { padding: 4px 4px 0; margin-bottom: 10px; }
.employer-row { display: flex; gap: 12px; align-items: center; }
.employer-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: #eef2ff; color: var(--brand); }
.employer-ic svg { width: 22px; height: 22px; }
.employer-name { font-weight: 700; font-size: 16px; }
.employer-sub { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }

/* documents */
.doc { display: flex; align-items: center; gap: 13px; padding: 14px; }
.doc-ic { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 13px; color: var(--brand); background: #eef2ff; }
.doc-ic svg { width: 24px; height: 24px; }
.doc-ic--permit { color: var(--ok); background: var(--ok-bg); }
.doc-ic--registration { color: var(--warn); background: var(--warn-bg); }
.doc-body { flex: 1; min-width: 0; }
.doc-label { font-weight: 700; font-size: 15px; }
.doc-number { font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; letter-spacing: 0.3px; margin-top: 1px; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; align-items: center; }
.exp { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 7px; }
.exp--valid { color: var(--ok); background: var(--ok-bg); }
.exp--soon { color: var(--warn); background: var(--warn-bg); }
.exp--expired { color: var(--bad); background: var(--bad-bg); }
.exp--none { display: none; }
.doc-issuer { font-size: 11px; color: var(--ink-soft); }

.doc-thumb {
  width: 52px; height: 52px; flex: none; border-radius: 11px; overflow: hidden;
  border: 1px solid var(--line); background: #f7f9ff; display: block;
}
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc-thumb--art {
  position: relative;
  background: linear-gradient(135deg, #1b2c5e 0%, #2f5bff 100%);
  display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 0 9px;
}
.doc-thumb--art i { height: 4px; border-radius: 3px; background: rgba(255,255,255,0.55); }
.doc-thumb--art i:nth-child(1) { width: 60%; }
.doc-thumb--art i:nth-child(2) { width: 85%; }
.doc-thumb--art i:nth-child(3) { width: 45%; }
.doc-thumb--img { padding: 0; cursor: zoom-in; -webkit-appearance: none; appearance: none; }
.doc-thumb--pdf {
  display: grid; place-items: center; text-decoration: none;
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%); border-color: transparent;
}
.doc-pdf-tag { font-size: 12px; font-weight: 800; letter-spacing: 0.5px; color: #fff; }

/* lightbox */
.no-scroll { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  padding: 20px; background: rgba(7, 12, 30, 0.82); backdrop-filter: blur(3px);
}
.lightbox[hidden] { display: none; }
.lightbox-img {
  max-width: 100%; max-height: 86vh; border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.5); background: #fff;
}
.lightbox-close {
  position: absolute; top: 16px; right: 16px; width: 40px; height: 40px;
  display: grid; place-items: center; border: none; border-radius: 50%;
  background: rgba(255,255,255,0.15); color: #fff; cursor: pointer;
}
.lightbox-close svg { width: 20px; height: 20px; }
.lightbox-close:hover { background: rgba(255,255,255,0.28); }

/* footer */
.foot { margin-top: 22px; text-align: center; }
.foot-verified { font-size: 13px; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 7px; }
.foot-verified b { color: var(--ink); }
.foot-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.foot-note { font-size: 11px; color: #9aa3bf; margin-top: 9px; line-height: 1.5; max-width: 320px; margin-left: auto; margin-right: auto; }

/* empty / not found */
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 10px; }
.empty-ic { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: var(--bad-bg); color: var(--bad); margin-bottom: 18px; }
.empty-ic svg { width: 32px; height: 32px; }
.empty-title { font-size: 22px; font-weight: 800; margin: 0 0 8px; }
.empty-sub { font-size: 14px; color: var(--ink-soft); max-width: 300px; line-height: 1.5; }

/* ---------- Printable ID card ---------- */
body.cardpage { background: var(--bg); display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.cardpage-wrap { text-align: center; }

.idcard {
  width: 340px;
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  text-align: left;
}
.idcard-band {
  background: linear-gradient(120deg, var(--brand-deep) 0%, #1e3a8a 55%, var(--brand) 100%);
  padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
}
.idcard-type { color: rgba(255,255,255,0.7); font-size: 11px; font-weight: 800; letter-spacing: 1px; }
.idcard-body { display: flex; gap: 13px; padding: 16px; align-items: flex-start; }
.idcard-photo { width: 72px; height: 88px; border-radius: 10px; object-fit: cover; flex: none; }
.idcard-photo--initials { display: grid; place-items: center; background: linear-gradient(140deg, var(--brand), #8aa2ff); color: #fff; font-weight: 800; font-size: 26px; }
.idcard-info { flex: 1; min-width: 0; }
.idcard-name { font-weight: 800; font-size: 16px; line-height: 1.2; }
.idcard-pos { font-size: 12px; color: var(--ink-soft); margin: 2px 0 9px; }
.idcard-fields { margin: 0; display: grid; gap: 6px; }
.idcard-fields div { display: flex; flex-direction: column; }
.idcard-fields dt { font-size: 9px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--ink-soft); font-weight: 700; }
.idcard-fields dd { margin: 0; font-size: 12px; font-weight: 600; }
.idcard-qr { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.idcard-qr img { width: 74px; height: 74px; }
.idcard-qr-cap { font-size: 8px; color: var(--ink-soft); text-align: center; max-width: 74px; line-height: 1.2; }
.idcard-foot { display: flex; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 10px; color: var(--ink-soft); font-weight: 600; letter-spacing: 0.3px; }

.print-btn {
  margin-top: 20px; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 14px;
  padding: 12px 22px; border-radius: 12px; box-shadow: 0 8px 20px rgba(47,91,255,0.35);
}

@media print {
  body.cardpage { background: #fff; }
  .print-btn { display: none; }
  .idcard { box-shadow: none; border: 1px solid var(--line); }
}
