/* ************************************************************ 
* Float-label
* TODO. Crear clases y modificar margenes para form-control y form-control-sm
* https://github.com/tonystar/float-label-css
*
*************************************************************/

.has-float-label {
    display: block;
    position: relative;
}
.has-float-label input:focus {
/* Eliminamos el box Shadow de focus que usa bootstrap porque
se monta encima de las letras */
    box-shadow: none;
}
.has-float-label select:focus {
/* Eliminamos el box Shadow de focus que usa bootstrap porque
se monta encima de las letras */
    box-shadow: none;
}
.has-float-label textarea:focus {
/* Eliminamos el box Shadow de focus que usa bootstrap porque
se monta encima de las letras */
    box-shadow: none;
}

.has-float-label label, .has-float-label>span {
    position: absolute;
    cursor: text;
    font-size: 75%;
    opacity: 1;
    -webkit-transition: all .2s;
    transition: all .2s;
    top: -.5em;
    left: .75rem;
    z-index: 3;
    line-height: 1;
    padding: 0 1px
}
/* Fix para Inputs normales */
.has-float-label label, .has-float-label>span.standard-input {
    top: -.8em;
    line-height: 1.5;
}
.has-float-label label {
    /* Esta propiedad permite que aunque se haga clic sobre el label el clic pase hasta el input  */
    pointer-events: none
}
.has-float-label label::after, .has-float-label>span::after {
    content: " ";
    display: block;
    position: absolute;
    background: #fff;
    height: 2px;
    top: 50%;
    left: -.2em;
    right: -.2em;
    z-index: -1
}

 .has-float-label .form-control::-webkit-input-placeholder {
    opacity: 1;
    -webkit-transition: all .2s;
    transition: all .2s
}
 .has-float-label .form-control::placeholder {
    /* El recurso necesita que exista placeholder y tenga datos para hacer las trancisiones */
    /* Asi que usamos uno dummy y lo camuflamos */
    color:#FFF;
}

.has-float-label .form-control:placeholder-shown:not(:focus)::-webkit-input-placeholder {
    opacity: 0
}

.has-float-label .form-control:placeholder-shown:not(:focus)+* {
    font-size: 0.875rem;
    /* opacity: .5; */
    color: #495057;
    top: .6em
} 

.input-group .has-float-label {
    display: table-cell
}

.input-group .has-float-label .form-control {
    border-radius: .25rem
}

.input-group .has-float-label:not(:last-child), .input-group .has-float-label:not(:last-child) .form-control {
    border-bottom-right-radius: 0;
    border-top-right-radius: 0;
    border-right: 0
}

.input-group .has-float-label:not(:first-child), .input-group .has-float-label:not(:first-child) .form-control {
    border-bottom-left-radius: 0;
    border-top-left-radius: 0
}

/* ==== Ajusta para darkmode ==== */
body.darkmode-body .has-float-label label::after, .has-float-label>span::after {
    background-color: #111;
}
