/*
 * Telas de autenticação em "tela dividida" (painel de imagem + formulário).
 * Usado por /login-form.php (Tela, variante .lg-tela, painel .lg-adm) e /ec/login-form.php (Espaço do Colaborador, variante .lg-ec, painel .lg-pub).
 * Tudo escopado sob .lg-wrap com prefixo .lg-*, para não afetar as outras telas que usam os mesmos headers.
 * A tela cobre a janela (position: fixed) e não depende do fundo/estrutura do header herdado.
 * Só apresentação: ids, nomes dos campos, POST, captcha e redirecionamentos ficam nas páginas.
 */
.lg-wrap {
    --lg-marinho: #0d2745;
    --lg-azul: #1a73e8;
    --lg-azul-hover: #1558b0;
    --lg-texto: #1b2733;
    --lg-texto-2: #5b6b7b;
    --lg-linha: #d3dce6;
    --lg-suave: #eef3f9;
    position: fixed;
    inset: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    overflow: auto;
    background: #fff;
    color: var(--lg-texto);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    -webkit-font-smoothing: antialiased;
}

.lg-wrap *, .lg-wrap *::before, .lg-wrap *::after { box-sizing: border-box; }
.lg-wrap button, .lg-wrap input { font-family: inherit; }

/* ------------------------------------------------------------------ PAINEL (só em telas grandes) */
.lg-wrap .lg-painel {
    display: none;
    position: relative;
    overflow: hidden;
    padding: 56px 64px;
}

.lg-wrap .lg-painel-conteudo {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    margin: auto 0;
}

