/*
  AFRINDT public certificate verification page (/verify/).
  Design tokens, base styles, buttons, header and footer are copied from
  index.html so this page looks like part of the same site. If the landing
  page's look changes, update the matching rules here too.
*/
:root {
  --navy-ink: #10233f;
  --navy-mid: #16305e;
  --navy-deep: #08101f;
  --gold: #c79a4b;
  --gold-bright: #e2bd7a;
  --gold-dim: #8a6a34;
  --steel: #5b6472;
  --paper: #f6f4ef;
  --white: #ffffff;
  --ink: #14181d;
  --ink-muted: #5b6472;
  --line: #dfe0d9;

  --font-display: 'Archivo', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;
  --space-7: 96px;

  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 14px; /* new for this page: cards and the search panel */
  --radius-pill: 999px;

  --container: 1240px;

  /* Motion tokens (same transitions.dev scale as the landing page) */
  --duration-quick: 150ms;
  --duration-fast: 250ms;
  --duration-very-slow: 500ms;
  --ease-smooth-out: cubic-bezier(0.22, 1, 0.36, 1);
  --stagger-dur: 500ms;
  --stagger-distance: 12px;

  /*
    Certificate status colours. Each text colour has at least 4.5:1
    contrast on its own background so the pills stay readable.
  */
  --status-valid: #1d7a4c;
  --status-valid-bg: #e5f3eb;
  --status-expiring: #8a5a00;
  --status-expiring-bg: #fbefd5;
  --status-expired: #5b6472;
  --status-expired-bg: #eceee9;
  --status-invalid: #a32a2a;
  --status-invalid-bg: #fae8e6;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* Hides text visually but keeps it available to screen readers. */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}
@media (min-width: 720px) {
  .wrap { padding-left: var(--space-5); padding-right: var(--space-5); }
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--navy-ink);
  margin: 0;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
p { margin: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--gold-dim);
}
.eyebrow::before {
  content: '';
  width: 22px;
  height: 2px;
  background: var(--gold);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-smooth-out),
              color var(--duration-fast) var(--ease-smooth-out),
              border-color var(--duration-fast) var(--ease-smooth-out),
              transform var(--duration-fast) var(--ease-smooth-out),
              box-shadow var(--duration-fast) var(--ease-smooth-out);
}
.btn:active { transform: translateY(1px) scale(0.98); transition-duration: var(--duration-quick); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: var(--navy-deep);
}
.btn-primary:hover { background: var(--gold-bright); transform: translateY(-1px); box-shadow: 0 8px 20px -8px rgba(199,154,75,0.55); }

.btn-ghost-dark {
  background: transparent;
  color: var(--navy-ink);
  border-color: var(--line);
}
.btn-ghost-dark:hover { border-color: var(--navy-ink); background: var(--paper); }

.btn-small { padding: 9px 18px; font-size: 14px; }

/* ---------- Header (copied from index.html, plus an active-page state) ---------- */
header.site {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
  gap: var(--space-3);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand img { height: 38px; width: auto; }

.nav-right { display: flex; align-items: center; gap: var(--space-5); }

nav.primary-nav { display: none; gap: var(--space-4); font-size: 14.5px; font-weight: 500; }
nav.primary-nav a {
  position: relative;
  text-decoration: none;
  color: var(--ink);
  padding: 6px 0;
  transition: color var(--duration-fast) var(--ease-smooth-out);
}
nav.primary-nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 1.5px;
  background: var(--gold);
  transition: right var(--duration-fast) var(--ease-smooth-out);
}
nav.primary-nav a:hover { color: var(--navy-ink); }
nav.primary-nav a:hover::after,
nav.primary-nav a[aria-current="page"]::after { right: 0; }
nav.primary-nav a[aria-current="page"] { color: var(--navy-ink); font-weight: 600; }

.nav-actions { display: flex; align-items: center; gap: var(--space-3); }
.nav-cta { display: none; padding: 10px 20px; font-size: 14px; }
@media (min-width: 900px) { .nav-cta { display: inline-flex; } }

.nav-toggle {
  display: inline-flex;
  background: none;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-smooth-out);
}
.nav-toggle:hover { border-color: var(--navy-ink); }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ''; display: block; width: 18px; height: 2px; background: var(--navy-ink); position: relative;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

