/* ==========================================================================
   THE REGISTRAR, verification record (public /verify/{code} and /v/{code} page)

   Builds on the Registrar tokens and components in registrar.css (paper, ink, hairlines, the seal, the
   stamp). This file only adds what the verification record needs: the "Certificate of Verification" sheet
   with its hairline double border, the status block, the ruled ledger, the "what this means" panel and the
   print stylesheet that turns the page into a one-page record for an audit file.

   Colours: every text pair comes from the measured Registrar tokens. Amber is used for the seal fill only.
   ========================================================================== */

.vf { padding: clamp(24px, 4vw, 56px) 0 clamp(48px, 7vw, 96px); }
.vf-wrap { max-width: 940px; margin: 0 auto; padding-inline: var(--rg-gutter); }
.vf [hidden] { display: none !important; }
.vf .rg-sec { margin-bottom: clamp(18px, 2.4vw, 28px); }

/* ---------------------------------------------------------------- The sheet */
/* Hairline double border: the outer rule is the border, the inner one an inset shadow, with a paper gap between. */
.vf-sheet {
  position: relative; isolation: isolate; background: var(--rg-card); border: 1px solid var(--rg-ink);
  box-shadow: inset 0 0 0 8px var(--rg-card), inset 0 0 0 9px var(--rg-ink), var(--rg-shadow-paper);
  padding: clamp(36px, 5.5vw, 68px) clamp(26px, 5.5vw, 68px) clamp(28px, 4vw, 48px);
}
/* Security-print wash behind the heading (pure CSS, no image bytes). */
.vf-sheet::before {
  content: ""; position: absolute; z-index: -1; left: 9px; right: 9px; top: 9px; height: 300px; pointer-events: none;
  background: repeating-radial-gradient(circle at 50% -30%, transparent 0 7px, rgba(11,27,51,.07) 7px 7.8px);
  -webkit-mask-image: linear-gradient(#000, transparent); mask-image: linear-gradient(#000, transparent);
}
.vf-head { display: grid; justify-items: center; text-align: center; gap: 14px; }
.vf-kicker { font: 700 12px/1.4 var(--rg-sans); letter-spacing: .2em; text-transform: uppercase; color: var(--rg-mute); }
.vf .vf-title { font-size: clamp(32px, 5.2vw, 54px); line-height: 1.04; letter-spacing: -.024em; }
.vf-ref { font: 400 13px/1.5 var(--rg-mono); color: var(--rg-mute); letter-spacing: .04em; overflow-wrap: anywhere; }
/* The issuer's own logo, in its natural colours: never filtered, dimmed or blended, and never Certifyd's mark. */
.vf-issuer { display: grid; justify-items: center; gap: 10px; margin-top: 6px; }
.vf-issuer img { display: block; max-height: 72px; max-width: min(260px, 100%); width: auto; height: auto; filter: none; opacity: 1; mix-blend-mode: normal; }
/* White lettering on a transparent background (logoTone "light"): sit it on a dark brand tile so it is readable. */
.vf-issuer img.vf-logo--light { background: #0B2A5B; padding: 10px 16px; border-radius: 10px; box-sizing: content-box; }
.vf-issuer__name { font: 400 20px/1.2 var(--rg-display); color: var(--rg-ink); }
.vf-issuer__text { text-align: center; }
.vf-issuer__label { font: 700 12px/1 var(--rg-sans); letter-spacing: .18em; text-transform: uppercase; color: var(--rg-mute); display: block; margin-bottom: 4px; }

/* The seal reflects the record: bright when valid, greyed when expired, struck through when revoked,
   an empty dashed ring when nothing was found. */
.vf-seal { position: relative; width: 96px; aspect-ratio: 1; }
.vf-seal .rg-seal-wrap { width: 100%; }
.vf-seal--expired .rg-seal { filter: grayscale(.85) drop-shadow(0 6px 8px rgba(11,27,51,.2)); opacity: .8; }
.vf-seal--revoked .rg-seal { filter: grayscale(1) drop-shadow(0 6px 8px rgba(11,27,51,.2)); opacity: .55; }
.vf-seal--revoked::after { content: ""; position: absolute; left: -6%; right: -6%; top: 50%; border-top: 3px solid var(--rg-revoked); transform: rotate(-24deg); }
.vf-seal--none { border: 2px dashed var(--rg-rule-ui); border-radius: 50%; }
.vf-seal--none::after { content: ""; position: absolute; left: 32%; right: 32%; top: 50%; border-top: 2px solid var(--rg-rule-ui); }
.vf-seal--none .rg-seal-wrap { display: none; }
.vf-seal--wait { border: 2px solid var(--rg-rule); border-radius: 50%; }
.vf-seal--wait .rg-seal-wrap { display: none; }
.vf-seal--wait::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--rg-ink); animation: vf-spin 1.1s linear infinite; }
@keyframes vf-spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ Status block */
.vf-status {
  margin-top: clamp(24px, 3.4vw, 36px); border-top: 2px solid var(--rg-ink); border-bottom: 1px solid var(--rg-rule);
  padding: 22px clamp(0px, 1vw, 12px); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px clamp(20px, 3vw, 36px); align-items: center;
}
.vf-status--valid { background: linear-gradient(90deg, rgba(15,107,64,.07), transparent 70%); }
.vf-status--expired { background: linear-gradient(90deg, rgba(138,90,0,.08), transparent 70%); }
.vf-status--revoked { background: linear-gradient(90deg, rgba(180,35,24,.07), transparent 70%); }
.vf-status--none, .vf-status--info { background: linear-gradient(90deg, rgba(86,97,120,.08), transparent 70%); }
.vf-status .rg-stamp { font-size: 15px; padding: 12px 20px; justify-self: start; }
.vf-status--none .rg-stamp, .vf-status--info .rg-stamp { color: var(--rg-ink-2); }
.vf-status__title { font: 400 clamp(23px, 3vw, 30px)/1.12 var(--rg-display); color: var(--rg-ink); letter-spacing: -.012em; margin: 0; }
.vf-status__text { margin-top: 6px; font-size: 16px; line-height: 1.55; color: var(--rg-ink-2); max-width: 40em; }
.vf-reason { margin-top: 12px; padding: 10px 14px; border-left: 3px solid var(--rg-revoked); background: rgba(255,255,255,.7); }
.vf-reason__label { display: block; font: 700 12px/1 var(--rg-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--rg-mute); margin-bottom: 4px; }
.vf-reason__value { color: var(--rg-ink); font-weight: 500; overflow-wrap: anywhere; }
.vf-checks { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: vfc; border-top: 1px solid var(--rg-rule); }
.vf-checks li { counter-increment: vfc; position: relative; padding: 9px 0 9px 34px; border-bottom: 1px solid var(--rg-rule); font-size: 15.5px; line-height: 1.5; color: var(--rg-ink-2); }
.vf-checks li::before { content: counter(vfc); position: absolute; left: 0; top: 5px; font: italic 400 22px/1.2 var(--rg-display); color: var(--rg-ink); }

