/* TapIn. Dark ground, and one brand colour that the member's logo sets:
   --brand and --on-brand are rewritten by app.js the moment a logo lands,
   and everything that carries colour reads them. */
:root {
  --ground: #0d1117;
  --panel: #161b22;
  --line: #2b3440;
  --ink: #e8ecf1;
  --muted: #9aa4b2;
  --dim: #6f7a89;
  --brand: #d6ff3f;
  --on-brand: #0d1117;
  --brand-label: rgba(13, 17, 23, .65);
  --radius: 22px;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;
  --pass-font: var(--display);
  --pass-weight: 700;
  --pass-size: 19px;
  --pass-tracking: -0.01em;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
[hidden] { display: none !important; }
main { max-width: 1040px; margin: 0 auto; padding: 0 20px 48px; }

.top { max-width: 1040px; margin: 0 auto; padding: 22px 20px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: var(--on-brand); display: inline-flex; align-items: center; justify-content: center; transition: background .3s; }
.top-nav { display: flex; gap: 22px; }
.top-nav a { color: var(--muted); text-decoration: none; font-size: 14px; }

.hero { padding: 24px 0 28px; max-width: 640px; }
.eyebrow { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); transition: color .3s; }
h1 { margin: 0 0 12px; font-family: var(--display); font-weight: 800; font-size: clamp(32px, 6vw, 54px); line-height: 1.02; letter-spacing: -0.03em; }
.lede { margin: 0; font-size: 18px; color: var(--muted); }
.lede strong { color: var(--ink); }

.builder { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 880px) { .builder { grid-template-columns: 400px 1fr; gap: 40px; } .preview { position: sticky; top: 24px; } }