@media (min-width: 900px) {
  nav.primary-nav { display: flex; }
  .nav-toggle { display: none; }
}

#mobile-nav { display: none; flex-direction: column; padding: var(--space-2) 0 var(--space-3); border-top: 1px solid var(--line); }
#mobile-nav.open { display: flex; }
#mobile-nav a { padding: 12px 0; text-decoration: none; color: var(--ink); font-weight: 500; border-bottom: 1px solid var(--line); transition: padding-left var(--duration-fast) var(--ease-smooth-out); }
#mobile-nav a:hover { padding-left: 6px; color: var(--navy-ink); }
#mobile-nav a[aria-current="page"] { color: var(--navy-ink); font-weight: 600; }
@media (min-width: 900px) { #mobile-nav { display: none !important; } }

/* ---------- Verify hero: dark band holding the search panel ---------- */
.verify-hero {
  position: relative;
  background:
    linear-gradient(100deg, rgba(8,16,31,0.97) 0%, rgba(8,16,31,0.92) 45%, rgba(8,16,31,0.74) 100%),
    url("../assets/img/hero-welding.jpg") center 40% / cover no-repeat;
  color: var(--white);
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}
.verify-hero-inner { max-width: 820px; }
.verify-hero .eyebrow { color: var(--gold-bright); margin-bottom: var(--space-2); }
.verify-hero h1 {
  color: var(--white);
  font-weight: 800;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.02em;
}
.verify-hero-sub {
  margin-top: var(--space-2);
  max-width: 56ch;
  font-size: 17px;
  line-height: 1.6;
  color: rgba(255,255,255,0.8);
}

/* ---------- Search panel ---------- */
.search-panel {
  margin-top: var(--space-4);
  background: var(--white);
  color: var(--ink);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.6);
}
@media (min-width: 720px) { .search-panel { padding: var(--space-4); } }

/* Segmented control: three radio buttons styled as one pill with a sliding highlight. */
.search-modes {
  position: relative;
  display: flex;
  width: 100%;
  padding: 4px;
  margin: 0 0 var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--paper);
  min-width: 0;
}
@media (min-width: 640px) { .search-modes { display: inline-flex; width: auto; } }
.search-mode-option { position: relative; z-index: 1; flex: 1; }
.search-mode-option input { position: absolute; opacity: 0; pointer-events: none; }
.search-mode-option label {
  display: block;
  text-align: center;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--steel);
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--duration-fast) var(--ease-smooth-out);
}
@media (min-width: 640px) { .search-mode-option label { padding: 8px 18px; } }
/* Narrow phones: smaller text and padding so all three options fit on one line. */
@media (max-width: 479px) {
  .search-panel { padding: 18px; }
  .search-mode-option label { font-size: 13px; padding: 8px 4px; }
}
.search-mode-option label:hover { color: var(--navy-ink); }
.search-mode-option input:checked + label { color: var(--white); }
.search-mode-option input:focus-visible + label { outline: 2px solid var(--gold); outline-offset: 2px; }
.search-mode-highlight {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  background: var(--navy-ink);
  border-radius: var(--radius-pill);
  z-index: 0;
  transition: transform var(--duration-fast) var(--ease-smooth-out), width var(--duration-fast) var(--ease-smooth-out);
}

.search-field-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--navy-ink);
  margin-bottom: var(--space-1);
}
.search-row { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 640px) { .search-row { flex-direction: row; } }

.search-input-wrap { position: relative; flex: 1; }
.search-input-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  color: var(--steel);
  pointer-events: none;
}
.search-input {
  width: 100%;
  height: 56px;
  padding: 0 48px 0 50px;
  font: 500 17px var(--font-body);
  letter-spacing: 0.01em;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  transition: border-color var(--duration-fast) var(--ease-smooth-out), box-shadow var(--duration-fast) var(--ease-smooth-out);
}
.search-input::placeholder { color: #9aa0a8; font-weight: 400; }
.search-input:hover { border-color: #c4c6bd; }
.search-input:focus { outline: none; border-color: var(--navy-ink); box-shadow: 0 0 0 4px rgba(199,154,75,0.28); }
.search-input[aria-invalid="true"] { border-color: var(--status-invalid); }
.search-input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px rgba(163,42,42,0.16); }

/* Small shake when the search is rejected, so the error is noticed. */
.search-input-wrap.is-shaking { animation: input-shake 360ms var(--ease-smooth-out); }
@keyframes input-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--steel);
  cursor: pointer;
  opacity: 1;
  transition: background-color var(--duration-fast) var(--ease-smooth-out), opacity var(--duration-fast) var(--ease-smooth-out);
}
.search-clear:hover { background: var(--paper); color: var(--navy-ink); }
.search-clear[hidden] { display: flex; opacity: 0; pointer-events: none; }
.search-clear svg { width: 16px; height: 16px; }

