fieldset {
  border: none;
  margin: 0;
  padding: 0;
  legend {
    display: block;
    padding-top: 1em;
    width: 100%;
    font-size: 14px;
    font-weight: 600;
    color: #757575;
  }
  p.switch {
    label {
      position: static;
    }
    input[type="checkbox"] {
      appearance: none;
      outline: 0;
      border: none;
      border-radius: 0;
      background: none;
      position: absolute;
      right: 0;
      width: 100%;
      height: 100%;
      &:before {
        content: "";
        position: absolute;
        right: 22px;
        top: 2px;
        height: 28px;
        width: 28px;
        border-radius: 50%;
        display: block;
        background: white;
        border: none;
        z-index: 2;
        box-shadow: 0 2px 5px rgba(0,0,0,.4);
        transform: translateZ(0);
        transition: transform 300ms ease-in 0s;
      }
      &:after {
        content: "";
        right: 0;
        width: 52px;
        height: 32px;
        background: @secondary_color;
        box-shadow: inset 0 0 0 16px #e5e5e5;
        border-radius: 16px;
        display: block;
        position: absolute;
        z-index: 1;
        transition: all 300ms ease-in 0s;
      }
      &:checked:before {
        transform: translateX(20px);
        box-shadow: 0 2px 5px rgba(0,0,0,.4);
      }
      &:checked:after {
        box-shadow: inset 0 0 0 0 @secondary_color;
      }
    }
  }
  p.radio {
    position: relative;
    border-bottom: 1px solid #c8c7cc;
    margin: 0;
    label {
      cursor: pointer;
      display: block;
      width: 100%;
      padding: 8px 0;
    }
    input[type=radio] {
      appearance: none;
      position: absolute;
      outline: 0;
      display: block;
      width: 100%;
      height: 100%;
      border: none;
      border-radius: 0;
      background: none;
    }
    input[type=radio]:checked {
      position: absolute;
      top: 4px;
      right: 0;
      width: 20px;
      height: 25px;
      background: no-repeat center;
      background-image: data-uri('../img/checkbox.svg');
      background-size: 15px 11px;
      z-index: 1;
    }
  }
}
fieldset > p {
  position: relative;
  margin-top: 1em;
  textarea {
    resize: none;
    overflow: hidden;
    height: 4em;
  }
  input[type="text"],
  textarea,
  select {
    appearance: none;
    outline: none;
    border-radius: 0;
    height: 2em;
    box-sizing: border-box;
    background-color: transparent;
    width: 100%;
    font-size: 17px;
    padding: 20px 8px;
    display: block;
    border: 1px solid #cbcbcb;
    margin-top: 1em;
    transition: border 150ms ease;
    &:focus {
      border: 1px @primary_color solid;
    }

    &:not(select):valid ~ label {
      transform: translate3d(-5px, -5px, 0) scale3d(.6, .6, 1);
      color: @primary_color;
    }
  }

  select {
    padding: 0 8px;
  }
  label {
    color: #757575;
    font-size: 16px;
    margin-left: 8px;
    transform: translate3d(0, 8px, 0) scale3d(1, 1, 1);
    font-weight: normal;
    position: absolute;
    pointer-events: none;
    left: 0;
    top: 0;
    transition: transform 150ms ease-in-out;
  }
  select {
    direction: rtl;
    color: #757575;
    option {
      direction: ltr;
    }
    & ~ label {
      color: inherit;
    }
  }
}
@-webkit-keyframes inputHighlighter {
  from {
    background: @primary_color;
  }
  to {
    width: 0;
    background: transparent;
  }
}
@-moz-keyframes inputHighlighter {
  from {
    background: @primary_color;
  }
  to {
    width: 0;
    background: transparent;
  }
}
@keyframes inputHighlighter {
  from {
    background: @primary_color;
  }
  to {
    width: 0;
    background: transparent;
  }
}
