@use '../utils' as *;

/*=============================
    Input
===============================*/
select,
.single-select,
.form-control,
.form-select,
textarea,
input {
    height: 55px;
    padding: 0 25px;
    border: 1px solid transparent;
    color: var(--tg-heading-color);
    background-color: var(--tg-color-smoke-3);
    font-size: 16px;
    font-weight: 300;
    width: 100%;
    font-family: var(--tg-body-font-family);
	transition: 0.4s ease-in-out;
    padding-right: 45px;
    border-radius: 5px;
    &:focus {
        outline: 0;
        box-shadow: none;
        border-color: transparent;
        background-color: var(--tg-color-smoke-3);
    }
    &::placeholder {
        color: var(--tg-body-color);
    }
    &.style-white {
        background: var(--tg-color-white-default);
    }
    &.style-dark {
        background: var(--tg-color-black-3);
        font-size: 14px;
        color: var(--tg-color-white-default);
        padding: 0 20px;
        &::placeholder {
            color: rgba($color: #ffffff, $alpha: 0.4);
        }
    }
    &.style-border {
        background: var(--tg-color-smoke-3);
        border: 1px solid var(--tg-border-1);
        border-radius: 10px;
        color: var(--tg-body-color);
        font-weight: 400;
        padding-right: 25px;
        &::placeholder {
            color: var(--tg-body-color);
        }
    }
    &.style-border2 {
        background: transparent;
        border-bottom: 1px solid rgba($color: #ffffff, $alpha: 0.3);
        border-radius: 0;
        color: var(--tg-color-white-default);
        font-weight: 400;
        padding: 0;
        padding-bottom: 20px;
        height: auto;
        &::placeholder {
            color: rgba($color: #ffffff, $alpha: 0.4);
        }
        &:hover,
        &:active,
        &:focus {
            border-bottom: 1px solid var(--tg-theme-primary);
        }
    }
    &.style-border3 {
        background: var(--tg-color-white-default);
        border: 1px solid var(--tg-border-4);
        border-radius: 10px;
        color: var(--tg-body-color);
        font-weight: 400;
        padding-right: 25px;
        height: 60px;
        &::placeholder {
            color: var(--tg-body-color);
        }
    }
}
.single-select,
.form-select,
select {
    display: block;
    width: 100%;
    line-height: 55px;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
    background-position: right 26px center;
    background-repeat: no-repeat;
    background-size: 16px 12px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    &:after {
        right: 30px;
        height: 8px;
        width: 8px;
    }
    .list {
        width: 100%;
    }
}

textarea.form-control,
textarea {
    min-height: 155px;
    padding-top: 18px;
    padding-bottom: 17px;
    &.style2 {
        min-height: 200px;
    }
    &.style-dark {
        padding: 20px;
    }
}

.form-group {
    position: relative;
    > i {
        display: inline-block;
        position: absolute;
        right: 25px;
        top: 21px;
        font-size: 16px;
        color: var(--tg-heading-color);
        &.fa-envelope {
            padding-top: 1px;
        }
        &.fa-comment {
            margin-top: -2px;
        }
        &.fa-chevron-down {
            width: 17px;
            background-color: var(--tg-heading-color);
        }
    }
    .form-icon-left {
        display: inline-block;
        position: absolute;
        right: auto;
        margin-bottom: 0;    
        left: 25px;
        top: 12px;
        margin-top: 0;
    }
    &:has(.form-icon-left) {
        input {
            padding-left: 50px;
        }
        textarea {
            padding-left: 55px;
        }
    }
    &.has-label {
        > i {
            top: 50px;
        }
    }
    &.has-icon {
        .form-control {
            padding-left: 70px;
        }
        .input-icon {
            display: inline-block;
            position: absolute;
            left: 40px;
            top: 18px;
            font-size: 16px;
            color: var(--tg-heading-color);
            &:hover {
                color: var(--tg-theme-primary);
            }
        }
    }
    &:has(.style-border2) {
        .form-icon-left {
            filter: brightness(99);
        }
    }
    .form-icon-right {
        display: inline-block;
        position: absolute;
        right: 25px;
        left: auto;
        top: 17px;
        margin-bottom: 0;        
    }
    .form-icon-right2 {
        display: inline-block;
        position: absolute;
        right: 25px;
        left: auto;
        top: 20px;
        margin-bottom: 0;        
    }
    &:has(.form-icon-right) {
        textarea,
        input {
            padding-right: 33px;
        }
    }
    &:has(textarea) {
        .form-icon-left {
            top: 17px;
        }
    }
    &.radius-group {
        input {
            border-radius: 100px;
        }
    }
    &.style-2 {
        .form-control {
            padding: 0 30px 0 55px;
        }
        textarea.form-control {
            padding: 16px 30px 30px 55px;
        }
    }
    &.style-3 {
        .form-control {
            padding: 0 60px 0 30px;
        }
    }
    .form-label {
        font-size: 14px;
        font-weight: 600;
        color: var(--tg-heading-color);
        margin-top: -0.5em;
    }
}
input[type=date] {
    padding: 0 25px 0 25px;
    position: relative;
}
input[type=date]::-webkit-calendar-picker-indicator {
    background: transparent;
    position: absolute;
    left: 0px;
    height: 100%;
    width: 100%;
    z-index: 1;
    cursor: pointer;  
}

option {
    &:checked,
    &:focus,
    &:hover {
        background-color: var(--tg-theme-primary);
        color: var(--tg-heading-color);
    }
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="checkbox"] {
    visibility: hidden;
    opacity: 0;
    display: inline-block;
    vertical-align: middle;
    width: 0;
    height: 0;
    display: none;
    border-radius: 10px;
    &:checked {
        ~ label {
            &:before {
                content: "\f00c";
                color: var(--tg-color-white-default);
                background-color: var(--tg-theme-primary);
                border-color: var(--tg-theme-primary);
            }
        }
    }

    ~ label {
        position: relative;
        padding-left: 30px;
        cursor: pointer;
        display: block;

        &:before {
            content: "";
            font-family: var(--tg-icon-font-family);
            font-weight: 700;
            position: absolute;
            left: 0px;
            top: 3.5px;
            background-color: var(--tg-color-white-default);
            border: 1px solid var(--tg-theme-primary);
            height: 18px;
            width: 18px;
            line-height: 18px;
            text-align: center;
            font-size: 12px;
        }
    }
    &.style2 {
        ~ label {
            color: #8B929C;
            padding-left: 23px;
            margin-bottom: -0.5em;
            &:before {
                background-color: rgba($color: #fff, $alpha: 1);
                border: 1px solid rgb(247, 204, 215);
                height: 14px;
                width: 14px;
                line-height: 14px;
                border-radius: 3px;
                top: 6px;
            }
        }
        &:checked {
            ~ label {
                &:before {
                    color: var(--tg-theme-primary);
                }
            }
        }
    }
}
  
input[type="radio"] {
    visibility: hidden;
    opacity: 0;
    display: inline-block;
    vertical-align: middle;
    width: 0;
    height: 0;
    display: none;

    ~ label {
        position: relative;
        padding-left: 30px;
        cursor: pointer;
        line-height: 1;
        display: inline-block;
        font-weight: 600;
        margin-bottom: 0;

        &::before {
            content: "\f111";
            position: absolute;
            font-family: var(--tg-icon-font-family);
            left: 0;
            top: -2px;
            width: 20px;
            height: 20px;
            padding-left: 0;
            font-size: 0.6em;
            line-height: 19px;
            text-align: center;
            border: 1px solid var(--tg-theme-primary);
            border-radius: 100%;
            font-weight: 700;
            background: var(--tg-color-white-default);
            color: transparent;
            transition: all 0.2s ease;
        }
    }

    &:checked {
        ~ label {
            &::before {
                border-color: var(--tg-theme-primary);
                background-color: var(--tg-theme-primary);
                color: var(--tg-color-white-default);
            }
        }
    }
}

label {
    margin-bottom: 0.5em;
    margin-top: -0.3em;
    display: block;
    color: var(--tg-heading-color);
    font-family: var(--tg-body-font-family);
    font-size: 16px;
}

textarea.is-invalid,
select.is-invalid,
input.is-invalid,
.was-validated input:invalid {
    background-position: right calc(0.375em + 0.8875rem) center;
    background-image: none;

    &:focus {
        outline: 0;
        box-shadow: none;
    }
}

textarea.is-invalid {
    background-position: top calc(0.375em + 0.5875rem) right
        calc(0.375em + 0.8875rem);
}

.row.no-gutters > .form-group {
    margin-bottom: 0;
}

.form-messages {
    display: none;

    &.mb-0 * {
        margin-bottom: 0;
    }

    pre {
        padding: 0;
        background-color: transparent;
        color: inherit;
    }
}
.xdsoft_datetimepicker {
    z-index: 9999;
}