@import '../../styles/common/colors';

.radio-component {
  cursor: pointer;
  overflow: hidden;
  position: relative;
  width: 100%;

  > input {
    cursor: pointer;
    height: 100%;
    left: 0;
    margin: 0;
    opacity: 0;
    padding: 0;
    position: absolute;
    width: 100%;
    z-index: 2;
  }

  &:not(.radio-disabled) {

    > input:checked + div .radio-input {
      border-color: $primary-1;

      &:before {
        content: "";
        background-color: $primary-1;
        border-radius: 50%;
        display: block;
        height: 9px;
        left: 3px;
        position: relative;
        top: 3px;
        width: 9px;
      }
    }
  }

  > div {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;

    .radio-input {
      background-color: $white;
      border-radius: 50%;
      border: solid 1px $neutral-3;
      height: 15px;
      flex-shrink: 0;
      width: 15px;
    }

    label {
      color: $navy-text;
      font-size: 14px;

      &.label-left{
        margin-right: 10px;
      }
      &.label-right {
        margin-left: 10px;
      }
    }
  }

  &.radio-error {
    > div .radio-input {
      border-color: $danger;
    }
  }

  &.radio-disabled {
    cursor: not-allowed;

    > input {
      cursor: not-allowed;
    }

    > div {
      label {
        color: $neutral-3;
      }
      .radio-input {
        background-color: $neutral-3;
        border-color: $neutral-3;
        &:before {
          display: none;
        }
      }
    }
  }
}

.radio-group {
  .radio-component {
    margin-bottom: 15px;

    &:last-child {
      margin-bottom: 0;
    }
  }
  > .asterisk {
    color: $danger;
    float: left;
    margin-right: 5px;
  }
  > label {
    display: block;
    margin-bottom: 10px;
  	font-size: 16px;
  	color: $navy-text;
    font-family: proxima_nova;
    font-weight: 200;
  }
}
