/* Completion Certificate — printable, branded
   Loaded by certificate.js. The print stylesheet (@media print) collapses the
   page chrome to JUST the certificate so "Save as PDF" gives a clean artifact.
*/

#cm-cert-root {
  position: fixed; inset: 0; z-index: 9500;
  background: rgba(10, 10, 26, 0.96);
  overflow-y: auto;
}

.cert-overlay {
  min-height: 100%;
  display: flex; flex-direction: column;
  font-family: 'Inter', system-ui, sans-serif;
  color: #1a1a2e;
}

/* ----- Toolbar ----- */
.cert-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: #0a0a1a;
  border-bottom: 0.5px solid rgba(255,255,255,0.08);
  position: sticky; top: 0; z-index: 2;
}
.cert-toolbar__title {
  color: rgba(255,255,255,0.92);
  font-family: 'Newsreader', Georgia, serif;
  font-size: 18px; letter-spacing: -0.01em;
}
.cert-toolbar__actions { display: flex; gap: 10px; }
.cert-btn {
  font-family: inherit;
  font-size: 13px; font-weight: 500;
  padding: 9px 16px; border-radius: 6px;
  border: 0.5px solid rgba(255,255,255,0.18);
  background: transparent; color: rgba(255,255,255,0.85);
  cursor: pointer; transition: all 0.18s ease;
}
.cert-btn--ghost:hover { background: rgba(255,255,255,0.06); color: #fff; }
.cert-btn--primary {
  background: #d4af37; color: #1a1a2e; border-color: #d4af37;
  font-weight: 600;
}
.cert-btn--primary:hover { background: #e8c252; }

/* ----- Page wrapper ----- */
.cert-page-wrap {
  flex: 1;
  padding: 40px 24px 80px;
  display: flex; justify-content: center;
}
.cert-page {
  width: 100%; max-width: 900px;
  aspect-ratio: 11 / 8.5; /* US letter landscape */
  background: linear-gradient(135deg, #fefefe 0%, #faf7f2 100%);
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
}

.cert-frame {
  position: absolute; inset: 28px;
  border: 0.5px solid #6b5b95;
  padding: 48px 60px 36px;
  display: flex; flex-direction: column;
}

/* Decorative corners */
.cert-corner {
  position: absolute; width: 36px; height: 36px;
  pointer-events: none;
}
.cert-corner--tl { top: -1px; left: -1px;
  border-top: 1.5px solid #6b5b95; border-left: 1.5px solid #6b5b95; border-top-left-radius: 4px; }
.cert-corner--tr { top: -1px; right: -1px;
  border-top: 1.5px solid #6b5b95; border-right: 1.5px solid #6b5b95; border-top-right-radius: 4px; }
.cert-corner--bl { bottom: -1px; left: -1px;
  border-bottom: 1.5px solid #6b5b95; border-left: 1.5px solid #6b5b95; border-bottom-left-radius: 4px; }
.cert-corner--br { bottom: -1px; right: -1px;
  border-bottom: 1.5px solid #6b5b95; border-right: 1.5px solid #6b5b95; border-bottom-right-radius: 4px; }

/* ----- Header ----- */
.cert-header { text-align: center; margin-bottom: 16px; }
.cert-eyebrow {
  font-size: 10px; letter-spacing: 0.28em; text-transform: uppercase;
  color: #5BBFCF; font-weight: 600;
  margin-bottom: 14px;
}
.cert-title {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 400; font-size: 42px; letter-spacing: -0.025em;
  color: #1E1B4B; line-height: 1.05;
  margin: 0 0 8px;
}
.cert-subhead {
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic; font-size: 18px; color: #6b5b95;
  margin: 0 0 4px;
}
.cert-subhead-sm {
  font-size: 12px; color: #6b5b95; letter-spacing: 0.04em;
  margin: 0;
}

/* ----- Body ----- */
.cert-body {
  flex: 1;
  display: flex; flex-direction: column;
  justify-content: center;
  text-align: center;
  margin: 8px 0;
}
.cert-prose-intro {
  font-size: 13px; color: #6b5b95; letter-spacing: 0.18em;
  text-transform: uppercase; margin: 0 0 12px;
}
.cert-name {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 500; font-size: 38px;
  color: #1E1B4B; letter-spacing: -0.015em;
  margin: 0 0 18px;
  padding: 0 24px 14px;
  border-bottom: 0.5px solid rgba(107,91,149,0.35);
  display: inline-block; align-self: center;
}
.cert-prose {
  font-size: 13px; line-height: 1.65; color: #2d2d4a;
  max-width: 64ch; margin: 0 auto 8px;
}
.cert-prose-sm {
  font-size: 11.5px; line-height: 1.6; color: #555575;
  max-width: 64ch; margin: 4px auto 0;
  font-style: italic;
}

/* ----- Meta strip ----- */
.cert-meta {
  display: flex; justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 0.5px solid rgba(107,91,149,0.25);
  border-bottom: 0.5px solid rgba(107,91,149,0.25);
  margin: 12px 0 18px;
}
.cert-meta-col { flex: 1; min-width: 0; text-align: center; }
.cert-meta-label {
  font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase;
  color: #6b5b95; font-weight: 600; margin: 0 0 4px;
}
.cert-meta-val {
  font-size: 13px; color: #1E1B4B; font-weight: 500;
  margin: 0;
}

/* ----- Signatures ----- */
.cert-attribution {
  display: flex; justify-content: space-around;
  gap: 32px;
  margin-top: 8px;
}
.cert-sig-block { text-align: center; min-width: 200px; }
.cert-sig-line {
  height: 0.5px; background: #1E1B4B;
  margin: 0 auto 8px;
  width: 80%;
}
.cert-sig-name {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 15px; color: #1E1B4B; margin: 0 0 4px;
  font-style: italic;
}
.cert-sig-title {
  font-size: 10px; color: #6b5b95; letter-spacing: 0.04em;
  line-height: 1.4; margin: 0;
}

/* ----- Footer ----- */
.cert-footer {
  text-align: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 0.5px solid rgba(107,91,149,0.18);
}
.cert-footer p:first-child {
  font-size: 11px; color: #6b5b95; letter-spacing: 0.1em;
  margin: 0 0 6px;
}
.cert-footer-fine {
  font-size: 9px; color: #888; line-height: 1.5;
  max-width: 70ch; margin: 0 auto;
}

/* ----- Standalone name prompt ----- */
.cert-name-prompt {
  max-width: 520px; margin: 80px auto;
  padding: 40px 36px;
  background: #1a1a2e;
  border: 0.5px solid rgba(91,191,207,0.4);
  border-radius: 12px;
  color: rgba(255,255,255,0.92);
  text-align: center;
}
.cert-name-prompt .cert-eyebrow { color: #5BBFCF; margin-bottom: 8px; }
.cert-name-prompt h2 {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 400; font-size: 26px; letter-spacing: -0.01em;
  margin: 0 0 8px; color: #fff;
}
.cert-name-prompt p {
  font-size: 13px; color: rgba(255,255,255,0.7); margin: 0 0 24px;
}
.cert-name-prompt input[type="text"] {
  width: 100%; padding: 12px 16px;
  font-family: 'Newsreader', Georgia, serif;
  font-size: 18px; color: #fff;
  background: rgba(255,255,255,0.06);
  border: 0.5px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  outline: none; transition: all 0.2s ease;
  text-align: center;
}
.cert-name-prompt input[type="text"]:focus {
  border-color: #5BBFCF;
  background: rgba(255,255,255,0.1);
}
.cert-name-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 18px;
}

/* ----- Print stylesheet ----- */
@media print {
  @page { size: letter landscape; margin: 0.4in; }
  body * { visibility: hidden !important; }
  #cm-cert-root, #cm-cert-root * { visibility: visible !important; }
  #cm-cert-root {
    position: absolute !important; inset: 0 !important;
    background: #fff !important;
    overflow: visible !important;
  }
  .cert-overlay { background: #fff !important; }
  .cert-toolbar { display: none !important; }
  .cert-page-wrap { padding: 0 !important; }
  .cert-page {
    box-shadow: none !important;
    border-radius: 0 !important;
    aspect-ratio: auto !important;
    width: 100% !important; max-width: none !important;
    height: 100vh !important;
    page-break-inside: avoid;
    background: #fff !important;
  }
  .cert-frame { inset: 16px !important; padding: 36px 48px !important; }
}

/* Print hint class added during print */
body.cert-printing .cert-toolbar { opacity: 0.4; pointer-events: none; }
