* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Google Sans", sans-serif;
}

header,
footer {
  width: 100%;
  background-color: #333;
  padding: 0.5em 0;
  color: #fff;
  font-weight: bold;
  text-align: center;
}

footer {
  margin: auto 0 0 0;
}

main {
  background-color: #fff;
  width: 100%;
  max-width: 35rem;
  margin: 2em auto;
  border: 0.5px solid #e5e5e5;
  border-radius: 4px;
  overflow: hidden;
}

form button,
form select,
input[type="color"] {
  background-color: transparent;
  border: 0.5px solid #e5e5e5;
  border-radius: 4px;
  outline: none;
  height: 42px;
  padding-inline: 0.25em;
}

form button {
  padding-inline: 0.75em;
  transition: background-color 0.3s;
}

form button:hover,
form button:focus {
  background-color: #e5e5e5;
}

form input[type="color"] {
  width: 50px;
}

.inputs-container {
  display: grid;
  gap: 0.5em;
  grid-template-columns: auto 1fr auto;
  background-color: transparent;
  padding: 1em 0.5em;
}

.color-scheme-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(2rem, 1fr));
  grid-auto-flow: dense;
  min-height: 20rem;
}

.color-scheme-container span {
  font-size: 0.75rem;
  position: absolute;
  bottom: 0;
  text-align: center;
  background-color: #ffffff;
  padding: 0.5em;
  width: 100%;
}

.instructions {
  width: 80%;
  margin: 0 auto;
}

/* Tablet responsiveness */
@media (max-width: 768px) {
  main {
    margin: 1em auto;
    width: calc(100% - 2em);
  }

  .inputs-container {
    grid-template-columns: auto 1fr;
    gap: 0.75em;
  }

  form button {
    grid-column: 1 / -1;
    padding: 0.75em;
  }

  .instructions {
    width: 90%;
  }

  .instructions h2 {
    font-size: 1.25rem;
  }

  .instructions p,
  .instructions li {
    font-size: 0.95rem;
  }
}

/* Mobile responsiveness */
@media (max-width: 480px) {
  header,
  footer {
    padding: 0.75em 1em;
    font-size: 0.9rem;
  }

  main {
    margin: 0.5em;
    width: calc(100% - 1em);
    border-radius: 8px;
  }

  .inputs-container {
    grid-template-columns: 1fr;
    gap: 0.75em;
    padding: 1em;
  }

  form input[type="color"] {
    width: 100%;
    height: 50px;
  }

  form select,
  form button {
    width: 100%;
    height: 48px;
    font-size: 1rem;
  }

  .color-scheme-container {
    grid-template-columns: repeat(auto-fit, minmax(3rem, 1fr));
    min-height: 15rem;
  }

  .color-scheme-container span {
    font-size: 0.65rem;
    padding: 0.4em;
  }

  .instructions {
    width: 95%;
    padding: 0 0.5em;
  }

  .instructions h2 {
    font-size: 1.1rem;
  }

  .instructions p,
  .instructions li {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .instructions ol {
    padding-left: 1.25em;
  }
}
