:root {
  --ink: #1a1524;
  --muted: #433c52;
  --blue: #2d6bff;
  --blue-press: #1f56e0;
  --charcoal: #1b1b20;
  --charcoal-press: #000;
  --card-radius: 28px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100dvh;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Naskh Arabic",
    "Noto Sans Arabic", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(42rem 28rem at 12% -10%, rgba(232, 214, 255, 0.95), transparent 60%),
    radial-gradient(36rem 26rem at 110% 8%, rgba(255, 206, 220, 0.9), transparent 58%),
    radial-gradient(32rem 24rem at 70% 110%, rgba(255, 214, 186, 0.95), transparent 55%),
    radial-gradient(28rem 20rem at 0% 80%, rgba(214, 228, 255, 0.7), transparent 50%),
    #f7f2f5;
}

.stage {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding:
    max(18px, env(safe-area-inset-top))
    16px
    max(22px, env(safe-area-inset-bottom));
}

.topbar {
  width: min(420px, 100%);
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.lang {
  appearance: none;
  border: 1px solid rgba(26, 21, 36, 0.12);
  background: rgba(255, 255, 255, 0.45);
  color: var(--muted);
  border-radius: 999px;
  min-height: 36px;
  padding: 0 12px;
  font: 600 13px/1 inherit;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.lang:focus-visible,
.btn:focus-visible,
.ghost:focus-visible,
.text-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.card {
  position: relative;
  width: min(420px, 100%);
  padding: 22px 18px 16px;
  border-radius: var(--card-radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.28)),
    linear-gradient(145deg, rgba(214, 196, 255, 0.55), rgba(255, 198, 216, 0.42) 48%, rgba(255, 216, 190, 0.55));
  box-shadow:
    0 22px 50px rgba(92, 62, 120, 0.16),
    0 2px 8px rgba(80, 50, 90, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    rgba(255, 186, 206, 0.95) 28%,
    rgba(196, 176, 255, 0.95) 58%,
    rgba(255, 210, 176, 0.95) 78%,
    rgba(255, 255, 255, 0.9)
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.95),
    0 0 0 5px rgba(255, 176, 146, 0.28),
    0 0 22px 4px rgba(255, 154, 132, 0.28),
    0 0 28px 8px rgba(176, 146, 255, 0.18);
}

.avatar img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  display: block;
}

.who {
  min-width: 0;
}

h1 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.title,
.company,
.phone {
  margin: 0;
}

.title {
  margin-top: 4px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

.company {
  margin-top: 2px;
  font-size: 0.84rem;
  line-height: 1.35;
  color: var(--muted);
}

.phone {
  margin-top: 6px;
}

.phone a {
  color: var(--ink);
  font-weight: 650;
  font-size: 0.98rem;
  text-decoration: none;
  letter-spacing: 0.01em;
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

.actions,
.secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.actions {
  margin-top: 18px;
}

.secondary {
  margin-top: 10px;
}

.btn,
.ghost {
  min-height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 12px;
  text-decoration: none;
  font: 650 0.95rem/1.1 inherit;
  letter-spacing: -0.01em;
  cursor: pointer;
  border: 0;
  -webkit-tap-highlight-color: transparent;
}

.btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex: 0 0 auto;
}

.btn-call {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 16px rgba(45, 107, 255, 0.22);
}

.btn-call:active {
  background: var(--blue-press);
}

.btn-dark {
  background: var(--charcoal);
  color: #fff;
}

.btn-dark:active {
  background: var(--charcoal-press);
}

#whatsapp svg {
  color: #3dde7a;
}

.ghost {
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.ghost:active {
  background: rgba(255, 255, 255, 0.85);
}

#qr-dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: calc(100vw - 28px);
}

#qr-dialog::backdrop {
  background: rgba(28, 22, 40, 0.46);
  backdrop-filter: blur(6px);
}

.qr-sheet {
  width: min(360px, calc(100vw - 28px));
  background: #fff;
  border-radius: 24px;
  padding: 18px 18px 14px;
  box-shadow: 0 24px 60px rgba(20, 12, 40, 0.28);
  text-align: center;
}

.qr-sheet h2 {
  margin: 0;
  font-size: 1.15rem;
}

.qr-hint {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.qr-frame {
  background: #fff;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid #eee;
}

.qr-frame img {
  display: block;
  width: min(240px, 100%);
  height: auto;
  margin: 0 auto;
  image-rendering: pixelated;
}

.qr-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.text-link {
  appearance: none;
  background: none;
  border: 0;
  color: var(--muted);
  font: 600 0.9rem/1 inherit;
  min-height: 40px;
  text-decoration: none;
  cursor: pointer;
}

.copied {
  margin: 8px 0 0;
  color: #146c3a;
  font-size: 0.86rem;
  font-weight: 650;
}

@media (max-width: 360px) {
  .avatar {
    width: 80px;
    height: 80px;
  }

  h1 {
    font-size: 1.25rem;
  }

  .btn,
  .ghost {
    font-size: 0.88rem;
    padding-inline: 8px;
  }
}

@media (min-width: 840px) {
  .card {
    width: min(460px, 100%);
    padding: 26px 22px 18px;
  }

  .avatar {
    width: 108px;
    height: 108px;
  }
}
