* {
  margin: 0;
  padding: 0;

  line-height: 1.5;
}

:root {
  --bg-color: #010409;
  --input-color: #0d1117;
  --main-text: #555;
  --second-bg-color: #0b0b11;
  --dark-text: #e6edf3;
  --border-color: #ebdbb7;
}

body {
  background-color: var(--bg-color);

  height: 100%;

  display: flex;
  flex-direction: column;
}

header,
.loading,
.dialog-heading > span,
.progress-tracker,
.class-list > a,
.no-articulations,
.selected-class {
  font-family: "helvetica_neuelight", Verdana, sans-serif;
}

main,
dialog > p,
.cid-second-line {
  font-family: "Segoe UI", Verdana, sans-serif;
}

form,
input,
select,
.submit,
.loading-gif,
.articulations,
.class-list > a {
  border: 1px ridge var(--dark-text);
  border-radius: 5px;
}

header,
select,
.loading,
.loading-container {
  color: silver;
}

header {
  display: flex;
  justify-content: flex-start;

  position: sticky;
  top: 0;

  height: 20%;
  z-index: 10;

  border-bottom: 1px ridge;
  margin-bottom: 20px;
  padding: 10px;

  background-color: var(--second-bg-color);

  font-size: 1.3em;

  user-select: none;
}

header > h1 {
  margin: auto;
  font-weight: lighter;
}

.back {
  display: none;
  opacity: 0;

  filter: invert(91%) sepia(0%) saturate(746%) hue-rotate(143deg)
    brightness(95%) contrast(91%);

  user-select: none;

  width: 40px;
}

.back:hover {
  background-color: #adadad1a;

  cursor: pointer;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;

  padding: 20px;

  color: gray;

  font-weight: 100;
}

form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;

  width: 90%;
  max-width: 400px;

  padding: 20px;
  margin-top: -10px;

  background-color: var(--bg-color);
  color: var(--dark-text);

  transition: opacity 0.3s;
}

.form-row {
  display: flex;
  justify-content: flex-start;
  flex-direction: column;

  width: 80%;
  max-width: 500px;

  font-size: 1.4em;
}

:not(.form-row > .loading) {
  transition: opacity 1s;
}

label {
  display: flex;
  justify-content: space-between;

  padding-right: 2%;
  margin-bottom: 1%;

  font-size: 0.9em;
}

input,
select {
  width: 100%;

  padding: 3px 5px;

  background-color: var(--input-color);
}

input:focus,
select:focus,
dialog:focus {
  outline: none;
}

select {
  appearance: none;
  background: url("./fonts/arrow-204-16..png") no-repeat right;
  background-position-x: calc(100% - 5px);
}

select > option {
  background-color: #010409;
}

.submit {
  justify-content: center;

  margin-top: 15px;
  padding: 5px;

  font-size: 0.9em;

  background-color: var(--bg-color);
  color: var(--dark-text);

  cursor: pointer;
}

.submit:hover {
  background-color: #0a0c0f;
}

.submit:active {
  background-color: #0e1014;
}

.loading {
  align-self: center;

  position: absolute;

  margin-top: 1vh;

  font-size: 2em;

  opacity: 0;
  transition: opacity 3s;

  user-select: none;
}

dialog {
  top: 0;
  bottom: calc(100% - 90%);
  position: absolute;

  width: 80%;
  max-width: 300px;
  height: 100px;

  margin: auto auto;
  padding: 20px;
  border: 5px solid silver;

  background-color: #e6edf3;

  opacity: 0;

  transition: opacity 0.3s;
}

dialog::backdrop {
  opacity: 0.7;
  background: #010409;
}

.dialog-heading {
  display: grid;
  grid-template-columns: 4fr 0fr;
  align-items: center;

  margin-bottom: 5px;
}

.dialog-heading > span {
  justify-self: center;

  font-size: 1.5em;
  text-decoration: underline;
}

img.close-dialog {
  width: 30px;
  margin-top: 3px;

  cursor: pointer;

  filter: invert(70%) sepia(7%) saturate(78%) hue-rotate(316deg) brightness(88%)
    contrast(90%);
}

