 * ----------------------------------------------------------------------------
 * Basic form
 * ----------------------------------------------------------------------------
 */
.Form {
  width: 100%;
}

.Form__Item {
  position: relative;
  margin-bottom: 15px;
}

.Form__Input,
.Form__Textarea,
.spr-form-input-text,
.spr-form-input-email,
.spr-form-input-textarea {
  -webkit-appearance: none;
  display: block;
  padding: 12px 14px;
  border-radius: 0;
  border: 1px solid var(--border-color);
  width: 100%;
  line-height: normal;
  resize: none;
  transition: border-color 0.1s ease-in-out;
  background: transparent;
}

.Form__Input:focus,
.Form__Textarea:focus,
.spr-form-input-text:focus,
.spr-form-input-email:focus,
.spr-form-input-textarea:focus {
  border-color: rgba(var(--text-color-rgb), 0.8);
  outline: none;
}

.Form__Input::-moz-placeholder, .Form__Textarea::-moz-placeholder, .spr-form-input-text::-moz-placeholder, .spr-form-input-email::-moz-placeholder, .spr-form-input-textarea::-moz-placeholder {
  color: var(--text-color-light);
}

.Form__Input:-ms-input-placeholder, .Form__Textarea:-ms-input-placeholder, .spr-form-input-text:-ms-input-placeholder, .spr-form-input-email:-ms-input-placeholder, .spr-form-input-textarea:-ms-input-placeholder {
  color: var(--text-color-light);
}

.Form__Input::placeholder,
.Form__Textarea::placeholder,
.spr-form-input-text::placeholder,
.spr-form-input-email::placeholder,
.spr-form-input-textarea::placeholder {
  color: var(--text-color-light);
}

.Form__FloatingLabel {
  position: absolute;
  bottom: calc(100% - 8px);
  left: 10px;
  padding: 0 5px;
  line-height: normal;
  color: var(--text-color-light);
  font-size: calc(var(--base-text-font-size) - (var(--default-text-font-size) - 12px));
  opacity: 0;
  background: rgba(var(--background-rgb), 0);
  pointer-events: none;
  transform: translateY(3px);
  transition: all 0.3s ease-in-out;
}

.Form__Input:not(:-moz-placeholder-shown) ~ .Form__FloatingLabel, .Form__Textarea:not(:-moz-placeholder-shown) ~ .Form__FloatingLabel {
  opacity: 1;
  background: var(--background);
  transform: translateY(0);
}

.Form__Input:not(:-ms-input-placeholder) ~ .Form__FloatingLabel, .Form__Textarea:not(:-ms-input-placeholder) ~ .Form__FloatingLabel {
  opacity: 1;
  background: var(--background);
  transform: translateY(0);
}

.Form__Input:not(:placeholder-shown) ~ .Form__FloatingLabel,
.Form__Textarea:not(:placeholder-shown) ~ .Form__FloatingLabel {
  opacity: 1;
  background: var(--background);
  transform: translateY(0);
}

.Form__Checkbox {
  position: absolute;
  opacity: 0;
}

.Form__Checkbox ~ label::before {
  display: inline-block;
  content: "";
  width: 1em;
  height: 1em;
  margin-right: 10px;
  border: 1px solid var(--border-color);
  vertical-align: -2px;
}

.Form__Checkbox ~ svg {
  position: absolute;
  top: 5px;
  left: 1px;
  width: 12px;
  height: 12px;
  transform: scale(0);
  transition: transform 0.2s ease-in-out;
  will-change: transform;
}

.Form__Checkbox:checked ~ label::before {
  border-color: var(--text-color);
}

.Form__Checkbox:checked ~ svg {
  transform: scale(1);
}

.Form__Alert,
.spr-form-message {
  margin-bottom: 20px;
}

.Form__Submit {
  display: block;
  margin-top: 20px;
}

.Form__Label,
.spr-form-label {
  display: block;
  padding-bottom: 8px;
  font-size: calc(var(--base-text-font-size) - (var(--default-text-font-size) - 11px));
  text-transform: uppercase;
  font-family: var(--heading-font-family);
  font-weight: var(--heading-font-weight);
  font-style: var(--heading-font-style);
  letter-spacing: 0.2em;
  line-height: normal;
}

.Form--small .Form__Input,
.Form--small .Form__Textarea {
  font-size: calc(var(--base-text-font-size) - (var(--default-text-font-size) - 13px));
  padding-top: 10px;
  padding-bottom: 10px;
}

.Form--spacingTight .Form__Item {
  margin-bottom: 15px;
}

.Form--spacingTight .Form__Alert {
  margin-bottom: 20px;
}

@media screen and (min-width: 641px) {
  .Form__Item,
  .Form__Alert {
    margin-bottom: 30px;
  }

  .Form__Group {
    display: flex;
  }

  .Form__Group > .Form__Item {
    flex: 1;
  }

  .Form__Group > :nth-child(2) {
    margin-left: 30px;
  }

  .Form--spacingTight .Form__Group > :nth-child(2) {
    margin-left: 15px;
  }
}

/**
 * ----------------------------------------------------------------------------
 * Form elements
 * ----------------------------------------------------------------------------
 */

.Form__Header {
  margin-bottom: 24px;
  text-align: center;
}

.Form__Hint {
  margin: 24px 0 0 0;
}

.Form__Hint:not(:last-child) {
  margin-bottom: 32px;
}

.Form__Hint--center {
  text-align: center;
}

.Form__ItemHelp {
  position: absolute;
  right: 12px;
  top: 50%;
  font-size: calc(var(--base-text-font-size) - (var(--default-text-font-size) - 12px));
  color: var(--text-color-light);
  transform: translateY(-50%);
}
