/* records.css: verify.html, record.html, badges.html (docs/DEMO-REDESIGN.md, section 6.5).
   Pages: verify.html (body.verify-page), record.html (body.record-page), badges.html (body.badges-page).
   Loads after theme.css and uses its components (card, page-head, msg, chip, table, kv).
   The on-screen frames (record sheet, badge cards) live in @media screen; the print block at the
   end restates what the printed record and badge sheet need.
   Never tint, filter, round-clip or resize-distort a QR code (.qr, .record-qr). */

/* =====================================================================
   verify.html: public check of a signed record
   ===================================================================== */
/* main keeps the 1100px page column (its left edge is the wordmark's); the content is one
   narrower column inside it. From 1000px a side panel explains what the check shows. */
.verify-main > * { max-width: 48rem; }
@media (min-width: 1000px) {
  .verify-main { display: grid; grid-template-columns: minmax(0, 48rem) minmax(0, 1fr); column-gap: 40px; align-items: start; }
  .verify-lookup { display: contents; }
  .verify-main > *, .verify-lookup > * { grid-column: 1; }
  .verify-main .page-head { grid-column: 1 / -1; }
  .verify-main .verify-aside { grid-column: 2; grid-row: 2 / span 3; position: sticky; top: 88px; }
}
.verify-aside { margin: 24px 0 0; }
.verify-aside h2 { font-size: 1.0625rem; margin: 0 0 10px; }
.verify-aside ul { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.verify-aside li { position: relative; padding-left: 28px; color: var(--ink-2); }
.verify-aside li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--success-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.2l2 2 4-4.4' fill='none' stroke='%231e6b3c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
  border: 1px solid var(--success-line);
}
.verify-aside p { margin: 0; }
@media (min-width: 1000px) { .verify-aside { margin: 0; } }

/* Lookup form: label on top, code box and button on one row. */
.verify-form {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: end;
  margin-bottom: 24px;
}
.verify-form .field { margin: 0; }
.verify-form .btn { min-height: 48px; padding-inline: 20px; }
@media (max-width: 480px) {
  .verify-form { grid-template-columns: minmax(0, 1fr); }
  .verify-form .btn { width: 100%; }
}
#verify-msg { margin: 0 0 24px; }