.search-submit { height: 56px; justify-content: center; padding: 0 30px; font-size: 16px; flex-shrink: 0; }
.search-submit svg { width: 18px; height: 18px; }
.search-submit .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(8,16,31,0.25);
  border-top-color: var(--navy-deep);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
.search-submit.is-loading { pointer-events: none; }
.search-submit.is-loading .spinner { display: inline-block; }
.search-submit.is-loading .submit-arrow { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.search-hint { margin-top: 10px; font-size: 13.5px; color: var(--steel); }
.search-error {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--status-invalid);
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.search-error[hidden] { display: none; }
.search-error svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }

/* Three reassurance points under the search panel. */
.trust-row {
  margin-top: var(--space-3);
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  font-size: 14px;
  color: rgba(255,255,255,0.75);
}
@media (min-width: 720px) { .trust-row { grid-template-columns: repeat(3, auto); justify-content: start; gap: var(--space-4); } }
.trust-item { display: flex; align-items: center; gap: 10px; }
.trust-item svg { width: 18px; height: 18px; color: var(--gold-bright); flex-shrink: 0; }

/* ---------- Results area ---------- */
.results-band {
  background: var(--paper);
  padding-top: var(--space-6);
  padding-bottom: var(--space-7);
  min-height: 460px;
  scroll-margin-top: 72px; /* keeps the sticky header from covering the results when scrolled to */
}
.results { max-width: 880px; }
.results:focus { outline: none; }

/* Each block of a result fades up in turn when it appears. */
.result-stack { display: flex; flex-direction: column; gap: var(--space-3); }
.result-stack > * { animation: result-in var(--stagger-dur) var(--ease-smooth-out) both; }
.result-stack > *:nth-child(2) { animation-delay: 60ms; }
.result-stack > *:nth-child(3) { animation-delay: 120ms; }
.result-stack > *:nth-child(4) { animation-delay: 180ms; }
.result-stack > *:nth-child(5) { animation-delay: 240ms; }
@keyframes result-in {
  from { opacity: 0; transform: translateY(var(--stagger-distance)); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Guide shown before the first search ---------- */
.guide-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  align-items: center;
}
@media (min-width: 820px) { .guide-card { grid-template-columns: 300px 1fr; } }

.guide-diagram { display: flex; justify-content: center; }
.mini-cert {
  position: relative;
  width: 280px;
  aspect-ratio: 1 / 1.2;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 22px 22px 18px;
  box-shadow: 0 24px 40px -28px rgba(8,16,31,0.45);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.mini-cert::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(199,154,75,0.45);
  border-radius: 3px;
  pointer-events: none;
}
.mini-cert-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.mini-logo { width: 54px; height: 16px; border-radius: 3px; background: linear-gradient(90deg, var(--navy-ink) 0 30%, var(--gold) 30% 100%); opacity: 0.85; }
.mini-line { height: 6px; border-radius: 3px; background: var(--line); }
.mini-line.w40 { width: 40%; }
.mini-line.w60 { width: 60%; }
.mini-line.w70 { width: 70%; }
.mini-line.w85 { width: 85%; }
.mini-name { font-family: var(--font-display); font-weight: 800; font-size: 17px; color: var(--navy-ink); margin-top: 4px; }
.mini-method { font-size: 11.5px; font-weight: 600; color: var(--gold-dim); margin-top: 6px; }
.mini-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--navy-ink);
  background: rgba(226,189,122,0.28);
  border: 1px dashed var(--gold);
  border-radius: var(--radius-pill);
  padding: 2px 8px 2px 3px;
  align-self: flex-start;
}
.mini-tag-number,
.guide-number {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-ink);
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
.mini-bottom { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; }
.mini-signature { width: 90px; border-top: 1px solid var(--steel); padding-top: 4px; font-size: 9px; color: var(--steel); }
.mini-qr-wrap { position: relative; display: block; }
.mini-qr {
  display: block;
  width: 58px;
  height: 58px;
  /* A checker pattern plus three corner squares: reads as "QR code" at a glance. */
  background:
    linear-gradient(var(--navy-ink), var(--navy-ink)) 0 0 / 16px 16px no-repeat,
    linear-gradient(var(--navy-ink), var(--navy-ink)) 100% 0 / 16px 16px no-repeat,
    linear-gradient(var(--navy-ink), var(--navy-ink)) 0 100% / 16px 16px no-repeat,
    repeating-conic-gradient(var(--navy-ink) 0 25%, var(--white) 0 50%) 0 0 / 8px 8px;
  border: 3px solid var(--white);
  outline: 1px solid var(--line);
}
.mini-qr-wrap .mini-tag-number { position: absolute; top: -8px; left: -8px; }

