/* Global box-sizing and reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Base typography and body */
body {
  font-family: Arial, sans-serif;
  background-color: #f2f2f2;
  /* UUK grey background */
  color: #000;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  /* prevent horizontal scroll */
  overflow-y: hidden;
  /* prevent unwanted vertical scroll */
}

/* Header */
header {
  background-color: #1d70eb;
  /* UUK brand blue */
  padding: 1rem;
  color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

header img {
  max-height: 3rem;
  height: auto;
  width: auto;
}

/* Main content wrapper */
main {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
  /* reduced padding for mobile safety */
  overflow-y: auto;
  /* allow scrolling if content exceeds viewport */
}

/* Headings */
h1 {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 1.8rem;
  margin: 1rem 0;
  font-weight: bold;
  color: #1d70eb;
  word-break: break-word;
  /* prevent long text from overflowing */
}

/* Buttons */
button {
  font-family: Arial, sans-serif;
  font-weight: bold;
  background-color: #1d70eb;
  color: #ffffff;
  border: none;
  padding: 0.8rem 1.2rem;
  margin: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  /* prevent wrapping inside button */
}

button:disabled {
  background-color: #cce1ff;
  cursor: not-allowed;
}

/* Containers */
#scanner,
#consent,
#result {
  margin: 1rem 0;
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  text-align: center;
  width: 100%;
  max-width: 480px;
  /* prevent containers from exceeding small screens */
  overflow-wrap: break-word;
}

/* Status text */
#status {
  margin-top: 1rem;
  font-weight: bold;
}

/* QR reader container */
#qr-reader {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

/* Consent styling */
#consent p {
  margin: 0.5rem 0;
  font-size: 1rem;
  word-break: break-word;
}

/* Result confirmation */
#result {
  font-size: 1.2rem;
  font-weight: bold;
  color: #02866d;
  /* UUK green accent */
}

/* Responsive adjustments for mobile */
@media (max-width: 480px) {
  body {
    overflow-y: auto;
    /* allow natural vertical scroll on very small screens */
  }

  main {
    padding: 1rem;
  }

  #scanner,
  #consent,
  #result {
    margin: 0.5rem 0;
    padding: 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  button {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
}