/* ------------------------------------------------------------------ Ledger */
.vf-ledger { margin: 0; padding: 0; border-top: 2px solid var(--rg-ink); margin-top: clamp(24px, 3vw, 34px); }
.vf-row { display: grid; grid-template-columns: minmax(140px, 230px) minmax(0, 1fr); gap: 4px 24px; padding: 14px 0; border-bottom: 1px solid var(--rg-rule); align-items: baseline; }
.vf-row dt { margin: 0; font: 700 12px/1.4 var(--rg-sans); letter-spacing: .15em; text-transform: uppercase; color: var(--rg-mute); }
.vf-row dd { margin: 0; font-size: 17px; line-height: 1.45; color: var(--rg-ink); overflow-wrap: anywhere; }
.vf-row dd.is-mono { font-family: var(--rg-mono); font-size: 16px; letter-spacing: .05em; }
.vf-row dd.is-strong { font: 400 clamp(21px, 2.4vw, 26px)/1.2 var(--rg-display); }
.vf-row--stamp dd { font-weight: 700; }
.vf-row--valid dd { color: var(--rg-verified); }
.vf-row--expired dd { color: var(--rg-expired); }
.vf-row--revoked dd { color: var(--rg-revoked); }

/* --------------------------------------------------------------- Signature (#868) */
/* Normal flow, directly under the ledger: it never overlays the preview, the QR or the credential ID. */
.vf-signature { margin-top: clamp(20px, 3vw, 28px); padding: 16px clamp(14px, 2vw, 20px); border: 1px solid var(--rg-rule); border-left: 4px solid var(--rg-mute); background: rgba(255,255,255,.6); }
.vf-signature--signed { border-left-color: var(--rg-verified); }
.vf-signature--failed { border-left-color: var(--rg-expired); }
.vf-signature__title { margin: 0 0 6px; font: 700 12px/1.4 var(--rg-sans); letter-spacing: .15em; text-transform: uppercase; color: var(--rg-mute); }
.vf-signature__state { margin: 0; font-size: 17px; line-height: 1.4; font-weight: 700; color: var(--rg-ink); overflow-wrap: anywhere; }
.vf-signature--signed .vf-signature__state { color: var(--rg-verified); }
.vf-signature__text { margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: var(--rg-ink-2); }
.vf-signature__facts { margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.vf-signature__fact { display: grid; grid-template-columns: minmax(110px, 160px) minmax(0, 1fr); gap: 2px 16px; align-items: baseline; }
.vf-signature__fact dt { margin: 0; font: 700 12px/1.4 var(--rg-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--rg-mute); }
.vf-signature__fact dd { margin: 0; font-size: 15px; line-height: 1.45; color: var(--rg-ink); overflow-wrap: anywhere; }
.vf-signature__fact dd.is-mono { font-family: var(--rg-mono); font-size: 13px; letter-spacing: .02em; }
@media (max-width: 640px) { .vf-signature__fact { grid-template-columns: minmax(0, 1fr); } }

/* ----------------------------------------------------------------- Preview */
.vf-preview { margin: clamp(28px, 4vw, 40px) 0 0; }
.vf-preview__frame { position: relative; background: var(--rg-paper-2); border: 1px solid var(--rg-rule); padding: clamp(8px, 1.6vw, 16px); }
.vf-preview img { display: block; width: 100%; height: auto; border: 1px solid var(--rg-rule); background: #fff; }
.vf-preview--revoked img { filter: grayscale(1); opacity: .8; }
.vf-preview--expired img { filter: grayscale(.5); }
.vf-preview__mark { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-12deg); font: 700 clamp(18px, 4vw, 34px)/1 var(--rg-sans); letter-spacing: .2em; text-transform: uppercase; padding: .35em .8em; border: 3px solid currentColor; outline: 1px solid currentColor; outline-offset: 3px; background: rgba(255,253,248,.85); pointer-events: none; }
.vf-preview--revoked .vf-preview__mark { color: var(--rg-revoked); }
.vf-preview--expired .vf-preview__mark { color: var(--rg-expired); }
.vf-preview figcaption { margin-top: 8px; font-size: 13px; color: var(--rg-mute); }
.vf-badge { display: flex; align-items: center; gap: 16px; margin-top: 18px; }
.vf-badge img { width: 96px; height: 96px; display: block; }

/* ----------------------------------------------------------------- Actions */
.vf-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; align-items: center; }
.vf-actions .rg-btn { height: 44px; padding: 0 18px; font-size: 14.5px; }
.vf-actions svg { width: 16px; height: 16px; flex: none; }
.vf-actions__label { flex-basis: 100%; font: 700 12px/1 var(--rg-sans); letter-spacing: .18em; text-transform: uppercase; color: var(--rg-mute); margin-top: 6px; }
.vf-toast { min-height: 1.5em; font-size: 14px; color: var(--rg-verified); margin-top: 8px; }

