/* Define global CSS variables in the :root selector */
:root {
  --box-sizing: border-box;
  --input-padding: 16px 12px;
  --input-border: 1px solid #0000003b;
  --input-border-radius: 8px;
  --input-font-size: 16px;
  --input-background-color: transparent;
  --input-focus-border-color: #469696;
  --input-focus-box-shadow: 0px 2px 4px rgba(70, 150, 150, 0.3);
  --background-color: #f0f0f0;
  --label-color: #757575;
  --label-focus-color: #469696;
  --label-font-size: 16px;
  --label-focus-font-size: 12px;
  --error-color: #d66560;
  --placeholder-color: transparent;
  --placeholder-focus-color: #757575;
  --text-color: #031926;
  --primary-color: #468189;
}

/* Apply box-sizing border-box to all elements */
*,
*::before,
*::after {
  box-sizing: var(--box-sizing);
}

/* Style for the userForm */
#userForm {
  margin: 0; /* Reset margin for the form */

  .input-container {
    position: relative;
    margin: 20px 0;
  }

  .form__input {
    width: 100%;
    padding: var(--input-padding);
    border: var(--input-border);
    border-radius: var(--input-border-radius);
    outline: none;
    font-size: var(--input-font-size);
    background-color: var(--input-background-color);
    transition:
      border-color 0.2s,
      box-shadow 0.2s;
  }

  /* Placeholder styling */
  .form__input::placeholder {
    color: var(--placeholder-color);
    transition: color 0.2s ease;
  }

  /* Placeholder color when input is focused */
  .form__input:focus::placeholder {
    color: var(--placeholder-focus-color);
  }

  /* Input field focus styling */
  .form__input:focus {
    border-color: var(--input-focus-border-color);
    box-shadow: var(--input-focus-box-shadow);
  }

  /* Label styling */
  .form__label {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    background-color: #fff;
    padding: 0 4px;
    color: var(--label-color);
    font-size: var(--label-font-size);
    pointer-events: none;
    transition: 0.3s ease all;
  }

  /* Label positioning when input is focused or not empty */
  .form__input:focus + .form__label,
  .form__input:not(:placeholder-shown) + .form__label {
    top: 0px !important;
    left: 8px;
    color: var(--label-focus-color);
    font-size: var(--label-focus-font-size);
    padding: 0 4px;
  }

  /* Label position adjustment for errors */
  .input-container .error-message:empty + .form__label {
    top: 50%;
  }

  .input-container .error-message:not(:empty) + .form__label {
    top: -8px;
    background: var(--error-color);
  }

  /* Button styling */
  button {
    margin-top: 24px;
    width: 100%;
  }

  /* Error message styling */
  .error-message {
    color: var(--error-color);
    font-size: 12px;
    margin-top: 4px;
  }

  /* Adjust the label position when input is focused */
  .input-container.has-error
    > .input-wrapper
    .form__input:focus
    + .form__label {
    transform: translateY(-50%);
    color: var(--error-color);
    font-size: var(--label-focus-font-size);
    padding: 0 4px;
  }
  /* Remove background color from autofill in WebKit browsers */
  .form__input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px white inset;
  }
  /* Adjust the label position when input is not focused */
  .input-container.has-error
    > .input-wrapper
    .form__input:not(:focus)
    + .form__label {
    top: 36%;
    transform: translateY(-50%);
    color: var(--error-color);
    padding: 0 4px;
  }
  /* Adjust the label position when input is not focused */
  .input-container.has-error
    > .input-wrapper
    .form__input:not(:focus):not(:placeholder-shown):not(:valid)
    + .form__label {
    top: 0px;
    transform: translateY(-50%);
    color: var(--error-color);
    padding: 0 4px;
  }

  .input-container.has-error > .input-wrapper .form__input {
    border-color: var(--error-color);
  }

  input:-internal-autofill-selected {
    background-color: white !important;
  }
}

body {
  /* Use flexbox to create a flexible layout */
  display: flex;
  /* Set the font family for the entire document */
  font-family: "Poppins", sans-serif;
  /* Remove default margin */
  margin: 0;
  /* Remove default padding */
  padding: 0;
  /* Set the background color */
  background-color: var(--background-color);
  color: var(--text-color);
}

p {
  /* Set the font size for paragraphs */
  font-size: 16px;
  /* Center align the text */
  text-align: center;
}

.secondary {
  color: #68757d;
}

h1 {
  /* Remove default margin */
  margin: 0;
  /* Set the color for headings */
  color: var(--primary-color);
  /* Set the font weight for headings */
  font-weight: 400;
  /* Center align the text */
  text-align: center;

  font-size: 24px;
}

#sidenav {
  /* Set the width of the side navigation */
  width: 280px;
  /** Set the maximum height of the side navigation */
  max-height: 100vh;
  /* Set the background color for the side navigation */
  background-color: #7f9a9d;
  /* Add padding to the side navigation */
  padding: 20px;
}

