/* ==============================================
 Forms - theme "public" (FormModel + views/form/public, vim.form.js)
 Self-contained: the base of the fields (former sky-forms plugin + Unify) is here, under .vim-form.
 Kept out of shop.style.css - a new design / Bootstrap = new theme file + templates.
 =============================================== */

/* ---------- base: fields of the templates (taken over from sky-forms 2.0.1 + Unify custom-sky-forms +
   sky-changes-4, final values; only what the templates use - the grid is Bootstrap's .row / .col-sm-*) ---------- */
.vim-form {
    margin: 0;
    outline: none;
    font: 13px/1.55 'Open Sans', Helvetica, Arial, sans-serif;
    color: #666;
}

.vim-form fieldset {
    display: block;
    padding: 0;
    border: none;
    background: transparent;
}

.vim-form footer {
    display: block;
    padding: 0;
    border-top: none;
    background: transparent;
}

.vim-form footer:after {
    content: '';
    display: table;
    clear: both;
}

.vim-form a {
    color: inherit;
}

.vim-form a.btn-u {
    color: #fff;
}

.vim-form button {
    float: none;
    margin-left: 0;
}

.vim-form button *,
.vim-form button *:after,
.vim-form button *:before {
    margin: 0 auto;
    padding: 0 auto;
}

.vim-form label.label-v2 {
    display: block;
    color: #999;
    font-size: 14px;
    font-weight: 400;
}

.vim-form .note {
    margin-top: 6px;
    padding: 0 1px;
    font-size: 11px;
    line-height: 15px;
    color: #999;
}

/* text inputs, selects, textareas: <label class="input|select|textarea"><input|select|textarea></label> */
.vim-form .input,
.vim-form .select,
.vim-form .textarea,
.vim-form .radio,
.vim-form .checkbox {
    position: relative;
    display: block;
}

.vim-form .input input,
.vim-form .select select,
.vim-form .textarea textarea {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 34px;
    padding: 6px 12px;
    outline: none;
    border: 1px solid #bbb;
    border-radius: 0;
    background: #fff;
    font: 14px/19px 'Open Sans', Helvetica, Arial, sans-serif;
    color: #404040;
    appearance: none;
    -moz-appearance: none;
    -webkit-appearance: none;
    transition: border-color .3s;
}

.vim-form .select select {
    padding: 6px 10px;
}

.vim-form .textarea textarea {
    height: auto;
    resize: none;
}

.vim-form .input:hover input,
.vim-form .select:hover select,
.vim-form .textarea:hover textarea {
    border-color: #999;
}

.vim-form .input input:focus,
.vim-form .select select:focus,
.vim-form .textarea textarea:focus {
    border-color: #bbb;
    box-shadow: 0 0 2px #c9c9c9;
}

/* select arrow: <i></i> after the select */
.vim-form .select i {
    position: absolute;
    top: 14px;
    right: 13px;
    width: 9px;
    height: 6px;
    background: #fff;
    box-shadow: 0 0 0 12px #fff;
}

.vim-form .select i:after,
.vim-form .select i:before {
    content: '';
    position: absolute;
    top: 4px;
    right: 0;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}

.vim-form .select i:after {
    bottom: 0;
    border-top: 4px solid #404040;
}

.vim-form .select i:before {
    top: -2px;
    border-bottom: 4px solid #404040;
}

/* disabled field: <label class="input state-disabled"> */
.vim-form .input.state-disabled input {
    cursor: default;
    opacity: .5;
}

.vim-form .input.state-disabled:hover input {
    border-color: #bbb;
}

/* icon in the input: <label class="input"><i class="icon-prepend fa fa-user"></i><input></label> (Field icon) */
.vim-form .icon-prepend {
    position: absolute;
    top: 1px;
    width: 29px;
    height: 32px;
    font-size: 14px;
    line-height: 33px;
    text-align: center;
    color: #b3b3b3;
    background: inherit;
}

.vim-form .icon-prepend {
    left: 6px;
    padding-right: 5px;
    border-right: 1px solid #bbb;
}

.vim-form .input .icon-prepend + input {
    padding-left: 46px;
}

/* radios + checkboxes: <label class="radio|checkbox"><input><i></i>text</label>, the input is hidden */
.vim-form .radio,
.vim-form .checkbox {
    margin-bottom: 4px;
    padding-left: 27px;
    font-size: 15px;
    font-weight: 400;
    line-height: 27px;
    color: #404040;
    cursor: pointer;
}

.vim-form .radio:last-child,
.vim-form .checkbox:last-child {
    margin-bottom: 0;
}

/* Bootstrap shifts a following radio / checkbox up by 5px */
.vim-form .radio + .radio,
.vim-form .checkbox + .checkbox {
    margin-top: 0;
}

.vim-form .radio input,
.vim-form .checkbox input {
    position: absolute;
    left: -9999px;
}

.vim-form .checkbox input {
    top: 4px;
    left: 1px !important; /* behind the box - still focusable / announced */
    margin-left: 0 !important;
}

.vim-form .radio i,
.vim-form .checkbox i {
    position: absolute;
    top: 5px;
    left: 0;
    display: block;
    width: 17px;
    height: 17px;
    outline: none;
    border: 1px solid #bbb;
    background: #fff;
    transition: border-color .3s;
}

.vim-form .radio i {
    border-radius: 50%;
}

.vim-form .radio input + i:after,
.vim-form .checkbox input + i:after {
    position: absolute;
    opacity: 0;
    transition: opacity .1s;
}

