// ==================================================
// 📝 Forms & Inputs Styles
// ==================================================

.form-input-layout{

}
.form{
  .form-group{
    margin-bottom: 0;
    label {
      display: inline-flex;
      align-items: flex-start;
      gap: 1px;
      padding-left: 8px;
      margin-bottom: 0;
      //@include font-size(18, 600, $warm-gray-14);
      &.f-14{

      }
    }
    .input-container{
      position: relative;
      &.has-error{
        .form-control {
          border-bottom: 3px solid $bright-red-12;
        }
      }
      &.has-icon{
        display: grid;
        grid-template-columns: 17px 1fr;
        align-items: center;
        column-gap: 9px;
        padding: 0 8px;
        border-bottom: 2px solid $warm-gray-14;
        &.mileage-grid{
          //grid-template-columns: 17px 1fr 90px;
          grid-template-columns: auto 1fr auto;
          padding: 0 0 0 8px;
          select{
            //padding: 0 13px;
            padding: 0 25px 0 13px;
          }
        }
        .input-icon{
          max-width: 17px;
        }
        .form-control{
          height: 38px;
          padding: 7px 0 9px;
          border-bottom: unset;
        }
        select {
          background-position: calc(100% - 5px) 50%;
        }
      }
      .form-control {
        width: 100%;
        height: 40px;
        padding: 10px 8px;
        border-radius: 0;
        border: none;
        outline: none;
        appearance: none;
        background-color: transparent;
        border-bottom: 2px solid $warm-gray-14;
        @include font-size(18, 400, $cool-gray-12);
        &::placeholder {
          color: $cool-gray-14;
        }
        &:focus {
          box-shadow: none;
        }
      }
      select {
        background: url("../../assets/icons/arrows/down-stroke-angle-arrow-gray-icon.svg");
        background-repeat: no-repeat;
        background-size: 12px;
        background-position: calc(100% - 13px) 50%;
        //color: $cool-gray-14!important;
        color: $cool-gray-12!important;
      }
    }

    ul.checkbox-list{
      li{
        display: grid;
        grid-template-columns: 16px 1fr;
        align-items: center;
        column-gap: 16px;
        &:not(:last-of-type){
          margin-bottom: 22px;
          @media screen and (max-width: $screen-xs) {
            margin-bottom: 18px;
          }
        }
        label{
          position: relative;
          cursor: pointer;
          display: block;
          margin-bottom: 0;
          padding-left: 0;
          user-select: none;
          @include font-size(18, 400, $cool-gray-08);
          a{
            text-decoration: underline;
            @include font-size(18, 400, $cool-gray-08);
          }
        }
        input[type=checkbox] {
          position: relative;
          height: 16px;
          width: 16px;
          cursor: pointer;
          border-radius: 50%;
          background: transparent;
          border: 1px solid $cool-gray-12;
          vertical-align: text-top;
          -webkit-appearance: none;
          &:checked {
            opacity: 1;
            border-color: $cool-gray-12;
            background: transparent;
            &:before {
              opacity: 1;
            }
            & + label{
              //font-weight: 700;
            }
          }
          &:before{
            content: "";
            background: url("../../assets/icons/others/form-check-black-icon.svg") no-repeat center;
            background-size: cover;
            width: 9px;
            height: 7px;
            position: absolute;
            top: 50%;
            right: 50%;
            transform: translateX(4.5px) translateY(-3px);
            z-index: 2;
            opacity: 0;
          }
        }
      }
    }

    ul.radio-list{
      li{
        display: grid;
        grid-template-columns: 16px 1fr;
        align-items: center;
        column-gap: 16px;
        &:not(:last-of-type){
          margin-bottom: 16px;
          @media screen and (max-width: $screen-xs) {
            margin-bottom: 12px;
          }
        }
        label{
          display: inline-flex;
          align-items: center;
          gap: 16px;
          position: relative;
          cursor: pointer;
          //display: block;
          margin-bottom: 0;
          padding-left: 0;
          user-select: none;
          @include font-size(18, 400, $cool-gray-08);
          a{
            text-decoration: underline;
            @include font-size(18, 400, $cool-gray-08);
          }
        }
        input[type=radio] {
          position: relative;
          top: 1px;
          height: 16px;
          width: 16px;
          cursor: pointer;
          border-radius: 50%;
          background: transparent;
          border: 1px solid $cool-gray-12;
          vertical-align: text-top;
          -webkit-appearance: none;
          &:checked {
            opacity: 1;
            border-color: $cool-gray-12;
            background: transparent;
            &:before {
              opacity: 1;
            }
            & + label{
              //font-weight: 700;
            }
          }
          &:before{
            content: "";
            background: $cool-gray-12;
            border-radius: 50%;
            width: 6px;
            height: 6px;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translateX(-50%) translateY(-50%);
            z-index: 2;
            opacity: 0;
            transition: $transition-01;
          }
        }
      }
    }

    ul.switch-list{
      li{
        display: block;
        &:not(:last-of-type){
          margin-bottom: 22px;
          @media screen and (max-width: $screen-xs) {
            margin-bottom: 18px;
          }
        }
        .switch {
          position: relative;
          display: inline-flex;
          align-items: center;
          gap: 8px;
          padding-left: 0;
          input {
            display: none;
          }

          .slider {
            position: relative;
            display: inline-block;
            width: 36px;
            height: 20px;
            background-color: $cool-gray-04;
            border-radius: 50px;
            transition: 0.4s;
            cursor: pointer;

            &:before {
              position: absolute;
              content: "";
              height: 16px;
              width: 16px;
              left: 2px;
              bottom: 2px;
              border-radius: 50%;
              background-color: $white;
              box-shadow: $box-shadow-01;
              transition: 0.4s;
            }
          }

          input:checked + .slider {
            background-color: #98E1BF;
          }

          input:focus + .slider {
            box-shadow: 0 0 1px #98E1BF;
          }

          input:checked + .slider:before {
            transform: translateX(16px);
          }

          .switch-label {
            cursor: pointer;
            user-select: none;
            @include font-size(18, 400, $cool-gray-08);
          }
        }

      }
    }

    .range-slider-input{
      position: relative;
      //width: 300px;

      .slider{
        -webkit-appearance: none;
        width: 100%;
        height: 6px;
        border-radius: 5px;
        background: linear-gradient(to right, $primary-01 50%, $warm-gray-11 50%);
        outline: none;
        transition: background 150ms ease-in-out;
        &::-webkit-slider-thumb {
          -webkit-appearance: none;
          appearance: none;
          width: 22px;
          height: 22px;
          border-radius: 50%;
          background: $primary-01;
          cursor: pointer;
          box-shadow: $box-shadow-06;
          margin-top: 0;
        }
        &::-moz-range-thumb {
          width: 22px;
          height: 22px;
          border-radius: 50%;
          background: $primary-01;
          cursor: pointer;
        }
      }

      .range-value {
        font-weight: 600;
        position: absolute;
        bottom: -25px;
        transform: translateX(-50%);
        pointer-events: none;
        margin-bottom: 0;
      }

      .range-hidden-value {
        display: none;
      }
    }

  }
}
