* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #f0f2f5;
  font-family: Arial, Helvetica, sans-serif;
  min-height: 100vh;
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* ── PAGE TITLE ── */
.page-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.page-title h1 {
  font-size: 13px;
  font-weight: 700;
  color: #4F758B;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.page-title p {
  font-size: 10px;
  color: #6B8FA3;
  letter-spacing: 1px;
}

/* ── MAIN CONTENT CONTAINER ── */
.main-container {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  flex-direction: row;
  margin-top: 30px
}

/* ── CONTROLS PANEL ── */
.panel {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  padding: 20px;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  order: 1;
}

/* ── CARD STAGE (Vertical Grid) ── */
.stage {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: center;
  order: 2;
}

@media(min-width: 768px) {
  .stage {
    flex-direction: row;
  }
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-section-title {
  font-size: 9px;
  font-weight: 700;
  color: #4F758B;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  padding-bottom: 6px;
  border-bottom: 1.5px solid #EEF6E8;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  font-size: 9px;
  color: #6B8FA3;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
}

.field input,
.field select {
  background: #FAFAFA;
  border: 1px solid #E0E0E0;
  border-radius: 4px;
  color: #2a2a2a;
  font-family: Arial;
  font-size: 12px;
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.15s;
}

.field input:focus,
.field select:focus {
  border-color: #6CC24A;
  background: #fff;
}

.field input::placeholder {
  color: #C0C0C0;
}

.upload-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #F5F5F5;
  border: 1px dashed #D0D0D0;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 11px;
  color: #6B8FA3;
}

.upload-btn:hover {
  border-color: #6CC24A;
  color: #6CC24A;
  background: #EEF6E8;
}

.divider {
  height: 1px;
  background: #F0F0F0;
}

.export-btn {
  width: 100%;
  padding: 11px;
  background: #4F758B;
  border: none;
  border-radius: 5px;
  color: #fff;
  font-size: 11px;
  font-family: Arial;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.export-btn:hover {
  background: #3d5d6e;
}

.export-btn.blue {
  background: #4F758B;
}

.export-btn.blue:hover {
  background: #385566;
}

.export-btn:disabled {
  background: #A0B2BC;
  cursor: not-allowed;
}

.hint-text {
  font-size: 9px;
  color: #B0B0B0;
  line-height: 1.6;
  text-align: center;
}

.preview-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #EEF6E8;
  border-radius: 4px;
  padding: 5px 10px;
}

.preview-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6CC24A;
}

.preview-badge span {
  font-size: 9px;
  color: #4F758B;
  font-weight: 700;
  letter-spacing: 1px;
}

/* CR80 Vertical Canvas Visual Container Setup */
.card-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.card-label {
  font-size: 9px;
  color: #6B8FA3;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 700;
}

/* Dimensiones Proporcionales CR80 Verticales */
.card {
  position: relative;
  width: 240px;
  height: 380px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

/* ── FRONT DYNAMIC OVERLAYS ── */
.front-photo-frame {
  position: absolute;
  top: 98.5px;
  left: 49.9%;
  transform: translateX(-50%);
  width: 145.5px;
  height: 145.5px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.front-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.front-photo-frame .placeholder-svg {
  width: 40px;
  height: 40px;
  opacity: 0.3;
  color: #4F758B;
}

.front-dynamic-name {
  position: absolute;
  top: 266px;
  left: 10px;
  right: 10px;
  font-size: 14px;
  font-weight: 900;
  color: #FFFFFF;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  word-break: break-word;
  z-index: 5;
}

.front-dynamic-role {
  position: absolute;
  bottom: 12px;
  right: 5px;
  font-size: 10px;
  font-weight: 700;
  color: #6B8499;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 1px;
  max-width: 200px;
  word-break: break-word;
  z-index: 5;
}

/* ── BACK DYNAMIC OVERLAYS ── */
.back-qr-zone {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: #ffffff;
  padding: 4px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.back-qr-zone canvas {
  display: block;
  width: 40px;
  height: 40px;
}

.lang-container {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.lang-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: bold;
  border: 2px solid #e1e9ee;
  background: #ffffff;
  color: #4F758B;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-btn.active {
  background: #4F758B;
  color: #ffffff;
  border-color: #4F758B;
}