/* =========================================================
   CERTIFICATE — navy/gold design, two selectable variants
   (classic / award). Copied exactly from the reference Quiz
   Platform app's certificate design, per spec — this is the
   one part of the visual system deliberately NOT reskinned to
   the site's own brand palette. Sized to an A4-landscape ratio
   so printing looks right, but scales fluidly on screen.
   ========================================================= */
:root {
    --cert-navy: #0F2A4A;
    --cert-gold: #C9A227;
    --cert-gold-text: #B8860B;
    --cert-award-bg: #fbf9f3;
    --cert-muted: #555;
    --cert-hair: #999;
    --cert-label: #8a8a8a;
}
.cert-frame {
    position: relative;
    width: 100%;
    max-width: 1050px;
    aspect-ratio: 1.4142;
    margin: 0 auto;
    background: #fff;
    font-family: Georgia, 'Times New Roman', serif;
    color: #222;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(15, 42, 74, .18);
    border-radius: 4px;
}
.cert-award { background: var(--cert-award-bg); }
.cert-content {
    position: absolute;
    inset: 0;
    padding: 3.5% 9%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ---- classic: folded ribbon corners + double border ---- */
.cert-corner-tl, .cert-corner-br {
    position: absolute; width: 0; height: 0; border-style: solid;
}
.cert-corner-tl { top: 0; left: 0; border-width: 80px 80px 0 0; border-color: var(--cert-navy) transparent transparent transparent; }
.cert-corner-br { bottom: 0; right: 0; border-width: 0 0 80px 80px; border-color: transparent transparent var(--cert-navy) transparent; }
.cert-ribbon-tl, .cert-ribbon-br {
    position: absolute; width: 130px; height: 15px; background: var(--cert-gold);
}
.cert-ribbon-tl { top: 15px; left: -24px; transform: rotate(-45deg); }
.cert-ribbon-br { bottom: 15px; right: -24px; transform: rotate(-45deg); }
.cert-border-outer, .cert-border-inner { position: absolute; pointer-events: none; }
.cert-border-outer { inset: 5px; border: 1.5px solid var(--cert-gold); }
.cert-border-inner { inset: 10px; border: 1px solid var(--cert-navy); }

/* ---- award: bracketed frame + diamond-flanked subtitle ---- */
.cert-border-award-outer, .cert-border-award-inner { position: absolute; pointer-events: none; }
.cert-border-award-outer { inset: 12px; border: 2px solid var(--cert-gold); }
.cert-border-award-inner { inset: 18px; border: 1px solid var(--cert-navy); }
.cert-bracket { position: absolute; width: 26px; height: 26px; border: 3px solid var(--cert-gold); }
.cert-bracket-tl { top: 26px; left: 26px; border-right: none; border-bottom: none; }
.cert-bracket-tr { top: 26px; right: 26px; border-left: none; border-bottom: none; }
.cert-bracket-bl { bottom: 26px; left: 26px; border-right: none; border-top: none; }
.cert-bracket-br { bottom: 26px; right: 26px; border-left: none; border-top: none; }

/* ---- shared content typography ---- */
.cert-academy { font-size: 15px; color: var(--cert-navy); font-weight: bold; letter-spacing: 1.5px; }
.cert-seal { width: 68px; height: 68px; object-fit: contain; margin: 6px auto; display: block; }
.cert-title { color: var(--cert-navy); font-size: clamp(20px, 3.2vw, 32px); letter-spacing: 4px; margin: 4px 0 0; font-weight: bold; }
.cert-subtitle { letter-spacing: 6px; color: var(--cert-muted); font-size: 13px; margin: 2px 0 10px; }
.cert-intro { font-size: 11.5px; letter-spacing: 1px; margin: 0 0 4px; color: #333; }
.cert-recipient { font-style: italic; color: var(--cert-gold-text); font-size: clamp(18px, 2.8vw, 28px); margin: 2px 0 8px; font-weight: bold; }
.cert-body { font-size: 12.5px; line-height: 1.5; }
.cert-line { margin: 5px 0; }
.cert-badge { display: inline-block; background: var(--cert-navy); color: #fff; padding: 5px 20px; font-weight: bold; letter-spacing: 2px; margin: 6px 0; font-size: 12px; }
.cert-quiz-title { display: block; font-weight: bold; font-size: 15px; color: var(--cert-navy); margin: 6px 0; }
.cert-quiz-list { list-style: none; padding: 0; margin: 6px 0; }
.cert-quiz-list li { font-family: Georgia, serif; color: var(--cert-navy); font-size: 1.05em; margin: 3px 0; }
.cert-issued-line { font-size: 10.5px; letter-spacing: .5px; color: var(--cert-label); margin: 8px 0 4px; }

.cert-footer { width: 100%; margin-top: 14px; font-size: 12px; border-collapse: collapse; }
.cert-footer-col { width: 33%; text-align: center; vertical-align: bottom; display: table-cell; }
.cert-footer-single { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cert-footer-label { display: block; font-size: 10px; letter-spacing: 1.5px; color: var(--cert-label); }
.cert-footer-org { display: block; font-size: 10px; color: var(--cert-gold-text); letter-spacing: .5px; margin-top: 2px; }
.cert-footer-value { display: block; font-weight: bold; }
.cert-signature-name { display: block; font-style: italic; font-size: 16px; }
.cert-signature-rule { display: block; color: var(--cert-hair); }
.cert-signature-rule::after { content: "—————"; }
.cert-cosign { margin-top: 6px; text-align: center; }
.cert-cosign-logo { width: 68px; height: 68px; object-fit: contain; border-radius: 6px; display: block; margin: 0 auto 4px; }
.cert-cosign-tagline { display: block; font-style: italic; font-size: 10px; color: var(--cert-label); line-height: 1.4; }
.cert-tagline { margin-top: 10px; font-size: 10px; color: var(--cert-navy); font-weight: bold; letter-spacing: 1.5px; }

/* ---- award-specific overrides ---- */
.cert-title-award { color: var(--cert-navy); font-size: clamp(16px, 2.4vw, 24px); letter-spacing: 6px; font-weight: bold; margin: 4px 0 0; }
.cert-subtitle-award-wrap { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 4px; }
.cert-subtitle-line { display: inline-block; width: 90px; height: 1px; background: var(--cert-gold); }
.cert-subtitle-diamond { display: inline-block; width: 7px; height: 7px; background: var(--cert-gold); transform: rotate(45deg); }
.cert-subtitle-award { font-size: 12px; letter-spacing: 4px; color: var(--cert-gold-text); }
.cert-intro-award { margin-top: 10px; font-size: 9.5px; color: var(--cert-muted); letter-spacing: 2px; }
.cert-recipient-award { margin-top: 6px; font-size: clamp(16px, 2.4vw, 24px); color: var(--cert-navy); font-style: italic; }
.cert-recipient-rule { width: 260px; max-width: 60%; height: 1px; background: var(--cert-gold); margin: 3px auto 0; }
.cert-body-award { margin-top: 8px; font-size: 11px; color: #444; line-height: 1.5; max-width: 560px; }
.cert-footer-value-award, .cert-signature-name-award { display: block; font-family: Georgia, serif; color: var(--cert-navy); font-weight: bold; }
.cert-signature-name-award { font-style: italic; font-weight: normal; font-size: 15px; border-bottom: 1px solid var(--cert-gold); padding-bottom: 3px; display: inline-block; margin-bottom: 4px; }

.certificate-actions { text-align: center; padding: 28px 16px 40px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
@media print {
    .no-print, .public-nav, .public-footer, .site-footer { display: none !important; }
    @page { size: A4 landscape; margin: 0; }
    .cert-frame { box-shadow: none; max-width: none; width: 100%; height: 100vh; aspect-ratio: auto; border-radius: 0; }
}
@media (max-width: 640px) {
    .cert-corner-tl { border-width: 46px 46px 0 0; }
    .cert-corner-br { border-width: 0 0 46px 46px; }
    .cert-ribbon-tl, .cert-ribbon-br { width: 90px; height: 10px; }
    .cert-bracket { width: 16px; height: 16px; }
}

/* ---- verify-lookup card (used by verify_certificate.php) ---- */
.cert-verify-card {
    display: flex; gap: 16px; align-items: flex-start; padding: 20px;
    border: 1px solid var(--border, #e2e6ee); border-radius: 12px; background: #fff;
}
.cert-verify-icon { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.cert-verify-body { min-width: 0; flex: 1; }
.cert-verify-status { font-weight: 800; font-size: 1.05em; letter-spacing: -.01em; }
.cert-verify-holder { font-size: 1.3em; font-weight: 700; margin-top: 2px; }
.cert-verify-note { margin: 6px 0 0; }
.cert-verify-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 10px 18px; margin-top: 14px; }
.cert-verify-details dt { font-size: .72em; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-bottom: 3px; }
.cert-verify-details dd { margin: 0; font-weight: 600; }
.cert-verify-valid { border-color: #1a9a5a; }
.cert-verify-valid .cert-verify-icon { background: #e6f7ee; color: #1a9a5a; }
.cert-verify-valid .cert-verify-status { color: #1a9a5a; }
.cert-verify-danger { border-color: #d64545; }
.cert-verify-danger .cert-verify-icon { background: #fbe9e9; color: #d64545; }
.cert-verify-danger .cert-verify-status { color: #d64545; }
@media (max-width: 640px) { .cert-verify-card { flex-direction: column; } }
