/* ============================================
   VARIABLES
   ============================================ */
:root {
  --primary: #b91c3c;
  --primary-dark: #9e1b32;
  --primary-light: #d43d5e;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --text: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.12);
  --transition: 0.25s ease;

  /* International CR80 ID-1 */
  --card-w: 3.37in;
  --card-h: 2.125in;
}

.orientation-portrait {
  --card-w: 2.125in;
  --card-h: 3.37in;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust:100%; }

body {
  font-family: 'Satoshi', 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width:100%; display:block; }

/* ============================================
   HEADER
   ============================================ */
.app-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: white;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.brand-icon {
  width: 44px;
  height: 44px;
  
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.brand h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.brand p {
  font-size: 0.85rem;
  opacity: 0.9;
  font-weight: 500;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* ============================================
   FORM PANEL
   ============================================ */
.form-panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  height: fit-content;
  position: sticky;
  top: 92px;
}

.form-panel h2 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--primary-dark);
}

.form-group { margin-bottom: 1.25rem; }

.profile-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
}

.profile-controls select {
  min-width: 0;
}

.profile-controls .btn {
  flex: none;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(185,28,60,0.10);
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.verify-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.id-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-weight: 700;
  font-size: 0.85rem;
  min-height: 44px;
}

.id-status.verified {
  background: #dcfce7;
  color: #047857;
  border: 1px solid #86efac;
}

