/* ==========================================================================
   STUDENTS PARLIAMENT NIGERIA - ID CARD GENERATOR (FRONT & BACK)
   ========================================================================== */

:root {
  --primary-green: #0b3d23;
  --primary-green-dark: #072a18;
  --gold-accent: #cda434;
  --gold-dark: #a67c1e;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #e2e8f0;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --red-accent: #dc2626;
  --amber-accent: #d97706;
  --blue-accent: #1e40af;
}

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

/* Hide Netlify Drawer & Badge Widget */
#netlify-drawer,
netlify-drawer,
div[data-netlify-drawer],
div[id^="netlify-"],
div[class*="netlify-drawer"],
iframe[src*="netlify.app"],
iframe[title*="Netlify"],
[class*="netlify-badge"],
[id*="netlify-badge"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f1f5f9;
  color: var(--text-dark);
  min-height: 100vh;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, #072a18 0%, #0b3d23 60%, #135936 100%);
  color: #ffffff;
  padding: 1.1rem 2rem;
  border-bottom: 3px solid var(--gold-accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 100;
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  text-decoration: none;
}

.header-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.header-titles {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.header-titles h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.2;
  margin: 0 0 3px 0;
  color: #ffffff;
}

.header-titles p {
  color: #f7df94;
  font-size: clamp(0.75rem, 1.6vw, 0.85rem);
  letter-spacing: 0.4px;
  line-height: 1.25;
  margin: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.btn-header-reset {
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid var(--gold-accent, #cda434);
  color: #fff;
  padding: 0.5rem 0.95rem;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-label-desktop {
  display: inline;
}

.btn-label-mobile {
  display: none;
}

.btn-header-reset:hover {
  background: var(--gold-accent);
  color: var(--primary-green-dark);
  border-color: var(--gold-accent);
}

.btn-header-action {
  background: rgba(205, 164, 52, 0.16);
  border: 1.5px solid var(--gold-accent, #cda434);
  color: #ffffff;
  padding: 0.55rem 1.15rem;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-header-action:hover {
  background: var(--gold-accent, #cda434);
  color: var(--primary-green-dark, #072a18);
  border-color: var(--gold-accent, #cda434);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transform: none;
}

/* Header Responsiveness */
@media (max-width: 860px) {
  .app-header {
    padding: 0.9rem 1.25rem;
  }

  .header-logo {
    width: 48px;
    height: 48px;
  }

  .header-titles h1 {
    font-size: 1.15rem;
  }

  .header-titles p {
    font-size: 0.78rem;
  }

  .btn-header-reset,
  .btn-header-action {
    padding: 0.42rem 0.75rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 640px) {
  .app-header {
    padding: 0.75rem 1rem;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .header-brand {
    width: 100%;
    gap: 0.75rem;
  }

  .header-logo {
    width: 46px;
    height: 46px;
  }

  .header-titles h1 {
    font-size: 1.1rem;
    line-height: 1.2;
  }

  .header-titles p {
    font-size: 0.75rem;
    line-height: 1.25;
  }

  .btn-label-desktop {
    display: none !important;
  }

  .btn-label-mobile {
    display: inline !important;
  }

  .header-actions {
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 0.35rem;
    box-sizing: border-box;
  }

  .header-actions .btn-header-reset,
  .header-actions .btn-header-action,
  .header-actions .btn-primary-action {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    text-align: center;
    padding: 0.45rem 0.25rem;
    font-size: 0.78rem;
    gap: 0.25rem;
    box-sizing: border-box;
  }

  .header-actions svg {
    flex-shrink: 0;
  }
}

@media (max-width: 380px) {
  .app-header {
    padding: 0.65rem 0.75rem;
  }

  .header-logo {
    width: 40px;
    height: 40px;
  }

  .header-titles h1 {
    font-size: 0.98rem;
  }

  .header-titles p {
    font-size: 0.7rem;
  }

  .header-actions {
    gap: 0.25rem;
  }

  .header-actions .btn-header-reset,
  .header-actions .btn-header-action,
  .header-actions .btn-primary-action {
    padding: 0.4rem 0.15rem;
    font-size: 0.72rem;
    gap: 0.2rem;
  }

  .header-actions svg {
    width: 13px;
    height: 13px;
  }
}

/* Main Layout (Top to Bottom Stack) */
.main-wrapper {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.layout-vertical {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  width: 100%;
}

/* Form Card on Top */
.form-panel {
  max-width: 840px;
  width: 100%;
  margin: 0 auto;
  background: var(--surface);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-green);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #f1f5f9;
}

.panel-title svg {
  color: var(--gold-accent);
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  min-width: 0;
}

.form-group.full-width {
  width: 100%;
}

.form-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.label-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.label-with-icon svg {
  color: var(--primary-green);
  flex-shrink: 0;
}

.form-input, .form-select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: #ffffff;
  color: #1e293b;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(11, 61, 35, 0.15);
}

.select-modal-trigger {
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #1e293b;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.select-modal-trigger:hover, .select-modal-trigger:focus {
  outline: none;
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(11, 61, 35, 0.15);
}

.select-modal-trigger .placeholder-text {
  color: #94a3b8;
  font-weight: 500;
}

/* Upload Dropzone - Fully Unclipped & Contained */
.upload-dropzone {
  width: 100%;
  box-sizing: border-box;
  border: 2px dashed #94a3b8;
  border-radius: 12px;
  padding: 1.5rem 1rem;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--primary-green);
  background: #f0fdf4;
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
}

.dropzone-icon {
  width: 44px;
  height: 44px;
  color: var(--primary-green);
  flex-shrink: 0;
}

.dropzone-text {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e293b;
}

.dropzone-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Photo Pan & Zoom adjustments + Reset Header */
.photo-adjust-box {
  display: none;
  margin-top: 0.85rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 0.95rem;
  border-radius: 10px;
  flex-direction: column;
  gap: 0.75rem;
}

.photo-adjust-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.5rem;
}

.photo-adjust-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--primary-green);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.btn-reset-photo {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s;
}

.btn-reset-photo:hover {
  background: #e2e8f0;
  color: var(--primary-green);
  border-color: var(--primary-green);
}

.photo-sliders-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

@media (max-width: 500px) {
  .photo-sliders-row {
    grid-template-columns: 1fr;
  }
}

.photo-adjust-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.photo-adjust-group label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #475569;
}

.photo-adjust-group input[type="range"] {
  accent-color: var(--primary-green);
  cursor: pointer;
}

/* Action Buttons & Quality Selector */
.form-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* Quality Selector Bar (Inline) */
.export-quality-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  background: #f8fafc;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-bottom: 0.25rem;
  gap: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

.export-quality-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.export-quality-label svg {
  color: var(--primary-green);
  flex-shrink: 0;
}

.quality-pills-group {
  display: flex;
  flex: 1 1 200px;
  max-width: 100%;
  background: #e2e8f0;
  padding: 3px;
  border-radius: 6px;
  gap: 3px;
  box-sizing: border-box;
}

.quality-pill-btn {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 0.78rem;
  font-weight: 800;
  color: #64748b;
  padding: 0.38rem 0.45rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.3px;
  text-align: center;
  white-space: nowrap;
  box-sizing: border-box;
}

.quality-pill-btn:hover {
  color: #0f172a;
}

.quality-pill-btn.active {
  background: #ffffff;
  color: var(--primary-green);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.export-row-split {
  display: flex;
  gap: 0.65rem;
  width: 100%;
  box-sizing: border-box;
  flex-wrap: wrap;
}

.export-row-split button {
  flex: 1 1 calc(50% - 0.35rem);
  min-width: 130px;
}

.btn-primary-action,
.btn-secondary-action,
.btn-gold-action,
.btn-jpeg-action,
.btn-jpeg-secondary {
  width: 100%;
  box-sizing: border-box;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: background-color 0.2s ease, border-color 0.2s ease, filter 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.btn-primary-action:active,
.btn-secondary-action:active,
.btn-gold-action:active,
.btn-jpeg-action:active,
.btn-jpeg-secondary:active {
  transform: scale(0.985);
}

.btn-primary-action {
  background: var(--primary-green);
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 4px rgba(11, 61, 35, 0.2);
}

.btn-primary-action:hover {
  background: var(--primary-green-dark);
}

.btn-secondary-action {
  background: #ffffff;
  color: var(--primary-green);
  border: 1.5px solid var(--primary-green);
}

.btn-secondary-action:hover {
  background: #f0fdf4;
}

/* JPEG Action Buttons */
.btn-jpeg-action {
  background: #0284c7;
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.2);
}

.btn-jpeg-action:hover {
  background: #0369a1;
}

.btn-jpeg-secondary {
  background: #ffffff;
  color: #0284c7;
  border: 1.5px solid #0284c7;
}

.btn-jpeg-secondary:hover {
  background: #f0f9ff;
}

.btn-gold-action {
  background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 4px rgba(184, 134, 11, 0.2);
}

.btn-gold-action:hover {
  filter: brightness(1.08);
}

/* ==========================================================================
   PREVIEW PANEL & LIVE OVERLAY CARDS (FRONT & BACK)
   ========================================================================== */
.preview-panel {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.preview-badge-header {
  background: #ffffff;
  padding: 0.85rem 1.4rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.preview-badge-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary-green);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* View Tabs */
.view-tabs {
  display: flex;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 3px;
  border: 1px solid #cbd5e1;
}

.tab-btn {
  background: none;
  border: none;
  padding: 0.4rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: #ffffff;
  color: var(--primary-green);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Cards Preview Row */
.cards-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
}

.card-column {
  flex: 0 1 380px;
  max-width: 380px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.card-side-tag {
  font-size: 0.8rem;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #ffffff;
  padding: 3px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

/* Container query for responsive card scaling */
.card-preview-container {
  width: 100%;
  max-width: 380px;
  container-type: inline-size;
}

/* The actual Card Stage (Aspect ratio: 6598 x 10477) */
.card-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 6598 / 10477;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
  background-color: #faf5ed;
  user-select: none;
}

/* The Official Template Images */
.card-bg-template {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  z-index: 1;
}

/* ==========================================================================
   FRONT OVERLAY REAL-TIME COORDINATES (Calibrated to id-card-1.png)
   ========================================================================== */
.card-overlay-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* 1. Upper White Box: Passport Photograph */
.overlay-passport-box {
  position: absolute;
  left: 62.12%;
  top: 29.58%;
  width: 32.74%;
  height: 23.67%;
  border-radius: 4px;
  overflow: hidden;
  background: transparent;
}

.overlay-passport-box img {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center center;
  transform: translate(-50%, -50%);
  display: block;
  /* Natural aspect ratio preserved - never squished or pressed */
  width: auto;
  height: 100%;
  max-width: none;
  max-height: none;
}

.passport-empty-hint {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #94a3b8;
  padding: 8px;
  pointer-events: none;
}

.passport-empty-hint svg {
  width: 28cqw;
  max-width: 36px;
  height: auto;
  opacity: 0.6;
}

.passport-empty-hint span {
  font-size: 2.2cqw;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 4px;
}

/* 2. Full Name & School Block directly beneath Passport Box (Auto-fitting) */
.overlay-bearer-block {
  position: absolute;
  left: 53%;
  width: 46%;
  top: 52.3%;
  height: 9.3%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: clamp(2px, 0.8cqw, 6px);
  overflow: hidden;
  pointer-events: none;
  box-sizing: border-box;
}

.overlay-bearer-name {
  color: #0b3d23;
  font-weight: 900;
  font-size: 3.8cqw;
  text-transform: uppercase;
  line-height: 1.1;
  letter-spacing: 0.2px;
  word-break: break-word;
  max-width: 100%;
}

.overlay-bearer-school {
  color: #172554;
  font-weight: 800;
  font-size: 2.35cqw;
  text-transform: uppercase;
  line-height: 1.1;
  letter-spacing: 0.1px;
  word-break: break-word;
  max-width: 100%;
}

/* 3. Left 5 Data Rows (Aligned precisely to template lines) */
.overlay-data-val {
  position: absolute;
  left: 33.0%;
  width: 26.5%;
  text-align: right;
  font-weight: 900;
  font-size: 2.65cqw;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

/* ID NUMBER */
.overlay-id-number {
  top: 64.4%;
  color: #b91c1c;
  font-size: 2.5cqw;
}

/* CATEGORY */
.overlay-category {
  top: 69.6%;
  color: #0b3d23;
  font-size: 2.55cqw;
}

/* DATE ISSUED */
.overlay-date-issued {
  top: 74.8%;
  color: #065f46;
  font-size: 2.5cqw;
}

/* STATE (Replaces Valid Until) */
.overlay-state {
  top: 80.0%;
  color: #0b3d23;
  font-size: 2.55cqw;
}

/* STATUS BADGE */
.overlay-status-row {
  position: absolute;
  left: 33.0%;
  width: 26.5%;
  top: 85.0%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.overlay-status-badge {
  background: #065f46;
  color: #ffffff;
  font-size: 2.1cqw;
  font-weight: 900;
  padding: 0.3cqw 1.6cqw;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.overlay-status-badge.pending {
  background: var(--amber-accent);
}

.overlay-status-badge.expired {
  background: var(--red-accent);
}

/* 4. Lower White Box: Dynamic QR Code */
.overlay-qr-box {
  position: absolute;
  left: 61.97%;
  top: 61.72%;
  width: 31.52%;
  height: 19.85%;
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2%;
}

.overlay-qr-box canvas, .overlay-qr-box img {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.qr-empty-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: #94a3b8;
  text-align: center;
}

.qr-empty-hint svg {
  width: 5.5cqw;
  max-width: 30px;
  height: auto;
  opacity: 0.55;
}

.qr-empty-hint span {
  font-size: 2.1cqw;
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* Toast */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--primary-green);
  color: #fff;
  padding: 0.85rem 1.4rem;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  border-left: 4px solid var(--gold-accent);
  font-size: 0.9rem;
  font-weight: 700;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 9999;
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}

/* Simple Category Modal (Direct & Minimal) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.modal-dialog-simple {
  background: #ffffff;
  width: 100%;
  max-width: 360px;
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  overflow: hidden;
  animation: modalFadeIn 0.18s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header-simple {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 1.2rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary-green);
}

.btn-modal-close {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.simple-modal-list {
  display: flex;
  flex-direction: column;
  padding: 0.6rem;
  gap: 0.35rem;
}

.simple-modal-option {
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  border: 1.5px solid transparent;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  text-align: left;
  font-size: 0.92rem;
  font-weight: 800;
  color: #1e293b;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.simple-modal-option:hover {
  background: #f0fdf4;
  color: var(--primary-green);
}

.simple-modal-option.active {
  background: #ecfdf5;
  color: var(--primary-green);
  border-color: var(--primary-green);
}

/* Searchable Modal Styles (State Selection) */
.modal-dialog-searchable {
  max-width: 400px;
}

.modal-search-wrapper {
  position: relative;
  padding: 0.75rem 1rem 0.6rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.modal-search-icon {
  position: absolute;
  left: 1.75rem;
  color: #94a3b8;
  pointer-events: none;
}

.modal-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 2.2rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 600;
  color: #1e293b;
  background: #ffffff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-search-input:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(11, 61, 35, 0.12);
}

.search-clear-btn {
  position: absolute;
  right: 1.6rem;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s;
}

.search-clear-btn:hover {
  color: #0f172a;
}

.state-scroll-list {
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.5rem 0.8rem;
  gap: 0.25rem;
}

.modal-empty-state {
  padding: 1.5rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
}
/* ==========================================================================
   Paystack Paywall Gate & Download Locks
   ========================================================================== */
.paywall-gate-box {
  background: linear-gradient(145deg, #ffffff 0%, #fefce8 100%);
  border: 2px solid var(--gold-accent);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 16px 0 20px;
  box-shadow: 0 6px 18px rgba(205, 164, 52, 0.15);
  text-align: left;
}

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

.paywall-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.paywall-price-wrap {
  display: flex;
  align-items: baseline;
  color: #0b3d23;
  font-weight: 900;
}

.paywall-price-currency {
  font-size: 1.1rem;
  margin-right: 2px;
}

.paywall-price-val {
  font-size: 1.55rem;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.5px;
}

.paywall-desc {
  font-size: 0.84rem;
  color: #475569;
  line-height: 1.45;
  margin: 0 0 12px;
}

.paywall-input-wrap {
  margin-bottom: 12px;
}

.paywall-email-input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  background: #ffffff;
  transition: border-color 0.2s;
}

.paywall-email-input:focus {
  border-color: #0b3d23;
  box-shadow: 0 0 0 3px rgba(11, 61, 35, 0.12);
}

.btn-paystack-pay {
  width: 100%;
  padding: 13px 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0b3d23 0%, #15803d 100%);
  color: #ffffff;
  border: 1.5px solid var(--gold-accent);
  font-size: 0.96rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(11, 61, 35, 0.3);
}

.btn-paystack-pay:hover {
  background: linear-gradient(135deg, #14532d 0%, #16a34a 100%);
  box-shadow: 0 4px 14px rgba(11, 61, 35, 0.3);
  transform: none;
}

.paywall-verified-box {
  background: #dcfce7;
  border: 2px solid #86efac;
  border-radius: 12px;
  padding: 14px 18px;
  margin: 16px 0 20px;
  text-align: left;
}

.paywall-verified-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #15803d;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.paywall-verified-box p {
  margin: 0;
  font-size: 0.8rem;
  color: #166534;
}

/* Downloads Locked State */
.export-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: all 0.2s ease;
}

.export-buttons-group.downloads-locked button {
  opacity: 0.55;
  filter: grayscale(40%);
  cursor: not-allowed;
}

.export-buttons-group.downloads-locked button:hover {
  transform: none !important;
}

/* Print Styles */
@media print {
  body { background: #fff !important; }
  .app-header, .form-panel, .preview-badge-header, .form-actions, .toast-notice, .card-side-tag, .modal-backdrop {
    display: none !important;
  }
  .main-wrapper { margin: 0 !important; padding: 0 !important; max-width: 100% !important; }
  .layout-grid, .layout-vertical { display: block !important; }
  .cards-preview-grid {
    display: flex !important;
    flex-direction: row !important;
    gap: 15mm !important;
    justify-content: center !important;
    page-break-inside: avoid;
  }
  .card-column {
    display: block !important;
    width: auto !important;
  }
  .card-stage {
    box-shadow: none !important;
    max-width: 85.6mm !important;
    width: 85.6mm !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* Prevent any upward float or transform movement on hover */
button:hover,
a:hover,
.btn-primary-action:hover,
.btn-secondary-action:hover,
.btn-gold-action:hover,
.btn-jpeg-action:hover,
.btn-jpeg-secondary:hover,
.btn-header-action:hover,
.btn-header-reset:hover,
.btn-paystack-pay:hover {
  transform: none !important;
}

/* Payment Unlock Highlighting & Download Pulsing */
@keyframes paymentUnlockGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
    border-color: #16a34a;
  }
  50% {
    box-shadow: 0 0 0 14px rgba(22, 163, 74, 0);
    border-color: #22c55e;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
    border-color: #16a34a;
  }
}

.payment-unlocked-pulse {
  animation: paymentUnlockGlow 1.2s ease-in-out 3;
  border: 2px solid #16a34a !important;
  border-radius: 12px !important;
  padding: 10px !important;
  background: rgba(240, 253, 244, 0.6) !important;
  transition: all 0.3s ease;
}

