/* ==========================================================
   HAMCONTACT - OVERLAY GLOBAL
   Reutilizável em qualquer operação assíncrona.
   ========================================================== */

.hc-overlay{
    position:fixed;
    inset:0;
    z-index:20000;

    display:flex;
    align-items:center;
    justify-content:center;

    padding:18px;

    background:
        rgba(11,18,28,.54);

    backdrop-filter:
        blur(5px);

    -webkit-backdrop-filter:
        blur(5px);

    opacity:0;
    visibility:hidden;
    pointer-events:none;

    transition:
        opacity .18s ease,
        visibility .18s ease;
}

html[data-theme="dark"] .hc-overlay{background:rgba(2,7,13,.72)!important}html[data-theme="dark"] .hc-overlay-card{background:#111923!important;color:#edf4fb!important;border-color:#3a4e63!important;box-shadow:0 24px 70px rgba(0,0,0,.6)!important}html[data-theme="dark"] .hc-overlay-title{color:#f4f8fc!important}html[data-theme="dark"] .hc-overlay-message,html[data-theme="dark"] .hc-overlay-meta{color:#b8c6d5!important}html[data-theme="dark"] .hc-overlay-icon-wrap{background:#17314e!important;color:#8dc0ff!important}html[data-theme="dark"] .hc-overlay-icon-wrap.hc-overlay-success{background:#123927!important;color:#83deb0!important}html[data-theme="dark"] .hc-overlay-icon-wrap.hc-overlay-error{background:#421d25!important;color:#ff98a2!important}html[data-theme="dark"] .hc-overlay-progress{background:#26384a!important}html[data-theme="dark"] .hc-overlay-actions{border-color:#3a4e63!important}

.hc-overlay.hc-overlay-visible{
    opacity:1;
    visibility:visible;
    pointer-events:auto;
}

.hc-overlay-card{
    width:min(430px,100%);

    overflow:hidden;

    background:
        var(--bs-body-bg);

    color:
        var(--bs-body-color);

    border:
        1px solid var(--bs-border-color);

    border-radius:18px;

    box-shadow:
        0 24px 70px rgba(0,0,0,.28);
}

.hc-overlay-main{
    padding:23px 22px 18px;

    text-align:center;
}

.hc-overlay-icon-wrap{
    width:58px;
    height:58px;

    margin:0 auto 13px;

    display:grid;
    place-items:center;

    border-radius:17px;

    background:
        rgba(13,110,253,.10);

    color:
        var(--bs-primary);

    font-size:1.55rem;
}

.hc-overlay-icon-wrap.hc-overlay-success{
    background:
        rgba(25,135,84,.11);

    color:
        var(--bs-success);
}

.hc-overlay-icon-wrap.hc-overlay-error{
    background:
        rgba(220,53,69,.11);

    color:
        var(--bs-danger);
}

.hc-overlay-title{
    margin:0;

    font-size:1.03rem;
    font-weight:800;
}

.hc-overlay-message{
    margin-top:5px;

    min-height:1.3em;

    color:
        var(--bs-secondary-color);

    font-size:.82rem;
}

.hc-overlay-progress{
    position:relative;

    height:4px;

    margin-top:17px;

    overflow:hidden;

    border-radius:999px;

    background:
        var(--bs-tertiary-bg);
}

.hc-overlay-progress-bar{
    position:absolute;
    inset:0 auto 0 0;

    width:34%;

    border-radius:inherit;

    background:
        var(--bs-primary);

    animation:
        hcOverlayIndeterminate
        1.05s ease-in-out infinite;
}

.hc-overlay-progress.hc-overlay-progress-success
.hc-overlay-progress-bar{
    width:100%;
    animation:none;

    background:
        var(--bs-success);
}

.hc-overlay-progress.hc-overlay-progress-error
.hc-overlay-progress-bar{
    width:100%;
    animation:none;

    background:
        var(--bs-danger);
}

@keyframes hcOverlayIndeterminate{

    0%{
        transform:
            translateX(-120%);
    }

    55%{
        transform:
            translateX(185%);
    }

    100%{
        transform:
            translateX(300%);
    }
}

.hc-overlay-meta{
    margin-top:11px;

    display:flex;
    align-items:center;
    justify-content:center;
    gap:7px;

    color:
        var(--bs-secondary-color);

    font-size:.70rem;
}

@media (max-width:500px){

    .hc-overlay{
        padding:10px;
    }

    .hc-overlay-card{
        border-radius:15px;
    }

    .hc-overlay-main{
        padding:20px 17px 16px;
    }
}


/* LISTA DE CONTATOS: abaixo do cabeçalho e acima do menu */
#hcListaContatosModal{z-index:14020!important;}
#hcListaContatosModal .modal-dialog{
    width:min(1040px,calc(100vw - 28px))!important;
    max-width:1040px!important;
    margin:92px auto 18px!important;
}
#hcListaContatosModal .modal-content{
    max-height:calc(100vh - 112px)!important;
    overflow:hidden!important;
    border-radius:12px!important;
}
#hcListaContatosModal .modal-body{
    overflow:auto!important;
    overscroll-behavior:contain;
}
body.hc-lista-contatos-modal-open .modal-backdrop{z-index:14010!important;}
#hcGlobalOverlay{z-index:20000!important;}
@media(max-width:849px){
  #hcListaContatosModal .modal-dialog{
    width:calc(100vw - 16px)!important;
    max-width:none!important;
    margin:74px auto 8px!important;
  }
  #hcListaContatosModal .modal-content{max-height:calc(100vh - 84px)!important;}
}


