/* Bitaqati card page. Paper and ink like the app; the card is the only colorful thing here. */
:root {
  --paper: #F5F3EF;
  --surface: #FFFFFF;
  --ink: #111112;
  --ink-2: #6E6C68;
  --hair: #E4E1DB;
  --shadow: 0 30px 60px -28px rgb(17 17 18 / 0.35), 0 8px 18px -10px rgb(17 17 18 / 0.18);
  --serif: "New York", ui-serif, "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
  --ar: "SF Arabic", "Geeza Pro", "Noto Naskh Arabic", "Segoe UI", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0E0E10;
    --surface: #1A1A1D;
    --ink: #F5F3EF;
    --ink-2: #9A9893;
    --hair: #2A2A2E;
    --shadow: 0 30px 60px -28px rgb(0 0 0 / 0.9), 0 0 0 1px rgb(255 255 255 / 0.04);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { font-family: var(--ar); }
a { color: inherit; }

/* ── top bar ───────────────────────────────────────────── */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top)) 20px 0;
  max-width: 1080px;
  margin: 0 auto;
}
.mark { display: inline-flex; align-items: baseline; gap: 8px; text-decoration: none; }
.mark span:first-child { font: 600 19px/1 var(--serif); letter-spacing: -0.01em; }
.mark-ar { font: 500 15px/1 var(--ar); color: var(--ink-2); }
.lang {
  font-size: 14px;
  text-decoration: none;
  padding: 7px 14px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: var(--surface);
}
.lang:hover { border-color: var(--ink-2); }

/* ── layout ────────────────────────────────────────────── */
.card-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 16px max(28px, env(safe-area-inset-bottom));
  display: grid;
  gap: 26px;
}
.stage { display: grid; place-items: center; }