.guide-copy h2 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 800; margin-top: var(--space-2); }
.guide-steps { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.guide-steps li { display: flex; gap: 14px; align-items: flex-start; }
.guide-number { width: 26px; height: 26px; font-size: 13px; margin-top: 1px; }
.guide-steps strong { display: block; font-family: var(--font-display); font-size: 16.5px; color: var(--navy-ink); }
.guide-steps p { font-size: 15px; color: var(--ink-muted); line-height: 1.55; }
.guide-note { margin-top: var(--space-3); font-size: 14.5px; color: var(--ink-muted); }
.guide-note button {
  background: none; border: none; padding: 0; font: inherit; font-weight: 600;
  color: var(--navy-ink); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; cursor: pointer;
}

/* ---------- Verdict banner (certificate number search and QR scans) ---------- */
.verdict {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-3);
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
}
.verdict-valid { background: var(--status-valid-bg); border-color: rgba(29,122,76,0.22); }
.verdict-expiring { background: var(--status-expiring-bg); border-color: rgba(138,90,0,0.22); }
.verdict-expired { background: var(--status-expired-bg); border-color: rgba(91,100,114,0.22); }
.verdict-invalid { background: var(--status-invalid-bg); border-color: rgba(163,42,42,0.22); }
.verdict-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--white);
}
.verdict-valid .verdict-icon { background: var(--status-valid); }
.verdict-expiring .verdict-icon { background: var(--status-expiring); }
.verdict-expired .verdict-icon { background: var(--status-expired); }
.verdict-invalid .verdict-icon { background: var(--status-invalid); }
.verdict-icon svg { width: 26px; height: 26px; }
/* The tick or cross draws itself once, a small confirmation that the check ran. */
.verdict-icon path {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: draw-mark 420ms 220ms var(--ease-smooth-out) forwards;
}
@keyframes draw-mark { to { stroke-dashoffset: 0; } }
.verdict-eyebrow { font-size: 13px; font-weight: 600; color: var(--ink-muted); display: flex; align-items: center; gap: 6px; }
.verdict-eyebrow svg { width: 15px; height: 15px; }
.verdict-title { font-size: clamp(22px, 3vw, 28px); font-weight: 800; margin-top: 4px; }
.verdict-valid .verdict-title { color: var(--status-valid); }
.verdict-expiring .verdict-title { color: var(--status-expiring); }
.verdict-expired .verdict-title { color: var(--status-expired); }
.verdict-invalid .verdict-title { color: var(--status-invalid); }
.verdict-text { margin-top: 6px; font-size: 15.5px; color: var(--ink); max-width: 60ch; }

/* ---------- Certificate holder card ---------- */
.holder-card {
  position: relative;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-3) var(--space-3) calc(var(--space-3) + 4px);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
@media (min-width: 640px) {
  .holder-card { flex-direction: row; justify-content: space-between; align-items: center; padding: var(--space-4) var(--space-4) var(--space-4) calc(var(--space-4) + 4px); }
}
.holder-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--gold); }
.holder-label { font-size: 13px; font-weight: 600; color: var(--gold-dim); letter-spacing: 0.03em; }
.holder-name { font-size: clamp(26px, 3.6vw, 34px); font-weight: 800; margin-top: 4px; }
.holder-number { margin-top: 6px; font-size: 15px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.holder-number strong { color: var(--ink); font-weight: 600; }
.holder-summary { display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 640px) { .holder-summary { justify-content: flex-end; max-width: 280px; } }

/* ---------- Certificate groups and cards ---------- */
.cert-group { display: flex; flex-direction: column; gap: 12px; }
.cert-group-title {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--steel);
}

