body {
  background-color: #fcd6b5; /* Main BG colour */
  color: #231f20; /* Text colour */
  font-family: Arial, Helvetica, sans-serif; /* Main font */
}

/* Set header to flex and centre items */
header {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Wrap the header text as flex column */
.header-text {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  text-align: justify;
}

header img {
  max-width: 8rem; /* Max ABS logo width */
  padding: 0rem 1rem; /* Add padding to sides of logo */
}

h1 {
  font-size: 2rem;
}
h2 {
  font-size: 1.5rem;
}
p {
  font-size: 1rem;
}
footer {
  text-align: center;
  margin-top: 2rem;
}

span.width {
  display: inline-block;
  width: 7rem;
}

span.hide {
  display: none;
}

span.error {
  color: red;
}

.active {
  background-color: #ffe4cc;
}

.hide {
  display: none;
}

section form {
  display: flex;
  flex-wrap: wrap;
  padding-top: 2rem;
  justify-content: center;
}
span.width {
  display: inline-block;
  width: 10rem; /* Width of question text */
  white-space: normal;
  margin-right: 2rem;
}

#opening-field span.width {
  width: 15rem;
}

/* Opening address container styling */
.address {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 1rem;
}
.address label {
  display: flex;
  flex-direction: column;
}
.address input {
  margin-top: 0.5rem;
}

#address-error,
#people-error {
  color: red;
  margin-top: 1rem;
}

/* Fieldset style */
fieldset {
  display: flex;
  flex-direction: column;
  padding: 1rem 1rem;
  background-color: #fac08e;
  border-radius: 0.5rem;
  border-width: 0.25rem;
  border-color: white;
  margin: auto;
}

.field-header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: start;
  margin-bottom: 2rem;
}

.field-title {
  text-align: center;
  width: 100%;
  margin: 0;
}

.help-icon {
  position: absolute;
  top: 0;
  right: 0;
  width: 1.5rem;
  height: 1.5rem;
  cursor: pointer;
}

.radio-group {
  display: inline-flex; /* Keep radio buttons on the same line */
  gap: 1rem;
  align-items: center;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

/* General button styling */
button {
  background-color: blue;
  color: white;
  padding: 0.75rem 1.5rem;
  margin-top: 1.5rem;
  font-size: 1rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease; /* Transition for button animations */
}

button:hover {
  background-color: darkblue; /* Make colour darker on hover */
  transform: scale(1.03); /* Scale up on hover */
}
button:active {
  transform: scale(0.98); /* Scale button when clicked */
}

/* Submit button */
.submit-button {
  background-color: blue;
  color: white;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease; /* Transition for button animations */
}
.submit-button:hover {
  background-color: darkblue; /* Make colour darker on hover */
  transform: scale(1.03); /* Scale up on hover */
}
.submit-button:active {
  transform: scale(0.98); /* Scale button when clicked */
}

.button-container {
  display: inline-block;
  gap: 1rem;
  flex-wrap: nowrap;
}

/* Container to position help tooltip */
.help-container {
  position: relative;
  display: inline-block;
}

/* Help tooltip styling */
.help-tooltip {
  position: absolute;
  top: 2rem; /* position tooltip below the icon */
  left: 50%;
  transform: translateX(-50%);
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
  padding: 0.5rem;
  width: 10rem;
  font-size: 0.75rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Add drop shadow */
  z-index: 100; /* Always show tooltip on top */
}

/* Show the tooltip on hover */
.help-container:hover .help-tooltip {
  display: block;
}

.invalid {
  border: 2px solid red; /* Outline invalid fields border in red */
}

.form-error {
  color: red;
  margin-top: 1rem;
}

#animal-error-2 {
  color: red;
  margin-top: 1rem;
}

/* Checkbox containter styles */
.checkbox-group {
  display: flex;
  flex-direction: column; /* Align one per line */
  margin-top: 1rem;
  margin-bottom: 1rem;
  gap: 0.5rem; /* Space between each checkbox */
}

/* Animal form styling */
.animal-form label {
  display: block;
  margin-bottom: 1rem;
  margin-top: 1rem;
}

/* Span ratings the width of field */
.rating-group {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

/* Only allow textarea to be resized vertically */
textarea {
  resize: vertical;
}
.scale-instructions {
  font-style: italic;
  margin-bottom: 1rem;
  color: gray;
  width: 25rem; /* Max width the instructions can take up */
}

/* Progress bar styling */
.my-progress {
  width: 100%;
  background-color: rgb(218, 218, 218);
  height: 1.5rem;
  position: relative;
  border-radius: 0.5rem;
  overflow: hidden; /* Stop progress from overflowing out of rounded corners */
  margin-bottom: 1rem;
  border: 2px solid white; /* Add border to progress bar */
}
.my-bar {
  height: 100%;
  background-color: green;
}
.progress-text {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: center; /* centre horizontal */
  align-items: center; /* centre vertical */
  color: black;
  pointer-events: none; /* Stop cursor from interacting with bar */
}

/* Horizontal rule styling */
hr {
  border: none;
  height: 0.1rem;
  background-color: #414141;
  margin: 1rem;
  margin-top: 1rem;
  margin-bottom: 2rem;
}

#people-question {
  margin-bottom: 1rem;
}

/* Tablet styles */
@media (max-width: 1000px) {
  label {
    display: flex;
    flex-direction: column; /* Stack question input vertically */
    align-items: flex-start; /* Align label and input to the left */
    margin-bottom: 1rem;
  }

  /* Increase question full width of form*/
  span.width {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  input:not([type="submit"]), /* Do not apply to submit button */
  select,
  textarea {
    width: 100%; /* Make all inputs span full width of form */
  }

  /* Put field header and help icon on opposite sides of form */
  .field-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }
  .field-title {
    text-align: left;
  }

  .help-icon {
    width: 1.5rem;
    height: auto;
  }

  /*  radio group style*/
  .radio-group {
    display: flex; /* Display radio buttons in a row */
    flex-wrap: wrap;
    margin-top: 0.5rem;
    justify-content: flex-start; /* Align buttons to the left */
  }

  .radio-group label {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    margin-right: 1rem;
  }
  .radio-group label:last-child {
    margin-right: 0; /* No extra space after the last label */
  }
  .radio-group input[type="radio"] {
    margin-right: 1rem; /* Add space after radio buttons */
  }

  /* Reduce font sizes and header image size */
  h1 {
    font-size: 1.5rem;
  }
  header img {
    max-width: 6rem;
  }

  .help-tooltip {
    left: -5rem; /* Move tooltip to left so it isnt cut off on tablet and mobile */
  }

  .help-container {
    top: -1rem; /* Move help icon up page */
  }
}
/* Mobile styles */
@media (max-width: 500px) {
  header-text {
    text-align: center; /* Center header text */
  }

  .help-icon {
    margin-top: 0.25rem; /* Reduce help icon margin */
  }

  section form {
    padding-top: 0rem; /* Reduce padding from top of form for mobile */
  }

  footer p {
    font-size: 0.75rem;
  }

  #opening-field span.width {
    width: 10rem;
  }

  .scale-instructions {
    width: auto; /* No max width on mobile */
  }
  h2 {
    font-size: 1rem;
  }
  h3 {
    font-size: 0.75rem;
  }
}
@media print {
  span.error {
    display: none; /* Hide error message on print */
  }
}
