/* ============================================================
   VG Immigration — Digital Business Card
   Matches the Blinq layout 1:1 but self-hosted & no third-party deps
   ============================================================ */

:root {
  --bg: #FFFDE8;
  --card: #FFFFFF;
  --ink: #0F1B2D;
  --ink-2: #1f2c44;
  --muted: #6b7280;
  --hair: #e8e1c6;
  --gold: #F5B800;
  --gold-strong: #E5A800;
  --gold-soft: #FFE9A8;
  --navy: #002665;
  --shadow: 0 14px 40px -10px rgba(15, 27, 45, 0.18), 0 2px 6px -2px rgba(15, 27, 45, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
}

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 16px 64px;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(64px, env(safe-area-inset-bottom));
}

/* ---- Card ---- */
.card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  padding: 0 28px 32px;
}

/* ---- Banner ---- */
.banner {
  margin: 0 -28px;
  padding: 22px 24px 18px;
  background: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 138px;
}
.banner-logo {
  max-width: 220px;
  width: 60%;
  height: auto;
  display: block;
}

/* ---- Profile photo (overlaps banner lower-left) ---- */
.photo-wrap {
  position: relative;
  margin-top: -56px;
  margin-bottom: 14px;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: #fff;
  padding: 4px;
  box-shadow: 0 4px 14px rgba(15,27,45,.12);
}
.photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
  display: block;
}

/* ---- Hero text ---- */
.hero { margin: 6px 0 18px; }
.name {
  font-size: 28px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: var(--ink);
}
.roles { margin: 0 0 12px; }
.role {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink-2);
}
.company {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink-2);
}
.tagline {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
}

/* ---- Credential badges ---- */
.badges {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.badge {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid #e5e7eb;
}

/* ---- Contact rows ---- */
.rows {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rows--social { margin-top: 6px; }

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--ink);
  padding: 4px 0;
  border-radius: 12px;
  transition: background .15s ease, transform .1s ease;
}
.row:hover { background: #fff8e0; }
.row:active { transform: scale(0.99); }

.row-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--gold);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.row-icon--muted {
  background: #d6d2c5;
  color: #fff;
}

.row-text { display: flex; flex-direction: column; min-width: 0; }
.row-primary {
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
  word-break: break-word;
}
.row-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

