/* Printable course completion certificate */
.cert-stage {
  padding: 24px 16px 40px;
  background: linear-gradient(180deg, #e8eef6 0%, #f7f9fc 100%);
}
.cert-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 20px auto 0;
  max-width: 900px;
  text-align: center;
}
.cert-actions .btn {
  cursor: pointer;
  min-width: 220px;
  justify-content: center;
}
.cert-actions-hint {
  margin: 0;
  font-size: 0.85rem;
  color: #6c757d;
}
.cert-sheet {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  background: #fffdf8;
  border: 10px solid #0d1b2a;
  box-shadow: 0 16px 40px rgba(13, 27, 42, 0.16);
  padding: 16px;
}
.cert-sheet::before {
  content: '';
  position: absolute;
  inset: 7px;
  border: 2px solid #f5a623;
  pointer-events: none;
}
.cert-sheet::after {
  content: '';
  position: absolute;
  inset: 13px;
  border: 1px solid rgba(26, 95, 180, 0.35);
  pointer-events: none;
}
.cert-inner {
  position: relative;
  z-index: 1;
  padding: 18px 28px 14px;
  text-align: center;
}
.cert-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
  color: #f5a623;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 700;
}
.cert-ornament span { height: 1px; width: 48px; background: linear-gradient(90deg, transparent, #f5a623, transparent); }
.cert-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 4px;
}
.cert-brand img { height: 38px; width: auto; }
.cert-brand-text { text-align: left; line-height: 1.1; }
.cert-brand-text strong {
  display: block;
  font-size: 1.15rem;
  color: #1a5fb4;
  font-weight: 800;
}
.cert-brand-text em {
  display: block;
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: #26a69a;
  font-weight: 600;
}
.cert-title {
  margin: 10px 0 4px;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 800;
  color: #0d1b2a;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cert-subtitle {
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.cert-name {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: #1a5fb4;
  font-weight: 700;
  margin: 0 0 6px;
  padding-bottom: 6px;
  border-bottom: 2px solid rgba(245, 166, 35, 0.55);
  display: inline-block;
  min-width: 42%;
}
.cert-body {
  max-width: 680px;
  margin: 8px auto 12px;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #3d4a5c;
}
.cert-body strong { color: #0d1b2a; }
.cert-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0 10px;
  text-align: left;
}
.cert-meta-item {
  background: rgba(244, 248, 255, 0.9);
  border: 1px solid #e4ebf5;
  border-radius: 10px;
  padding: 8px 12px;
}
.cert-meta-item span {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6c757d;
  font-weight: 700;
  margin-bottom: 2px;
}
.cert-meta-item strong {
  color: #0d1b2a;
  font-size: 0.88rem;
  word-break: break-word;
}
.cert-seal-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-top: 18px;
  padding: 0 8px;
}
.cert-sign {
  flex: 1;
  text-align: center;
}
.cert-sign-space {
  height: 64px;
  margin: 0 auto 4px;
  width: 78%;
}
.cert-sign-line {
  border-top: 1px solid #9aa7b8;
  margin: 0 auto 4px;
  width: 78%;
  padding-top: 6px;
  font-family: Georgia, serif;
  font-style: italic;
  color: #1a5fb4;
  font-size: 0.92rem;
}
.cert-sign small { color: #6c757d; font-size: 0.72rem; display: block; }
.cert-seal {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px double #f5a623;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: radial-gradient(circle at 30% 30%, #fff8e8, #f5e0b0);
  color: #8a5a00;
  font-weight: 800;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,0.5);
  flex-shrink: 0;
}
.cert-seal i { font-size: 1.05rem; margin-bottom: 2px; color: #c4861a; }
.cert-footer-note {
  margin-top: 12px;
  font-size: 0.75rem;
  color: #6c757d;
}
.cert-footer-note a { color: #1a5fb4; text-decoration: underline; }
.cert-verify-block {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed #d5deea;
  text-align: center;
}
.cert-verify-block > p {
  margin: 0 0 6px;
  font-size: 0.8rem;
  color: #6c757d;
}
.cert-verify-link {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #3d4a5c;
  word-break: break-all;
}
.cert-verify-link a {
  color: #1a5fb4;
  text-decoration: underline;
  font-weight: 600;
}
.cert-error {
  max-width: 560px;
  margin: 80px auto;
  text-align: center;
  padding: 40px 28px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(26,95,180,0.12);
}

.verify-card {
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 8px 32px rgba(26,95,180,0.12);
}
.verify-result {
  margin-top: 24px;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #e8edf5;
  background: #f8fafc;
}
.verify-result.valid {
  border-color: #a5d6a7;
  background: #f1faf1;
}
.verify-result.invalid {
  border-color: #ef9a9a;
  background: #fff5f5;
}
.verify-result h3 { margin-bottom: 8px; }
.verify-result dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 12px;
  margin-top: 14px;
  font-size: 0.95rem;
}
.verify-result dt { color: #6c757d; font-weight: 600; }
.verify-result dd { color: #0d1b2a; margin: 0; }

@media print {
  @page {
    margin: 0;
    size: auto;
  }
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100vh !important;
  }
  .navbar, .nav-backdrop, .footer, .cert-actions, .page-hero, .hamburger,
  .whatsapp-float, .scroll-top, [data-whatsapp], noscript {
    display: none !important;
  }
  .cert-stage {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    min-height: 100vh !important;
    height: 100vh !important;
    width: 100% !important;
    padding: 18mm 14mm !important;
    margin: 0 !important;
    background: #fff !important;
  }
  .cert-sheet {
    box-shadow: none !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 auto !important;
    border-width: 8px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .cert-verify-link {
    font-size: 0.7rem;
    color: #0d1b2a;
  }
  .cert-verify-link a {
    color: #0d1b2a;
    text-decoration: none;
  }
  .cert-sign-space { height: 72px; }
}

@media (max-width: 768px) {
  .cert-inner { padding: 20px 12px; }
  .cert-meta { grid-template-columns: 1fr; }
  .cert-seal-row { flex-direction: column; align-items: center; }
  .cert-brand { flex-direction: column; }
  .cert-brand-text { text-align: center; }
}