#sidenav p {
  /* Set the color for the side navigation subtitle */
  color: #ffffff;
  /* Set the font size for the side navigation subtitle */
  font-size: 14px;
  /* Align the side navigation subtitle to the start */
  justify-self: flex-start;
  /* Align the text to the left */
  text-align: left;
  /* Add margin to the left of the side navigation subtitle */
  margin-left: 14px;
}

#main {
  /* Set the width of the main content area to fill the remaining space */
  width: 100%;
}

#container {
  /* Allow the container to grow and fill the available space */
  flex-grow: 1;
  /* Use flexbox to align the content */
  display: flex;
  /* Stack the child elements vertically */
  flex-direction: column;
  /* Center align the child elements horizontally */
  align-items: center;
  /* Center align the child elements vertically */
  justify-content: center;
  /* Set a minimum height for the container */
  min-height: 100vh;
}

.content {
  /* Add padding to the content area */
  padding: 20px;
  /* Use flexbox to align the content */
  display: flex;
  /* Stack the child elements vertically */
  flex-direction: column;
  /* Center align the child elements horizontally */
  align-items: center;
  /* Center align the child elements vertically */
  justify-content: center;
  /* Set the width of the content area */
  width: 430px;
  /* Move the content area up by 90px */
  margin-top: -90px;
}

@media screen and (min-height: 801px) {
  .content {
    /* Move the content area up by 90px */
    margin-top: -90px;
  }
}

@media screen and (max-height: 800px) {
  .content {
    /* Move the content area up by 60px */
    margin-top: unset;
  }
}

button {
  /* Set the font size for buttons */
  font-size: 15px;
  /* Add padding to buttons */
  padding: 10px 20px;
  /* Set the background color for buttons */
  background-color: #77aca2;
  /* Set the text color for buttons */
  color: white;
  /* Remove the border */
  border: none;
  /* Add rounded corners to buttons */
  border-radius: 8px;
  /* Change the cursor to a pointer on hover */
  cursor: pointer;
  /* Set the font weight for buttons */
  font-weight: 400;
  /* Set the font family for buttons */
  font-family: "Poppins";
  /* Set a minimum width for buttons */
  min-width: 238px;
  /* Set a minimum height for buttons */
  min-height: 42px;

  transition: background-color 0.3s ease;
}

button:disabled {
  /* Change the background color */
  background-color: #ccc;
  /* Change the text color */
  color: #888;
  /* Change the cursor */
  cursor: not-allowed;
}

a {
  /* Set the color for links */
  color: #469696;
  /* Remove the underline from links */
  text-decoration: underline;
}

button:disabled:hover {
  /* Keep the background color the same */
  background-color: #ccc;
}

button:hover {
  /* Change the background color on hover */
  background-color: #65938a;
}

#checkboxContainer {
  /* Use flexbox to align the checkboxes horizontally */
  display: flex;
  /* Arrange the checkboxes in a row */
  flex-direction: row;
  /* Add margin to the top of the checkbox container */
  margin-top: 24px;
  /* Add margin to the bottom of the checkbox container */
  margin-bottom: 24px;
}

.primary {
  /* Set the color for elements with the "primary" class */
  color: var(--primary-color);
}

.text-primary {
  /* Set the text color for elements with the "text-primary" class */
  color: var(--text-color);
}

#mitIDCard {
  /* Add margin to the MIT ID card */
  margin-top: 32px;
  /* Use flexbox to align the content */
  display: flex;
  /* Stack the child elements vertically */
  flex-direction: column;
  /* Center align the child elements horizontally */
  align-items: center;
  /* Center align the child elements vertically */
  justify-content: center;
  /* Set the background color for the MIT ID card */
  background-color: #f8f8f9;
  /* Add a border to the MIT ID card */
  border: 1px solid #d7d7d1;
  /* Add rounded corners to the MIT ID card */
  border-radius: 8px;
  /* Set the opacity of the MIT ID card */
  opacity: 1;
  /* Set the width of the MIT ID card */
  width: 280px;
  /* Set the height of the MIT ID card */
  height: 320px;
}

#mitIDCard p {
  /* Set the font size for paragraphs inside the MIT ID card */
  font-size: 12px;
}

#mitIDCard img {
  /* Set the width of the image inside the MIT ID card */
  width: 174px;
  /* Set the height of the image inside the MIT ID card */
  height: auto;
  /* Make the image inside the MIT ID card circular */
  border-radius: 50%;
  /* Add margin to the bottom of the image inside the MIT ID card */
  margin-bottom: 24px;
}

input[type="radio"] {
  /* Set the accent color for radio buttons */
  accent-color: #469696;
}

progress {
  /* Hide the progress element by default */
  display: none;
}

#footer {
  /** Set the position of the footer */
  position: absolute;
  /** Set the bottom position of the footer */
  bottom: 0px;
}

