@use "../util" as *;
@use "../globals" as *;





$trans-time: 300ms;
$width: 100%;

form{
    display: block;
    margin-top: 1rem;
}

.form-group{
    position: relative;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    flex: 1 0 300px;//TEMP
  }
  
  textarea {
    resize: none;
  }
  
  input:not([type="radio"], [type="radio"]),
  textarea,
  select {
    background: none;
    color: var(--text-core);
    font-weight: $font-weight-600;
    font-size: $base-font-size;
    padding: 10px 24px 10px 5px;
    display: block;
    width: 100%;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid $border-core;
        &:focus { 
            outline: none;
        }
        &:focus ~ label.label-animated,
        &:valid ~ label.label-animated {
            top: -12px;
            font-size: $font-size-sm;
            color: var(--bg-core-primary-darken);
        }
        &:focus ~ .bar:before {
            width: $width;
        }

  }
  
  input[type="password"] {
    letter-spacing: 0.15rem;
  }
  
  label.label-animated {
    color: $text-core-lc;
    font-size: $base-font-size;
    font-weight: $font-weight-400;
    position: absolute;
    pointer-events: none;
    left: 5px;
    top: 10px;
    transition: $trans-time ease all;
  }
  
  .bar {
    position: relative;
    display: block;
    width: $width;
        &:before {
        content: '';
        height: 2px;
        width: 0;
        bottom: 0px;
        position: absolute;
        background: var(--bg-core-primary-darken);
        transition: $trans-time ease all;
        left: 0%;
        }
  }

.input-helper-text{
    position: absolute;
    bottom: -40px;
    line-height: 30px;
    font-size: 12px;
    color: $text-core-lc;
    padding: 5px 10px 10px 5px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
}

/*ERROR*/
.error input:focus ~ label.label-animated,
.error input:valid ~ label.label-animated,
.error textarea:focus ~ label.label-animated,
.error textarea:valid ~ label.label-animated,
.error select:focus ~ label.label-animated,
.error select:valid ~ label.label-animated{
    color: $danger;
}
  
.error .bar:before {
    content: '';
    background:$danger;
}

.input-error-text{
    display: none;
}
.error .input-error-text{
    position: absolute;
    bottom: -40px;
    line-height: 30px;
    display: inline-block;
    font-size: 12px;
    color: $danger;
    padding: 5px 10px 10px 5px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
}

.error .input-helper-text{
    display: none;
}

.error input{
    padding-right:3rem;
}

.error .input-glyph.error {
    display: flex;
    color: $danger;
}

.input-glyph.error {
   display:none;
}

/*GLYPH*/
.input-glyph-wraper {
    position: absolute;
    display: flex;
    height: auto;
    right: 0;
    top: .8rem;
}

.input-glyph {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: $base-margin;
}

.input-glyph i {
    font-size: 1.25rem;
    z-index: 1;
}
/*GLYPH BUTTON*/
.input-glyph.button {
    cursor: pointer;
}

.input-glyph.button:before {
    content: "";
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: transparent;
    cursor: pointer;
    scale: .75;
    transition: scale 0.35s cubic-bezier(0.6,-1.25,0.6,2.25);
}

.input-glyph.button:hover:before {
    background: var(--bg-core-primary-lighten);
    scale: 1;
    opacity: .5;
}

/*GLYPH RESET*/
.input-glyph.button.reset {
    display:none
}

/*SELECT*/


select {
    appearance: none;

    &:focus-within ~ .drop-down {
        height: auto;
        max-height: max-content;
        opacity: 1;
        transition: all $trans-time ease-in-out;
    }
}



.drop-down{
    position: absolute;
    opacity: 0;
    display: flex;
    flex-direction: column;
    top: 46px;
    left: 0;
    min-width: 100%;
    height: 0;
    max-height: 0;
    //padding: $base-padding;
    z-index: 1500;
    list-style: none;
    background-color: #fff;
    box-shadow: $base-box-shadow;
    border-radius: 0 0 $border-radius-lg $border-radius-lg;
}


.dropdown-header {
    display: block;
    padding: 0.5rem 1.5rem;
    margin-bottom: 0;
    font-size: $font-size-sm;
    color: var(--text-core-lc);
    white-space: nowrap;
  }

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.5rem 1.5rem;
    clear: both;
    color: inherit;
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
}

.dropdown-item:focus, .dropdown-item:hover {
    color: var(--text-core-hc);
    text-decoration: none;
    background-color: var(--bg-core-primary-lighten);
}

.dropdown-divider {
    height: 0;
    margin: 0.5rem 0;
    overflow: hidden;
    border-top: 1px solid $border-core;
  }