/* ----------------------------------------------- What this verification means */
.vf-meaning { margin-top: clamp(30px, 4vw, 44px); background: var(--rg-paper-2); border: 1px solid var(--rg-rule); border-top: 2px solid var(--rg-ink); padding: clamp(20px, 3vw, 34px); }
.vf .vf-meaning h2 { font-size: clamp(24px, 2.6vw, 30px); line-height: 1.1; }
.vf-meaning__lead { margin-top: 10px; font-size: 15.5px; color: var(--rg-ink-2); max-width: 46em; }
.vf-meaning__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px clamp(20px, 3vw, 40px); margin-top: 18px; }
.vf .vf-meaning h3 { font: 700 12px/1.3 var(--rg-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--rg-ink); margin-bottom: 8px; }
.vf-meaning ul { margin: 0; padding: 0; list-style: none; }
.vf-meaning li { position: relative; padding: 8px 0 8px 22px; border-top: 1px solid var(--rg-rule); font-size: 15px; line-height: 1.5; color: var(--rg-ink-2); }
.vf-meaning li::before { content: ""; position: absolute; left: 2px; top: 16px; width: 8px; height: 8px; background: var(--rg-ink); }
.vf-meaning__no li::before { background: transparent; border: 1.5px solid var(--rg-ink); }
.vf-meaning__note { margin-top: 16px; font-size: 14px; color: var(--rg-mute); }

