* {
  box-sizing: border-box;
}

html {
  padding: 0;
  margin: 0;
  background: #9dbbcc;
  height: 100vh;
  background-attachment: fixed;
}

body {
  margin: 0.5em 0 0;
  padding: 0;
  color: #333;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans",
    "Droid Sans", "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.4;
}

.main {
  max-width: 48em;
  margin: 0 auto;
}

a {
  color: #c30000;
}

a:visited {
  color: #980128;
}

#fov-extra-info {
  color: #f00;
  text-align: center;
}

.caption {
  text-align: center;
  padding-bottom: 0.5em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  margin-bottom: 0.5em;
}

h1, h2 {
  color: #722;
  text-shadow: 0 1px 3px rgba(192, 0, 0, 0.2);
}

h1 {
  margin: 0;
  padding: 0;
  font-weight: normal;
  font-size: 2em;
}

h2 {
  margin: 0;
  padding: 0;
  font-weight: normal;
  font-size: 1.2em;
}

p {
  margin: 0 0 0.5em;
  padding: 0;
}

.note {
  font-size: 80%;
  color: #737373;
  letter-spacing: 1px;
  margin: 0.5em 0 0.7em;
  clear: both;
}

form {
  max-width: 35em;
  margin: 0 auto 0.5em;
  border-bottom: 2px solid #78a3ca;
}

fieldset {
  margin: 0 0 1em;
  padding: 0.5em;
  border: none;
}

legend {
  display: block;
  margin: 0;
  padding: 0;
}

.units label {
  display: block;
  margin: 0 0 0.5em;
}

input + label {
  margin-top: 0.1em;
}

input,
textarea,
select {
  font: inherit;
}

select {
  margin-left: 0.5em;
}

input[type="text"],
input[type="number"],
textarea {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  border: 1px solid #999;
  border-radius: 4px;
  background-color: #f4f4f4;
  padding: 0.2em 0 0.2em 0.5em;
  line-height: 1;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus {
  border-color: #f10000;
  color: #800;
}

input[type="number"] {
  float: left;
  margin: 0 0 0 0.5em;
  width: 4em;
}

#aspect-ratio-custom {
  display: inline-block;
  margin-left: 1em;
  visibility: hidden;
}

#aspect-ratio-custom.visible {
  visibility: visible;
}

#aspect-ratio-custom input[type="number"] {
  float: none;
  display: inline-block;
  margin: 0;
}

input[type="range"] {
  display: block;
  float: left;
  width: calc(100% - 11em);
}

input[type="number"] + label {
    margin-left: 0.5em;
    float: left;
}

.unit-switch::before,
.unit-switch::after {
  display: block;
  width: 0;
  overflow: visible;
  float: right;
}

.unit-switch::before {
  content: "inch";
  margin-top: -1.2em;
}

.unit-switch::after {
  content: "cm";
  margin-top: -1em;
}

.unit-switch input {
  display: none;
}

.unit-switch_slider {
  display: block;
  position: relative;
  width: 1.05em;
  height: 3em;
  margin-right: 0.3em;
  background-color: #78a3ca;
  margin-top: -0.7em;
  border-radius: 0.5em;
  border-width: 1px;
  border-style: solid;
  border-color: #444 #777 #777 #444;
  box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  cursor: ns-resize;
}

.unit-switch_slider:hover {
  background-color: #a1cef7;
  border-color: #555 #888 #888 #555;
}

.unit-switch_slider--thumb {
  display: block;
  position: absolute;
  width: 0.82em;
  height: 0.82em;
  left: 1px;
  top: auto;
  bottom: 1px;
  border-radius: 50%;
  background-color: #f10000;
  box-shadow:
    inset 1px 1px 2px rgba(255, 180, 100, 0.8),
    inset -1px -1px 2px rgba(0, 0, 64, 0.2),
          0 1px 3px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 0, 0, 0.4);
}

.unit-switch_slider:hover .unit-switch_slider--thumb {
  background-color: #ff588d;
  border-color: rgba(160, 0, 0, 0.5);
}


.unit-switch.inches .unit-switch_slider--thumb {
  top: 1px;
  bottom: auto;
}

#fov-preview {
  display: block;
  max-width: 600px;
  max-height: 520px;
  border: none;
  margin: 0.5em auto;
  cursor: crosshair;
  font: inherit;
}

.slider {
  margin-top: 0.1em;
  height: 1.3em;
  width: calc(100% - 11em);
  float: left;
  clear: left;
  padding: 0;
  position: relative;
}

.slider__track {
  /* Visual track */
  position: absolute;
  top: 0.4em;
  left: 0.5em;
  right: 0.5em;
  height: 0.3em;
  background-color: #78a3ca;
  border-width: 0.05em;
  border-style: solid;
  border-color: #444 #777 #777 #444;
  z-index: 1;
}

.slider__thumb-container {
  /* For easier positioning of thumb */
  position: absolute;
  top: 0.03em;
  left: 0.5em;
  right: 0.5em;
  bottom: 0;
  z-index: 2;
}

.slider__thumb {
  position: absolute;
  top: 0.13em;
  left: 50%;
  width: 0.82em;
  height: 0.82em;
  margin-left: -0.4em;
  border-radius: 50%;
  background-color: #f10000;
  box-shadow:
    inset 1px 1px 2px rgba(255, 180, 100, 0.8),
    inset -1px -1px 2px rgba(0, 0, 64, 0.2),
          0 1px 3px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 0, 0, 0.4);
}

.slider__thumb:hover {
  background-color: #ff588d;
  border-color: rgba(160, 0, 0, 0.5);
}

.feedback-popper {
  text-align: center;
}

.popup-background {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.popup-background.visible {
  display: grid;
  align-items: center;
}

.popup-background form {
  background: #ddd;
  border: 1px solid #aaa;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
  width: 20em;
  padding: 1em;
}

.popup-background form label {
  display: block;
  margin-top: 1em;
}

.popup-background form textarea,
.popup-background form input {
  display: block;
  width: 100%;
}

.popup-background form textarea {
  height: 8em;
}

.popup-background form p {
  margin: 0 0 1em;
}

.too-long {
  color: #800;
}

button {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid #aaa;
  background-color: #eee;
  color: #444;
  border-radius: 0;
  font: inherit;
  box-shadow:
    inset 1px 1px 1px #fff,
    0 2px 3px rgba(0, 0, 0, 0.1);
  padding: 0.2em 0.5em;
}

button:hover {
  background-color: #fff;
  color: #000;
  border-color: #888;
}

button[type="submit"] {
  background-color: #ded;
}

button[type="submit"]:hover {
  background-color: #dfd;
}

button:active {
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.1);
}

button:disabled {
  pointer-events: none;
  opacity: 0.5;
}

.form-buttons {
  text-align: right;
}

.form-buttons button {
  width: 6em;
}

.number-hint {
  display: none;
  float: right;
  clear: both;
  width: 21em;
  margin: 0 2em 0 0;
  padding: 0.5em 1em;
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.1);
  background-color: #eed;
  font-size: 0.8em;
}

.number-hint.visible {
  display: block;
}

@media (max-width: 56em) {
  body {
    margin: 0.5em;
    padding: 0 0.5em;
  }

  #fov-preview {
    max-width: 100%;
  }
}

@media (max-width: 580px) {
  body {
    border: none;
    margin: 0;
    box-shadow: none;
    min-height: 100%;
  }

  h1 {
    margin: 0 0 0.5em;
  }

  #fov-preview {
    max-width: 100%;
  }
}
