:root {
  --bg-deep: #07090e;
  --bg-card: rgba(16, 20, 29, 0.84);
  --bg-row: rgba(255, 255, 255, 0.032);
  --bg-row-hover: rgba(232, 204, 147, 0.08);

  --gold-bright: #f2ddb0;
  --gold-mid: #cfa866;
  --gold-deep: #8c6a34;
  --gold-border: rgba(218, 182, 118, 0.22);
  --gold-border-soft: rgba(218, 182, 118, 0.12);

  --wa-bg: rgba(37, 211, 102, 0.12);
  --wa-border: rgba(37, 211, 102, 0.34);
  --wa-text: #74f0a2;

  --text-primary: #f6f3ec;
  --text-secondary: #a8aebc;
  --text-muted: #707788;

  --radius-card: 28px;
  --radius-group: 18px;
  --radius-btn: 15px;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Didot", "Bodoni 72", "Playfair Display", Georgia, "Times New Roman", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* Ambient dark-luxury background */
.ambient-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.42;
}

.ambient-orb-1 {
  width: 380px;
  height: 380px;
  top: -130px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(207, 168, 102, 0.36) 0%, rgba(207, 168, 102, 0) 70%);
}

.ambient-orb-2 {
  width: 340px;
  height: 340px;
  bottom: -140px;
  right: -90px;
  background: radial-gradient(circle, rgba(64, 92, 148, 0.25) 0%, rgba(16, 20, 29, 0) 72%);
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(232, 204, 147, 0.055) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at top, black 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at top, black 20%, transparent 78%);
}

/* Main layout */
.shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(20px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

.card {
  width: 100%;
  max-width: 430px;
  background: linear-gradient(165deg, rgba(24, 29, 42, 0.92) 0%, rgba(12, 15, 22, 0.94) 52%, rgba(9, 11, 17, 0.96) 100%);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-card);
  padding: 20px 20px 18px;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.65),
    0 1px 0 rgba(242, 221, 176, 0.14) inset,
    0 0 0 1px rgba(255, 255, 255, 0.025) inset;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: cardReveal 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Topbar */
.card-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.nfc-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-bright);
  background: rgba(207, 168, 102, 0.08);
  border: 1px solid var(--gold-border-soft);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.12s ease;
}

.icon-btn:hover {
  background: rgba(207, 168, 102, 0.12);
  border-color: var(--gold-border);
  color: var(--gold-bright);
}

.icon-btn:active {
  transform: scale(0.94);
}

/* Hero & Luxury Monogram */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 6px 6px 22px;
}

.emblem-wrap {
  position: relative;
  margin-bottom: 18px;
}

.emblem-glow {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(207, 168, 102, 0.28) 0%, rgba(207, 168, 102, 0) 68%);
  pointer-events: none;
}

.emblem {
  position: relative;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  background: linear-gradient(135deg, #f5e2ba 0%, #c8a15e 46%, #6e5225 100%);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.55),
    0 0 24px rgba(207, 168, 102, 0.16);
}

.emblem::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 24%, #1f2535 0%, #0e121b 65%, #080a10 100%);
}

.emblem::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 1px solid rgba(232, 204, 147, 0.24);
  pointer-events: none;
}

.monogram {
  position: relative;
  z-index: 1;
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding-left: 0.06em;
  background: linear-gradient(180deg, #faf0d7 0%, #dfc084 52%, #b08844 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  user-select: none;
}

.avatar-img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.full-name {
  margin: 0;
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-primary);
}

.role-badge {
  margin-top: 9px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(207, 168, 102, 0.13), rgba(207, 168, 102, 0.05));
  border: 1px solid rgba(218, 182, 118, 0.24);
  color: var(--gold-bright);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.role-icon {
  width: 14px;
  height: 14px;
  color: var(--gold-mid);
  flex-shrink: 0;
}

.subtitle {
  margin: 9px 0 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.location-line {
  margin: 10px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-secondary);
}