/* the pass preview */
.pass { border-radius: var(--radius); background: var(--brand); color: var(--on-brand); padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.8); transition: background .35s, color .35s; }
.pass small { display: block; font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-label); margin-bottom: 2px; }
.pass-head { display: flex; align-items: center; gap: 10px; }
.pass-logo { width: 42px; height: 42px; border-radius: 12px; background: rgba(0,0,0,.14); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.pass-logo img { width: 100%; height: 100%; object-fit: contain; }
.pass-initials { font-family: var(--display); font-weight: 800; font-size: 15px; }
.pass-org { font-family: var(--pass-font); font-weight: var(--pass-weight); font-size: var(--pass-size); letter-spacing: var(--pass-tracking); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pass-kind { text-align: right; font-size: 14px; font-weight: 600; }
.pass-kind small { margin-bottom: 0; }
.pass-body { display: flex; align-items: center; gap: 12px; }
.pass-photo { width: 58px; height: 58px; border-radius: 14px; background: rgba(0,0,0,.18); overflow: hidden; flex-shrink: 0; }
.pass-photo img { width: 100%; height: 100%; object-fit: cover; }
.pass-fields { display: flex; justify-content: space-between; gap: 12px; flex: 1; }
.pass-fields > div { min-width: 0; }
.pass-fields > div:last-child { text-align: right; }
.pass-fields span { display: block; font-family: var(--display); font-weight: 700; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pass-fields-2 span { font-size: 14px; }
.pass-code { background: #fff; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pass-2d { display: flex; justify-content: center; }
.pass-alt { font-size: 12px; color: #111; }
.mono { font-family: var(--mono); font-weight: 700; }
.preview { position: relative; }
.preview::before { content: ""; position: absolute; inset: -40px -30px auto; height: 70%; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 28%, transparent), transparent); filter: blur(30px); z-index: -1; transition: background .35s; }
.preview-note { text-align: center; font-size: 13px; color: var(--dim); margin: 14px 0 0; }

/* the form */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 22px; }
.step { display: flex; flex-direction: column; gap: 12px; }
.step-head { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 18px; }
.step-n { width: 26px; height: 26px; border-radius: 8px; background: var(--brand); color: var(--on-brand); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-family: var(--mono); transition: background .3s; }
label > span { display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
label > span em { font-style: normal; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--dim); margin-left: 6px; }
input[type="text"], input:not([type]), input[inputmode], select {
  width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; min-height: 48px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #10151c; color: var(--ink);
}
input.mono { font-family: var(--mono); font-weight: 700; letter-spacing: .02em; }
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 20%, transparent); }
input:invalid:not(:placeholder-shown) { border-color: #e06c5a; }

.scan-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; padding: 0 16px; font: inherit; font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--ground); background: var(--ink); border: 0; border-radius: 14px; cursor: pointer; }
.scan-btn:active { transform: translateY(1px); }
.scan-btn:disabled { opacity: .6; cursor: progress; }
.scan-status { margin: -4px 0 0; font-size: 13px; color: var(--muted); min-height: 1.2em; }
.scan-status[data-kind="ok"] { color: #8fe09b; }
.scan-status[data-kind="err"] { color: #f0907f; }
.scan-detected { margin: -4px 0 0; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.scan-detected b { display: inline-block; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--brand) 22%, #10151c); border: 1px solid var(--brand); font-weight: 600; font-size: 12px; }
.scan-detected em { font-style: normal; color: var(--dim); }

/* the live scanner: full-screen camera with a finder frame */
.scanner { position: fixed; inset: 0; z-index: 50; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner-frame { position: relative; width: min(82vw, 420px); aspect-ratio: 1.6; box-shadow: 0 0 0 100vmax rgba(0,0,0,.55); border-radius: 14px; }
.scanner-frame span { position: absolute; width: 28px; height: 28px; border: 3px solid var(--brand); border-radius: 4px; }
.scanner-frame span:nth-child(1) { top: -3px; left: -3px; border-right: 0; border-bottom: 0; }
.scanner-frame span:nth-child(2) { top: -3px; right: -3px; border-left: 0; border-bottom: 0; }
.scanner-frame span:nth-child(3) { bottom: -3px; left: -3px; border-right: 0; border-top: 0; }
.scanner-frame span:nth-child(4) { bottom: -3px; right: -3px; border-left: 0; border-top: 0; }
.scanner-hint { position: relative; margin: 22px 0 0; color: #fff; font-size: 15px; text-align: center; padding: 0 24px; }
.scanner-actions { position: absolute; bottom: max(24px, env(safe-area-inset-bottom)); left: 0; right: 0; display: flex; justify-content: center; gap: 12px; padding: 0 20px; }
.scanner-btn { min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1.5px solid rgba(255,255,255,.35); background: rgba(0,0,0,.5); color: #fff; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.scanner-cancel { background: #fff; color: #000; border-color: #fff; }

.logo-row { display: flex; }
.logo-drop { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 12px; border: 1.5px dashed var(--line); border-radius: 12px; background: #10151c; cursor: pointer; }
.logo-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.logo-drop-art { width: 44px; height: 44px; border-radius: 10px; background: #1c232d; color: var(--muted); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.logo-drop-art img { width: 100%; height: 100%; object-fit: contain; }
.logo-drop-text { display: flex; flex-direction: column; font-size: 15px; }
.logo-drop-text em { font-style: normal; font-size: 12px; color: var(--dim); }
.logo-drop.is-set { border-style: solid; border-color: var(--brand); }
.swatches { display: flex; flex-direction: column; gap: 8px; }
.swatch-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.swatch-row { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; padding: 0; }
.swatch.is-on { border-color: var(--ink); }
.fonts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 420px) { .fonts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.font-chip { flex: 1; min-height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: #10151c; color: var(--ink); font-size: 15px; cursor: pointer; }
.font-chip.is-on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, #10151c); }
.more summary { cursor: pointer; font-size: 14px; color: var(--muted); list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary em { font-style: normal; color: var(--dim); }
.more[open] summary { margin-bottom: 12px; }
.more label + label { margin-top: 12px; }

.photo-row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #10151c; cursor: pointer; }
.photo-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-art { width: 44px; height: 44px; border-radius: 12px; background: #1c232d; color: var(--muted); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.photo-art img { width: 100%; height: 100%; object-fit: cover; }
.photo-text { display: flex; flex-direction: column; font-size: 15px; flex: 1; }
.photo-text em { font-style: normal; font-size: 12px; color: var(--dim); }
.photo-clear { width: 36px; height: 36px; border-radius: 50%; border: 0; background: #2b3440; color: var(--ink); font-size: 20px; cursor: pointer; }

.wallet-row { display: flex; flex-direction: column; gap: 10px; }
.wallet-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; padding: 0 20px; font: inherit; font-family: var(--display); font-weight: 700; font-size: 18px; border-radius: 14px; cursor: pointer; }
.apple-btn { background: #000; color: #fff; border: 0; }
.google-btn { background: #10151c; color: var(--ink); border: 1.5px solid var(--line); }
.wallet-btn:disabled { opacity: .6; cursor: progress; }
.fine { margin: 0; font-size: 13px; color: var(--dim); text-align: center; }

.ad { margin: 36px auto; max-width: 728px; min-height: 90px; border-radius: 12px; border: 1px dashed var(--line); display: flex; align-items: center; justify-content: center; color: var(--dim); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.ad:empty { display: none; }

.how, .faq { max-width: 680px; margin-top: 40px; }
h2 { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: -0.02em; margin: 0 0 14px; }
.how ol { padding-left: 22px; margin: 0; display: flex; flex-direction: column; gap: 10px; color: var(--muted); }
.how strong { color: var(--ink); }
dl { margin: 0; }
dt { font-weight: 700; margin-top: 16px; }
dd { margin: 4px 0 0; color: var(--muted); }
.foot { border-top: 1px solid var(--line); padding: 24px 20px 40px; text-align: center; font-size: 13px; color: var(--dim); }
.foot a { color: var(--muted); }
.problem { max-width: 560px; margin: 80px auto; padding: 0 20px; }
.problem h1 { font-size: 32px; }
