* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  font-family: Arial, sans-serif;
}

body {
  color: #000;
  background: #005696;
  font-size: 14px;
  line-height: 1.5em;
}

a {
  color: #005696;
}

#Content {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  background: #fff;
}

#middle {
  flex: 1;
}

#header {
  height: 83px;
  overflow: hidden;
  background: #fff url("assets/header-background.png") center top / 1px 83px repeat-x;
  text-align: center;
}

#headermain {
  height: 83px;
  margin: 0;
  font-size: 0;
}

#header img {
  display: block;
  width: 271px;
  height: 83px;
  margin: 0 auto;
}

.survey-content {
  padding: 18px 14px 40px;
}

.custard-frame {
  overflow: hidden;
  width: 100%;
  margin: 0 auto 34px;
  padding: 5px;
  border: 1px solid #c8c8c8;
  background: #fff;
  box-shadow: 0 2px 7px rgb(0 0 0 / 18%);
}

.custard-frame img {
  display: block;
  width: 100%;
  height: auto;
}

h2 {
  margin: 0 0 30px;
  font-size: 22px;
  line-height: 1.3;
  text-align: center;
}

.scan-button,
.capture-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: 0;
  color: #fff;
  background: #005696;
  font: 20px Arial, sans-serif;
  cursor: pointer;
  text-decoration: none;
}

.scan-button {
  height: 50px;
  margin: 0 auto;
}

.capture-button {
  height: 52px;
}

.scan-button img,
.capture-button img {
  width: 24px;
  height: 24px;
}

.scan-button:hover,
.scan-button:focus,
.capture-button:hover,
.capture-button:focus {
  background: #00477e;
}

.manual-entry {
  display: block;
  width: fit-content;
  margin: 18px auto 0;
  color: #777;
  text-align: center;
  text-decoration: underline;
}

.about-content {
  padding: 28px 20px 44px;
}

.about-content h2 {
  margin-bottom: 24px;
}

.about-content p {
  margin: 0 0 18px;
  font-size: 16px;
  line-height: 1.55;
}

.back-link {
  display: inline-block;
  margin-top: 8px;
  font-weight: bold;
}

#footer {
  min-height: 94px;
  padding: 14px 10px;
  color: #fff;
  background: #005696;
  box-shadow: 0 -2px 0 #005696, 0 2px 0 #005696;
  text-align: left;
}

#footer a {
  color: #fff;
}

#footer p {
  margin: 0;
}

#footer a + p {
  margin-top: 9px;
}

.about-link {
  font-weight: bold;
}

.scanner-page {
  background: #005696;
}

.scanner-page [hidden] {
  display: none !important;
}

.scanner-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  background: #fff;
}

.scanner-top-banner {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  width: 100%;
  height: calc(40px + env(safe-area-inset-top));
  background: #005696;
}

.scanner-instruction {
  position: absolute;
  top: env(safe-area-inset-top);
  left: 0;
  z-index: 4;
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.camera-stage {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  margin: 200px 0 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #fff;
}

.camera-source {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.camera-view,
#capture-preview {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.camera-view {
  object-fit: cover;
  object-position: center top;
}

#capture-preview {
  object-fit: cover;
  object-position: center top;
}

#capture-preview.is-ocr-crop {
  object-fit: contain;
  object-position: center center;
  background: #111;
}

.camera-source::-webkit-media-controls,
.camera-source::-webkit-media-controls-enclosure,
.camera-source::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
}

.camera-overlay {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

.scanner-page.has-scan-failure::before {
  position: fixed;
  z-index: 10;
  inset: 0;
  background: rgb(0 0 0 / 62%);
  content: "";
  animation: scan-failure-dark-in 300ms ease-out both;
}

.scanner-page.is-dismissing-failure::before {
  animation: scan-failure-dark-out 160ms linear both;
}

.scan-failure-popup {
  position: absolute;
  z-index: 11;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.scan-failure-popup img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  opacity: 0;
  transform: scale(.25);
}

.scan-failure-popup.is-visible img {
  animation: scan-failure-in 420ms cubic-bezier(.16, 1, .3, 1) both;
}

.scan-failure-popup.is-dismissing img {
  animation: scan-failure-out 160ms linear both;
}

@keyframes scan-failure-in {
  from {
    opacity: 0;
    transform: scale(.25);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scan-failure-out {
  from {
    opacity: 1;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(.25);
  }
}

@keyframes scan-failure-dark-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes scan-failure-dark-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.scanner-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 96px;
  padding: 10px 14px calc(56px + env(safe-area-inset-bottom));
  background: #fff;
}

.capture-button:disabled {
  cursor: wait;
  opacity: .55;
}

.capture-button.is-scanning {
  cursor: wait;
}

.capture-button.is-failed,
.capture-button.is-failed:hover,
.capture-button.is-failed:focus {
  background: #999;
  cursor: default;
  opacity: 1;
}

.capture-button.is-failed img {
  display: none;
}

.capture-button.is-scanning img {
  display: none;
}

.capture-button.is-scanning::before {
  width: 20px;
  height: 20px;
  border: 3px solid rgb(255 255 255 / 40%);
  border-top-color: #fff;
  border-radius: 50%;
  content: "";
  animation: scan-spinner .8s linear infinite;
}

@keyframes scan-spinner {
  to {
    transform: rotate(360deg);
  }
}

.cancel-link {
  margin-top: 16px;
  color: #999;
  text-decoration: underline;
}

.awaiting-camera-permission .cancel-link {
  color: #005696;
  font-size: 20px;
  font-weight: bold;
}

.cancel-link.is-scanning {
  color: #005696;
  font-weight: bold;
}

@media (min-width: 600px) {
  #Content {
    max-width: 520px;
    margin: 0 auto;
  }
}
