/**
 * Framework Tecno
 * @author Anderson Carlos <anderson.carlos@tecnoprog.com.br>
 * @copyright Tecnoprog © 2019, Tecnoprog Informatica e Eletronica LTDA - ME.
 *
 * Inputs Cork apos Bootstrap |inline.
 * O main.css e <link> e perde para o Bootstrap no <style>
 * (form-control / form-control-sm ficam mais baixos que o Select2).
 * Emitido por ultimo no <head> (#erp-css-late).
 */

.form-control {
    height: calc(1.4em + 1.4rem + 2px) !important;
    padding: 0.75rem 1.25rem !important;
    font-size: 15px !important;
    line-height: 1.5;
    color: #3b3f5c;
    border: 1px solid #bfc9d4 !important;
    border-radius: 6px;
    letter-spacing: 1px;
    box-sizing: border-box;
}

/**
 * Textarea respeita rows / altura livre (nao herda height fixa de input)
 */
textarea.form-control,
textarea.form-control.form-control-sm,
textarea.form-control.form-control-lg {
    height: auto !important;
    min-height: calc(1.4em + 1.4rem + 2px) !important;
}

.form-control.form-control-sm,
.form-control-sm {
    height: calc(1.4em + 1.4rem + 2px) !important;
    padding: 7px 16px !important;
    font-size: 13px !important;
    line-height: 1.5;
    box-sizing: border-box;
}

textarea.form-control.form-control-sm,
textarea.form-control-sm {
    height: auto !important;
}

.form-control.form-control-lg,
.form-control-lg {
    font-size: 19px !important;
    padding: 11px 20px !important;
}

.form-control:focus {
    box-shadow: 0 0 5px 2px rgba(194, 213, 255, 0.619608);
    border-color: #1b55e2 !important;
    color: #3b3f5c;
}

/**
 * Select2 (tema bootstrap4) na mesma altura dos inputs Cork.
 */
.select2-container--bootstrap4 .select2-selection--single {
    height: calc(1.4em + 1.4rem + 2px) !important;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
    line-height: calc(1.4em + 1.4rem) !important;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow {
    height: calc(1.4em + 1.4rem + 2px) !important;
    top: 0 !important;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder {
    line-height: calc(1.4em + 1.4rem) !important;
}

/**
 * Select2 multiple (Select2 4.1 usa <button> no X — precisa resetar).
 * Evita herdar line-height 45px do .select2-selection__rendered (single).
 */
.select2-container--bootstrap4 .select2-selection--multiple {
    min-height: calc(1.4em + 1.4rem + 2px) !important;
    height: auto !important;
    padding: 4px 8px !important;
    border: 1px solid #bfc9d4 !important;
    border-radius: 6px !important;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 0 !important;
    line-height: 1.4 !important;
    list-style: none;
    margin: 0;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice {
    display: inline-flex;
    align-items: center;
    float: none !important;
    margin: 0 !important;
    padding: 2px 6px 2px 2px !important;
    background-color: #eaf1ff;
    border: 1px solid #c2d5ff;
    border-radius: 4px;
    color: #1b55e2;
    font-size: 13px;
    line-height: 1.3 !important;
    max-width: 100%;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__display {
    padding: 0 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove,
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear {
    position: static !important;
    float: none !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    min-height: 16px;
    margin: 0 2px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 3px !important;
    background: transparent !important;
    color: #888ea8 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    box-shadow: none !important;
    cursor: pointer;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove:hover,
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear:hover {
    color: #e7515a !important;
    background: rgba(231, 81, 90, 0.08) !important;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
    background: #e0e6ed !important;
    color: #3b3f5c !important;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline {
    float: none !important;
    line-height: 1.4 !important;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline .select2-search__field {
    height: auto !important;
    min-height: 24px !important;
    margin: 0 !important;
    padding: 2px 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
}

.select2-container--bootstrap4.select2-container--focus .select2-selection--multiple {
    border-color: #1b55e2 !important;
    box-shadow: 0 0 5px 2px rgba(194, 213, 255, 0.62);
}

.custom-select {
    height: calc(1.4em + 1.4rem + 2px) !important;
    padding: 0.75rem 1.25rem !important;
    font-size: 15px !important;
    color: #3b3f5c;
    border: 1px solid #f1f2f3;
    border-radius: 6px;
    box-sizing: border-box;
}

.custom-select.custom-select-sm {
    font-size: 13px !important;
    padding: 10px 25px 10px 10px !important;
}

/**
 * Telas de auth (signin, lock-screen, etc.): o padding lateral
 * reserva espaco para o icone (cadeado/usuario). O override global
 * acima nao pode sobrescrever isso.
 */
.auth-field .form-control,
.form-form .form-form-wrap form .field-wrapper input.form-control,
.form-form .form-form-wrap form .field-wrapper input {
    height: var(--auth-field-h, 3rem) !important;
    min-height: var(--auth-field-h, 3rem) !important;
    padding: 0 2.75rem 0 2.75rem !important;
    font-size: 0.9375rem !important;
    letter-spacing: normal;
    border-radius: var(--auth-radius, 10px);
}

.auth-field:has(.auth-toggle-pass) .form-control {
    padding-right: 3rem !important;
}

.auth-field .form-control:focus,
.form-form .form-form-wrap form .field-wrapper input.form-control:focus {
    box-shadow: 0 0 0 3px var(--auth-accent-soft, rgba(27, 85, 226, 0.18));
    border-color: var(--auth-accent, #1b55e2) !important;
}
