/* ABCL TECH — certificate sheet (js/cert-sheet.js), used by certificate.html and admin.html#certificate. */
/* certificate demo (A4 landscape proportions) */
.ap-cert-tools { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; align-items: flex-end; }
.ap-cert-tools h2 { display: flex; align-items: center; gap: .5rem; margin: 0 0 .3rem; font-size: 1.1rem; }
.ap-cert-tools p { margin: 0; max-width: 60ch; }
.ap-cert-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.ap-cert-form label { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.ap-cert-form input, .ap-cert-form select { min-width: 200px; max-width: 100%; padding: .45rem .6rem; border-radius: 8px; border: 1px solid var(--line-2, var(--line)); background: var(--surface); color: var(--ink); font: 500 .92rem 'Anek Bangla', 'Roboto', sans-serif; }
/* certificate demo — formal A4 landscape: guilloché security border, gold foil, rosette seal, QR */
/* certificate demo — technology style, A4 landscape: circuit border + corners with moving data pulses,
   dot-grid paper, scanning light, hexagon "verified" badge, QR with HUD brackets */
/* certificate demo — corporate "gold standard", A4 landscape: white sheet, deep-green + gold corner
   geometry, serif title in gold foil, gold rosette seal. Effects stay subtle: slow foil shimmer,
   a light sweep over the seal, a gentle tilt on hover. Printing goes through ABCL_CERT.print()
   (js/cert-sheet.js), which copies the sheet into a clean document. */
.ap-cert-wrap { overflow-x: auto; padding: .6rem 0 1.4rem; perspective: 1800px; }
.ap-cert-wrap.is-fluid .ap-cert { min-width: 0; }      /* public page: the whole sheet scales down on phones */
.ap-cert { --deep: #0d2b1c; --brand: #1f6e2b; --gold-1: #8a6510; --gold-2: #d9b44a; --gold-3: #f7e7a1; --ink-c: #14211a; --muted-c: #5d6a63; --rx: 0deg; --ry: 0deg;
  container-type: inline-size; position: relative; width: 100%; min-width: 760px; max-width: 1120px; margin: 0 auto; aspect-ratio: 297 / 210; background: #fff;
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .3s ease-out;
  box-shadow: 0 1px 2px rgba(13,43,28,.06), 0 14px 34px rgba(13,43,28,.14), 0 36px 70px -30px rgba(13,43,28,.3);
  animation: ac-in .7s cubic-bezier(.2,.8,.2,1) both; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
@keyframes ac-in { from { opacity: 0; transform: translateY(14px); } }
.cs-defs { position: absolute; }

/* sheet with a double frame: deep green rule + gold hairline */
.cs-sheet { position: absolute; inset: 0; overflow: hidden; box-sizing: border-box; padding: 4.6cqw 11cqw 4.8cqw; display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--ink-c);
  background: radial-gradient(ellipse at 50% 40%, #ffffff 40%, #fbf8ef 100%); }
.cs-sheet::before { content: ''; position: absolute; inset: 1.4cqw; border: .32cqw solid var(--deep); pointer-events: none; z-index: 1; }
.cs-sheet::after { content: ''; position: absolute; inset: 2.1cqw; border: .1cqw solid var(--gold-2); pointer-events: none; z-index: 1; }
/* body ornament: gold corner brackets, guilloché wave bands, fine-line rosette behind the name */
.cs-orn { position: absolute; width: 9cqw; height: 9cqw; z-index: 2; fill: none; stroke: url(#acGold); stroke-width: 1.7; stroke-linecap: round; }
.cs-orn rect, .cs-orn circle { fill: url(#acGold); stroke: none; }
.cs-orn.tl { top: 2.8cqw; left: 2.8cqw; }
.cs-orn.tr { top: 2.8cqw; right: 2.8cqw; transform: scaleX(-1); }
.cs-orn.bl { bottom: 2.8cqw; left: 2.8cqw; transform: scaleY(-1); }
.cs-orn.br { bottom: 2.8cqw; right: 2.8cqw; transform: scale(-1); }
.cs-band { position: absolute; left: 14cqw; right: 14cqw; height: 1.5cqw; width: auto; z-index: 0; fill: none; stroke-width: .8; vector-effect: non-scaling-stroke; }
.cs-band path { vector-effect: non-scaling-stroke; }
.cs-band path:nth-child(odd) { stroke: #c99a2e; stroke-opacity: .45; }
.cs-band path:nth-child(even) { stroke: #1f6e2b; stroke-opacity: .28; }
.cs-band.top { top: 2.5cqw; }
.cs-band.bottom { bottom: 2.5cqw; }
.cs-rosette-bg { position: absolute; z-index: 0; left: 50%; top: 52%; width: 44cqw; height: 44cqw; transform: translate(-50%, -50%); fill: none; pointer-events: none; opacity: .5; }
.cs-rosette-bg .cs-ell ellipse { stroke: #d9b44a; stroke-opacity: .32; stroke-width: .6; }
.cs-rosette-bg .cs-r1 { stroke: #1f6e2b; stroke-opacity: .16; stroke-width: .6; }
.cs-rosette-bg .cs-r2 { stroke: #c99a2e; stroke-opacity: .3; stroke-width: .6; }
.cs-rosette-bg circle { stroke: #c99a2e; stroke-opacity: .35; stroke-width: .5; }
.cs-sheet > *:not(.cs-orn):not(.cs-band):not(.cs-rosette-bg):not(.cs-qr) { position: relative; z-index: 3; }

.cs-head { display: flex; flex-direction: column; align-items: center; }
.cs-logo { width: 12cqw; height: auto; }
/* gold foil title with a slow shimmer */
.cs-title { margin: 1.5cqw 0 0; font: 700 5.4cqw/1 'Playfair Display', Georgia, serif; letter-spacing: .14em; padding-left: .14em; text-transform: uppercase;
  background: linear-gradient(100deg, #7a5609 0%, #c99a2e 18%, #f7e7a1 30%, #d9b44a 42%, #8a6510 55%, #c99a2e 72%, #f7e7a1 84%, #7a5609 100%);
  background-size: 260% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: ac-foil 9s ease-in-out infinite alternate; }
@keyframes ac-foil { from { background-position: 100% 0; } to { background-position: 0 0; } }
.cs-sub { display: flex; align-items: center; gap: 1.4cqw; margin: 1cqw 0 0; font: 600 1.35cqw 'Montserrat', sans-serif; letter-spacing: .48em; padding-left: .48em; text-transform: uppercase; color: var(--deep); }
.cs-sub span { width: 6cqw; height: .1cqw; background: linear-gradient(90deg, transparent, var(--gold-2)); }
.cs-sub span:last-child { transform: scaleX(-1); }
.cs-lead { margin: 2.6cqw 0 0; font: 400 1.45cqw 'Montserrat', sans-serif; color: var(--muted-c); letter-spacing: .03em; }
.cs-name { margin: 1cqw 0 0; padding: 0 1cqw; font: 700 5.2cqw/1.25 'Playfair Display', Georgia, serif; color: var(--deep); white-space: nowrap; }
.cs-name-line { display: block; width: 44cqw; height: .14cqw; margin-top: .8cqw; background: linear-gradient(90deg, transparent, var(--gold-1) 15%, var(--gold-2) 50%, var(--gold-1) 85%, transparent); }
.cs-course { margin: 1.1cqw 0 0; font: 700 2.4cqw/1.25 'Montserrat', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.cs-meta { display: flex; align-items: center; margin: 1.8cqw 0 0; font: 500 1.05cqw 'Montserrat', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-c); }
.cs-meta b { margin-left: .6cqw; font-weight: 700; letter-spacing: .04em; text-transform: none; color: var(--ink-c); }
.cs-meta i { width: .45cqw; height: .45cqw; margin: 0 1.3cqw; transform: rotate(45deg); background: var(--gold-2); }

.cs-foot { margin-top: auto; width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; }
.cs-sign { display: flex; flex-direction: column; align-items: center; justify-self: start; min-width: 20cqw; }
.cs-sign:last-child { justify-self: end; }
.cs-sign img { height: 5.8cqw; width: auto; max-width: 19cqw; object-fit: contain; margin-bottom: -.5cqw; }
.cs-sign b { display: block; align-self: stretch; padding-top: .75cqw; border-top: .1cqw solid var(--ink-c); font: 700 1.4cqw 'Montserrat', sans-serif; color: var(--ink-c); }
.cs-sign span { margin-top: .3cqw; font: 600 .92cqw 'Montserrat', sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-1); }

/* gold rosette seal with deep-green ribbons and a light sweep */
.cs-seal { position: relative; width: 12cqw; height: 15cqw; margin-bottom: -1.4cqw; }
.cs-ribbons { position: absolute; left: 0; top: 5.9cqw; width: 12cqw; height: auto; filter: drop-shadow(0 .2cqw .25cqw rgba(0,0,0,.18)); }
.cs-rosette { position: absolute; left: 0; top: 0; width: 12cqw; height: 12cqw; filter: drop-shadow(0 .3cqw .5cqw rgba(90,62,6,.35)); }
.cs-ring-t { font: 700 5.6px 'Montserrat', sans-serif; letter-spacing: .3px; fill: #5c4108; }
.cs-seal-t { font: 800 6.4px 'Montserrat', sans-serif; letter-spacing: .5px; fill: #4a3406; }
.cs-seal-s { font: 700 4.2px 'Montserrat', sans-serif; letter-spacing: 1px; fill: #5c4108; }
.cs-sheen { position: absolute; left: 0; top: 0; width: 12cqw; height: 12cqw; border-radius: 50%; overflow: hidden; pointer-events: none; }
.cs-sheen::after { content: ''; position: absolute; top: -20%; left: -70%; width: 40%; height: 140%; transform: rotate(25deg); background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation: ac-sweep 5s ease-in-out infinite; }
@keyframes ac-sweep { 0%, 60% { left: -70%; } 90%, 100% { left: 140%; } }

.cs-qr { position: absolute; z-index: 3; top: 4.4cqw; right: 5cqw; display: flex; flex-direction: column; align-items: center; gap: .45cqw; }
.cs-qr-code { width: 7cqw; height: 7cqw; padding: .4cqw; background: #fff; border: .1cqw solid var(--gold-2); }
.cs-qr-code svg { display: block; width: 100%; height: 100%; }
.cs-qr span { font: 600 .72cqw 'Montserrat', sans-serif; letter-spacing: .18em; text-transform: uppercase; color: var(--muted-c); }

@media (prefers-reduced-motion: reduce) { .ap-cert, .cs-title, .cs-sheen::after { animation: none; } .ap-cert { transition: none; } }
/* centre the name block between the heading and the signatures */
.cs-sheet .cs-head + .cs-lead { margin-top: auto; }
.cs-sheet .cs-meta { margin-bottom: auto; }
.cs-sheet .cs-foot { margin-top: 0; }