.location-line[hidden],
.subtitle[hidden] {
  display: none;
}

/* Primary Buttons */
.primary-actions {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 10px;
  margin-bottom: 22px;
}

.primary-actions.single {
  grid-template-columns: 1fr;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 16px;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.14s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.btn:active {
  transform: scale(0.975);
}

.btn-gold {
  color: #141008;
  background: linear-gradient(135deg, #f3e0b8 0%, #d4af6e 55%, #b88f4c 100%);
  box-shadow:
    0 8px 24px rgba(207, 168, 102, 0.26),
    0 1px 0 rgba(255, 255, 255, 0.45) inset;
}

.btn-gold:hover {
  box-shadow:
    0 10px 28px rgba(207, 168, 102, 0.36),
    0 1px 0 rgba(255, 255, 255, 0.55) inset;
}

.btn-whatsapp {
  color: var(--wa-text);
  background: var(--wa-bg);
  border-color: var(--wa-border);
}

.btn-whatsapp:hover {
  background: rgba(37, 211, 102, 0.19);
  border-color: rgba(37, 211, 102, 0.52);
}

.btn-subtle {
  width: 100%;
  color: var(--gold-bright);
  background: rgba(207, 168, 102, 0.1);
  border-color: var(--gold-border);
}

.btn-subtle:hover {
  background: rgba(207, 168, 102, 0.17);
}

/* Contact Sections */
.contact-section {
  margin-bottom: 18px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 6px 8px;
}

.section-title {
  margin: 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-mid);
}

.section-count {
  font-size: 11.5px;
  color: var(--text-muted);
}

.contact-group {
  background: var(--bg-row);
  border: 1px solid var(--gold-border-soft);
  border-radius: var(--radius-group);
  overflow: hidden;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  transition: background-color 0.18s ease;
}

.contact-row + .contact-row {
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.contact-row:hover {
  background: var(--bg-row-hover);
}

.contact-link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 6px 13px 14px;
  text-decoration: none;
  color: inherit;
}

.contact-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(207, 168, 102, 0.09);
  border: 1px solid rgba(207, 168, 102, 0.16);
  color: var(--gold-bright);
}

.contact-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.contact-value {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-btn {
  width: 36px;
  height: 36px;
  margin-right: 10px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.copy-btn:hover {
  color: var(--gold-bright);
  background: rgba(207, 168, 102, 0.1);
  border-color: var(--gold-border-soft);
}

.copy-btn:active {
  transform: scale(0.92);
}

.copy-btn.copied {
  color: var(--wa-text);
}

/* Footer */
.card-footer {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.version-badge {
  font-variant-numeric: tabular-nums;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(207, 168, 102, 0.08);
  border: 1px solid var(--gold-border-soft);
  color: var(--gold-mid);
  font-size: 11px;
  font-weight: 500;
}

/* Icons */
.icon-xs {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.icon-sm {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.icon-md {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 6, 10, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 340px;
  background: linear-gradient(165deg, #171c29 0%, #0e111a 100%);
  border: 1px solid var(--gold-border);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  text-align: center;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.qr-frame {
  width: 220px;
  height: 220px;
  margin: 0 auto 14px;
  padding: 14px;
  border-radius: 18px;
  background: #f8f5ee;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.qr-frame svg {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-caption {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-all;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translate(-50%, 16px);
  z-index: 50;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(21, 26, 38, 0.96);
  border: 1px solid var(--gold-border);
  color: var(--gold-bright);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Small screen refinement */
@media (max-width: 375px) {
  .card {
    padding: 16px 15px 15px;
    border-radius: 24px;
  }

  .primary-actions {
    grid-template-columns: 1fr;
  }

  .full-name {
    font-size: 24px;
  }

  .contact-value {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card {
    animation: none;
  }
  .btn,
  .icon-btn,
  .copy-btn,
  .toast {
    transition: none;
  }
}
