/**
 * Easy Gestão Core - Formulários
 * Versão 0.1.1
 */

:root {
    --cor-principal: #173c70;
    --cor-principal-2: #245b9e;
    --cor-fundo: #f3f6fb;
    --cor-borda: #d8e0eb;
    --cor-texto: #25324a;
    --cor-muted: #6b778c;
}

* {
    box-sizing: border-box;
}

.easy-form-page {
    margin: 0;
    font-family: "Source Sans 3", Arial, Helvetica, sans-serif;
    background: var(--cor-fundo);
    color: var(--cor-texto);
    font-size: .80rem;
}

.easy-form-page .page-header {
    padding: 10px 0;
    color: #fff;
    background: linear-gradient(
        135deg,
        var(--cor-principal),
        var(--cor-principal-2)
    );
    box-shadow: 0 4px 16px rgba(23, 60, 112, .18);
}

.easy-form-page .page-header h1 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}

.easy-form-page .page-header small,
.easy-form-page .page-header .opacity-75 {
    opacity: .78;
}

.easy-form-page main {
    margin-top: 10px;
}

/* Larguras padronizadas para formularios em menu horizontal. */
.easy-form-container {
    width: calc(100% - 24px);
    margin-right: auto;
    margin-left: auto;
}

.easy-form-container-sm { max-width: 760px; }
.easy-form-container-md { max-width: 1050px; }
.easy-form-container-lg { max-width: 1350px; }
.easy-form-container-xl { max-width: 1450px; }

.form-card {
    overflow: hidden;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid var(--cor-borda);
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(31, 48, 76, .06);
}

/* Para autocomplete e menus que precisam ultrapassar os limites do card. */
.form-card.easy-card-overflow-visible {
    position: relative;
    z-index: 40;
    overflow: visible !important;
}

.form-card-header {
    min-height: 33px;
    padding: 7px 12px;
    background: #edf3fb;
    border-bottom: 1px solid var(--cor-borda);
    color: var(--cor-principal);
    font-size: .82rem;
    font-weight: 700;
}

.form-card-body {
    padding: 10px 12px;
}

.easy-form-page .form-card-body .row,
.easy-form-page .row.g-3 {
    --bs-gutter-x: .75rem;
    --bs-gutter-y: .50rem;
}

.easy-form-page .form-label {
    margin-bottom: 2px;
    color: #4a5870;
    font-size: .73rem;
    font-weight: 700;
}

.easy-form-page .form-control,
.easy-form-page .form-select,
.easy-form-page .input-group-text,
.easy-form-page .btn {
    min-height: 30px;
    padding: .20rem .48rem;
    font-size: .78rem;
    line-height: 1.25;
}

.easy-form-page textarea.form-control {
    min-height: 54px;
    resize: vertical;
}

.required::after {
    content: " *";
    color: #dc3545;
}

.status-registro {
    padding: 8px 11px;
    border-radius: 8px;
    font-weight: 600;
}

.status-novo {
    color: #8a6400;
    background: #fff8e1;
    border: 1px solid #f1d88d;
}

.status-existente {
    color: #17653a;
    background: #e7f7ed;
    border: 1px solid #a9dfbc;
}

.resumo-card {
    border-left: 4px solid #0d6efd;
}

.resumo-label {
    display: block;
    color: var(--cor-muted);
    font-size: .68rem;
    text-transform: uppercase;
}

.resumo-valor {
    font-size: 1rem;
    font-weight: 700;
}

.resumo-atalho {
    border: 0;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}

.resumo-atalho:hover,
.resumo-atalho:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(13, 110, 253, .20);
}

.secao-destacada {
    animation: destacarSecao 1.4s ease;
}

@keyframes destacarSecao {
    0% {
        box-shadow: 0 0 0 4px rgba(13, 110, 253, .28);
    }

    100% {
        box-shadow: 0 3px 12px rgba(31, 48, 76, .06);
    }
}

.btn-voltar-topo {
    position: fixed;
    right: 22px;
    bottom: 78px;
    z-index: 1050;
    display: none;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(31, 48, 76, .22);
}

.btn-voltar-topo.visivel {
    display: flex;
}

.idade-badge {
    display: flex;
    min-height: 31px;
    align-items: center;
    justify-content: center;
    padding: .22rem .5rem;
    border-radius: 6px;
    color: #fff;
    font-weight: 700;
}

