/* Tapcard. Phone-first, light by default, dark on request. Calm iPhone-style surfaces; the card is the hero. */
:root {
  --bg: #f2f2f7; --surface: #ffffff; --fill: rgba(120, 120, 128, .12); --text: #0b0b0f; --muted: #6c6c74;
  --line: rgba(60, 60, 67, .14); --danger: #d92d20;
  --accent: #1f6feb;
  --accent-ink: color-mix(in srgb, var(--accent) 88%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 8px rgba(0, 0, 0, .03);
  --shadow-lg: 0 28px 50px -22px rgba(15, 23, 42, .45), 0 10px 20px -12px rgba(15, 23, 42, .25);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;
  --ease: cubic-bezier(.2, .9, .3, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #1c1c1e; --fill: rgba(120, 120, 128, .26); --text: #f5f5f7; --muted: #98989f;
  --line: rgba(84, 84, 88, .55); --danger: #ff6b5f;
  --accent-ink: color-mix(in srgb, var(--accent) 55%, #fff);
  --accent-soft: color-mix(in srgb, var(--accent) 26%, transparent);
  --shadow-sm: none;
  --shadow-lg: 0 28px 50px -22px rgba(0, 0, 0, .9);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
html, body { margin: 0; }
body {
  font: 17px/1.42 var(--font); letter-spacing: -.012em; color: var(--text);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  min-height: 100dvh; position: relative;
}
/* soft glow of the card colour behind the top of every page */
body::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: 0; right: 0; top: 0; height: 520px;
  background: radial-gradient(60% 70% at 50% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
}
a { color: inherit; }
button { font: inherit; letter-spacing: inherit; }
[hidden] { display: none !important; }
.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.wrap { max-width: 460px; margin: 0 auto; padding: calc(6px + env(safe-area-inset-top)) 16px calc(36px + env(safe-area-inset-bottom)); }
.view { animation: rise .45s var(--ease); }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 18px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 19px; letter-spacing: -.025em; text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent) 55%, color-mix(in srgb, var(--accent) 70%, #000));
  box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--accent) 80%, transparent);
}
.brand-mark .ico { width: 18px; height: 18px; stroke-width: 2.4; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--fill); color: var(--text);
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.icon-btn .ico { width: 20px; height: 20px; }
#theme .sun { display: none; }
[data-theme="dark"] #theme .sun { display: block; }
[data-theme="dark"] #theme .moon { display: none; }

.large { font-size: 32px; line-height: 1.1; font-weight: 750; letter-spacing: -.03em; margin: 4px 2px 6px; }
.lede { color: var(--muted); margin: 0 2px 18px; font-size: 16px; }

/* ---------- the card (wallet-pass style) ---------- */
.pass {
  position: relative; isolation: isolate; overflow: hidden; color: #fff;
  border-radius: 26px; padding: 20px 20px 18px;
  min-height: calc((min(100vw, 460px) - 32px) / 1.586);
  display: flex; flex-direction: column;
  background: var(--accent);
  background:
    radial-gradient(110% 90% at 100% 0%, color-mix(in srgb, var(--accent) 50%, #fff) 0%, transparent 55%),
    radial-gradient(90% 90% at 0% 100%, color-mix(in srgb, var(--accent) 55%, #000) 0%, transparent 65%),
    linear-gradient(140deg, color-mix(in srgb, var(--accent) 85%, #fff), var(--accent) 50%, color-mix(in srgb, var(--accent) 72%, #000));
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 0 0 1px rgba(255, 255, 255, .08);
}
/* big faint rings: a quiet pattern, not decoration for its own sake */
.pass::after {
  content: ""; position: absolute; z-index: -1; width: 340px; height: 340px; right: -130px; bottom: -170px;
  border-radius: 50%; border: 46px solid rgba(255, 255, 255, .07); box-shadow: 0 0 0 46px rgba(255, 255, 255, .035);
}
/* a single glint when the card first appears */
.pass.shine::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .32) 48%, transparent 66%);
  transform: translateX(-130%); animation: glint 1.5s .35s var(--ease) forwards;
}
.pass-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pass-logo {
  width: 54px; height: 54px; border-radius: 16px; flex: none; display: grid; place-items: center; overflow: hidden;
  background: rgba(255, 255, 255, .2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
  font-weight: 700; font-size: 20px; letter-spacing: 0;
}
.pass-logo img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.pass-org {
  font-size: 13px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; text-align: right;
  opacity: .92; max-width: 62%; overflow-wrap: anywhere; padding-top: 4px;
}
.pass-main { margin-top: auto; padding-top: 18px; }
.pass-name { font-size: clamp(23px, 7vw, 29px); font-weight: 750; letter-spacing: -.03em; line-height: 1.08; overflow-wrap: anywhere; }
.pass-role { font-size: 15px; opacity: .86; margin-top: 4px; overflow-wrap: anywhere; }
.pass-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 14px; }
.pass-lines { display: grid; gap: 1px; min-width: 0; font-size: 14px; font-weight: 500; opacity: .9; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.pass-lines span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pass-tap { width: 28px; height: 28px; opacity: .85; stroke-width: 2.2; }

/* ---------- grouped lists ---------- */
.group { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-sm); overflow: hidden; }
.group + .group, .list-wrap { margin-top: 14px; }
.group-h { font-size: 13px; font-weight: 600; color: var(--muted); margin: 26px 18px 8px; letter-spacing: 0; }
.section-h { font-size: 22px; font-weight: 750; letter-spacing: -.025em; margin: 30px 4px 12px; }
.list { list-style: none; margin: 0; padding: 0; }
.row {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 12px 16px; min-height: 62px; text-decoration: none; color: inherit; text-align: left;
  background: none; border: 0; cursor: pointer;
}
.list > li + li > .row::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; border-top: 1px solid var(--line); }
a.row:active, button.row:active { background: var(--fill); }
.row-text { flex: 1; min-width: 0; }
.row-text small { display: block; font-size: 13px; color: var(--muted); margin-bottom: 1px; }
.row-text span, .row-text b { display: block; overflow-wrap: anywhere; }
.row-text b { font-weight: 600; }
.row-text em { display: block; font-style: normal; font-size: 14px; color: var(--muted); margin-top: 2px; }
.chev { width: 16px; height: 16px; color: var(--muted); opacity: .55; stroke-width: 2.6; }
.tile { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; color: #fff; background: var(--accent); }
.tile .ico { width: 18px; height: 18px; }
.t-phone { background: #34c759; } .t-chat { background: #25d366; } .t-mail { background: #0a84ff; }
.t-globe { background: #5e5ce6; } .t-pin { background: #ff453a; } .t-linkedin { background: #0a66c2; }
.t-instagram { background: linear-gradient(45deg, #f9a825, #e1306c 50%, #833ab4); }
.t-plus { background: #0a84ff; } .t-nfc { background: #30b0c7; } .t-bolt { background: #ff9f0a; } .t-image { background: #bf5af2; }

/* ---------- buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 54px; padding: 12px 20px; border-radius: 16px; border: 0; cursor: pointer;
  font-weight: 600; font-size: 17px; text-decoration: none; text-align: center;
  background: var(--fill); color: var(--text);
  transition: transform .15s var(--ease), filter .15s;
}
.btn:active, .tile-btn:active, .q:active, .bar button:active { transform: scale(.97); }
.btn.primary {
  color: #fff; background: var(--accent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 86%, #fff), var(--accent));
  box-shadow: 0 12px 24px -12px color-mix(in srgb, var(--accent) 85%, transparent), inset 0 1px 0 rgba(255, 255, 255, .22);
}
[data-theme="dark"] .btn.primary { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), inset 0 1px 0 rgba(255, 255, 255, .22); }
.btn.plain { background: none; color: var(--accent-ink); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-col { display: grid; gap: 10px; margin-top: 18px; }

/* main "Send my contact" button */
.cta { min-height: 76px; border-radius: 22px; justify-content: flex-start; text-align: left; padding: 14px 18px; gap: 14px; margin-top: 20px; }
.bubble { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none; background: rgba(255, 255, 255, .2); }
.cta b { display: block; font-size: 18px; letter-spacing: -.02em; }
.cta small { display: block; font-weight: 450; font-size: 13.5px; opacity: .88; margin-top: 1px; }
.cta .chev { margin-left: auto; color: #fff; opacity: .7; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.tile-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px; min-height: 120px; padding: 16px;
  border: 0; border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm);
  text-align: left; cursor: pointer; transition: transform .15s var(--ease);
}
.tile-btn .bubble { width: 42px; height: 42px; border-radius: 13px; background: var(--accent-soft); color: var(--accent-ink); }
.tile-btn .bubble.wa { background: rgba(37, 211, 102, .16); color: #128c4b; }
[data-theme="dark"] .tile-btn .bubble.wa { color: #4ade80; }
.tile-btn b { display: block; font-size: 16px; letter-spacing: -.015em; }
.tile-btn small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.3; }

.bar { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 12px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-sm); overflow: hidden; }
.bar button {
  border: 0; background: none; color: var(--text); font-size: 13px; font-weight: 550; cursor: pointer;
  padding: 12px 6px; min-height: 66px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  transition: transform .15s var(--ease);
}
.bar button + button { box-shadow: inset 1px 0 0 var(--line); }
.bar .ico { width: 21px; height: 21px; color: var(--accent-ink); }

.pill {
  border: 0; border-radius: 999px; padding: 8px 15px; cursor: pointer; flex: none;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 15px; font-weight: 600;
}
.pill.quiet { background: var(--fill); color: var(--text); }

/* ---------- receiver page: Call / WhatsApp / Email / Website ---------- */
.quick { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; margin-top: 18px; }
.q {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 13px 4px 11px;
  border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm);
  color: var(--accent-ink); text-decoration: none; font-size: 13px; font-weight: 600;
  transition: transform .15s var(--ease);
}
.q .ico { width: 23px; height: 23px; }
.about { margin: 16px 4px 0; font-size: 16px; color: var(--muted); }
.sticky-bar {
  position: sticky; bottom: 0; z-index: 5; margin: 22px -16px 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  display: flex; gap: 10px;
}
.sticky-bar .btn { flex: 1; }
.sticky-bar .btn.plain { flex: 0 0 auto; width: auto; }

/* ---------- form ---------- */
.field { position: relative; padding: 11px 16px 11px; }
.group > .field + .field::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 1px solid var(--line); }
.field label, .field .label { display: block; font-size: 13px; font-weight: 550; color: var(--muted); margin: 0 0 2px; }
.opt { font-weight: 400; opacity: .8; }
.field input, .field textarea {
  display: block; width: 100%; border: 0; background: transparent; padding: 2px 0; min-height: 30px;
  font: inherit; color: var(--text); outline: none; border-radius: 0;
}
.field textarea { resize: vertical; min-height: 50px; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: .55; }
.field:focus-within label { color: var(--accent-ink); }
.field:focus-within::after { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.field:has([aria-invalid="true"]) label { color: var(--danger); }
.field:has([aria-invalid="true"])::after { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--danger); }
.err { color: var(--danger); font-size: 14px; margin: 4px 0 0; }
.err:empty { display: none; }
.swatches { display: flex; gap: 14px; flex-wrap: wrap; padding: 10px 2px 6px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.swatch[aria-checked="true"] { outline: 2.5px solid var(--text); outline-offset: 3px; }
.logo-row { display: flex; gap: 12px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.logo-prev {
  width: 54px; height: 54px; border-radius: 16px; overflow: hidden; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 19px;
}
.logo-prev img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- focus ---------- */
.btn:focus-visible, .pill:focus-visible, .icon-btn:focus-visible, .tile-btn:focus-visible, .bar button:focus-visible,
.q:focus-visible, .row:focus-visible, .swatch:focus-visible, .brand:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px;
}

/* ---------- notes, toasts, footer ---------- */
.note { background: var(--accent-soft); border-radius: 16px; padding: 13px 15px; font-size: 15px; margin-top: 14px; }
.note strong { display: block; margin-bottom: 2px; }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, 24px) scale(.96); opacity: 0; pointer-events: none;
  background: rgba(28, 28, 30, .94); color: #fff; padding: 12px 18px; border-radius: 18px;
  font-size: 15px; font-weight: 500; max-width: calc(100% - 32px); width: max-content; text-align: center;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .45); transition: .28s var(--ease);
}
[data-theme="dark"] .toast { background: rgba(58, 58, 60, .94); }
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.foot { color: var(--muted); font-size: 13px; text-align: center; margin: 28px 12px 0; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.foot .ico { width: 14px; height: 14px; }
.foot a { color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.center { text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; background: var(--fill); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }

/* ---------- numbered steps ---------- */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 10px 0 0; }
.steps > li { counter-increment: s; position: relative; padding-left: 42px; margin: 14px 0; min-height: 28px; }
.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px; font-weight: 700; letter-spacing: 0;
  background: var(--accent-soft); color: var(--accent-ink);
}
ul.steps > li::before { content: ""; width: 8px; height: 8px; left: 10px; top: 9px; background: var(--accent); }
.steps .steps > li { padding-left: 34px; margin: 10px 0; }
.steps .steps > li::before { width: 23px; height: 23px; font-size: 12px; top: 0; }
.card-pad { padding: 18px; }
.card-pad h2 { font-size: 19px; letter-spacing: -.02em; margin: 0 0 4px; }
.hint { color: var(--muted); font-size: 15px; margin: 0 0 4px; }

.note.warn { background: color-mix(in srgb, #ff9f0a 16%, transparent); }
.st-status { margin: 12px 2px 14px; font-size: 15px; font-weight: 500; min-height: 1px; }
.st-status.ok { color: #12a150; } .st-status.bad { color: var(--danger); }
.st-status.wait::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; background: var(--accent); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }

/* ---------- full-screen QR ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 40; display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom)); text-align: center; color: #fff;
  background: var(--accent);
  background:
    radial-gradient(90% 60% at 50% 0%, color-mix(in srgb, var(--accent) 60%, #fff), transparent 70%),
    linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000));
}
.overlay.open { display: flex; animation: fade .25s ease; }
.qr-card {
  background: #fff; color: #111; border-radius: 32px; padding: 20px 20px 18px; width: min(88vw, 60vh, 400px);
  box-shadow: 0 34px 60px -24px rgba(0, 0, 0, .55); animation: pop .4s var(--ease);
}
.qr-card .qr svg { width: 100%; height: auto; display: block; }
.qr-card h2 { margin: 6px 0 0; font-size: 21px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.qr-card p { margin: 2px 0 0; color: #6b7280; font-size: 14px; }
.overlay > p { margin: 0; font-size: 16px; opacity: .9; display: flex; gap: 8px; align-items: center; }
.overlay .btn { max-width: 300px; color: #fff; background: rgba(255, 255, 255, .2); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
body.qr-open { overflow: hidden; }

/* ---------- bottom sheets ---------- */
dialog {
  border: 0; margin: auto 0 0; width: 100%; max-width: 100%; max-height: 92dvh;
  padding: 10px 20px calc(18px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0; background: var(--surface); color: var(--text);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .18);
}
dialog::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 3px; background: var(--fill); margin: 0 auto 16px; }
dialog[open] { animation: sheet .38s var(--ease); }
dialog::backdrop { background: rgba(0, 0, 0, .42); }
dialog[open]::backdrop { animation: fade .3s ease; }
dialog h2 { margin: 0 0 6px; font-size: 23px; letter-spacing: -.025em; }
dialog .hint { margin-bottom: 8px; }
dialog label { display: block; font-size: 14px; font-weight: 600; margin: 16px 0 6px; }
dialog input {
  display: block; width: 100%; font: inherit; color: var(--text); background: var(--fill); border: 0;
  border-radius: 14px; padding: 14px 15px; min-height: 52px; outline: none;
}
dialog input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
dialog input[aria-invalid="true"] { box-shadow: 0 0 0 2px var(--danger); }
.sheet-icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; margin: 4px 0 14px; background: var(--accent-soft); color: var(--accent-ink); }
.sheet-icon .ico { width: 28px; height: 28px; }
@media (min-width: 600px) {
  dialog { margin: auto; max-width: 420px; border-radius: 28px; padding-bottom: 20px; }
  dialog::before { display: none; }
  dialog[open] { animation: pop .3s var(--ease); }
}

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes sheet { from { transform: translateY(100%); } to { transform: none; } }
@keyframes glint { to { transform: translateX(130%); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 350px) {
  .tiles { grid-template-columns: 1fr; }
  .quick { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
}