/* Viewfinder corners: the card sits where a camera found it. */
.frame {
  position: relative;
  width: min(100%, 440px);
  padding: 14px;
  --c: var(--ink-2);
  background:
    linear-gradient(var(--c), var(--c)) top left / 18px 1.5px,
    linear-gradient(var(--c), var(--c)) top left / 1.5px 18px,
    linear-gradient(var(--c), var(--c)) top right / 18px 1.5px,
    linear-gradient(var(--c), var(--c)) top right / 1.5px 18px,
    linear-gradient(var(--c), var(--c)) bottom left / 18px 1.5px,
    linear-gradient(var(--c), var(--c)) bottom left / 1.5px 18px,
    linear-gradient(var(--c), var(--c)) bottom right / 18px 1.5px,
    linear-gradient(var(--c), var(--c)) bottom right / 1.5px 18px;
  background-repeat: no-repeat;
  animation: arrive 700ms cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes arrive {
  from { opacity: 0; transform: translateY(18px) rotateX(10deg) scale(.98); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .frame { animation: none; } }

/* ── the pass (WalletCardView at a 375pt reference; 1u = 1pt there) ── */
.pass { container-type: inline-size; width: 100%; }
.pass-in {
  --u: calc(100cqw / 375);
  position: relative;
  aspect-ratio: 375 / 264;
  overflow: hidden;
  border-radius: calc(14 * var(--u));
  background: var(--bg);
  color: var(--fg);
  box-shadow: var(--shadow);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  line-height: 1.2;
}
.pass-head {
  height: calc(63 * var(--u));
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
  padding: calc(8 * var(--u)) calc(16 * var(--u)) 0;
}
.logo { max-width: calc(160 * var(--u)); max-height: calc(50 * var(--u)); object-fit: contain; object-position: left center; }
.logo-text { font-size: calc(17 * var(--u)); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.grow { flex: 1; }
.pass-primary { position: relative; height: calc(144 * var(--u)); }
.strip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.name, .title { position: absolute; left: calc(18 * var(--u)); max-width: calc(339 * var(--u)); white-space: nowrap; overflow: hidden; text-align: left; }
.name { top: calc(12 * var(--u)); font-size: calc(var(--ns) * var(--u)); font-weight: 300; line-height: 1.19; letter-spacing: -0.01em; }
.title { top: calc(80.5 * var(--u)); font-size: calc(17 * var(--u)); line-height: 1.19; text-overflow: ellipsis; }
.has-strip .name, .has-strip .title { color: #fff; }
.pass-row {
  margin-top: calc(8 * var(--u));
  height: calc(41 * var(--u));
  display: flex;
  justify-content: space-between;
  gap: calc(12 * var(--u));
  padding: 0 calc(16 * var(--u));
}
.f { min-width: 0; text-align: left; }
.f-l { font-size: calc(11 * var(--u)); font-weight: 600; text-transform: uppercase; color: var(--lb); white-space: nowrap; overflow: hidden; }
.f-v { margin-top: calc(3 * var(--u)); font-size: calc(21 * var(--u)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-head { text-align: right; flex-shrink: 0; max-width: 55%; }
.f-head .f-v { font-size: calc(14 * var(--u)); }

/* ── who + actions ─────────────────────────────────────── */
.who { width: min(100%, 440px); margin: 0 auto; }
.who h1 { font: 600 clamp(30px, 8vw, 40px)/1.08 var(--serif); letter-spacing: -0.02em; margin: 0; }
html[lang="ar"] .who h1 { font-family: var(--serif), var(--ar); letter-spacing: 0; }
.role { margin: 6px 0 0; color: var(--ink-2); font-size: 17px; }
.primary-actions { display: grid; gap: 10px; margin-top: 22px; }
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  padding: 0 24px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 17px;
  transition: transform 120ms ease;
}
.btn:active { transform: scale(.97); }
.btn.ink { background: var(--ink); color: var(--paper); }
.btn.wallet { background: #000; color: #fff; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .14); }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.tiles { display: flex; gap: 8px; margin-top: 18px; }
.tile {
  flex: 1;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 12px 4px 10px;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 16px;
  text-decoration: none;
  font-size: 12.5px;
  color: var(--ink);
}
.tile span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tile:hover { border-color: var(--ink-2); }
.addr { margin: 16px 0 0; color: var(--ink-2); font-size: 15px; }

.ios-only, .desktop-only { display: none !important; }
@supports (-webkit-touch-callout: none) { .ios-only { display: flex !important; } }

.scan { align-items: center; gap: 16px; margin-top: 26px; padding: 16px; border: 1px dashed var(--hair); border-radius: 18px; }
.qr { width: 112px; height: 112px; border-radius: 10px; flex: none; }
.scan p { margin: 0; color: var(--ink-2); font-size: 15px; }

.foot { grid-column: 1 / -1; text-align: center; color: var(--ink-2); font-size: 13px; padding-top: 6px; }
.foot p { margin: 0; }
.foot strong { color: var(--ink); font-weight: 600; }

@media (min-width: 900px) and (hover: hover) {
  .card-page { grid-template-columns: 1.15fr 1fr; align-items: center; padding-top: 7vh; gap: 56px; }
  .frame { width: min(100%, 520px); }
  .who { margin: 0; }
  .desktop-only { display: flex !important; }
  .foot { padding-top: 40px; }
}

/* ── empty / error ─────────────────────────────────────── */
.empty { max-width: 440px; margin: 0 auto; padding: 12vh 24px 40px; text-align: center; }
.empty h1 { font: 600 30px/1.15 var(--serif); margin: 28px 0 8px; }
html[lang="ar"] .empty h1 { font-family: var(--ar); }
.empty > p { color: var(--ink-2); margin: 0 0 24px; }
.empty .foot { margin-top: 40px; }
.ghost { position: relative; width: 180px; height: 120px; margin: 0 auto; }
.ghost div { position: absolute; inset: 0; border-radius: 14px; border: 1.5px dashed var(--ink-2); opacity: .5; }
.ghost div:first-child { transform: rotate(-7deg) translate(-12px, 6px); opacity: .25; }

/* ── home ──────────────────────────────────────────────── */
.home { max-width: 640px; margin: 0 auto; padding: 14vh 24px 40px; }
.home h1 { font: 600 clamp(36px, 9vw, 56px)/1.04 var(--serif); letter-spacing: -0.02em; margin: 0 0 16px; }
.home p { color: var(--ink-2); font-size: 18px; margin: 0; }
.home-ar { margin-top: 48px !important; font-family: var(--ar) !important; font-weight: 700 !important; letter-spacing: 0 !important; }

/* ── documents (privacy, support) ──────────────────────── */
.doc { max-width: 680px; margin: 0 auto; padding: 8vh 24px 64px; }
.doc h1 { font: 600 clamp(32px, 7vw, 44px)/1.08 var(--serif); letter-spacing: -0.02em; margin: 0 0 8px; }
html[lang="ar"] .doc h1, html[lang="ar"] .doc h2 { font-family: var(--ar); letter-spacing: 0; font-weight: 700; }
.doc .lede { color: var(--ink-2); font-size: 18px; margin: 0 0 8px; }
.doc .meta { color: var(--ink-2); font-size: 14px; margin: 0 0 36px; }
.doc h2 { font: 600 21px/1.25 var(--serif); margin: 36px 0 10px; }
.doc p, .doc li { font-size: 16.5px; }
.doc p { margin: 0 0 12px; }
.doc ul { margin: 0 0 12px; padding-inline-start: 22px; }
.doc li { margin: 0 0 8px; }
.doc li strong, .doc p strong { font-weight: 600; }
.doc .summary { background: var(--surface); border: 1px solid var(--hair); border-radius: 18px; padding: 18px 20px; margin: 0 0 8px; }
.doc .summary p { margin: 0; }
.doc details { border-bottom: 1px solid var(--hair); padding: 14px 0; }
.doc summary { cursor: pointer; font-weight: 600; font-size: 17px; list-style-position: outside; }
.doc details p { margin: 10px 0 0; color: var(--ink); }
.doc .contact { margin-top: 36px; padding: 18px 20px; border: 1px dashed var(--hair); border-radius: 18px; }
.links { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; padding: 0 24px 40px; color: var(--ink-2); font-size: 14px; }
.links a { text-decoration: none; }
.links a:hover { color: var(--ink); text-decoration: underline; }
