@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,800;1,400&family=Great+Vibes&family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ═══ A4 Landscape Container ═══ */
.certificate-a4 {
  width: 1122px;
  height: 794px;
  background: #faf9f5;
  display: flex;
  flex-direction: column;
  position: relative;
  font-family: 'Poppins', sans-serif;
  box-shadow: 0 24px 80px rgba(0,0,0,.3);
  overflow: hidden;
  color: #0d1b4b;
}

/* ═══ Top Navy Banner ═══ */
.cert-top-banner {
  background: #0d1b4b;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  flex-shrink: 0;
  gap: 12px;
}
.cert-banner-company {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}
.cert-banner-company span { color: #f59e0b; }
.cert-banner-title {
  font-family: 'Playfair Display', serif;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.7);
  letter-spacing: 3.5px;
  text-transform: uppercase;
}
.cert-banner-right {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.cert-banner-date { font-size: 11px; color: rgba(255,255,255,.65); }

/* ═══ Gold Stripe ═══ */
.cert-gold-stripe {
  height: 4px;
  background: linear-gradient(90deg, #0d1b4b, #c9a74c 25%, #f0c060 50%, #c9a74c 75%, #0d1b4b);
  flex-shrink: 0;
}

/* ═══ Header Logo Row ═══ */
.cert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 36px;
  border-bottom: 1.5px solid #e5e0d0;
  flex-shrink: 0;
  background: #fff;
  min-height: 84px;
}
.cert-gov-logo-left {
  height: 85px; /* Increased from 68px */
  max-width: 140px;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.cert-gov-logo-right {
  height: 64px;
  max-width: 110px;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.cert-header-center { text-align: center; }
.cert-company-name {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: #0d1b4b;
  letter-spacing: .3px;
}
.cert-company-name span { color: #c9a74c; }
.cert-company-tagline {
  font-size: 9px; color: #888; letter-spacing: 2px;
  text-transform: uppercase; margin-top: 2px;
}
.cert-company-reg { font-size: 8.5px; color: #bbb; margin-top: 2px; }

/* ═══ Body ═══ */
.cert-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 60px 6px;
  position: relative;
  overflow: hidden;
  background: #faf9f5;
  min-height: 0; /* Critical: lets body shrink so footer isn't cut */
}

/* Watermark */
.cert-watermark {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%) rotate(-25deg);
  font-family: 'Poppins', sans-serif;
  font-size: 100px; font-weight: 900;
  color: #0d1b4b; opacity: .02;
  white-space: nowrap; pointer-events: none; z-index: 0;
}

/* Title row */
.cert-title-row {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; margin-bottom: 3px; position: relative; z-index: 1;
}
.cert-orn-line {
  flex: 1; max-width: 100px; height: 1px;
  background: linear-gradient(90deg, transparent, #c9a74c);
}
.cert-orn-line.r { background: linear-gradient(90deg, #c9a74c, transparent); }
.cert-main-title {
  font-family: 'Playfair Display', serif;
  font-size: 21px; font-weight: 700;
  color: #0d1b4b; letter-spacing: 5px;
  text-transform: uppercase; white-space: nowrap; padding: 0 10px;
}
.cert-orn-star { color: #c9a74c; font-size: 10px; letter-spacing: 5px; }

/* Certify line */
.cert-intro {
  font-family: 'Playfair Display', serif;
  font-style: italic; font-size: 13px; color: #777;
  text-align: center; margin-bottom: 6px; margin-top: 6px;
  position: relative; z-index: 1;
}

/* Student Name — large extra bottom padding ensures ZERO overlap with bar */
.cert-student-name {
  font-family: 'Great Vibes', cursive;
  font-size: 68px; color: #0d1b4b;
  text-align: center; line-height: 1;
  position: relative; z-index: 1;
  padding: 4px 0 32px; /* top tiny lift + large bottom clears descenders fully */
  margin-bottom: 0;
}
.cert-name-bar {
  width: 480px; height: 1.5px;
  background: linear-gradient(90deg, transparent 0%, #c9a74c 20%, #c9a74c 80%, transparent 100%);
  margin: 0 auto 12px;
  position: relative; z-index: 1;
}

/* Details strip — 3 columns */
.cert-details-strip {
  display: flex; align-items: stretch; justify-content: center;
  background: #fdfbf7; border: 1px solid #e0d9c5; border-radius: 7px;
  padding: 8px 0; margin-bottom: 10px;
  width: 100%; max-width: 900px;
  position: relative; z-index: 1;
}
.cert-detail-cell {
  display: flex; flex-direction: column;
  align-items: center; padding: 0 22px; flex: 1;
}
.cert-detail-lbl {
  font-size: 8px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: #aaa; margin-bottom: 3px;
}
.cert-detail-val {
  font-size: 12px; font-weight: 700;
  color: #0d1b4b; text-align: center; line-height: 1.3;
}
.cert-detail-sep {
  width: 1px; background: #d5cfbe; align-self: stretch; margin: 2px 0;
}

/* Content block */
.cert-content-block {
  text-align: center; width: 100%; position: relative; z-index: 1;
}
.cert-achievement-intro { font-size: 13px; color: #555; margin-bottom: 3px; }
.cert-role-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px; font-weight: 700; color: #0d1b4b; margin-bottom: 3px;
}
.cert-at-company { font-size: 13px; color: #555; margin-bottom: 8px; }
.cert-at-company strong { color: #0d1b4b; font-weight: 700; }

/* Performance bar */
.cert-perf-bar {
  display: inline-flex; align-items: center;
  justify-content: center; gap: 10px;
  background: rgba(200,167,76,0.08);
  border: 1px solid rgba(200,167,76,0.4);
  border-radius: 999px;
  padding: 6px 24px;
  font-size: 10px; font-weight: 600;
  color: #444; letter-spacing: 0.3px;
  margin: 0 auto 8px;
  white-space: nowrap;
}
.cert-perf-bar > span {
  display: inline-flex; align-items: center; line-height: 1; padding-top: 1px;
}
.cert-perf-bar > span > span { color: #0d1b4b; font-weight: 700; margin-left: 4px; }
.cert-perf-dot {
  display: inline-block; width: 4px; height: 4px;
  border-radius: 50%; background: #c9a74c; flex-shrink: 0;
  transform: translateY(1px); /* Optically centers the dot with the text baseline */
}

/* Description */
.cert-description {
  font-size: 10.5px; color: #789;
  font-style: italic; line-height: 1.55;
  max-width: 800px; text-align: center;
  margin: 0 auto; /* Ensure it is perfectly centered laterally */
}

/* ═══ Footer — 2-column: LEFT sigs, RIGHT logos+QR ═══ */
.cert-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 10px 36px 10px;
  border-top: 1.5px solid #e5e0d0;
  flex-shrink: 0;
  background: #f5f3ed;
  height: 130px; /* taller to fit logos row + QR without overlap */
  box-sizing: border-box;
}

/* LEFT: Two signatures side by side */
.cert-sig-pane {
  display: flex; gap: 30px; align-items: flex-end;
}
.cert-sig-block {
  display: flex; flex-direction: column; align-items: center;
}
.cert-sig-cursive {
  font-family: 'Mrs Saint Delafield', cursive;
  font-size: 38px;
  color: #1e3a8a;
  min-width: 160px; max-width: 200px;
  display: flex; align-items: flex-end; justify-content: center;
  line-height: .8; white-space: nowrap;
  height: 52px; 
  transform: translateY(-16px); /* Physically lift the signature completely above the line, double height */
  margin-bottom: -16px; /* Counter-balance the lift so the line stays put */
}
.cert-sig-line {
  width: 160px; height: 1.5px;
  background: linear-gradient(90deg, transparent, #0d1b4b 15%, #0d1b4b 85%, transparent);
  margin: 0 0 4px;
}
.cert-sig-name { font-size: 11px; font-weight: 700; color: #0d1b4b; }
.cert-sig-desig { font-size: 9px; color: #888; margin-top: 1px; }

/* CENTER: ISO Logo */
.cert-footer-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1; /* allow it to take available space in center */
}

/* RIGHT: QR block */
.cert-footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
}
.cert-footer-logo {
  height: 90px; /* Increased massively to match request */
  max-width: 160px;
  object-fit: contain; mix-blend-mode: multiply;
}
.cert-qr-block {
  display: flex; flex-direction: row; align-items: center;
  gap: 8px; background: transparent;
  padding: 0;
}
.cert-qr-inner {
  width: 80px; height: 80px;
  border: 2px solid #c9a74c;
  background: white; border-radius: 5px; padding: 2px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cert-qr-inner img, .cert-qr-inner canvas { width: 74px !important; height: 74px !important; }
.cert-qr-right-labels {
  display: flex; flex-direction: column; gap: 4px; justify-content: center;
}
.cert-qr-label { font-size: 8px; color: #888; letter-spacing: 0.3px; }
.cert-id-tag {
  font-family: monospace; font-size: 8.5px; font-weight: 700;
  color: #0d1b4b; background: #fff; border: 1px solid #c9a74c;
  padding: 4px 10px; border-radius: 4px;
  text-align: center; letter-spacing: 0.3px;
  white-space: nowrap;
}

/* Bottom Banner */
.cert-bottom-banner {
  background: #0d1b4b; height: 22px;
  display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.cert-bottom-text {
  font-size: 8.5px; color: rgba(255,255,255,.5); letter-spacing: .3px;
}

/* Preview wrapper */
.cert-preview-wrapper {
  overflow-x: auto; padding: 24px 0;
  background: #dde2e8; border-radius: 12px;
  border: 1px solid #c8cdd4;
}