/* ------------------------------------------------ Compare with your copy (line pattern) */
/* The pattern card sits inside the record, written by the server for a valid credential. It is a visual aid, not a guarantee. */
.vf-pattern { margin-top: clamp(26px, 3.6vw, 38px); padding: clamp(16px, 2.4vw, 24px); background: var(--rg-paper-2); border: 1px solid var(--rg-rule); border-top: 2px solid var(--rg-ink); }
.vf .vf-pattern h2 { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.1; }
.vf-pattern__lead { margin-top: 8px; font-size: 16px; color: var(--rg-ink-2); }
.vf-pattern__figure { margin: 14px 0 0; }
.vf-pattern__figure img { display: block; width: 100%; max-width: 640px; height: auto; background: #fff; border: 1px solid var(--rg-rule); }
.vf-pattern figcaption { margin-top: 6px; font-size: 13px; color: var(--rg-mute); }
.vf-pattern__ref { margin-top: 12px; font-size: 15px; color: var(--rg-ink-2); }
.vf-pattern__ref strong { font: 700 20px/1 var(--rg-mono); letter-spacing: .12em; color: var(--rg-ink); }
.vf-pattern__refname { font: 700 12px/1 var(--rg-sans); letter-spacing: .18em; text-transform: uppercase; color: var(--rg-mute); }
.vf-pattern__note { margin-top: 10px; font-size: 13.5px; line-height: 1.5; color: var(--rg-mute); max-width: 46em; }

/* ----------------------------------------------------------------- Check a PDF */
.vf-check { margin: clamp(22px, 3vw, 32px) auto 0; background: var(--rg-card); border: 1px solid var(--rg-rule); border-top: 2px solid var(--rg-ink); padding: clamp(18px, 2.6vw, 28px); }
.vf .vf-check h2 { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.1; }
.vf-check__lead { margin-top: 8px; font-size: 16px; color: var(--rg-ink-2); max-width: 46em; }
.vf-check__privacy { margin-top: 8px; font-size: 15px; color: var(--rg-ink); max-width: 46em; }
.vf-drop { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; justify-items: start; padding: clamp(16px, 2.4vw, 24px); border: 2px dashed var(--rg-rule-ui); background: var(--rg-paper-2); }
.vf-drop.is-over { border-color: var(--rg-ink); background: var(--rg-card); }
.vf-drop__label { font: 700 13px/1.3 var(--rg-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--rg-ink); }
.vf-drop > * { min-width: 0; max-width: 100%; }
/* A file input has a wide intrinsic size (the "no file chosen" text); width:100% lets it shrink to the card at 320px. */
.vf-drop__input { width: 100%; max-width: 100%; font: 400 15px/1.4 var(--rg-sans); color: var(--rg-ink); }
.vf-drop__input:focus-visible { outline: 3px solid var(--rg-ink); outline-offset: 3px; }
.vf-check__help { margin-top: 10px; font-size: 13.5px; color: var(--rg-mute); max-width: 46em; }
.vf-check__result { margin-top: 14px; }
.vf-check__result:empty { display: none; }
.vf-check__card { padding: 14px 16px; border: 1px solid var(--rg-rule); border-left: 4px solid var(--rg-ink-2); background: var(--rg-paper-2); display: grid; gap: 8px; justify-items: start; }
.vf-check__card--valid { border-left-color: var(--rg-verified); }
.vf-check__card--warn { border-left-color: var(--rg-expired); }
.vf-check__card--bad { border-left-color: var(--rg-revoked); }
.vf-check__title { font: 400 clamp(20px, 2.2vw, 24px)/1.15 var(--rg-display); color: var(--rg-ink); margin: 0; }
.vf-check__text { font-size: 15.5px; line-height: 1.55; color: var(--rg-ink-2); margin: 0; max-width: 46em; }
.vf-check__file { font: 400 12.5px/1.4 var(--rg-mono); color: var(--rg-mute); margin: 0; overflow-wrap: anywhere; }

/* ---------------------------------------------------------- Foot + lookup */
.vf-foot { margin-top: clamp(22px, 3vw, 32px); padding-top: 16px; border-top: 1px solid var(--rg-rule); display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; font-size: 13.5px; color: var(--rg-mute); }
.vf-foot a { font-weight: 600; }
/* The growth link under the whole page: small, muted, centred, never styled as a button or banner. */
.vf-cta { margin: clamp(22px, 3vw, 32px) auto 0; text-align: center; font-size: 13px; color: var(--rg-mute); }
.vf-cta a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.vf-cta a:hover, .vf-cta a:focus-visible { color: var(--rg-ink); }
.vf-printmeta { display: none; }
.vf-lookup { margin: clamp(22px, 3vw, 32px) auto 0; background: var(--rg-card); border: 1px solid var(--rg-rule); padding: 16px 18px; }
.vf-lookup label { display: block; font: 700 12px/1 var(--rg-sans); letter-spacing: .18em; text-transform: uppercase; color: var(--rg-mute); margin-bottom: 8px; }
.vf-lookup__row { display: flex; gap: 10px; }
.vf-lookup .rg-verify__input { height: 46px; }
.vf-note { margin-top: 16px; font-size: 14px; color: var(--rg-mute); text-align: center; }

@media (max-width: 640px) {
  .vf-status { grid-template-columns: minmax(0, 1fr); }
  .vf-row { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 12px 0; }
  .vf-meaning__cols { grid-template-columns: minmax(0, 1fr); }
  .vf-lookup__row { flex-direction: column; }
  .vf-lookup .rg-verify__go { height: 48px; }
  .vf-actions .rg-btn { flex: 1 1 100%; }
  .vf-sheet::before { height: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  .vf-seal--wait::after { animation: none; border-top-color: var(--rg-ink); border-right-color: var(--rg-ink); }
}

/* -------------------------------------------------------------------- Print */
/* Printing yields a one-page record for an audit file: the ledger, the status, the verification time and the
   page address, with no navigation, buttons or page chrome. */
@media print {
  @page { size: A4; margin: 11mm; }
  html, body.rg { background: #fff !important; color: #000; font-size: 10pt; line-height: 1.4; }
  body.rg::before, body.rg::after { display: none !important; }
  .cd-nav, .cd-foot, .cd-skip-link, .cd-cookie-notice, .vf .rg-sec, .vf-actions, .vf-toast, .vf-lookup, .vf-badge, .vf-noprint, .vf-pattern, .vf-sheet::before { display: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .vf { padding: 0; }
  .vf-wrap { max-width: none; padding: 0; }
  .vf-sheet { box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 5px #000; border-color: #000; background: #fff; padding: 8mm 9mm 6mm; }
  .vf-head { gap: 5px; }
  .vf-seal { width: 14mm; }
  .vf-kicker, .vf-meaning__lead { display: none; }
  .vf .vf-title { font-size: 19pt; }
  .vf-kicker { font-size: 7.5pt; }
  .vf-ref { font-size: 9pt; }
  .vf-issuer img { max-height: 8mm; }
  .vf-issuer { gap: 1mm; margin-top: 0; }
  .vf-issuer__label { display: none; }
  .vf-reason { margin-top: 1.5mm; padding: 1mm 2.5mm; }
  .vf-reason__value { font-size: 9pt; }
  .vf-reason__label { margin-bottom: .5mm; }
  .vf-issuer__name { font-size: 12pt; }
  .vf-status { margin-top: 4mm; padding: 3mm 0; gap: 6mm; background: none !important; break-inside: avoid; }
  .vf-status .rg-stamp { font-size: 11pt; padding: 2mm 4mm; transform: none; }
  .vf-status__title { font-size: 15pt; }
  .vf-status__text { font-size: 9.5pt; margin-top: 1mm; }
  body.rg { padding-bottom: 0 !important; }
  /* Two columns of ledger rows on paper; the recipient and the credential keep a full-width row each. */
  .vf-ledger { margin-top: 3mm; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 6mm; }
  .vf-row:has(.is-strong) { grid-column: 1 / -1; }
  .vf-row { padding: 1.05mm 0; grid-template-columns: 27mm minmax(0, 1fr); break-inside: avoid; }
  .vf-row:has(.is-strong) { grid-template-columns: 42mm minmax(0, 1fr); }
  .vf-row dt { font-size: 7.5pt; }
  .vf-row dd { font-size: 10pt; }
  .vf-row dd.is-mono { font-size: 10pt; }
  .vf-row dd.is-strong { font-size: 13pt; }
  .vf-preview { margin-top: 3mm; break-inside: avoid; }
  .vf-preview__frame { text-align: center; }
  .vf-preview__frame { padding: 1.5mm; background: #fff; }
  .vf-preview img { width: auto; max-width: 100%; max-height: 19mm; margin: 0 auto; }
  .vf-preview figcaption { display: none; }
  .vf-preview__mark { font-size: 14pt; }
  .vf-meaning { margin-top: 4mm; padding: 3mm 4mm; background: #fff; break-inside: avoid; }
  .vf .vf-meaning h2 { font-size: 11pt; }
  .vf-meaning__lead, .vf-meaning__note { font-size: 7.5pt; margin-top: 1mm; }
  .vf-meaning__cols { gap: 4mm; margin-top: 2mm; }
  .vf .vf-meaning h3 { font-size: 7pt; margin-bottom: 1mm; }
  .vf-meaning li { font-size: 7.5pt; padding: 1mm 0 1mm 4mm; line-height: 1.3; }
  .vf-meaning li::before { top: 2mm; width: 1.6mm; height: 1.6mm; }
  .vf-foot { display: none; }
  .vf-printmeta { display: block; margin-top: 4mm; padding-top: 2.5mm; border-top: 1px solid #000; font: 400 8pt/1.5 var(--rg-mono); color: #000; overflow-wrap: anywhere; }
  .vf-printmeta strong { font-family: var(--rg-sans); letter-spacing: .1em; text-transform: uppercase; font-size: 7pt; color: #000; }
  a { color: #000 !important; text-decoration: none; }
}

/* While the register is being read the sheet is held at roughly the height of a finished record, so the footer
   stays below the fold and does not jump when the answer arrives (keeps Cumulative Layout Shift near zero). */
#state-loading { min-height: 1100px; }
@media print { #state-loading { min-height: 0; } }
