/* Vérification des documents du groupe TMG. Papier de sécurité froid,
   encre bleu nuit, un seul élément fort : le tampon du verdict. */

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #e9efed;
  --sheet: #f8fbfa;
  --ink: #15253a;
  --ink-soft: #4b5d6b;
  --rule: #c6d3cf;
  --guilloche: #d5e1dd;
  --ok: #1d6a4c;
  --warn: #8a5800;
  --bad: #a32330;
  --info: #2a5577;
  --focus: #1f63c9;
  --seal: var(--info);
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101a22;
    --sheet: #17242e;
    --ink: #e7eef0;
    --ink-soft: #a9bac4;
    --rule: #2c3d49;
    --guilloche: #1c2b36;
    --ok: #5cc49a;
    --warn: #e2b04a;
    --bad: #f07b84;
    --info: #8fb8dc;
    --focus: #8fb8ff;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    repeating-radial-gradient(circle at 100% 0, transparent 0 11px, var(--guilloche) 11px 12px) top right / 340px 340px no-repeat,
    var(--paper);
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.55;
  padding: 0 1rem env(safe-area-inset-bottom);
}

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--sheet);
  color: var(--ink);
  padding: 0.5rem 0.75rem;
  z-index: 10;
}

.skip:focus {
  left: 0.5rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

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

.masthead,
main,
.footer {
  max-width: 34rem;
  margin: 0 auto;
}

.masthead {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  gap: 0.875rem;
  align-items: start;
  padding: 1.75rem 0 1.25rem;
}

.masthead__mark {
  width: 2.75rem;
  height: 2.75rem;
  color: var(--ink);
  margin-top: 0.2rem;
}

h1 {
  font-size: 1.75rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.35rem;
}

.masthead__issuers {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

main:focus {
  outline: none;
}

.reader,
.result {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 1.25rem;
  padding: 1rem;
}

.viewfinder {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 0.875rem;
  overflow: hidden;
  background: var(--ink);
}

.viewfinder video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.viewfinder__frame {
  display: none;
  position: absolute;
  inset: 20% 8%;
  border-radius: 0.5rem;
  border: 2px solid var(--sheet);
  box-shadow: 0 0 0 100vmax color-mix(in srgb, var(--ink) 45%, transparent);
  pointer-events: none;
}

.viewfinder__idle {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 1.5rem;
  color: var(--sheet);
  text-align: center;
  font-size: 1rem;
}

.viewfinder[data-live="true"] .viewfinder__idle {
  display: none;
}

.viewfinder[data-live="true"] .viewfinder__frame {
  display: block;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 1rem;
}

.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.button--primary {
  background: var(--ink);
  color: var(--sheet);
  flex: 1 1 12rem;
}

.button:hover {
  background: color-mix(in srgb, var(--ink) 10%, transparent);
}

.button--primary:hover {
  background: color-mix(in srgb, var(--ink) 88%, var(--sheet));
}

.status {
  min-height: 1.55em;
  margin: 0.875rem 0 0;
  font-weight: 700;
}

.privacy {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.result {
  margin-top: 1rem;
}

.seal {
  width: min(14rem, 62vw);
  margin: 0.25rem auto 0.75rem;
  color: var(--seal);
  transform: rotate(-7deg);
}

.seal svg {
  display: block;
  width: 100%;
  height: auto;
}

.seal__ring {
  fill: none;
  stroke: currentColor;
  stroke-width: 6;
}

.seal__ring--thin {
  stroke-width: 2;
}

.seal__band {
  fill: color-mix(in srgb, currentColor 12%, transparent);
  stroke: currentColor;
  stroke-width: 2.5;
}

.seal__arc {
  fill: currentColor;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.seal__word {
  fill: currentColor;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.result[data-tone="ok"] { --seal: var(--ok); }
.result[data-tone="warn"] { --seal: var(--warn); }
.result[data-tone="bad"] { --seal: var(--bad); }

.result[data-stamp="true"] .seal {
  animation: stamp 260ms cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

@keyframes stamp {
  from {
    transform: rotate(-16deg) scale(1.35);
    opacity: 0;
  }
  to {
    transform: rotate(-7deg) scale(1);
    opacity: 1;
  }
}

.result h2 {
  font-size: 1.375rem;
  line-height: 1.25;
  margin: 0 0 1rem;
  color: var(--seal);
}

.result h2:focus {
  outline: none;
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1rem;
  margin: 0;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.facts dt {
  color: var(--ink-soft);
}

.facts dd {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.facts .facts__sub {
  display: block;
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.advice {
  margin: 1rem 0 0.5rem;
}

.revocation {
  margin: 0 0 1.25rem;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.revocation[data-tone="warn"] {
  color: var(--warn);
  font-weight: 700;
}

.result .button--primary {
  width: 100%;
}

.footer {
  padding: 1.5rem 0 2rem;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.footer p {
  margin: 0;
}

@media (max-width: 26rem) {
  .facts {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .facts dd {
    margin-bottom: 0.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .result[data-stamp="true"] .seal {
    animation: none;
  }
}