/* ---- The record: a plain bordered card with an outlined seal ---- */
.verify-page .cert {
  position: relative; overflow: hidden;
  padding: 28px; margin-bottom: 0;
  border-color: var(--hairline-strong); box-shadow: none;
}
.verify-page .cert::before { content: none; }
.verify-page .cert-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
/* The round seal is aria-hidden decoration; .verified-stamp carries the words. */
.verify-page .cert-seal {
  flex: none; display: grid; place-content: center; justify-items: center; gap: 2px;
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--surface-1); color: var(--success); text-align: center;
  border: 2px solid var(--success); box-shadow: none;
}
.verify-page .cert-seal-check { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.verify-page .cert-seal-text { font-size: .6875rem; font-weight: 600; line-height: 1; letter-spacing: .04em; }
@media (max-width: 560px) {
  .verify-page .cert { padding: 20px; }
  .verify-page .cert-seal { width: 56px; height: 56px; }
  .verify-page .cert-seal-check { font-size: 1.125rem; }
  .verify-page .cert-seal-text { font-size: .5625rem; }
}

.cert-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.cert-heading .eyebrow { flex: 1 0 100%; margin: 0; }
.verify-page .cert-title { font-size: 1.5rem; font-weight: 600; line-height: 1.25; letter-spacing: 0; margin: 0; }
.verify-page .verified-stamp {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .8125rem; font-weight: 600; line-height: 1.4; letter-spacing: 0;
  color: var(--success); background: var(--success-bg);
  border: 1px solid var(--success-line); border-radius: var(--r-sm); padding: 2px 8px;
}

.cert-hours {
  margin: 20px 0; padding: 20px 0;
  border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
}
.cert-hours-num { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin: 0; }
.cert-num {
  font-size: 2.25rem; font-weight: 600; line-height: 1.1; letter-spacing: -.01em;
  color: var(--ink-1); font-variant-numeric: tabular-nums;
}
.cert-unit { font-size: 1rem; font-weight: 500; color: var(--ink-2); }
.cert-hours-exact { margin: 6px 0 0; font-size: .875rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.verify-page .cert-kv { gap: 8px 24px; margin: 0; align-items: baseline; }
.verify-page .cert-kv dt { font-size: .8125rem; font-weight: 500; color: var(--ink-soft); }
.verify-page .cert-kv dd { font-size: 1rem; overflow-wrap: anywhere; min-width: 0; }
.verify-page .cert-kv .cert-student { font-size: 1.125rem; font-weight: 600; line-height: 1.3; }

.cert h3.cert-section-title { font-size: 1rem; font-weight: 600; color: var(--ink-1); margin: 24px 0 8px; }

/* Total row: same size as the rows, set apart by one stronger rule. */
.cert-table tbody tr:last-child > td,
.record-sheet tbody tr:last-child > td { border-bottom-color: var(--hairline-strong); }
.cert-table tfoot th, .cert-table tfoot td,
.record-page .record-sheet tfoot th, .record-page .record-sheet tfoot td {
  background: var(--surface-1); color: var(--ink-1);
  font-size: .9375rem; font-weight: 600; letter-spacing: 0; text-transform: none;
  padding: 10px 12px; border-top: 1px solid var(--hairline-strong); border-bottom: 0;
}

.cert-sign { margin: 24px 0; display: grid; gap: 2px; max-width: 26rem; }
.cert-sign p { margin: 0; }
.cert-sign-label { font-size: .8125rem; font-weight: 500; color: var(--ink-soft); }
.cert-signer {
  font-size: 1.125rem; font-weight: 600; line-height: 1.3;
  padding-bottom: 6px; border-bottom: 1px solid var(--ink-soft); overflow-wrap: anywhere;
}
.cert-sign-date { padding-top: 4px; font-size: .875rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* "Supporting record only" keeps the warning look (msg msg-warn); the prototype note is grey. */
.records-page .notice { font-size: .9375rem; font-weight: 400; }
.cert .notice, .cert-proto { margin: 0 0 12px; padding: 10px 14px; border-radius: var(--r-md); }
.cert-proto {
  background: var(--surface-sunk); border: 1px solid var(--hairline);
  font-size: .9375rem; color: var(--ink-1);
}
.cert > p:last-child { margin: 0; }

@media (max-width: 560px) {
  .verify-page .cert { padding: 16px; }
  .verify-page .cert-title { font-size: 1.25rem; }
  .verify-page .cert-kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .verify-page .cert-kv dd { margin-bottom: 10px; }
}

/* =====================================================================
   record.html: signed record (on screen: a white sheet in the page column)
   ===================================================================== */
.record-main > * { max-width: 800px; }
.record-page .record-tip { margin: 0 0 12px; }

@media screen {
  .record-page .record-sheet {
    margin: 0; padding: 40px 48px;
    background: #fff; color: var(--ink-1);
    border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: none;
  }
  .record-page .record-head { border-bottom: 1px solid var(--hairline-strong); }
}
@media screen and (max-width: 640px) {
  .record-page .record-sheet { padding: 20px 16px; }
}
@media screen and (max-width: 400px) {
  .record-page .record-sheet { padding-inline: 12px; }
}

.record-page .record-sheet > .chip-demo { margin: 0 0 16px; }
.record-page .record-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start;
  gap: 12px 32px; padding-bottom: 16px; margin-bottom: 20px;
}
.record-page .record-head > div:first-child { flex: 1 1 18rem; min-width: 0; }
.record-page .record-head p { margin: 0; }
.record-page .record-sheet .eyebrow { margin: 0 0 4px; }
.record-page .record-sheet h1 { font-size: 1.5rem; font-weight: 600; line-height: 1.25; letter-spacing: 0; margin: 0; }
.record-page .record-meta { flex: none; color: var(--ink-soft); line-height: 1.6; }
.record-page .record-meta strong { color: var(--ink-1); font-weight: 600; letter-spacing: .08em; }

.record-page .record-sheet .kv { gap: 8px 24px; align-items: baseline; }
.record-page .record-sheet .kv dt { font-size: .8125rem; font-weight: 500; color: var(--ink-soft); }
.record-page .record-sheet .kv dd { font-size: 1rem; min-width: 0; }
.record-page .record-sheet h2 { font-size: 1rem; font-weight: 600; letter-spacing: 0; margin: 24px 0 8px; }
.record-page .record-sheet .record-total { font-weight: 600; letter-spacing: 0; }
.record-page .record-sheet .table-wrap + .small { margin: 8px 0 0; }
.record-page .sign-block { margin-top: 24px; gap: 16px 24px; }
.record-page .sign-block p { margin: 0 0 8px; }
.record-page .sign-block .small { margin: 4px 0 0; color: var(--ink-2); }
.record-page .sign-line { border-bottom: 1px solid var(--ink-soft); }
.record-page .record-sheet .notice { margin: 20px 0 0; padding: 10px 14px; border-radius: var(--r-md); }

/* Times and totals never break inside a value; on a phone the date column wraps instead. */
.record-page .record-sheet td:not(:first-child), .record-page .record-total span { white-space: nowrap; }

@media (max-width: 640px) {
  .record-page .record-sheet .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .record-page .record-sheet .kv dd { margin-bottom: 10px; }
  .record-page .record-sheet table { font-size: .8125rem; }
  .record-page .record-sheet th, .record-page .record-sheet td { padding-inline: 4px; }
  .record-page .record-sheet th:first-child, .record-page .record-sheet td:first-child {
    min-width: 5.25rem; overflow-wrap: normal; padding-left: 8px;
  }
  .record-page .record-sheet td:last-child, .record-page .record-sheet th:last-child { padding-right: 8px; }
  .record-page .record-sheet td.record-total { white-space: normal; }
  .record-page .record-sheet tfoot th, .record-page .record-sheet tfoot td { font-size: inherit; padding: 8px 4px 8px 8px; }
  .record-page .record-sheet tfoot td { padding: 8px 8px 8px 4px; }
  .record-page .sign-block { grid-template-columns: minmax(0, 1fr); }
}

/* =====================================================================
   badges.html: badge cards (print block below: 74 mm cards, dashed cut
   lines, 2 columns, page break every 6, so 6 per Letter or A4 page)
   ===================================================================== */
.badges-page .badges-controls { align-items: flex-end; gap: 12px 24px; }
.badges-page .badges-controls .field { margin: 0; min-width: 14rem; }
.badges-page .badges-controls .switch { min-height: 40px; }
.badges-page .badges-warning { margin: 0 0 24px; }
.badges-page #badge-msg { margin: 0 0 16px; }

.badges-page .badge-card { border-radius: var(--r-md); gap: 4px; }
@media screen {
  .badges-page .badge-sheet { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
  .badges-page .badge-card {
    padding: 20px 16px 16px; background: #fff; color: var(--ink-1);
    border: 1px dashed var(--hairline-strong);
  }
  .badges-page .badge-card .bc-org { margin-bottom: 8px; }
  .badges-page .badge-card .bc-name { margin-top: 8px; }
  .badges-page .badge-card .bc-demo { margin-top: 6px; }
}
.badges-page .badge-card .bc-org {
  font-size: .75rem; font-weight: 500; line-height: 1.4; letter-spacing: 0; text-transform: none;
  color: var(--ink-soft);
}
.badges-page .badge-card .bc-name { font-size: 1rem; font-weight: 600; line-height: 1.3; letter-spacing: 0; }
.badges-page .badge-card .bc-code { font-family: var(--font-mono); font-size: 1.125rem; font-weight: 500; letter-spacing: .08em; }
.badges-page .badge-card .bc-school { color: var(--ink-soft); }
.badges-page .badge-card .bc-demo {
  padding: 1px 6px;
  font-size: .75rem; font-weight: 500; line-height: 1.4; letter-spacing: 0;
  color: var(--notice-ink); background: var(--notice-bg);
  border: 1px solid var(--notice-line); border-radius: var(--r-sm);
}

/* =====================================================================
   Print
   ===================================================================== */
@media print {
  .records-page { background: #fff !important; color: #000; }
  /* Keep the printed DEMO marking: white with a black border on all four sides. */
  .records-page .demo-banner { background: #fff !important; color: #000 !important; border: 2px solid #000 !important; margin-bottom: 8pt; }
  .records-page .demo-banner strong { background: #fff !important; color: #000 !important; }
  .records-page .chip-demo { background: #fff !important; color: #000 !important; border: 1px solid #000 !important; }
  .records-page .notice { background: #fff; color: #000; border: 1px solid #000; border-radius: 0; }

  /* Verify */
  .has-record .verify-lookup { display: none !important; }
  .verify-main { display: block; }
  .verify-aside { display: none !important; }
  .verify-main > * { max-width: none; }
  .verify-page .cert { border: 0; padding: 0; box-shadow: none; }
  .verify-page .cert::before, .verify-page .cert-seal { display: none; }
  .cert-num { color: #000; }
  .verify-page .verified-stamp { background: #fff; color: #000; border-color: #000; }
  .cert-table tfoot th, .cert-table tfoot td { background: #fff !important; }
  .cert-proto { background: #fff; border: 1px solid #000; border-radius: 0; color: #000; }

  /* Signed record: plain black on white, no outer frame, compact enough for one page. */
  .record-main > * { max-width: none; }
  .record-page .record-sheet { border: 0; border-radius: 0; padding: 0; max-width: none; box-shadow: none; }
  .record-page .record-sheet, .record-page .record-sheet .muted, .record-page .record-sheet .eyebrow { color: #000; }
  .record-page .record-head { border-bottom: 2px solid #000; padding-bottom: 6pt; margin-bottom: 8pt; }
  .record-page .record-sheet h1 { font-size: 17pt; }
  .record-page .record-sheet h2 { margin: 10pt 0 4pt; font-size: 12pt; }
  .record-page .record-sheet .table-wrap { border: 1px solid #000; border-radius: 0; box-shadow: none; overflow: visible; }
  .record-page .record-sheet th, .record-page .record-sheet td { padding: 4pt 6pt; border-color: #999; color: #000; }
  .record-page .record-sheet tfoot th, .record-page .record-sheet tfoot td { background: #fff !important; border-top: 2px solid #000; padding: 4pt 6pt; }
  .record-page .sign-block { margin-top: 10pt; break-inside: avoid; }
  .record-page .sign-line { border-bottom-color: #000; }
  .record-page .record-sheet .notice { border-radius: 0; border-width: 1px; margin-top: 8pt; break-inside: avoid; }

  /* Badge sheet: dashed cut lines, demo label black on white. */
  .badge-card { border: 1px dashed #555; }
  .badges-page .badge-sheet { grid-template-columns: 1fr 1fr; gap: 3mm 6mm; }
  .badges-page .badge-card { height: 74mm; padding: 3mm; }
  .badges-page .badge-card .qr { width: 36mm; height: 36mm; }
  .badges-page .badge-card .bc-org { color: #000; }
  .badges-page .badge-card .bc-demo { background: #fff; color: #000; border: 1px solid #000; }
}