/* ---- CTA buttons ---- */
.cta-wrap {
  margin-top: 26px;
  display: flex;
  gap: 10px;
  flex-direction: column;
  align-items: stretch;
}
.cta {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  cursor: pointer;
  background: var(--gold);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 16px -6px rgba(245, 184, 0, 0.55);
  transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
  width: 100%;
}
.cta:hover { background: var(--gold-strong); }
.cta:active { transform: translateY(1px); }
.cta--ghost {
  background: #fff;
  color: var(--ink-2);
  border: 1.5px solid #e5e7eb;
  box-shadow: none;
}
.cta--ghost:hover { background: #f9fafb; }
.cta-icon { display: inline-flex; }

/* ---- Footer ---- */
.legal {
  margin: 22px 0 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  background: rgba(15, 27, 45, 0.94);
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 1000;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.4);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---- Tiny screens ---- */
@media (max-width: 380px) {
  .card { padding: 0 22px 28px; }
  .banner { margin: 0 -22px; }
  .name { font-size: 26px; }
  .row-primary { font-size: 15px; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .row, .cta, .toast { transition: none !important; }
}

/* ============================================================
   Lead-capture modal
   ============================================================ */
.lead-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 27, 45, 0.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
  z-index: 1100;
  /* dvh so mobile URL bar doesn't clip the card */
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.lead-backdrop.is-open { opacity: 1; pointer-events: auto; }

.lead-card {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 420px;
  border-radius: 20px;
  padding: 28px 26px 24px;
  box-shadow: 0 30px 80px -20px rgba(0, 12, 36, .35);
  transform: translateY(20px) scale(.98);
  transition: transform .3s cubic-bezier(.2,.9,.3,1);
  max-height: 92dvh;
  overflow-y: auto;
  margin: auto;
}
.lead-backdrop.is-open .lead-card { transform: translateY(0) scale(1); }

.lead-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 999px; border: 0;
  background: #f3f4f6; color: #1f2937;
  font-size: 22px; line-height: 1;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease;
}
.lead-close:hover { background: #e5e7eb; }

.lead-title {
  margin: 6px 0 6px;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.lead-desc {
  margin: 0 0 18px;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--muted);
}

.lead-form { display: flex; flex-direction: column; gap: 12px; }
.lead-field { display: flex; flex-direction: column; gap: 4px; }
.lead-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.01em;
}
.lead-field input {
  appearance: none; -webkit-appearance: none;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  border-radius: 12px;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
  width: 100%;
  min-width: 0;
}
.lead-field input:focus {
  outline: 0;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 184, 0, 0.2);
}
.lead-field input::placeholder { color: #9ca3af; }

/* Honeypot — hidden from real users */
.lead-hp {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

.lead-error {
  background: #fee2e2;
  color: #991b1b;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 10px;
  margin-top: 4px;
}

#lead-submit { margin-top: 8px; }
#lead-submit[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

.lead-skip {
  appearance: none; -webkit-appearance: none;
  background: transparent; border: 0;
  color: var(--muted);
  font-family: inherit;
  font-size: 13.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 8px;
  cursor: pointer;
  align-self: center;
}
.lead-skip:hover { color: var(--ink-2); }

/* Success state */
.lead-success { text-align: center; padding: 6px 0 4px; }
.lead-success-check {
  width: 64px; height: 64px;
  margin: 4px auto 14px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #059669;
  display: inline-flex; align-items: center; justify-content: center;
}
.lead-success-title {
  margin: 0 0 6px;
  font-size: 20px; font-weight: 800;
  color: var(--ink);
}
.lead-success-desc {
  margin: 0 0 18px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--muted);
}
.lead-success .cta { width: auto; padding: 12px 24px; }

@media (max-width: 380px) {
  .lead-card { padding: 24px 20px 20px; }
  .lead-title { font-size: 20px; }
}

/* ============================================================
   Secondary CTA row (Share + QR side-by-side on wider screens)
   ============================================================ */
.cta-row {
  display: flex;
  gap: 10px;
  width: 100%;
}
.cta-row .cta { flex: 1; }
@media (max-width: 380px) {
  .cta-row { flex-direction: column; }
}

/* ============================================================
   QR modal
   ============================================================ */
.qr-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 27, 45, 0.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
  z-index: 1150;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.qr-backdrop.is-open { opacity: 1; pointer-events: auto; }

.qr-card {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 380px;
  border-radius: 20px;
  padding: 28px 24px 24px;
  box-shadow: 0 30px 80px -20px rgba(0, 12, 36, .35);
  transform: translateY(20px) scale(.98);
  transition: transform .3s cubic-bezier(.2,.9,.3,1);
  max-height: 92dvh;
  overflow-y: auto;
  text-align: center;
  margin: auto;
}
.qr-backdrop.is-open .qr-card { transform: translateY(0) scale(1); }

.qr-frame {
  position: relative;
  margin: 8px auto 16px;
  width: 280px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 0 0 1.5px var(--gold-soft), 0 8px 22px -10px rgba(245, 184, 0, 0.35);
}
.qr-canvas {
  width: 100%;
  height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.qr-canvas svg, .qr-canvas img, .qr-canvas canvas {
  width: 100%;
  height: 100%;
  display: block;
}
/* VG logo punched into the center of the QR — high error-correction
   level (H) is already used so this won't break scannability */
.qr-logo {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 56px; height: 56px;
  object-fit: contain;
  background: #fff;
  padding: 6px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.qr-url {
  margin: 0 0 14px;
  font-size: 12.5px;
  color: var(--muted);
  word-break: break-all;
  line-height: 1.4;
}

@media (max-width: 380px) {
  .qr-frame { width: 240px; padding: 12px; }
  .qr-logo { width: 50px; height: 50px; }
}
