@font-face {
  font-family: "Sailec";
  src: url("assets/sailec-regular.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Sailec";
  src: url("assets/sailec-medium.woff") format("woff");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Sailec";
  src: url("assets/sailec-bold.otf") format("opentype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --brand: #006aff;
  --brand-dark: #0056d6;
  --navy: #14264f;
  --text: #5b6987;
  --muted: #8490a8;
  --line: #dce4f0;
  --surface: #ffffff;
  --canvas: #f4f7fb;
}

* {
  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(--navy);
  font-family: "Sailec", Arial, sans-serif;
}

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

.brand {
  display: block;
  width: clamp(12rem, 23vw, 17rem);
  height: auto;
}

.product-name {
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.certificate-page {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 4vw, 4rem) 1.25rem;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(0, 106, 255, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(0, 106, 255, 0.05) 1px, transparent 1px),
    var(--canvas);
  background-size: 4rem 4rem;
}

.certificate-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.certificate-content[hidden],
.user-error[hidden] {
  display: none;
}

.certificate-page::before {
  position: absolute;
  top: -12rem;
  width: 40rem;
  height: 24rem;
  border: 5rem solid rgba(0, 106, 255, 0.05);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.status-copy,
.qr-section {
  position: relative;
  z-index: 1;
}

.status-copy {
  max-width: 54rem;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  color: var(--brand-dark);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow span {
  display: grid;
  width: 1.6rem;
  height: 1.6rem;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #ffffff;
}

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

/* Formal greeting shown under the title */
.greeting {
  margin: 0.5rem 0 1rem;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  font-weight: 600;
  color: var(--navy);
  opacity: 0.9;
}

.status-copy > p:last-child {
  max-width: 39rem;
  margin: 1rem auto 1.5rem;
  color: var(--text);
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  line-height: 1.6;
}

.qr-section {
  text-align: center;
}

.qr-anchor {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  background: #ffffff;
  box-shadow: 0 1.25rem 3rem rgba(20, 38, 79, 0.12);
}

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

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

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

/* Hide the visible UUID so the interface shows only the QR */
.uuid-block {
  display: none;
}

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

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

.qr-availability {
  max-width: 40rem;
  min-height: 1.2rem;
  margin: 0.55rem auto 0;
  color: var(--text);
  font-size: 0.72rem;
  line-height: 1.45;
}

.user-error {
  position: relative;
  z-index: 1;
  width: min(100%, 42rem);
  padding: clamp(1.5rem, 5vw, 3rem);
  border-top: 0.35rem solid var(--brand);
  background: var(--surface);
  box-shadow: 0 1.25rem 3rem rgba(20, 38, 79, 0.12);
  text-align: center;
}

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

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

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

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

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

footer {
  min-height: 4rem;
  padding: 1.25rem;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

@media (max-width: 48rem) {
  .topbar {
    justify-content: center;
  }

  .brand {
    align-self: center;
  }

  .product-name {
    display: none;
  }

  .qr-code {
    width: min(76vw, 28rem);
  }
}

@media (max-width: 24rem) {
  .certificate-page {
    padding-inline: 1rem;
  }

  .qr-anchor {
    padding: 0.4rem;
  }

  .qr-code {
    width: 76vw;
  }
}