/* ==========================================================
   OVERLAY V2 - REGRAS CRÍTICAS
   ========================================================== */

.hc-overlay{
    position:fixed !important;
    inset:0 !important;
    z-index:20000 !important;

    display:flex !important;
    align-items:center !important;
    justify-content:center !important;

    width:100vw !important;
    height:100vh !important;
}

.hc-overlay-card{
    width:min(430px,calc(100vw - 28px)) !important;
    max-width:430px !important;
}

.hc-overlay-actions{
    display:none;
    gap:8px;
    padding:12px 14px;
    border-top:1px solid var(--bs-border-color);
}

.hc-overlay-actions.hc-overlay-actions-visible{
    display:flex;
}


/*
 * Durante o envio QSL, o log permanece visível no modal.
 * O fundo continua bloqueando cliques duplicados, mas sem esconder a tela.
 */
.hc-overlay.hc-overlay-qsl{
    align-items:flex-end !important;
    justify-content:flex-start !important;

    padding:18px !important;

    background:rgba(11,18,28,.10) !important;

    backdrop-filter:none !important;
    -webkit-backdrop-filter:none !important;
}


.hc-overlay.hc-overlay-qsl .hc-overlay-card{
    width:min(330px,calc(100vw - 28px)) !important;
    max-width:330px !important;

    background:rgba(var(--bs-body-bg-rgb),.93) !important;

    box-shadow:0 12px 35px rgba(0,0,0,.22);
}


.hc-overlay.hc-overlay-qsl .hc-overlay-main{
    padding:14px 16px 12px;
}


.hc-overlay.hc-overlay-qsl .hc-overlay-icon-wrap{
    width:42px;
    height:42px;
    margin-bottom:8px;
    border-radius:12px;
    font-size:1.1rem;
}


.hc-overlay.hc-overlay-qsl .hc-overlay-progress{
    margin-top:10px;
}


.hc-overlay.hc-overlay-qsl .hc-overlay-meta{
    margin-top:7px;
}


@media(max-width:600px){

    .hc-overlay.hc-overlay-qsl{
        padding:8px !important;
    }


    .hc-overlay.hc-overlay-qsl .hc-overlay-card{
        width:min(300px,calc(100vw - 16px)) !important;
    }
}

/* Conferência de carga: estados reais das consultas, sem dependência de ícones. */
.hc-load-checklist{list-style:none;padding:0;margin:16px 0;text-align:left;display:grid;gap:9px;font-size:13px;line-height:1.4}
.hc-load-checklist li{padding:8px 10px;border-radius:7px;background:rgba(90,130,170,.08);color:inherit}
.hc-load-checklist li[data-state=ok]{color:#287344}
.hc-load-checklist li[data-state=erro]{color:#ba3545}
html[data-theme=dark] .hc-load-checklist li[data-state=ok]{color:#a4dcb8}
html[data-theme=dark] .hc-load-checklist li[data-state=erro]{color:#ff9eab}
.hc-overlay-card:has(.hc-load-checklist){width:min(480px,calc(100vw - 36px))}

/* A variante compacta do QSL não pode repor o fundo claro no tema escuro. */
html[data-theme="dark"] #hcGlobalOverlay .hc-overlay-card,
html[data-bs-theme="dark"] #hcGlobalOverlay .hc-overlay-card{
    background:#111923 !important;
    color:#edf4fb !important;
    border-color:#3a4e63 !important;
}
html[data-theme="dark"] #hcGlobalOverlay .hc-overlay-title,
html[data-bs-theme="dark"] #hcGlobalOverlay .hc-overlay-title{color:#f4f8fc !important;}
html[data-theme="dark"] #hcGlobalOverlay .hc-overlay-message,
html[data-theme="dark"] #hcGlobalOverlay .hc-overlay-meta,
html[data-bs-theme="dark"] #hcGlobalOverlay .hc-overlay-message,
html[data-bs-theme="dark"] #hcGlobalOverlay .hc-overlay-meta{color:#b8c6d5 !important;}