dialog > p {
  font-size: 1.2em;
}

:not(.form-row > label)[aria-disabled="true"] {
  opacity: 0.2;

  cursor: not-allowed;
  user-select: none;
}

button[aria-disabled="true"] {
  opacity: 0.1;
}

.loading-gif {
  width: 70px;
}

.results {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.articulations {
  display: grid;
  grid-template-columns: repeat(auto-fit, 280px);
  gap: 50px 100px;

  justify-content: center;

  width: 100%;

  border: 1px ridge silver;
  padding: 30px;
  margin-top: -10px;

  background-color: var(--bg-color);

  opacity: 1;

  transition: opacity 0.3s;
}

.articulations > .class-list {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  margin-bottom: 20px;

  gap: 10px;

  opacity: 0;

  transition: opacity 0.3s;

  height: min-content;

  color: var(--dark-text);
}

.class-list > a {
  width: 100%;

  text-decoration: none;
  text-align: center;

  background-color: var(--bg-color);
  color: var(--dark-text);

  padding: 7px;
  border: 1px solid var(--dark-text);

  font-size: 1.1em;

  cursor: pointer;
}

.class-list > a:hover {
  background-color: #111111;
}

.class-list > a:active {
  background-color: #1f1f1f;
}

.class-list > p {
  text-align: center;

  white-space-collapse: discard;
}

.loading-container,
.info-text {
  display: flex;
  align-items: center;
  margin-top: -20px;
}

.loading-container {
  justify-content: center;

  gap: 15px;

  margin-bottom: 30px;

  color: silver;

  transition: 0.7s;
}

.info-text {
  flex-direction: column;
  text-align: center;

  margin-bottom: 5px;
}

.results {
  display: none;
  opacity: 0;

  flex-direction: column;
  gap: 20px;

  transition: opacity 0.3s;

  width: 80%;
  max-width: 700px;
}

.conjunction {
  font-weight: bold;
  text-decoration: underline;

  font-size: 2em;

  color: #888888;
}

.connector {
  color: #666666;
}

.no-articulations {
  opacity: 0;

  justify-self: center;

  transition: opacity 0.3s;

  color: var(--dark-text);
}

.selected-class {
  font-size: 2.5vh;
  text-align: center;

  color: var(--dark-text);
}

.cid-section {
  display: none;
  justify-content: center;
  align-items: center;

  position: relative;

  opacity: 0;

  gap: 20px;

  margin: -20px 0 25px 0;
}

.cid-info {
  width: 28px;

  filter: invert(58%) sepia(21%) saturate(0%) hue-rotate(143deg) brightness(83%)
    contrast(99%);

  cursor: pointer;
}

.cids {
  position: relative;
  display: inline-block;

  width: 60px;
  height: 34px;
}

.slider:before {
  position: absolute;
  content: "";

  height: 26px;
  width: 26px;

  bottom: 3px;
  left: 4px;

  background-color: var(--dark-text);
  transition: 0.4s;
}

.slider {
  position: absolute;
  cursor: pointer;

  width: 70px;

  top: 0;
  right: 0;
  bottom: 0;
  left: 0;

  transition: 0.4s;
}

.slider.round {
  border-radius: 34px;
  border: 1px solid silver;
}

.slider.round:before {
  border-radius: 50%;
}

.cids input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cids input:checked + .slider {
  background-color: #5555558c;
}

.cids input:checked + .slider:before {
  transform: translateX(36px);
}

.cids input:focus + .slider {
  box-shadow: 0 0 1px var(--main-text);
}

.cid {
  display: none;

  margin-left: 8px;

  font-size: 0.9em;
  font-weight: bold;

  color: gray;
}

.cid-second-line {
  margin-top: 30px;

  font-size: 0.95em;
  font-style: italic;
}

@font-face {
  font-family: "helvetica_neuelight";
  src:
    url("./fonts/helveticaneuelight-webfont..woff2") format("woff2"),
    url("./fonts/helveticaneuelight-webfont..woff") format("woff");
  font-weight: normal;
  font-style: normal;
}
