:root {
  --dark: #1c0f45;
  --accent: #7c3aed;
  --accent-dark: #2a1065;
  --bg-top: #fbf9ff;
  --bg-bottom: #e7e1fa;
  --gray: #6e6e82;
  --green: #22c55e;
  --white: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Poppins', system-ui, sans-serif;
  background: linear-gradient(135deg, #f7f5ff 0%, #ece6fb 100%);
  color: var(--dark);
}

.app { max-width: 1100px; margin: 0 auto; padding: 24px 16px 60px; }

.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.brand-logo { height: 44px; }
.topbar h1 { margin: 0; font-size: 22px; font-weight: 800; }
.topbar p { margin: 2px 0 0; font-size: 13px; color: var(--gray); }

.roles { display: flex; gap: 10px; margin-bottom: 20px; }
.role-btn {
  flex: 1;
  padding: 14px 10px;
  border-radius: 999px;
  border: none;
  background: var(--white);
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  color: var(--dark);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(28,15,69,0.08);
}
.role-btn.active {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: var(--white);
}

.layout { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 860px) {
  .layout { grid-template-columns: 360px 1fr; align-items: start; }
}

.controls {
  background: var(--white);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(28,15,69,0.08);
  display: flex;
  flex-direction: column;
}
.controls label { font-weight: 700; font-size: 13px; margin: 14px 0 6px; }
.controls label:first-child { margin-top: 0; }
.controls input[type="text"] {
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #e3ddf7;
  outline: none;
  width: 100%;
}
.controls input[type="text"]:focus { border-color: var(--accent); }
.controls input[type="file"] { font-size: 13px; }

.actions { display: flex; gap: 10px; margin-top: 18px; }
.btn-primary, .btn-secondary {
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  border-radius: 999px;
  padding: 14px 18px;
  border: none;
  cursor: pointer;
}
.btn-primary { flex: 1; background: linear-gradient(135deg, var(--accent-dark), var(--accent)); color: var(--white); }
.btn-primary:disabled, .btn-secondary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-secondary { background: var(--white); color: var(--accent); border: 1px solid var(--accent); }

.privacy { font-size: 12px; color: var(--gray); margin-top: 14px; line-height: 1.5; }

.preview-pane { min-width: 0; }
.preview-label { font-size: 12px; font-weight: 700; color: var(--gray); letter-spacing: 0.08em; margin: 0 0 10px; }

.preview-scale-wrap { width: 100%; }
.preview-scale {
  width: 1080px;
  height: 1350px;
  transform-origin: top left;
}

.card {
  position: relative;
  width: 1080px;
  height: 1350px;
  background: linear-gradient(135deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  border-radius: 28px;
  overflow: hidden;
  font-family: 'Poppins', sans-serif;
}

.card-header {
  position: absolute; top: 60px; left: 70px; right: 70px;
  display: flex; justify-content: space-between; align-items: flex-start;
}
.card-logo { height: 70px; }
.role-badge {
  background: var(--accent-dark);
  color: var(--white);
  font-weight: 700;
  font-size: 24px;
  border-radius: 27px;
  height: 54px;
  padding: 0 26px;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.role-badge .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--green); display: inline-block; }

.headline { position: absolute; top: 220px; left: 70px; width: 600px; }
.headline .h1 { font-size: 76px; font-weight: 800; line-height: 1.05; color: var(--dark); }
.h2-wrap { margin-top: 2px; }
.headline .h2 { font-size: 56px; font-weight: 700; line-height: 1.1; color: var(--accent); }
.underline { width: 130px; height: 7px; border-radius: 3px; background: var(--accent); margin-top: 8px; }
.headline .sub { font-size: 24px; font-weight: 600; color: var(--dark); margin-top: 22px; line-height: 1.4; }

.photo-zone { position: absolute; top: 530px; left: 150px; width: 460px; height: 460px; }
.photo-ring {
  position: absolute; inset: -10px;
  border-radius: 50%;
  border: 3px solid #c7b8f7;
}
.photo-circle {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: #ede9fd;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background-size: cover;
  background-position: center;
}
.silhouette { position: absolute; bottom: 0; width: 100%; display: flex; flex-direction: column; align-items: center; }
.sil-head { width: 150px; height: 150px; border-radius: 50%; background: #c4b5fd; margin-bottom: -20px; }
.sil-body { width: 100%; height: 55%; background: #c4b5fd; border-radius: 50% 50% 0 0 / 60% 60% 0 0; }
.photo-circle.has-photo .silhouette, .photo-circle.has-photo .placeholder-text { display: none; }
.placeholder-text { position: absolute; top: 36%; text-align: center; color: var(--accent); font-weight: 700; font-size: 20px; }
.placeholder-text small { display: block; font-weight: 500; font-size: 14px; color: #8a7bbf; margin-top: 4px; }

.secondary-badge {
  position: absolute; left: 310px; top: 55px;
  display: flex; flex-direction: column; align-items: center;
}
.secondary-circle {
  width: 170px; height: 170px; border-radius: 50%;
  background: var(--accent-dark);
  border: 6px solid var(--white);
  display: flex; align-items: center; justify-content: center;
  background-size: contain; background-repeat: no-repeat; background-position: center;
  color: var(--white); font-weight: 700; font-size: 20px;
}
.secondary-label {
  margin-top: 16px;
  background: var(--dark);
  color: var(--white);
  font-weight: 700;
  font-size: 18px;
  padding: 8px 18px;
  border-radius: 16px;
  white-space: nowrap;
}

.stat-chips { position: absolute; top: 230px; right: 70px; width: 300px; }
.chip {
  background: var(--white);
  border-radius: 20px;
  height: 96px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  margin-bottom: 20px;
}
.chip-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--accent); flex-shrink: 0; position: relative; }
.chip-icon.gear-icon::after {
  content: ""; position: absolute; inset: 14px; border-radius: 50%;
  border: 6px solid var(--white); background: var(--accent);
}
.chip-icon.trophy-icon::after {
  content: "🏆"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.chip-text strong { display: block; font-size: 26px; font-weight: 700; color: var(--dark); }
.chip-text span { display: block; font-size: 20px; color: #78788f; margin-top: 2px; }

.qr-box {
  position: absolute; top: 460px; right: 70px; width: 300px; height: 300px;
  background: var(--white); border-radius: 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 20px;
}
.qr-box img { width: 190px; height: 190px; }
.qr-box p { font-size: 18px; font-weight: 600; margin: 14px 0 4px; line-height: 1.3; }
.qr-box a { font-size: 19px; font-weight: 700; color: var(--accent); text-decoration: none; }

.name-card {
  position: absolute; left: 70px; top: 910px; width: 600px; height: 160px;
  background: var(--white); border-radius: 22px;
  display: flex; align-items: center; gap: 22px; padding: 0 20px;
}
.name-icon { width: 64px; height: 64px; border-radius: 16px; background: var(--accent); flex-shrink: 0; }
.name-title { font-size: 34px; font-weight: 700; color: var(--dark); }
.name-detail { font-size: 22px; font-weight: 500; color: #5a5a72; margin-top: 6px; line-height: 1.3; }

.cta-row { position: absolute; left: 70px; top: 1110px; right: 70px; display: flex; justify-content: space-between; align-items: center; }
.cta-btn {
  background: var(--accent); color: var(--white); font-weight: 700; font-size: 26px;
  border-radius: 35px; padding: 20px 28px; display: inline-flex; align-items: center; gap: 14px;
  text-decoration: none; cursor: pointer;
}
.cta-btn .arrow { background: var(--white); color: var(--accent); width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; }
.cta-text { text-align: right; }
.cta-text strong { display: block; font-size: 24px; color: var(--dark); }
.cta-text span { display: block; font-size: 18px; color: var(--gray); margin-top: 6px; }

.footer-strip {
  position: absolute; left: 70px; right: 70px; top: 1200px; height: 80px;
  background: var(--white); border-radius: 18px;
  display: flex; align-items: center; justify-content: space-evenly;
}
.footer-strip img { height: 48px; }

.page-footer { text-align: center; font-size: 12px; color: var(--gray); margin-top: 30px; }
