@import url('https://fonts.googleapis.com/css2?family=Open+Sans&display=swap');

#color-contrast {
  font-family: 'Open Sans';
}

.h1-color {
  font-size: 30px !important;
}

.h2-color {
  font-size: 18px !important;
}

h1, h2 {
  text-align: center;
  display: block;
  margin-top: 0;
}

span {
  display: block;
}

/* Tool general styles */
#color-contrast {
  background: #fff;
  box-shadow: 0 0 1rem rgba(0,0,0,0.25);
  border-radius: 5px;
  width: max-content;
  box-sizing: border-box;
  padding: 2rem;
}

/* boxes */
#boxes {
  display: flex;
  margin-top: 1.5rem;
}

#boxes > div {
  flex: 1;
  text-align: center;
  background: #008450;
  color: white;
  padding: 0.5rem 0;
  margin-left: 10px;
  border-radius: 3px;
  transition: background 0.5s;
  position: relative;
}

#boxes > div::after {
  content: "✓ Pass";
  display: block;
  position: absolute;
  color: #000;
  text-align:center;
  width: 100%;
  margin-top: 10px;
}

#boxes > div.fail {
  background: #b81d13;
}

#boxes > div.fail::after {
  content: "✕ Fail";
}

#boxes > div:first-child {
  margin-left: 0;
}

#boxes span:first-child {
  font-size: 0.75em;
  display: inline-block;
  margin-bottom: 0.5em;
}

/* demo */
#sample-text {
  margin: 4rem 0 1.6rem 0;
  padding: 1rem;
  background: #fff;
  color: #000;
  text-align: center;
  font-size: 20px;
  border-radius: 3px;
  border: solid 3px #f8f8f8;
}

/* sliders */
#bars {
  display: flex;
  flex-direction: row;
}

#bars > div {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#bars > div:first-child {
  margin-right: 1rem;
}

#bars > div:last-child {
  margin-left: 1rem;
}

#bars > div > div {
  display: flex;
  margin-bottom: 0.5rem;
}

#bars label {
  display: inline-block;
  color: white;
  width: 2rem;
  height: 2rem;
  line-height: 2rem;
  font-size: 1rem;
  text-align: center;
  border-radius: 2px;
  box-sizing: border-box;
}

label.red { background: #b81d13; }
label.green { background: #008450; }
label.blue { background: #176ced; }

#bars input[type="range"] {
  flex: 1;
  margin: 0 12px;
}
#bars input[type="number"] {
  text-align: center;
  width: 3rem;
  border-radius: 2px;
  border: 1px solid #ccc;
  font-size: 0.75rem;
  height: 2rem;
  box-sizing:border-box;
  line-height: 2rem;
}
#bars input[type="text"] {
  border-radius: 2px;
  border: 1px solid #ccc;
  text-align: center;
  font-size: 1rem;
  height: 2rem;
  box-sizing:border-box;
  line-height: 2rem;
}
