@font-face {
  font-family: "Roboto";
  src: url("assets/roboto-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("assets/roboto-medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("assets/roboto-bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #091522;
  --teal: #006e78;
  --teal-soft: #e2f3f2;
  --surface: #ffffff;
  --line: #d6dde1;
  --muted: #5e6972;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
}

body {
  display: grid;
  min-height: 100svh;
  grid-template-rows: auto 1fr auto;
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: "Roboto", Arial, sans-serif;
}

.topbar {
  display: flex;
  min-height: 4.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem clamp(1.25rem, 5vw, 4rem);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: block;
  width: 6.5rem;
  height: auto;
}

.topbar span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.certificate-page {
  display: grid;
  justify-items: center;
  gap: 1rem;
  padding: 1.25rem;
}

.qr-stage[hidden],
.user-error[hidden] {
  display: none;
}

.qr-stage {
  display: grid;
  justify-items: center;
  text-align: center;
}

.active-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 10px;
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.active-status span {
  display: grid;
  width: 1.5rem;
  height: 1.5rem;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #ffffff;
}

h1 {
  margin: 0.35rem 0 0.75rem;
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.025em;
}

/* Greeting text shown with the participant's name */
.greeting {
  margin: 0.2rem 0 0.6rem;
  font-size: clamp(1.1rem, 2.1vw, 1.4rem);
  font-weight: 600;
  color: var(--ink);
  max-width: 56rem;
}

.qr-anchor {
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 0.45rem;
  border: 1px solid var(--line);
  background: #ffffff;
}

.qr-anchor:focus-visible {
  outline: 4px solid rgba(0, 110, 120, 0.25);
  outline-offset: 3px;
}

.qr-code {
  display: block;
  width: clamp(18rem, min(82vw, 70svh), 46rem);
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.uuid-block {
  margin-top: 0.75rem;
}

/* Hide the visible UUID while keeping it in the DOM for accessibility if needed */
.uuid-block {
  display: none;
}

.uuid-block p {
  margin: 0 0 0.3rem;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: clamp(0.74rem, 1.4vw, 0.86rem);
}

.qr-availability {
  max-width: 42rem;
  min-height: 1.2rem;
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.user-error {
  width: min(100%, 42rem);
  align-self: center;
  padding: clamp(1.5rem, 5vw, 3rem);
  border-top: 0.3rem solid var(--teal);
  background: var(--surface);
  text-align: center;
}

.user-error > span {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  place-items: center;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 1.5rem;
  font-weight: 700;
}

.user-error > p:first-of-type {
  margin: 0 0 0.5rem;
  color: var(--teal);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.user-error h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.5rem);
}

.user-error > p:last-child {
  margin: 1rem 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.user-error code {
  display: inline;
  color: var(--teal);
  font-weight: 700;
}

footer {
  min-height: 3.5rem;
  padding: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.68rem;
  text-align: center;
}

@media (max-width: 38rem) {
  .topbar span {
    display: none;
  }

  .qr-code {
    width: min(88vw, 33rem);
  }
}
