/* ============================================================
   EAS Construtora — Tela de Login
   Autocontido: esta página não carrega app.css.
   Estilo: corporativo, flat, sem ornamentos.
   As cores chegam via variáveis definidas inline no <head>
   (--lg-accent, --lg-painel, --lg-fundo, --lg-texto).
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --lg-borda:       color-mix(in srgb, var(--lg-texto) 14%, transparent);
    --lg-borda-forte: color-mix(in srgb, var(--lg-texto) 26%, transparent);
    --lg-texto-2:     color-mix(in srgb, var(--lg-texto) 62%, transparent);
    --lg-texto-3:     color-mix(in srgb, var(--lg-texto) 42%, transparent);
    --lg-campo:       color-mix(in srgb, var(--lg-texto) 4%, var(--lg-fundo));
    --lg-erro:        #e5534b;
}

html, body { height: 100%; }

body.pagina-login {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    background: var(--lg-fundo);
    color: var(--lg-texto);
    -webkit-font-smoothing: antialiased;
}

.login-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(440px, 560px);
    min-height: 100vh;
    min-height: 100dvh;
}

/* -- Painel institucional (esquerda) ------------------------ */

.painel-marca {
    background: var(--lg-painel);
    border-right: 1px solid var(--lg-borda);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
}

.painel-marca .marca-logo img {
    max-width: 200px;
    max-height: 64px;
    object-fit: contain;
    display: block;
}

.painel-marca .marca-nome {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.painel-marca .marca-descricao {
    max-width: 380px;
}

.painel-marca .marca-descricao h2 {
    font-size: 26px;
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.painel-marca .marca-descricao p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--lg-texto-2);
}

.painel-marca .marca-rodape {
    font-size: 12px;
    color: var(--lg-texto-3);
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

/* -- Painel do formulário (direita) ------------------------- */

.painel-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
}

.form-caixa {
    width: 100%;
    max-width: 360px;
}

.form-logo-mobile {
    display: none;
    max-width: 160px;
    max-height: 52px;
    object-fit: contain;
    margin: 0 auto 28px;
}

.form-titulo {
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}

.form-subtitulo {
    font-size: 13px;
    color: var(--lg-texto-2);
    margin-bottom: 28px;
}

/* -- Alerta de erro ------------------------------------------ */

.alerta-erro {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: 18px;
    font-size: 13px;
    line-height: 1.45;
    color: #f1a6a1;
    background: color-mix(in srgb, var(--lg-erro) 9%, transparent);
    border: 1px solid color-mix(in srgb, var(--lg-erro) 30%, transparent);
    border-radius: 4px;
}

.alerta-erro svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    margin-top: 1px;
    stroke: var(--lg-erro);
    fill: none;
    stroke-width: 2;
}

/* -- Campos --------------------------------------------------- */

.campo {
    margin-bottom: 16px;
}

.campo label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--lg-texto-2);
    margin-bottom: 6px;
}

.campo-envelope {
    position: relative;
}

.campo input[type="text"],
.campo input[type="password"] {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--lg-texto);
    background: var(--lg-campo);
    border: 1px solid var(--lg-borda-forte);
    border-radius: 4px;
    outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.campo-envelope input {
    padding-right: 42px;
}

.campo input::placeholder {
    color: var(--lg-texto-3);
}

.campo input:focus {
    border-color: var(--lg-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--lg-accent) 18%, transparent);
}

/* -- Mostrar/ocultar senha ------------------------------------ */

.alternar-senha {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--lg-texto-3);
    cursor: pointer;
}

.alternar-senha:hover { color: var(--lg-texto); }

.alternar-senha svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.alternar-senha .icone-olho-fechado { display: none; }
.alternar-senha.is-active .icone-olho { display: none; }
.alternar-senha.is-active .icone-olho-fechado { display: block; }

/* -- Opções e botão ------------------------------------------- */

.linha-opcoes {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 20px;
}

.lembrar-acesso {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--lg-texto-2);
    cursor: pointer;
    user-select: none;
}

.lembrar-acesso input {
    width: 15px;
    height: 15px;
    accent-color: var(--lg-accent);
    cursor: pointer;
}

.botao-entrar {
    width: 100%;
    height: 42px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background: var(--lg-accent);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: filter 120ms ease;
}

.botao-entrar:hover { filter: brightness(1.08); }
.botao-entrar:active { filter: brightness(0.95); }

.botao-entrar:disabled {
    opacity: 0.7;
    cursor: default;
}

.botao-entrar:focus-visible,
.alternar-senha:focus-visible,
.lembrar-acesso input:focus-visible {
    outline: 2px solid var(--lg-accent);
    outline-offset: 2px;
}

.form-rodape {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--lg-borda);
    font-size: 12px;
    color: var(--lg-texto-3);
    text-align: center;
    display: none;
}

/* -- Responsivo ----------------------------------------------- */

@media (max-width: 900px) {
    .login-layout { grid-template-columns: 1fr; }
    .painel-marca { display: none; }
    .form-logo-mobile { display: block; }
    .form-titulo, .form-subtitulo { text-align: center; }
    .form-rodape { display: block; }
    .painel-form {
        padding: 32px 20px;
        padding-bottom: max(32px, env(safe-area-inset-bottom));
    }
}