.vim-form .radio input + i:after {
    content: '';
    top: 5px;
    left: 5px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: #999;
}

.vim-form .checkbox input + i:after {
    content: '\f00c';
    top: 2px;
    left: 0;
    width: 15px;
    height: 15px;
    font: 600 10px 'Font Awesome 5 Free';
    text-align: center;
    color: #999;
}

.vim-form .radio input:checked + i:after,
.vim-form .checkbox input:checked + i:after {
    opacity: 1;
}

.vim-form .radio:hover i,
.vim-form .checkbox:hover i,
.vim-form .radio input:checked + i,
.vim-form .checkbox input:checked + i,
.vim-form .radio input:focus + i,
.vim-form .checkbox input:focus + i {
    border-color: #999;
    box-shadow: none;
}

/* radios in one line (radio / thumbs template) */
.vim-form .inline-group {
    margin: 0 -30px -4px 0;
}

.vim-form .inline-group:after {
    content: '';
    display: table;
    clear: both;
}

.vim-form .inline-group .radio {
    float: left;
    margin-right: 30px;
}

.vim-form .inline-group .radio:last-child {
    margin-bottom: 4px;
}

[hidden] {
    display: none !important;
}

/* ---------- busy / locked button (VIMForm.busy, any button on the page) ---------- */
.vim-busy {
    cursor: wait;
}

button.vim-busy,
input.vim-busy {
    position: relative;
    -webkit-text-fill-color: transparent;
    pointer-events: none;
}

button.vim-busy * {
    visibility: hidden;
}

button.vim-busy:after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1em;
    height: 1em;
    margin: -.5em 0 0 -.5em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: vim-spin .7s linear infinite;
}

button[disabled],
input[type=submit][disabled] {
    opacity: .65;
    cursor: not-allowed;
}

@keyframes vim-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- form frame ---------- */
.vim-form section {
    margin-bottom: 15px;
}

.vim-form.vim-busy textarea,
.vim-form.vim-busy input,
.vim-form.vim-busy select {
    pointer-events: none;
    opacity: .7;
}

/* honeypot (AntiSpamGuard) - off screen, not display:none (some bots skip hidden fields) */
.vim-form .vim-hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
}

.vim-form.vim-form-boxed {
    border: 1px solid #eee;
}

.vim-form.vim-form-boxed fieldset {
    padding: 20px 20px 5px;
}

.vim-form.vim-form-boxed footer {
    padding: 0 20px 20px;
    text-align: right;
}

.vim-form.vim-form-boxed .vim-form-msg {
    margin: 0 20px 15px;
}

/* ---------- Bootstrap .panel inside a form (e.g. checkout sections): grey box, taller light inputs ---------- */
.vim-form .panel {
    margin-bottom: 0;
    border-color: #eee;
    border-radius: 0;
    background: #f8f8f8;
    box-shadow: none;
}

.vim-form .panel-body {
    padding: 20px 20px 5px;
}

.vim-form .panel .input input,
.vim-form .panel .select select {
    height: 40px;
    border-color: #eee;
    color: #555;
}

.vim-form .panel .textarea textarea {
    border-color: #eee;
    color: #555;
}

.vim-form .panel .select i {
    top: 17px; /* arrow in the middle of the 40px select */
}

.vim-form .panel .input input::placeholder,
.vim-form .panel .textarea textarea::placeholder {
    color: #888;
}

.vim-form .panel .input.state-disabled input {
    background: #eee;
}

.vim-form .panel .radio,
.vim-form .panel .checkbox {
    font-size: 14px;
}

/* ---------- errors (answer.errors -> VIMForm.showErrors) ---------- */
.vim-field-error {
    margin-top: 5px;
    color: #a94442;
    font-size: 12px;
    line-height: 1.4;
}

.vim-form .vim-has-error .input input,
.vim-form .vim-has-error .textarea textarea,
.vim-form .vim-has-error .select select {
    border-color: #e9a9a9;
    background: #fff6f6;
}

.vim-has-error .stars-ratings label,
.vim-has-error .vim-thumbs .vim-thumb {
    color: #e3a5a5;
}

.vim-form-msg {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 3px;
    color: #3c763d;
    background: #dff0d8;
}

.vim-form-msg.vim-form-msg-error {
    color: #a94442;
    background: #f2dede;
}

/* ---------- rating (stars) ---------- */
.stars-ratings input:checked ~ label {
    color: #72c02c;
}

.stars-ratings input:focus-visible + label {
    outline: 2px solid #72c02c;
}

/* ---------- thumbs: radio with icons, circle hidden (the base keeps the input off-screen) ---------- */
.vim-form .vim-thumbs .radio {
    padding-left: 0;
    margin-right: 25px;
}

.vim-thumbs .radio .vim-thumb {
    margin-right: 5px;
    color: #bbb;
    font-size: 18px;
    transition: color .2s;
}

.vim-thumbs .radio:hover .vim-thumb,
.vim-thumbs .radio input:checked + .vim-thumb {
    color: #72c02c;
}

.vim-thumbs .radio:hover .vim-thumb.fa-thumbs-down,
.vim-thumbs .radio input:checked + .vim-thumb.fa-thumbs-down {
    color: #a94442;
}

.vim-thumbs .radio input:checked + .vim-thumb {
    font-weight: 900; /* Font Awesome 5: 900 = solid glyph */
}

.vim-thumbs .radio input:checked + .vim-thumb + span {
    font-weight: 600;
}

.vim-thumbs .radio input:focus-visible + .vim-thumb {
    outline: 2px solid #72c02c;
}