progress[value] {
  /* Remove the default appearance of the progress bar */
  -webkit-appearance: none;
  /* Remove the default appearance of the progress bar */
  appearance: none;
  /* Set the width of the progress bar to fill the container */
  width: 100%;
  /* Set the height of the progress bar */
  height: 6px;
  /* Position the progress bar fixed to the viewport */
  position: fixed;
}

progress[value]::-webkit-progress-bar {
  /* Set the background color of the progress bar */
  background-color: #ebebe8;
  /* Add rounded corners to the progress bar */
  border-radius: 2px;
  /* Add a box shadow to the progress bar */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) inset;
}

progress[value]::-webkit-progress-value {
  /* Set the background color of the progress bar value */
  background-color: #e6dab6;
  /* Add rounded corners to the progress bar value */
  border-radius: 2px;
}

progress[value]::-moz-progress-bar {
  /* Set the background color of the progress bar value in Firefox */
  background-color: #e6dab6;
  /* Add rounded corners to the progress bar value in Firefox */
  border-radius: 2px;
}

@keyframes progress-animation {
  0% {
    background-color: #3366cc;
  }
  /* Set the background color at the start of the animation */

  50% {
    background-color: #6699cc;
  }
  /* Set the background color at the middle of the animation */

  100% {
    background-color: #3366cc;
  }
  /* Set the background color at the end of the animation */
}

progress.animated::-webkit-progress-value {
  /* Apply the progress animation to the progress bar value in WebKit browsers */
  animation: progress-animation 3s linear infinite;
}

progress.animated::-moz-progress-bar {
  /* Apply the progress animation to the progress bar value in Firefox */
  animation: progress-animation 3s linear infinite;
}

#backButton {
  i {
    /* Set the font size for the icon inside the back button */
    font-size: 24px;
    /* Set the color for the icon inside the back button */
    color: #77aca2;
  }

  /* Position the back button fixed to the viewport */
  position: fixed;
  /* Set the top position of the back button */
  top: 10px;
  /* Set the left position of the back button */
  left: 290px;
  /* Add padding to the back button */
  padding: 10px;
  /* Change the cursor to a pointer on hover */
  cursor: pointer;
  /* Hide the back button by default */
  display: none;
}

#logo {
  /* Add margin to the top of the logo */
  margin-top: 14px;
}

input[type="checkbox"] {
  /* Hide the default checkbox */
  appearance: none;
  /* Set the width of the checkbox */
  width: 18px;
  /* Set the height of the checkbox */
  height: 18px;
  /* Set the background color of the checkbox */
  position: relative;
  /* Add a border to the checkbox */
  border: 2px solid #469696;
  /* Add rounded corners to the checkbox */
  border-radius: 3px;
  /* Add margin to the right of the checkbox */
  display: flex;
  /* Align the content to the center */
  align-items: center;
  /* Align the content to the center */
  justify-content: center;
  /* Set the cursor to a pointer on hover */
  cursor: pointer;
  /* Add margin to the right of the checkbox */
  margin-right: 10px;
}

input[type="checkbox"]::before {
  /* Add content before the checkbox */
  content: "";
  /** Set the font family for the checkbox */
  font-family: "Material Icons";
  /* Set the font size for the checkbox */
  font-size: 18px;
  /* Set the line height for the checkbox */
  line-height: 18px;
}

input[type="checkbox"]:checked::before {
  /* Add content before the checkbox when checked */
  content: "check";
  /* Set the color for the checkbox when checked */
  color: #ffffff;
  /* Set the background color for the checkbox when checked */
  background-color: #469696;
  /* Add rounded corners to the checkbox */
  border-radius: 3px;
}

#popup {
  background-color: #f7f7f7;
  width: 100vw;
  height: 100vh;
  padding: 18px 26px 26px;

  #pcontainer {
    display: flex;
    align-items: center;
    height: 90%;
  }

  #pcard {
    border: 2px solid #e8eeee;
    background-color: #fff;
    margin: auto;
    padding: 44px 24px;
    width: 400px;
    display: flex;
    justify-content: space-between;
    flex-direction: column;
  }
}

/* Spinner styling */
.button-spinner {
  border: 2px solid rgba(255, 255, 255, 0.3); /* Light border */
  border-top: 2px solid #ffffff; /* White border on top */
  border-radius: 50%; /* Make it a circle */
  width: 20px; /* Width of the spinner */
  height: 20px; /* Height of the spinner */
  animation: spin 0.6s linear infinite; /* Spin animation */
  display: inline-block; /* Inline block to fit inside button */
  vertical-align: middle; /* Align vertically in the middle */
  margin-left: 8px; /* Space between text and spinner */
}

/* Spin animation keyframes */
@keyframes spin {
  0% {
    transform: rotate(0deg); /* Start at 0 degrees */
  }
  100% {
    transform: rotate(360deg); /* End at 360 degrees */
  }
}

