* {
  box-sizing: border-box;
}

body {
  align-items: flex-start;
  background: radial-gradient(circle at center, #111 0, #000 100%);
  color: #fff;
  display: flex;
  font-family: Poppins, Arial, Helvetica, sans-serif;
  justify-content: center;
  margin: 0;
  min-height: 100vh;
  padding: 48px 16px 36px;
}

.page {
  align-items: center;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.card-stage {
  perspective: 1200px;
}

.card-wrap {
  border-radius: 16px;
  transform-style: preserve-3d;
  transition: transform 180ms ease, filter 180ms ease;
}

.platinum-card {
  background: url("assets/card-bg.png") center / cover no-repeat;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  height: 500px;
  max-width: 300px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s ease;
  width: 300px;
}

.platinum-card.flipped {
  transform: rotateY(180deg);
}

.card-face {
  backface-visibility: hidden;
  border-radius: 16px;
  color: #111;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
  left: 0;
  padding: 24px;
  position: absolute;
  top: 0;
  width: 100%;
}

.card-back {
  text-align: center;
  transform: rotateY(180deg);
}

.company-header {
  margin-bottom: 10px;
  text-align: center;
}

.brand-title {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
  padding: 0 10px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.brand-divider {
  background: linear-gradient(90deg, #cfa94d, #fff3b0);
  border-radius: 5px;
  height: 2px;
  margin: 6px auto 0;
  width: 60px;
}

.logo-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 25px;
}

.logo-circle {
  align-items: center;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  display: flex;
  height: 130px;
  justify-content: center;
  width: 130px;
}

.logo-circle img {
  height: auto;
  width: 95px;
}

.user-info {
  margin-top: 15px;
  text-align: center;
}

.card-name {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 4px;
}

.card-role {
  color: #444;
  font-size: 0.9rem;
  margin: 0 0 4px;
}

.card-phone {
  color: #222;
  font-size: 0.85rem;
  margin: 0 0 8px;
}

.qr-section {
  align-items: center;
  display: flex;
  flex-direction: column;
  margin-top: auto;
  width: 100%;
}

.small-details {
  color: #333;
  font-size: 0.75rem;
  margin-bottom: 12px;
  width: 100%;
}

.detail-row {
  align-items: center;
  display: flex;
  gap: 8px;
  line-height: 1.35;
  margin: 0 0 6px;
  min-width: 0;
}

.icon {
  color: #2f2f2f;
  display: inline-flex;
  flex: 0 0 15px;
  justify-content: center;
  width: 15px;
}

.qr {
  align-self: center;
  background: #fff;
  flex: 0 0 90px;
  height: 90px;
  overflow: hidden;
  padding: 0;
  width: 90px;
}

.qr img,
.qr canvas {
  height: 90px;
  image-rendering: pixelated;
  width: 90px;
}

.qr img,
.qr canvas,
.map-qr img,
.map-qr canvas {
  display: block;
}

.back-title {
  color: #111;
  font-size: 1.25rem;
  margin: 26px 0 0;
  text-align: center;
}

.address {
  color: #575656;
  font-size: 0.85rem;
  line-height: 1.45;
  margin: 0;
  text-align: left;
}

.address-content {
  padding-top: 8px;
}

.map-qr {
  align-self: center;
  background: #fff;
  height: 100px;
  overflow: hidden;
  width: 100px;
}

.platinum-btn {
  background: linear-gradient(135deg, #31a2ee, #fff, #127efa);
  border: 1px solid #ccc;
  border-radius: 50px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  color: #000;
  cursor: pointer;
  display: block;
  font: 800 14px/1.2 Poppins, Arial, Helvetica, sans-serif;
  padding: 12px 20px;
  text-align: center;
  text-decoration: none;
  transition: box-shadow 0.3s ease, transform 0.3s ease, background 0.3s ease;
  width: 100%;
}

.platinum-btn:hover {
  background: linear-gradient(135deg, #ececec, #cfcfcf, #eaeaea);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.platinum-btn:active {
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.1);
  transform: translateY(0);
}

.flip-btn {
  margin-top: 24px;
  max-width: 300px;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 48px;
  max-width: 280px;
  width: 75%;
}

/* Keep both faces aligned with the supplied card artwork. */
.card-face { background: url("assets/card-bg.png") center / cover no-repeat; }
.card-front .company-header, .card-back .company-header { position: absolute; top: 24px; left: 12px; right: 12px; }
.brand-title { font-size: 0.9rem; line-height: 1.5; }
.logo-wrapper { position: absolute; top: 112px; left: 0; right: 0; margin: 0; }
.user-info { position: absolute; top: 258px; left: 12px; right: 12px; margin: 0; }
.card-name { font-size: 1.3rem; }
.card-role { font-size: 0.9rem; }
.card-phone { font-size: 0.85rem; }
.qr-section {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 22px;
  width: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
  align-items: center;
}
.small-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  margin: 0;
}
.small-details .detail-row {
  align-items: flex-start;
  gap: 5px;
  margin: 0;
  min-width: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #333;
}
.small-details .icon { flex: 0 0 14px; width: 14px; line-height: 1.45; }
.small-details a { min-width: 0; white-space: nowrap; }
.small-details .detail-row:first-child { font-size: 10px; letter-spacing: -0.2px; }
.detail-row a { color: inherit; text-decoration: none; }
.detail-row a:hover { text-decoration: underline; }
.qr {
  position: static;
  align-self: center;
  width: 96px;
  height: 96px;
  border: 0;
  padding: 0;
}
.address { position: absolute; top: 158px; left: 22px; right: 22px; font-size: 0.85rem; }
.back-title { margin: 0; }
.map-qr { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); width: 108px; height: 108px; border: 4px solid white; }


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

.actions { width: min(100%, 225px); max-width: 225px; gap: 16px; }
.actions .platinum-btn { display: flex; align-items: center; justify-content: center; min-height: 47px; padding: 12px 16px; font-size: 14px; }

/* Scale the entire card together; internal layout stays at 300 by 500. */
.card-viewport {
  width: min(100%, 300px);
  aspect-ratio: 3 / 5;
  flex: none;
  position: relative;
}
.card-stage {
  width: 300px;
  height: 500px;
  transform: scale(var(--card-scale, 1));
  transform-origin: top left;
}
@media (hover: none), (pointer: coarse) {
  .card-wrap { transform: none !important; }
}