.lg-wrap .lg-painel h2 {
    margin: 0 0 12px;
    font-size: clamp(28px, 3.1vw, 44px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -.02em;
}

.lg-wrap .lg-painel .lg-lead { margin: 0 0 28px; font-size: 17px; line-height: 1.55; }

.lg-wrap .lg-pontos { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 16px; }
.lg-wrap .lg-pontos li { display: flex; gap: 14px; align-items: flex-start; }
.lg-wrap .lg-pontos .lg-ponto-ico {
    flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.lg-wrap .lg-pontos strong { display: block; font-size: 15.5px; font-weight: 700; line-height: 1.3; }
.lg-wrap .lg-pontos span.lg-ponto-txt { display: block; font-size: 14px; line-height: 1.45; }

/* ---- variante administrativa (Tela): ferramenta de trabalho */
.lg-wrap .lg-adm {
    color: #fff;
    background: linear-gradient(135deg, #0d2745 0%, #123a69 55%, #1560b8 100%);
}
.lg-wrap .lg-adm .lg-foto {
    position: absolute; inset: 0;
    background: url('../img/login_tela.jpg') center / cover no-repeat;
    opacity: .22; mix-blend-mode: luminosity;
}
.lg-wrap .lg-adm::before { /* brilho radial no canto superior */
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(900px 520px at 85% -8%, rgba(120, 180, 255, .38), transparent 62%);
}
.lg-wrap .lg-adm::after { /* textura de pontos discreta */
    content: ''; position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .10) 1px, transparent 1.4px);
    background-size: 22px 22px;
}
.lg-wrap .lg-adm .lg-lead { color: #bcd6f7; }
.lg-wrap .lg-adm .lg-pontos .lg-ponto-ico { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.lg-wrap .lg-adm .lg-pontos span.lg-ponto-txt { color: #bcd6f7; }

/* módulos do sistema: etiquetas translúcidas, só decorativas */
.lg-wrap .lg-modulos { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 4px; }
.lg-wrap .lg-modulo {
    display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
    font-size: 13.5px; font-weight: 600; color: #fff;
    background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .22);
}
.lg-wrap .lg-modulo .fa { font-size: 14px; color: #bcd6f7; }

/* ---- variante pública (colaborador): acolhe e motiva */
.lg-wrap .lg-pub {
    color: var(--lg-marinho);
    background: linear-gradient(160deg, #e6f0fd 0%, #f6f9fe 100%);
}
.lg-wrap .lg-quadro-foto {
    margin: 0 0 28px; height: clamp(180px, 30vh, 300px); border-radius: 20px; overflow: hidden;
    box-shadow: 0 18px 40px rgba(13, 39, 69, .18); background: #cfd8e6;
}
.lg-wrap .lg-quadro-foto img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 55% 38%; }
.lg-wrap .lg-pub .lg-lead { color: #3d5069; }
.lg-wrap .lg-pub .lg-pontos .lg-ponto-ico { background: #dbe8fb; color: var(--lg-azul-hover); }
.lg-wrap .lg-pub .lg-pontos span.lg-ponto-txt { color: #4a5d75; }
.lg-wrap .lg-selo {
    display: flex; align-items: center; gap: 16px; margin-top: 30px; padding: 12px 18px 12px 12px;
    background: #fff; border-radius: 16px; box-shadow: 0 8px 22px rgba(13, 39, 69, .10); max-width: 460px;
}
.lg-wrap .lg-selo img { flex: 0 0 auto; width: 92px; height: auto; display: block; }
.lg-wrap .lg-selo p { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.35; color: var(--lg-marinho); }

/* ------------------------------------------------------------------ LADO DO FORMULÁRIO */
.lg-wrap .lg-lado {
    display: flex; flex-direction: column; min-height: 100%; min-width: 0;
    padding: 22px 22px 18px;
    background: linear-gradient(180deg, #e3eefc 0, #ffffff 260px);
}
/* topo: logo da empresa (recortada, sem a margem branca do arquivo) à esquerda e selo do sistema à direita */
.lg-wrap .lg-topo { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid #e3ebf5; }
.lg-wrap .lg-marca-empresa { display: block; flex: none; width: 128px; height: 68px; object-fit: cover; object-position: 50% 50%; mix-blend-mode: multiply; }
.lg-wrap .lg-sistema { display: flex; align-items: center; gap: 12px; padding: 7px 16px 7px 8px; border: 1px solid #d5e2f3; border-radius: 999px; background: #f4f8fe; }
.lg-wrap .lg-sistema .lg-marca-sistema { display: block; width: 46px; height: 46px; flex: none; }
.lg-wrap .lg-sistema .lg-nome { font-size: 15px; font-weight: 800; letter-spacing: -.01em; color: var(--lg-marinho); line-height: 1.15; }

.lg-wrap .lg-caixa { width: 100%; max-width: 400px; margin: auto; padding: 28px 0; }

.lg-wrap .lg-titulo { margin: 0 0 6px; font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; color: var(--lg-marinho); }
.lg-wrap .lg-sub { margin: 0 0 24px; font-size: 15px; color: var(--lg-texto-2); }

.lg-wrap .lg-rotulo { display: block; margin: 0 0 6px; font-size: 13.5px; font-weight: 600; color: var(--lg-texto); }
.lg-wrap .lg-campo { position: relative; margin: 0 0 16px; }
.lg-wrap .lg-campo .lg-ico {
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
    color: var(--lg-texto-2); font-size: 16px; line-height: 1; pointer-events: none;
}
.lg-wrap .lg-form input.lg-input {
    display: block; width: 100%; height: 48px; margin: 0;
    padding: 0 14px 0 43px; font-size: 16px; font-weight: 400; color: var(--lg-texto);
    background: #fff; border: 1px solid var(--lg-linha); border-radius: 10px; box-shadow: none;
    transition: border-color .14s ease, box-shadow .14s ease;
}
.lg-wrap .lg-form input.lg-input::placeholder { color: #7a8896; opacity: 1; }
.lg-wrap .lg-form input.lg-input:hover:not([readonly]) { border-color: #aebccd; }
.lg-wrap .lg-form input.lg-input:focus:not([readonly]) {
    border: 1px solid var(--lg-azul); outline: 0; box-shadow: 0 0 0 4px rgba(26, 115, 232, .16);
}
.lg-wrap .lg-form input.lg-input.lg-com-olho { padding-right: 52px; }

.lg-wrap .lg-olho {
    position: absolute; right: 2px; top: 2px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px;
    background: transparent; color: var(--lg-texto-2); font-size: 17px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: color .14s ease, background-color .14s ease;
}
.lg-wrap .lg-olho:hover { color: var(--lg-azul-hover); background: var(--lg-suave); }

/* foco visível em tudo que é interativo */
.lg-wrap a:focus-visible, .lg-wrap button:focus-visible { outline: 3px solid var(--lg-azul); outline-offset: 3px; }

/* captcha: código em quadro tracejado ao lado do campo numérico */
.lg-wrap .lg-captcha-bloco { margin: 0 0 16px; }
.lg-wrap .lg-captcha { display: flex; gap: 12px; align-items: stretch; }
.lg-wrap #CaptchaDiv {
    flex: 0 0 auto; display: flex; align-items: center; justify-content: center; min-width: 150px; height: 48px; margin: 0; padding: 0 8px 0 16px;
    font: 800 21px/1 'Plus Jakarta Sans', system-ui, sans-serif; font-style: normal; letter-spacing: .38em; color: var(--lg-marinho);
    background: #eaf2fe; border: 2px dashed #9bbcf0; border-radius: 10px; user-select: none; -webkit-user-select: none;
}
.lg-wrap .lg-captcha .lg-campo { flex: 1 1 auto; margin: 0; min-width: 0; }
.lg-wrap .lg-form input.lg-input.lg-sem-ico { padding-left: 14px; text-align: center; letter-spacing: .12em; font-weight: 600; }
/* libs/captcha.css define #CaptchaInput por id (borda, margem e largura fixa): aqui o campo segue o padrão dos demais */
.lg-wrap #CaptchaInput { width: 100%; margin: 0; border: 1px solid var(--lg-linha); }
.lg-wrap #CaptchaInput:focus:not([readonly]) { border-color: var(--lg-azul); }
.lg-wrap #labCaptcha { display: block; margin: 6px 0 0; font-size: 13px; font-weight: 600; color: #a31d1d; white-space: pre-line; }
.lg-wrap #labCaptcha:empty { display: none; }

/* botões */
.lg-wrap .lg-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; height: 48px; margin: 0;
    padding: 0 18px; border: 2px solid transparent; border-radius: 10px;
    font-size: 16px; font-weight: 700; line-height: 1; text-decoration: none; cursor: pointer;
    transition: background-color .14s ease, box-shadow .14s ease, border-color .14s ease, color .14s ease;
}
.lg-wrap .lg-btn-primario { background: var(--lg-azul); color: #fff; box-shadow: 0 6px 16px rgba(26, 115, 232, .30); }
.lg-wrap .lg-btn-primario:hover:not([disabled]) { background: var(--lg-azul-hover); }
.lg-wrap .lg-btn-primario[disabled] { cursor: progress; background: var(--lg-azul-hover); }
.lg-wrap .lg-btn-sec { background: #fff; color: var(--lg-azul-hover); border-color: var(--lg-azul); box-shadow: none; }
.lg-wrap .lg-btn-sec:hover { background: #eef5fe; color: var(--lg-azul-hover); text-decoration: none; }
.lg-wrap .lg-spin {
    display: none; width: 18px; height: 18px; border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: lg-gira .8s linear infinite;
}
.lg-wrap .lg-btn[aria-busy="true"] .lg-spin { display: inline-block; }
.lg-wrap .lg-btn[aria-busy="true"] .lg-ico-btn { display: none; }
@keyframes lg-gira { to { transform: rotate(360deg); } }

.lg-wrap .lg-links { margin: 18px 0 0; text-align: center; font-size: 14px; color: var(--lg-texto-2); }
.lg-wrap .lg-links > * { margin: 0 0 4px; }
.lg-wrap .lg-link {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; border: 0; background: none;
    color: var(--lg-azul-hover); font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.lg-wrap .lg-link:hover { text-decoration: underline; color: var(--lg-azul-hover); }
.lg-wrap .lg-ou { margin: 14px 0 0; }

/* erro */
.lg-wrap .lg-erro {
    display: flex; gap: 10px; align-items: flex-start; margin: 0 0 18px; padding: 12px 14px;
    color: #8a1c1c; background: #fdecec; border: 1px solid #f5b5b5; border-radius: 10px; font-size: 14px; line-height: 1.45;
}
.lg-wrap .lg-erro .fa { margin-top: 3px; font-size: 16px; }
.lg-wrap .lg-erro a { color: #8a1c1c; font-weight: 700; text-decoration: underline; }

.lg-wrap .lg-rodape { margin: 0; padding-top: 8px; text-align: center; font-size: 13px; color: var(--lg-texto-2); }
.lg-wrap .lg-rodape a { color: var(--lg-azul-hover); font-weight: 600; text-decoration: none; }
.lg-wrap .lg-rodape a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ DESKTOP */
@media (min-width: 992px) {
    .lg-wrap { grid-template-columns: minmax(0, 54fr) minmax(0, 46fr); overflow: hidden; }
    .lg-wrap .lg-painel { display: flex; flex-direction: column; }
    .lg-wrap .lg-lado { height: 100%; min-height: 0; overflow-y: auto; padding: 32px 48px 22px; background: #fff; }
    .lg-wrap .lg-marca-empresa { width: 168px; height: 90px; }
    .lg-wrap .lg-sistema { gap: 14px; padding: 8px 22px 8px 9px; }
    .lg-wrap .lg-sistema .lg-marca-sistema { width: 56px; height: 56px; }
    .lg-wrap .lg-sistema .lg-nome { font-size: 18px; }
}

/* telas baixas: aperta o painel para não cortar o conteúdo */
@media (min-width: 992px) and (max-height: 760px) {
    .lg-wrap .lg-painel { padding: 36px 56px; }
    .lg-wrap .lg-pontos { margin-top: 18px; gap: 12px; }
    .lg-wrap .lg-painel .lg-lead { margin-bottom: 18px; }
    .lg-wrap .lg-quadro-foto { height: 160px; margin-bottom: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .lg-wrap *, .lg-wrap *::before, .lg-wrap *::after { transition: none !important; }
    .lg-wrap .lg-spin { animation: none; }
}
