/* ============ Tokens ============ */
:root {
  --c: #4f46e5;
  --c-deep: color-mix(in srgb, var(--c) 62%, #05060a);
  --bg: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --text: #0f1115;
  --text-2: #3d424d;
  --muted: #7a808c;
  --line: rgba(15, 17, 21, .07);
  --tint: color-mix(in srgb, var(--c) 10%, #fff);
  --tint-text: color-mix(in srgb, var(--c) 88%, #000);
  --shadow-sm: 0 1px 2px rgba(15, 17, 21, .04);
  --shadow: 0 1px 2px rgba(15, 17, 21, .04), 0 8px 24px -8px rgba(15, 17, 21, .10);
  --shadow-lg: 0 2px 4px rgba(15, 17, 21, .04), 0 24px 48px -16px rgba(15, 17, 21, .18);
  --r-lg: 28px;
  --r: 20px;
  --r-sm: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
body.dark {
  --bg: #0b0c10;
  --surface: #15171c;
  --surface-2: #1b1e24;
  --text: #f4f5f7;
  --text-2: #c9ccd3;
  --muted: #8b909b;
  --line: rgba(255, 255, 255, .07);
  --tint: color-mix(in srgb, var(--c) 18%, #15171c);
  --tint-text: color-mix(in srgb, var(--c) 55%, #fff);
  --shadow-sm: none;
  --shadow: 0 0 0 1px rgba(255, 255, 255, .04);
  --shadow-lg: 0 0 0 1px rgba(255, 255, 255, .05), 0 24px 48px -16px rgba(0, 0, 0, .6);
}

/* ============ Base ============ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: "Plus Jakarta Sans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
svg { width: 20px; height: 20px; flex: none; }
img { display: block; }

#app { max-width: 460px; margin: 0 auto; min-height: 100vh; position: relative; background: var(--bg); overflow-x: clip; }
@media (min-width: 500px) {
  body:not(.is-preview) {
    background:
      radial-gradient(900px 500px at 50% -10%, color-mix(in srgb, var(--c) 18%, transparent), transparent 70%),
      #e7e9ee;
  }
  body.dark:not(.is-preview) { background: radial-gradient(900px 500px at 50% -10%, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%), #050608; }
  body:not(.is-preview) #app { box-shadow: 0 0 0 1px rgba(0,0,0,.04), 0 30px 80px rgba(0, 0, 0, .14); }
}

/* ============ Sticky app bar ============ */
.appbar {
  position: fixed; top: 0; left: 50%; z-index: 30;
  width: 100%; max-width: 460px;
  transform: translate(-50%, -100%);
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  transition: transform .3s var(--ease);
}
.appbar.show { transform: translate(-50%, 0); }
.appbar-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.appbar-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-av {
  width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex: none;
  display: grid; place-items: center; background: var(--c); color: #fff; font-size: 12px; font-weight: 700;
}
.appbar-av img { width: 100%; height: 100%; object-fit: cover; }
.appbar-av.lg { width: 48px; height: 48px; font-size: 16px; }
.appbar-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--tint-text); }
.appbar-btn svg { width: 18px; height: 18px; }

/* ============ Hero ============ */
.hero {
  height: 232px; position: relative; overflow: hidden;
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--c) 55%, #fff) 0%, transparent 55%),
    radial-gradient(90% 80% at 0% 100%, var(--c-deep) 0%, transparent 70%),
    linear-gradient(160deg, var(--c), var(--c-deep));
}
.hero::before { /* subtle dot pattern */
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1.2px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(200deg, #000 10%, transparent 75%);
          mask-image: linear-gradient(200deg, #000 10%, transparent 75%);
}
.hero.has-img { background-color: var(--c-deep); background-position: center; background-size: cover; background-repeat: no-repeat; }
.hero.has-img::before { background: linear-gradient(180deg, rgba(0,0,0,.35), transparent 45%, rgba(0,0,0,.25)); -webkit-mask-image: none; mask-image: none; }
.hero-top {
  position: absolute; z-index: 1; top: calc(14px + env(safe-area-inset-top)); right: 14px;
  display: flex; gap: 8px;
}
.glass {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: background .2s;
}
.glass:active { background: rgba(255, 255, 255, .3); }
.glass svg { width: 18px; height: 18px; }

/* ============ Identity card ============ */
.content { padding: 0 16px calc(112px + env(safe-area-inset-bottom)); }
.id-card {
  position: relative; margin-top: -86px;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 66px 20px 18px; text-align: center;
}
.avatar {
  position: absolute; top: -54px; left: 50%; transform: translateX(-50%);
  width: 112px; height: 112px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
  border: 4px solid var(--surface);
  background: linear-gradient(140deg, var(--c), var(--c-deep));
  color: #fff; font-size: 38px; font-weight: 700; letter-spacing: -.02em;
  box-shadow: 0 10px 30px -6px color-mix(in srgb, var(--c) 45%, rgba(0,0,0,.3));
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.id-card h1 { font-size: 24px; line-height: 1.2; font-weight: 800; letter-spacing: -.025em; margin: 0; }
.role { margin: 6px 0 0; font-size: 15px; font-weight: 600; color: var(--tint-text); }
.company {
  display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 0;
  padding: 5px 11px 5px 9px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--line);
}
.company svg { width: 14px; height: 14px; color: var(--muted); }

.actions {
  display: grid; grid-template-columns: repeat(var(--n, 4), 1fr);
  margin: 20px -6px 0; padding-top: 16px; border-top: 1px solid var(--line);
}
.action {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
}
.action-ic {
  width: 50px; height: 50px; border-radius: 16px;
  display: grid; place-items: center;
  background: var(--tint); color: var(--tint-text);
  transition: transform .15s var(--ease), background .2s;
}
.action:first-child .action-ic { background: var(--c); color: #fff; box-shadow: 0 8px 18px -6px color-mix(in srgb, var(--c) 70%, transparent); }
.action:active .action-ic { transform: scale(.9); }

/* ============ Groups ============ */
.group { margin-top: 26px; }
.group h2 {
  margin: 0 0 10px 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
}
.sheet-card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.bio { padding: 18px 20px; }
.bio p { margin: 0; font-size: 15px; line-height: 1.65; color: var(--text-2); white-space: pre-line; }

.list { padding: 4px 0; }
.row { display: flex; align-items: center; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 70px; right: 16px; height: 1px; background: var(--line); }
.row-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 12px 0 12px 16px; }
.row-main:active { opacity: .6; }
.tile {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; background: var(--tint); color: var(--tint-text);
}
.tile svg { width: 19px; height: 19px; }
.row-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-txt small { color: var(--muted); font-size: 12px; font-weight: 500; }
.row-txt b { font-weight: 600; font-size: 15px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-act {
  width: 44px; height: 44px; margin-right: 6px; border-radius: 12px; flex: none;
  display: grid; place-items: center; color: var(--muted);
}
.row-act svg { width: 17px; height: 17px; }
button.row-act:active { background: var(--surface-2); color: var(--text); }
.row-act.ghost { opacity: .55; }

/* Social */
.socials { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.social {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 4px 11px; border-radius: 18px;
  background: var(--surface); box-shadow: var(--shadow);
  transition: transform .15s var(--ease);
}
.social:active { transform: scale(.95); }
.social-ic {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  color: var(--s); background: color-mix(in srgb, var(--s) 10%, transparent);
}
.social.mono .social-ic { color: var(--text); background: var(--surface-2); }
body.dark .social-ic { background: color-mix(in srgb, var(--s) 18%, transparent); }
.social small { font-size: 11.5px; font-weight: 600; color: var(--text-2); }

/* Bank card */
.bank {
  position: relative; overflow: hidden; color: #fff;
  border-radius: var(--r); padding: 18px 20px;
  background:
    radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--c) 55%, transparent), transparent 60%),
    linear-gradient(135deg, #1a1d24, #0c0e12);
  box-shadow: var(--shadow-lg);
}
.bank::after {
  content: ""; position: absolute; right: -40px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%;
  border: 28px solid rgba(255, 255, 255, .04);
}
.bank-top { display: flex; align-items: center; justify-content: space-between; }
.chip { width: 34px; height: 25px; border-radius: 6px; background: linear-gradient(135deg, #e7c77d, #b38a3a); opacity: .9; }
.bank-label { font-size: 11px; font-weight: 700; letter-spacing: .16em; opacity: .6; }
.bank-iban {
  margin: 18px 0 16px; font-size: 16.5px; font-weight: 600; letter-spacing: .04em;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; word-spacing: -.1em;
}
.bank-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.bank-bottom span { font-size: 13px; opacity: .75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bank-bottom button {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 12.5px; font-weight: 700; padding: 7px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .14);
}
.bank-bottom svg { width: 14px; height: 14px; }

.foot { text-align: center; color: var(--muted); font-size: 12px; margin: 32px 0 0; opacity: .8; }
.foot span { font-weight: 600; }

/* ============ Dock ============ */
.dock {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 20;
  width: 100%; max-width: 460px;
  display: flex; gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg) 92%, transparent) 30%);
}
.btn {
  height: 54px; border-radius: 18px; padding: 0 20px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 700; font-size: 15.5px; letter-spacing: -.01em;
  transition: transform .15s var(--ease), filter .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary {
  flex: 1; background: var(--c); color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 12px 24px -10px color-mix(in srgb, var(--c) 80%, transparent);
}
.btn.ghost { flex: 1; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn.square {
  width: 54px; padding: 0; flex: none;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}

/* ============ Share sheet ============ */
.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet-bg { position: absolute; inset: 0; background: rgba(5, 6, 10, .5); opacity: 0; transition: opacity .28s; backdrop-filter: blur(2px); }
.sheet-body {
  position: absolute; bottom: 0; left: 50%; width: 100%; max-width: 460px;
  transform: translate(-50%, 100%); transition: transform .32s var(--ease);
  background: var(--surface); border-radius: 28px 28px 0 0;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
}
.sheet.open .sheet-bg { opacity: 1; }
.sheet.open .sheet-body { transform: translate(-50%, 0); }
.grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 16px; filter: contrast(3); }
.sheet-x {
  position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2); color: var(--muted);
}
.sheet-x svg { width: 16px; height: 16px; }
.sheet-id { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding-right: 40px; }
.sheet-id div { display: flex; flex-direction: column; min-width: 0; }
.sheet-id b { font-size: 16px; }
.sheet-id small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-wrap {
  display: grid; place-items: center; padding: 22px; border-radius: 24px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.qr {
  width: 212px; height: 212px; padding: 14px; background: #fff; border-radius: 18px;
  display: grid; place-items: center; color: #666; font-size: 13px;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,.18);
}
.qr-hint { text-align: center; color: var(--muted); font-size: 13px; margin: 14px 0 18px; }
.sheet-actions { display: flex; gap: 10px; }
.sheet-actions .btn { height: 50px; font-size: 14.5px; border-radius: 16px; }
.sheet-actions svg { width: 18px; height: 18px; }

/* ============ Toast ============ */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 50;
  display: inline-flex; align-items: center; gap: 8px;
  transform: translate(-50%, 16px) scale(.96); opacity: 0; pointer-events: none;
  background: #0f1115; color: #fff; padding: 11px 16px 11px 13px; border-radius: 14px;
  font-size: 14px; font-weight: 600; transition: all .22s var(--ease);
  box-shadow: 0 12px 30px -8px rgba(0,0,0,.4);
}
body.dark .toast { background: #f4f5f7; color: #0f1115; }
.toast svg { width: 17px; height: 17px; color: #34d399; }
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ============ Entrance animation (first load only) ============ */
.animate .hero { animation: heroIn .7s var(--ease) both; }
.animate .reveal { animation: up .6s var(--ease) both; animation-delay: calc(var(--d, 0ms) + 120ms); }
.animate .dock { animation: dockIn .6s var(--ease) .45s both; }
@keyframes up { from { opacity: 0; transform: translateY(14px); } }
@keyframes heroIn { from { opacity: .4; } }
@keyframes dockIn { from { opacity: 0; transform: translate(-50%, 20px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============ Documents ============ */
.doc { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 16px; position: relative; }
.doc + .doc::before { content: ""; position: absolute; top: 0; left: 70px; right: 16px; height: 1px; background: var(--line); }
.doc:active { opacity: .65; }
.doc-badge {
  width: 40px; height: 48px; flex: none; border-radius: 7px 13px 7px 7px; position: relative;
  display: grid; place-items: end center; padding-bottom: 8px;
  font-size: 10px; font-weight: 800; letter-spacing: .04em; color: #fff; background: var(--fc);
  box-shadow: 0 6px 14px -6px var(--fc);
}
.doc-badge::before { content: ""; position: absolute; top: 0; right: 0; width: 13px; height: 13px; border-radius: 0 13px 0 6px; background: rgba(255, 255, 255, .38); }
.doc .row-txt b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.doc-desc { font-size: 13px; color: var(--text-2); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.doc .row-txt small { margin-top: 2px; font-weight: 600; letter-spacing: .02em; }
.doc-dl {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--tint); color: var(--tint-text);
}
.doc-dl svg { width: 18px; height: 18px; }

/* ============ Language switcher ============ */
.lang { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; }
.lang button {
  min-width: 34px; height: 28px; padding: 0 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em;
  transition: background .2s, color .2s;
}
.lang-hero {
  position: absolute; z-index: 1; top: calc(16px + env(safe-area-inset-top)); left: 14px;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.lang-hero button { color: rgba(255, 255, 255, .82); }
.lang-hero button.on { background: #fff; color: #0f1115; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.lang-sm { background: var(--surface-2); border: 1px solid var(--line); }
.lang-sm button { min-width: 30px; height: 26px; padding: 0 6px; font-size: 11px; color: var(--muted); }
.lang-sm button.on { background: var(--c); color: #fff; }
.appbar-right { display: flex; align-items: center; gap: 8px; flex: none; }
.appbar-id { flex: 1; }

/* ============ Products & services (list, small thumbnail first) ============ */
.products { padding: 4px 0; }
.product { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; position: relative; }
.product + .product::before { content: ""; position: absolute; top: 0; left: 90px; right: 16px; height: 1px; background: var(--line); }
a.product:active { opacity: .65; }
.product-img {
  width: 60px; height: 60px; flex: none; border-radius: 14px; overflow: hidden;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
}
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-size: 19px; font-weight: 800; color: #fff; letter-spacing: -.02em;
  background: linear-gradient(140deg, var(--c), var(--c-deep));
}
.product-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding-top: 1px; }
.product-body b { font-size: 15px; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
.product-desc {
  font-size: 13px; line-height: 1.45; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-more {
  margin-top: 3px; display: inline-flex; align-items: center; gap: 3px;
  font-size: 12.5px; font-weight: 700; color: var(--tint-text);
}
.product-more svg { width: 13px; height: 13px; }

/* Admin preview: keep hero controls clear of the phone mockup's notch */
.is-preview .lang-hero, .is-preview .hero-top { top: 46px; }
.is-preview .appbar { padding-top: 44px; }