.cert-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--radius-md);
  transition: box-shadow var(--duration-fast) var(--ease-smooth-out), border-color var(--duration-fast) var(--ease-smooth-out);
}
.cert-card:hover { box-shadow: 0 14px 28px -22px rgba(8,16,31,0.4); }
.cert-card.status-valid { border-left-color: var(--status-valid); }
.cert-card.status-expiring { border-left-color: var(--gold); }
.cert-card.status-expired { border-left-color: #b9bdb4; }
.cert-card.status-suspended,
.cert-card.status-withdrawn { border-left-color: var(--status-invalid); }
.cert-card.is-highlighted { box-shadow: 0 0 0 3px rgba(199,154,75,0.35); }

.cert-heading { margin: 0; font-size: inherit; }
.cert-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "badge title chevron"
    "badge status chevron";
  column-gap: var(--space-2);
  row-gap: 6px;
  align-items: center;
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-2);
  background: none;
  border: none;
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  color: inherit;
}
@media (min-width: 640px) {
  .cert-toggle {
    grid-template-columns: auto 1fr auto auto;
    grid-template-areas: "badge title status chevron";
    padding: 18px var(--space-3) 18px 18px;
  }
}
.cert-toggle .method-badge { grid-area: badge; }
.cert-title-group { grid-area: title; min-width: 0; }
.cert-toggle .status-pill { grid-area: status; justify-self: start; }
@media (min-width: 640px) { .cert-toggle .status-pill { justify-self: end; } }
.cert-chevron { grid-area: chevron; width: 20px; height: 20px; color: var(--steel); transition: transform var(--duration-fast) var(--ease-smooth-out); }
.cert-card.is-open .cert-chevron { transform: rotate(180deg); }

.cert-title { display: block; font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--navy-ink); line-height: 1.2; }
.cert-subtitle { display: block; margin-top: 3px; font-size: 14px; color: var(--ink-muted); }

