$border: #008b8b; $border-focus: #008b8b; $brand-color: #1b3d4d; $booking-green: #02595a; $asphalt: #506982; @mixin border-radius($v) { -moz-border-radius: $v; -webkit-border-radius: $v; border-radius: $v; } @mixin transition($v...) { -moz-transition: $v; -o-transition: $v; -webkit-transition: $v; transition: $v; } @mixin appearance($v) { -moz-appearance: $v; -webkit-appearance: $v; } .form-group { margin-bottom: 20px; } .controls { text-align: left; position: relative; width: 100%; margin-top: 5px; margin-bottom: 10px; input[type="text"], input[type="email"], input[type="number"], input[type="date"], input[type="tel"], textarea, button, select { padding: 18px 12px 10px; font-size: 14px; border: 1px solid $border; width: 100%; margin-bottom: 18px; color: $booking-green; font-family: 'Lato', 'sans-serif'; font-size: 16px; font-weight: 300; @include border-radius(2px); @include transition(all .3s); background: #f3fffe; &:focus, &:hover { outline: none; border-color: $border-focus; + label { color: $border-focus; cursor: text; } } } .fa-sort { position: absolute; right: 10px; top: 17px; color: #999; } select { @include appearance(none); cursor: pointer; } label { position: absolute; left: 8px; top: 12px; width: auto; color: $booking-green; font-size: 16px; display: inline-block; padding: 4px 10px; font-weight: 400; background-color: transparent; @include transition(color .3s, top .3s, background-color .8s); &.active { top: -16px; color: $booking-green; background-color: #f3fffe; width: auto; } } textarea { resize: none; height: 200px; } button { cursor: pointer; background-color: $booking-green; border: none; color: #fff; padding: 12px 0; float: right; &:hover { background-color: lighten($brand-color, 5%); } } } .clear:after { content: ""; display: table; clear: both; } $clolr: #0077FF; $inp-Color: #008b8b; /**/ .inp { position: relative; margin: auto; width: 100%; min-width: 280px; border-radius: 3px; overflow: hidden; margin-bottom: 10px; .inp-label { position: absolute; top: 18px; left: 12px; font-size: 18px; color: $inp-Color; font-weight: 500; -webkit-transform-origin: 0 0; transform-origin: 0 0; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); -webkit-transition: all 0.2s ease; transition: all 0.2s ease; pointer-events: none; background: transparent; } .focus-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.05); z-index: -1; -webkit-transform: scaleX(0); transform: scaleX(0); -webkit-transform-origin: left; transform-origin: left; } input, select { -webkit-appearance: none; -moz-appearance: none; appearance: none; width: 100%; border: 0; font-family: inherit; padding: 16px 12px 0 12px; height: 56px; font-size: 16px; font-weight: 400; background: rgba(0, 0, 0, 0.05); //box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.3); color: $inp-Color; -webkit-transition: all 0.15s ease; transition: all 0.15s ease; box-shadow: inset 0 -2px 0 $inp-Color; &:hover { background: rgba(0, 0, 0, 0.08); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.5); } &:not(:placeholder-shown) + .inp-label { color: $inp-Color; -webkit-transform: translate3d(0, -12px, 0) scale(0.9); transform: translate3d(0, -12px, 0) scale(0.9); } &:focus { background: rgba(0, 0, 0, 0.1); outline: none; box-shadow: inset 0 -2px 0 $clolr; + .inp-label { color: $clolr; -webkit-transform: translate3d(0, -12px, 0) scale(0.85); transform: translate3d(0, -12px, 0) scale(0.85); } + .inp-label + .focus-bg { -webkit-transform: scaleX(1); transform: scaleX(1); -webkit-transition: all 0.1s ease; transition: all 0.1s ease; } } } }