.idade-normal {
    background: #0d6efd;
}

.idade-alerta {
    background: #dc3545;
}

.idade-vazia {
    background: #8894a7;
}

.easy-list-item {
    padding: 9px 11px;
    background: #fff;
    border: 1px solid var(--cor-borda);
    border-radius: 8px;
    transition: .15s ease;
}

.easy-list-item:hover {
    background: #f7faff;
    border-color: #8eb1dc;
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    padding: 8px 10px;
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid var(--cor-borda);
    box-shadow: 0 -5px 18px rgba(31, 48, 76, .08);
}

/* Barra fixa usada nos novos formularios do Easy Gestao. */
.easy-fixed-actions {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    padding: 8px 12px;
    background: rgba(255, 255, 255, .97);
    border-top: 1px solid var(--cor-borda);
    box-shadow: 0 -5px 18px rgba(31, 48, 76, .10);
    backdrop-filter: blur(5px);
}

.easy-fixed-actions-inner {
    display: flex;
    width: calc(100% - 24px);
    max-width: 1450px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 auto;
}

.easy-form-has-fixed-actions {
    padding-bottom: 70px;
}

.easy-fixed-actions .easy-actions-left,
.easy-fixed-actions .easy-actions-right {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.area-registros-scroll,
.area-registros-scroll {
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid var(--cor-borda);
    border-radius: 8px;
}

.area-registros-scroll table,
.area-registros-scroll table {
    margin-bottom: 0;
}

.area-registros-scroll thead th,
.area-registros-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8f9fa;
    box-shadow: inset 0 -1px 0 var(--cor-borda);
}

.campo-copiavel {
    cursor: copy;
}

.autocomplete-wrapper {
    position: relative;
}

.autocomplete-list {
    position: fixed;
    z-index: 99999;
    display: none;
    max-height: 240px;
    overflow-y: auto;
    pointer-events: auto;
    background: #fff;
    border: 1px solid #aebbd0;
    border-radius: 7px;
    box-shadow: 0 12px 28px rgba(25, 42, 70, .22);
}

.autocomplete-list.ativo,
.autocomplete-list.show {
    display: block;
}

.autocomplete-item,
.autocomplete-list .list-group-item {
    padding: 8px 10px;
    cursor: pointer;
    background: #fff;
    border: 0;
    border-bottom: 1px solid #edf1f6;
    border-radius: 0;
}

.autocomplete-item:last-child,
.autocomplete-list .list-group-item:last-child {
    border-bottom: 0;
}

.autocomplete-item:hover,
.autocomplete-list .list-group-item:hover {
    color: var(--cor-principal);
    background: #edf4ff;
}

.select2-container {
    width: 100% !important;
    font-size: .78rem;
}

.select2-container .select2-selection--single {
    height: 30px;
    border: 1px solid var(--cor-borda);
    border-radius: 6px;
}

.select2-container
.select2-selection--single
.select2-selection__rendered {
    padding-left: .5rem;
    padding-right: 24px;
    line-height: 28px;
}

.select2-container
.select2-selection--single
.select2-selection__arrow {
    height: 28px;
}

.select2-dropdown {
    z-index: 10050;
    font-size: .78rem;
}

.select2-results__option {
    padding: 5px 8px;
}

.easy-field-error {
    border-color: #dc3545 !important;
}

.easy-error-text {
    margin-top: 2px;
    color: #dc3545;
    font-size: .72rem;
}

@media (max-width: 767px) {
    .easy-form-page .page-header {
        padding: 10px 0;
    }

    .form-card-body {
        padding: 9px 10px;
    }

    /* Evita o zoom automático do Safari/iOS ao focar os campos. */
    .easy-form-page .form-control,
    .easy-form-page .form-select,
    .easy-form-page .select2-search__field {
        font-size: 16px;
    }

    .easy-form-container {
        width: calc(100% - 12px);
    }

    .easy-fixed-actions {
        padding: 7px 6px;
    }

    .easy-fixed-actions-inner {
        width: 100%;
    }

    .easy-fixed-actions .btn .easy-btn-text-optional {
        display: none;
    }
}

@media print {
    .sticky-actions,
    .easy-fixed-actions,
    .btn-voltar-topo,
    .easy-no-print {
        display: none !important;
    }

    .form-card {
        box-shadow: none;
    }
}