.method-badge {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, var(--navy-mid), var(--navy-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.method-badge svg { width: 22px; height: 22px; color: var(--gold-bright); stroke-width: 1.8; }

/* Expand and collapse by animating the grid row from 0 to its natural height. */
.cert-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--duration-fast) var(--ease-smooth-out);
}
.cert-card.is-open .cert-body { grid-template-rows: 1fr; }
.cert-body-inner {
  overflow: hidden;
  visibility: hidden;
  /* Hide the closed panel from keyboard and screen readers only after the closing animation ends. */
  transition: visibility 0s linear var(--duration-fast);
}
.cert-card.is-open .cert-body-inner { visibility: visible; transition-delay: 0s; }
.cert-body-content {
  border-top: 1px solid var(--line);
  margin: 0 var(--space-3);
  padding: var(--space-3) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cert-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2) var(--space-3);
  margin: 0;
}
@media (min-width: 640px) { .cert-details { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cert-details dt, .detail-label { font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--steel); }
.cert-details dd { margin: 2px 0 0; font-size: 15.5px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.scope-chips { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.scope-chips li {
  font-size: 14px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--navy-ink);
}

.validity-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.validity-remaining { font-size: 14px; font-weight: 600; color: var(--ink); }
.validity-track { margin-top: 8px; height: 6px; border-radius: var(--radius-pill); background: var(--line); overflow: hidden; }
.validity-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-bright), var(--gold)); }
.status-expiring .validity-fill { background: var(--status-expiring); }
.status-expired .validity-fill { background: #b9bdb4; }
.status-suspended .validity-fill,
.status-withdrawn .validity-fill { background: repeating-linear-gradient(45deg, var(--status-invalid) 0 6px, #c95c5c 6px 12px); }
.validity-dates { margin-top: 6px; display: flex; justify-content: space-between; font-size: 12.5px; color: var(--steel); }

.cert-notice {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  line-height: 1.5;
}
.cert-notice svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.cert-notice-invalid { background: var(--status-invalid-bg); color: var(--status-invalid); }
.cert-notice-expiring { background: var(--status-expiring-bg); color: var(--status-expiring); }
.cert-notice-expired { background: var(--status-expired-bg); color: var(--ink); }

.cert-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy-ink);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 3px;
}
.text-button svg { width: 16px; height: 16px; }

/* ---------- Status pills ---------- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.status-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pill.status-valid { color: var(--status-valid); background: var(--status-valid-bg); }
.status-pill.status-expiring { color: var(--status-expiring); background: var(--status-expiring-bg); }
.status-pill.status-expired { color: var(--status-expired); background: var(--status-expired-bg); }
.status-pill.status-suspended,
.status-pill.status-withdrawn { color: var(--status-invalid); background: var(--status-invalid-bg); }

/* ---------- Choosing between people with the same surname ---------- */
.result-intro h2 { font-size: clamp(24px, 3.2vw, 30px); font-weight: 800; }
.result-intro p { margin-top: 8px; color: var(--ink-muted); max-width: 62ch; }
.choice-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.choice-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 18px var(--space-3);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  color: inherit;
  transition: border-color var(--duration-fast) var(--ease-smooth-out), box-shadow var(--duration-fast) var(--ease-smooth-out), transform var(--duration-fast) var(--ease-smooth-out);
}
.choice-item:hover { border-color: var(--navy-ink); transform: translateY(-1px); box-shadow: 0 14px 28px -22px rgba(8,16,31,0.4); }
.choice-initials {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper); border: 1px solid var(--line);
  font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--navy-ink);
  flex-shrink: 0;
}
.choice-text { flex: 1; min-width: 0; }
.choice-name { display: block; font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--navy-ink); }
.choice-meta { display: block; font-size: 14px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.choice-item > svg { width: 20px; height: 20px; color: var(--steel); flex-shrink: 0; }

/* ---------- Message cards: not found, too many searches ---------- */
.message-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}
.message-icon {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper); color: var(--navy-ink);
}
.message-icon svg { width: 24px; height: 24px; }
.message-card h2 { font-size: clamp(24px, 3.2vw, 30px); font-weight: 800; }
.message-card p { color: var(--ink-muted); max-width: 60ch; }
.message-card strong { color: var(--ink); overflow-wrap: anywhere; }
.message-card ul { margin: 0; padding-left: 20px; color: var(--ink-muted); font-size: 15px; }
.message-card ul li + li { margin-top: 4px; }
.message-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--space-1); }

/* ---------- Footer of a result ---------- */
.results-footer {
  border-top: 1px solid var(--line);
  padding-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
@media (min-width: 720px) { .results-footer { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; } }
.checked-at { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); }
.checked-at svg { width: 18px; height: 18px; color: var(--status-valid); flex-shrink: 0; }
.results-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.privacy-note { flex-basis: 100%; font-size: 13px; color: var(--steel); }

/* ---------- Footer (copied from index.html) ---------- */
footer.site { background: var(--white); border-top: 1px solid var(--line); padding-top: var(--space-6); padding-bottom: var(--space-5); }
.footer-top { display: flex; flex-direction: column; gap: var(--space-4); padding-bottom: var(--space-5); border-bottom: 1px solid var(--line); }
@media (min-width: 760px) { .footer-top { flex-direction: row; justify-content: space-between; align-items: flex-start; } }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand img { height: 34px; }
.footer-tagline { font-size: 13.5px; color: var(--steel); margin-top: 8px; letter-spacing: 0.02em; }
.footer-nav { display: flex; flex-wrap: wrap; gap: var(--space-4); font-size: 14.5px; }
.footer-nav a { text-decoration: none; color: var(--ink-muted); transition: color var(--duration-fast) var(--ease-smooth-out); }
.footer-nav a:hover { color: var(--navy-ink); }
.footer-bottom { display: flex; flex-direction: column; gap: var(--space-2); padding-top: var(--space-3); font-size: 13px; color: var(--steel); }
@media (min-width: 760px) { .footer-bottom { flex-direction: row; justify-content: space-between; } }

/* ---------- Print: just the result and when it was checked ---------- */
@media print {
  header.site, .verify-hero, footer.site, .results-actions, .cert-actions, .cert-chevron { display: none !important; }
  .results-band { background: none; padding: 0; min-height: 0; }
  .result-stack > * { animation: none !important; }
  .cert-card .cert-body { grid-template-rows: 1fr !important; }
  .cert-body-inner { visibility: visible !important; }
  .cert-card { break-inside: avoid; }
}
