@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,800;1,400;1,600;1,700&family=Great+Vibes&family=Cormorant+Garamond:ital,wght@1,600;1,700&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: 4px 36px;
  border-bottom: 1.5px solid #e5e0d0;
  flex-shrink: 0;
  background: #fff;
  min-height: 76px;
}

.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 — thinner, more delicate serif, Title Case */
.cert-student-name {
  font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  font-size: 56px;
  font-weight: 600;
  font-style: italic;
  color: #0d1b4b;
  text-align: center;
  line-height: 1.1;
  letter-spacing: 1px;
  text-transform: capitalize;
  position: relative;
  z-index: 1;
  padding: 0px 0 24px; /* increased bottom gap so text lifts away from the gold bar */
  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;
}

/* Professional Inline Performance Strip */
.cert-perf-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px auto 14px;
}

.cert-perf-segment {
  display: flex;
  align-items: center;
  gap: 4px;
}

.perf-lbl {
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 8.5px;
}

.perf-val {
  color: #0d1b4b;
  font-weight: 800;
  font-size: 11px;
}

.cert-perf-divider {
  color: #cbd5e1;
  margin: 0 10px;
  font-size: 11px;
}

/* 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: 6px 36px 6px;
  border-top: 1.5px solid #e5e0d0;
  flex-shrink: 0;
  background: #f5f3ed;
  height: 110px;
  /* Reduced from 130px to save vertical space */
  box-sizing: border-box;
}

/* LEFT: Two signatures side by side */
.cert-sig-pane {
  display: flex;
  gap: 36px;
  align-items: flex-end;
}

.cert-sig-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-width: 140px;
}

/* Real handwritten signature image */
.cert-sig-image {
  width: 150px;
  height: 64px;
  object-fit: contain;
  object-position: center bottom;
  mix-blend-mode: multiply;
  /* white bg becomes transparent on cream paper */
  display: block;
  /* Pull the line UP into the image so descenders cross below the line */
  margin-bottom: -8px;
  position: relative;
  z-index: 2;
  /* Ink ABOVE the line */
}

/* Manoj Pathak's signature intersection — M and j descenders cross the line */
.cert-sig-block:nth-child(2) .cert-sig-image {
  margin-bottom: -22px; /* push sig down so bottom loops of M, j cut below the line */
}

.cert-sig-line {
  width: 160px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #0d1b4b 15%, #0d1b4b 85%, transparent);
  position: relative;
  z-index: 1;
  /* Line sits UNDER the signature image */
  margin-bottom: 6px;
}

.cert-sig-name {
  font-size: 11px;
  font-weight: 700;
  color: #0d1b4b;
  margin-top: 0;
  text-align: center;
}

.cert-sig-desig {
  font-size: 9px;
  color: #888;
  margin-top: 1px;
  text-align: center;
}

/* 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;
  border-radius: 4px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  /* Reset to completely natural flow to prevent clipping */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  line-height: normal;
}

/* 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;
}