.form-group input:disabled,
.form-group select:disabled {
  background: #f9fafb;
  cursor: not-allowed;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: #fafafa;
  position: relative;
  overflow: hidden;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: #fff5f7;
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon {
  color: var(--primary);
  margin: 0 auto 0.5rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-zone p { font-size: 0.9rem; color: var(--text-secondary); font-weight: 500; }
.upload-zone small { font-size: 0.75rem; color: var(--text-muted); }

.photo-preview-thumb {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 0.5rem;
  border: 2px solid var(--primary);
  display: none;
}
.photo-preview-thumb.visible { display: block; }

.photo-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}
.photo-actions .btn {
  flex: 1 1 140px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 44px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  box-shadow: 0 4px 14px rgba(185,28,60,0.35);
  width: 100%;
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(185,28,60,0.45); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover { border-color: var(--primary); color: var(--primary); background: #fff5f7; }

.btn-group {
  display: flex;
  gap: 0.625rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.btn-group .btn { flex: 1; min-width: 100px; }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}
.btn.loading .spinner { display: inline-block; }
.btn.loading .btn-text { opacity: 0.85; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   PREVIEW PANEL
   ============================================ */
.preview-panel { min-width: 0; }

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.preview-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.status-badge {
  background: #ecfdf5;
  color: #059669;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid #a7f3d0;
}

/* Status color variants */
.status-active { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.status-not-active { background: #fff7ed; color: #92400e; border-color: #ffedd5; }
.status-expelled { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.status-graduated { background: #eef2ff; color: #3730a3; border-color: #c7d2fe; }
.status-unknown { background: #f3f4f6; color: #374151; border-color: #e5e7eb; }

.preview-stage {
  width: 100%;
  overflow-x: auto;
  padding: 0.5rem;
  display: flex;
  justify-content: center;
}

.capture-area {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  width: fit-content;
}

.orientation-portrait .id-card-front {
  background: linear-gradient(180deg, #b91c3c 0%, #9a1b32 50%, #fafafa 50%, #fafafa 100%);
}

.orientation-portrait .card-header {
  height: 0.72in;
  padding: 0.08in 0.16in 0 0.16in;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.1in;
  min-height: 0;
  background: transparent;
}

.orientation-portrait .card-logo {
  width: 0.32in;
  height: 0.32in;
  box-shadow: 0 8px 16px rgba(0,0,0,0.18);
}

.orientation-portrait .card-title-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.02in;
  flex: 1;
}

.orientation-portrait .card-title {
  font-size: 0.13in;
  line-height: 1.05;
}

.orientation-portrait .card-subtitle {
  font-size: 0.075in;
  opacity: 0.9;
}

.orientation-portrait .card-body {
  display: grid;
  grid-template-columns: 1fr minmax(0.75in, 0.75in);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "photo photo"
    "details qr";
  gap: 0.02in;
  padding: 0.04in 0.18in 0.16in;
  background: transparent;
  position: relative;
}

.orientation-portrait .card-photo-wrap {
  grid-area: photo;
  grid-column: 1 / -1;
  width: 1.15in;
  height: 1.4in;
  justify-self: center;
}

.orientation-portrait .card-details {
  grid-area: details;
  width: 100%;
}

.orientation-portrait .card-qr {
  grid-area: qr;
  grid-row: 2 / span 1;
  width: fit-content;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0.04in 0.12in 0 0.04in;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.orientation-portrait .qr-box {
  width: 0.66in;
  height: 0.66in;
  border-color: transparent;
}

..orientation-portrait .qr-caption {
  display: block;
  text-align: center;
  width: 100%;
  color: #334155;
  font-size: 0.065in;
  line-height: 1.2;
  margin-top: 0.02in;
  letter-spacing: 0.02em;
}

.orientation-portrait .back-body {
  padding: 0.18in 0.16in 0.12in;
  text-align: center;
}

.orientation-portrait .back-footer {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.08in;
  padding-left: 0;
}

.orientation-portrait .signature-block {
  width: auto;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.card-side-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  align-self: flex-start;
}

/* ============================================
   ID CARD — FRONT (CR80 constant size)
   ============================================ */
.id-card-front,
.id-card-back {
  width: var(--card-w);
  height: var(--card-h);
  background: #ffffff;
  border-radius: 0.08in;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.14);
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.id-card-front::before,
.id-card-back::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.25;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0,0,0,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.02) 1px, transparent 1px);
  background-size: 0.08in 0.08in;
  z-index: 0;
}

/* Header */
.card-header {
  height: 0.55in;
  background: linear-gradient(90deg, #9e1b32, var(--primary));
  display: flex;
  align-items: center;
  gap: 0.1in;
  padding: 0 0.2in;
  position: relative;
  z-index: 1;
}

.card-logo {
  width: 0.4in;
  height: 0.4in;
  background:red;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.card-logo svg { width: 0.26in; height: 0.26in; }

.card-title-block { color: white; }

.card-title {
  font-size: 0.16in;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.1;
}

.card-subtitle {
  font-size: 0.11in;
  font-weight: 500;
  opacity: 0.95;
  letter-spacing: 0.3px;
}

/* Body */
.card-body {
  flex: 1;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.14in;
  padding: 0.12in 0.18in;
  position: relative;
  z-index: 1;
  background: #fafafa;
}

/* Photo — SMALLER */
.card-photo-wrap {
  width: 0.95in;
  height: 1.15in;
  border: 2px solid var(--primary);
  border-radius: 0.06in;
  overflow: hidden;
  flex-shrink: 0;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.card-photo-wrap img {
  max-width: none;
  width: auto;
  height: 100%;
  object-fit: cover;
  display: none;
}
.card-photo-wrap img.visible { display: block; }

.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #9ca3af;
}
.photo-placeholder svg { opacity: 0.4; margin-bottom: 2px; }
.photo-placeholder span { font-size: 0.08in; font-weight: 500; }

/* Details — WIDER for long names */
.card-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.09in;
  min-width: 0;
  word-break: normal;
}

.card-field label {
  font-size: 0.075in;
  text-transform: uppercase;
  letter-spacing: 0.015in;
  color: #6b7280;
  font-weight: 700;
  display: block;
  margin-bottom: 0.01in;
}

.card-field .value {
  font-size: 0.105in;
  font-weight: 800;
  color: #111827;
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* QR — SMALLER */
.card-qr {
  width: 0.72in;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.03in;
}

.qr-box {
  width: 0.58in;
  height: 0.58in;
  border: 1px solid #e5e7eb;
  border-radius: 0.04in;
  padding: 0.02in;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.qr-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 4%;
  height: 4%;
  min-width: 10px;
  min-height: 10px;
  max-width: 16px;
  max-height: 16px;
  object-fit: contain;
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  pointer-events: none;
  z-index: 2;
}

.qr-box > canvas,
.qr-box > img:not(.qr-logo) {
  width: 100% !important;
  height: 100% !important;
}

.qr-caption {
  font-size: 0.07in;
  color: var(--text-secondary);
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.2px;
}

/* ============================================
   ID CARD — BACK
   ============================================ */
.id-card-back {
  border-bottom: 0.06in solid var(--primary);
}

.back-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.12in 0.16in 0.09in;
  position: relative;
  z-index: 1;
  text-align: center;
  gap: 0.05in;
}

.back-logo {
  width: 0.38in;
  height: 0.38in;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.08in;
  box-shadow: 0 4px 12px rgba(185,28,60,0.25);
}

.back-logo svg { width: 0.26in; height: 0.26in; }

.back-text {
  font-size: 0.094in;
  line-height: 1.5;
  color: #374151;
  max-width: 2.75in;
  margin-bottom: 0.05in;
}

.back-text strong { color: #111827; font-weight: 700; }

.back-return {
  font-size: 0.09in;
  color: #4b5563;
  line-height: 1.45;
  margin-bottom: 0.08in;
}

.back-return strong {
  font-weight: 700;
  color: #111827;
}

.back-reg-number {
  font-size: 0.087in;
  color: var(--text-secondary);
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 0.06in;
}

.back-reg-number span {
  color: var(--primary);
  font-weight: 800;
}

/* Socials — SMALLER */
.back-socials {
  display: flex;
  gap: 0.05in;
  margin-bottom: 0.1in;
}

.social-chip {
  width: 0.22in;
  height: 0.22in;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition);
}

.social-chip:hover { transform: translateY(-2px); }

.social-chip svg { width: 0.12in; height: 0.12in; fill: currentColor; }

/* Footer with signature */
.back-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.08in;
  margin-top: auto;
  padding-top: 0.04in;
  padding-left: 0.3in;
  border-top: 1px solid #f3f4f6;
}

.back-brand {
  font-size: 0.085in;
  color: var(--text-muted);
  font-weight: 600;
}

.signature-block {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  text-align: left;
  gap: 0.05in;
}

.signature-image {
  width: 0.6in;
  max-width: 100%;
  height: auto;
  display: block;
  padding-left:10px;
  object-fit: contain;
  }

.signature-role {
  font-size: 0.075in;
  color: #6b7280;
  font-weight: 500;
  line-height: 1.2;
}

/* ============================================
   MODAL — SHARE
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.75rem;
  width: 90%;
  max-width: 400px;
  z-index: 501;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}
.modal.active { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }

.modal h3 { font-size: 1.15rem; margin-bottom: 1.25rem; font-weight: 800; }

.crop-modal {
  max-width: 460px;
}

.modal-note {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.crop-canvas-wrap {
  background: #f3f4f6;
  border-radius: 18px;
  padding: 1rem;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
}

.crop-canvas-wrap canvas {
  width: 100%;
  max-width: 360px;
  height: auto;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.07);
  cursor: grab;
}

.crop-controls {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.crop-controls label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.crop-controls input[type="range"] {
  width: 100%;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.modal-footnote {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--primary); color: white; }

.share-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  transition: all var(--transition);
  min-height: 44px;
}

.share-btn:hover { border-color: var(--primary); background: #fff5f7; }

.share-btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ============================================
   TOAST
   ============================================ */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #111827;
  color: white;
  padding: 0.875rem 1.5rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 960px) {
  .container {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    padding: 1.25rem;
  }

  .form-panel {
    position: static;
    order: 1;
  }

  .preview-panel { order: 2; }

  .preview-stage {
    justify-content: flex-start;
    padding: 0.5rem 0;
  }
}

@media (max-width: 480px) {
  .app-header { padding: 1.25rem; }
  .brand h1 { font-size: 1.1rem; }
  .brand p { font-size: 0.8rem; }

  .form-panel { padding: 1.25rem; }
  .btn-group .btn { font-size: 0.85rem; padding: 0.75rem; }

  .share-grid { grid-template-columns: 1fr; }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
  @page {
    size: auto;
    margin: 0.4in;
  }

  html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    background: white;
    color: #111827;
  }

  .app-header,
  .form-panel,
  .preview-header,
  .modal-overlay,
  .modal,
  .toast,
  .card-side-label {
    display: none !important;
  }

  .preview-stage {
    overflow: visible !important;
    padding: 0 !important;
    justify-content: center;
  }

  .capture-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5in;
  }

  .id-card-front,
  .id-card-back {
    page-break-inside: avoid;
    break-inside: avoid;
    page-break-after: avoid;
    margin: 0 auto;
  }
  .container {
    display: block;
    padding: 0;
    margin: 0;
  }

  .preview-stage {
    overflow: visible;
    padding: 0;
    justify-content: center;
    width: 100%;
  }

  .capture-area {
    gap: 0.4in;
    padding: 0;
    align-items: center;
    justify-content: center;
    width: 100%;
  }

  .id-card-front,
  .id-card-back {
    box-shadow: none !important;
    border: 1px solid #ccc;
    page-break-inside: avoid;
    margin: 0 auto;
    width: var(--card-w);
    height: var(--card-h);
  }

  .id-card-back {
    page-break-before: always;
  }
}