:root {
  --text: #20242a;
  --muted: #69707a;
  --line: #d9dee6;
  --blue: #0d6efd;
  --blue-soft: #9ec5fe;
  --surface: #ffffff;
  --page: #f7f8fa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.app {
  min-height: 100vh;
  padding: 32px 16px;
}

.view {
  width: min(1300px, 100%);
  margin: 0 auto;
}

.view[hidden] {
  display: none !important;
}

#searchView {
  display: flex;
  min-height: calc(100vh - 64px);
  flex-direction: column;
}

.searchHeader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
}

.eventTitle {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #111;
  font-weight: 800;
  line-height: 0.95;
  text-align: center;
  text-transform: uppercase;
}

.eventTitleTop {
  color: #e7661b;
  font-size: 1rem;
}

.eventTitleRun {
  margin-top: 3px;
  color: #08753f;
  font-size: 1.15rem;
}

.eventTitleDetails {
  margin-top: 5px;
  color: var(--text);
  font-size: 0.62rem;
  letter-spacing: 0.02em;
}

h1 {
  margin: 0;
  font-size: clamp(1.6rem, 2vw, 2.1rem);
  line-height: 1.2;
}

.searchBox {
  margin-bottom: 14px;
}

input[type="search"] {
  width: 100%;
  height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  outline: none;
}

input[type="search"]:focus {
  border-color: var(--blue-soft);
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.22);
}

.results {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.resultButton {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 11px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.resultButton:hover,
.resultButton:focus {
  background: #eef5ff;
  outline: none;
}

.resultButton:last-child {
  border-bottom: 0;
}

.statusMessage {
  margin: 12px 2px;
  color: var(--muted);
}

.statusMessage:empty {
  display: none;
}

.siteFooter {
  margin-top: auto;
  padding-top: 32px;
  color: var(--muted);
  text-align: center;
}

.siteFooter a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.siteFooter a:hover,
.siteFooter a:focus {
  text-decoration: underline;
}

.certificateView {
  text-align: center;
}

.certificateView h1 {
  margin-bottom: 24px;
}

.certificateShell {
  display: flex;
  justify-content: center;
  overflow-x: auto;
}

canvas {
  display: block;
  width: min(596px, 100%);
  height: auto;
  background: #fff;
  border: 1px solid #c9ccd1;
}

.actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
  flex-wrap: wrap;
}

button {
  min-height: 38px;
  padding: 8px 16px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.75;
}

.isLoading::before {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-right: 8px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  content: "";
  vertical-align: -0.1em;
  animation: buttonSpinner 0.7s linear infinite;
}

@keyframes buttonSpinner {
  to {
    transform: rotate(360deg);
  }
}

.primaryButton {
  background: var(--blue);
}

.secondaryButton {
  background: #6c757d;
}

.srOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .app {
    padding: 20px 12px;
  }

  .searchHeader {
    gap: 10px;
  }

  .eventTitleTop {
    font-size: 0.9rem;
  }
}
