/* Tela de login redesenhada (2026-09-26).
   Carregada só pelo layout Frontend.Layouts.login. Escopo body.hg-login: a
   tela de login não recebe body.ui-new-nav, e o layout é exclusivo dela.
   Cores do painel escuro são da ilustração (marca Declatrack); ações usam os
   tokens de base/tokens.css. */

body.hg-login {
    --hg-login-ink: #0B2F38;
    --hg-login-ink-2: #123F4A;
    --hg-login-muted-on-ink: #B9D3DA;
    --hg-login-eyebrow: #9FC4CD;
    --hg-login-accent: #E8943A;
    --hg-login-text: #10262D;
    --hg-login-text-2: #4F6369;
    --hg-login-icon: #5E7278;
    --hg-login-field: #F4F7F8;
    --hg-login-border: #D3DDE0;
    --hg-login-line: #E3EAEC;
    --hg-login-display: 'Sora', var(--hg-font-family);
    --hg-login-body: 'DM Sans', var(--hg-font-family);

    margin: 0;
    min-height: 100vh;
    background: var(--color-white, #ffffff);
    background-image: none;
    color: var(--hg-login-text);
    font-family: var(--hg-login-body);
    font-size: 15px;
}

body.hg-login *,
body.hg-login *::before,
body.hg-login *::after { box-sizing: border-box; }

body.hg-login .hg-login__shell {
    display: flex;
    min-height: 100vh;
}

/* ---------- Painel do ecossistema ---------- */

body.hg-login .hg-login__eco {
    flex: 0 0 min(54%, 860px);
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 48px 64px;
    background: var(--hg-login-ink);
    color: #ffffff;
}

body.hg-login .hg-login__eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--hg-login-eyebrow);
}

body.hg-login .hg-login__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--hg-login-accent);
}

body.hg-login .hg-login__map {
    display: block;
    width: 100%;
    height: auto;
    max-height: 46vh;
    font-family: var(--hg-login-body);
}

body.hg-login .hg-login__node-title { fill: #ffffff; font-size: 14px; font-weight: 600; }
body.hg-login .hg-login__node-sub { fill: var(--hg-login-eyebrow); font-size: 11px; }

@keyframes hgLoginPulse { from { transform: scale(1); opacity: .55; } to { transform: scale(2); opacity: 0; } }
@keyframes hgLoginDash { to { stroke-dashoffset: -40; } }
@keyframes hgLoginFlow { to { stroke-dashoffset: -24; } }

body.hg-login .hg-login__pulse {
    transform-box: fill-box;
    transform-origin: center;
    animation: hgLoginPulse 2.6s ease-out infinite;
}
body.hg-login .hg-login__route { animation: hgLoginDash 2.2s linear infinite; }
body.hg-login .hg-login__flow { animation: hgLoginFlow 1.6s linear infinite; }

@media (prefers-reduced-motion: reduce) {
    body.hg-login .hg-login__pulse,
    body.hg-login .hg-login__route,
    body.hg-login .hg-login__flow { animation: none; }
}

body.hg-login .hg-login__hero {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: auto;
}

body.hg-login .hg-login__title {
    margin: 0;
    max-width: 620px;
    font-family: var(--hg-login-display);
    font-size: 38px;
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -.02em;
    color: #ffffff;
}

body.hg-login .hg-login__lead {
    margin: 0;
    max-width: 600px;
    font-size: 17px;
    line-height: 1.55;
    color: var(--hg-login-muted-on-ink);
}

body.hg-login .hg-login__cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

body.hg-login .hg-login__card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
}
body.hg-login .hg-login__card strong { font-size: 14px; font-weight: 600; }
body.hg-login .hg-login__card span { font-size: 13px; line-height: 1.45; color: var(--hg-login-muted-on-ink); }

/* ---------- Formulário ---------- */

body.hg-login .hg-login__main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 48px 32px;
}

body.hg-login .hg-login__box {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 26px;
}

body.hg-login .hg-login__logo img {
    display: block;
    max-width: 210px;
    max-height: 56px;
    width: auto;
    height: auto;
}

body.hg-login .hg-login__heading h2 {
    margin: 0 0 8px;
    font-family: var(--hg-login-display);
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--hg-login-text);
}
body.hg-login .hg-login__heading p { margin: 0; font-size: 16px; color: var(--hg-login-text-2); }

body.hg-login .hg-login__alert {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
    border: 1px solid;
}
body.hg-login .hg-login__alert--danger { background: #FDF0F0; border-color: #F1C2C2; color: #8A1F1F; }
body.hg-login .hg-login__alert--success { background: var(--color-primary-tint, #f0f7f9); border-color: #BFDCE3; color: var(--color-primary-deep, #084e63); }

body.hg-login .hg-login__form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 0;
}

body.hg-login .hg-login__field { display: flex; flex-direction: column; gap: 8px; }
body.hg-login .hg-login__field label {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--hg-login-text);
}

body.hg-login .hg-login__control { position: relative; color: var(--hg-login-icon); }
body.hg-login .hg-login__control > svg {
    position: absolute;
    left: 14px;
    top: 14px;
    pointer-events: none;
}

body.hg-login .hg-login__input {
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 14px 0 44px;
    font: inherit;
    font-size: 15px;
    color: var(--hg-login-text);
    background: var(--hg-login-field);
    border: 1px solid var(--hg-login-border);
    border-radius: 12px;
    box-shadow: none;
    transition: border-color .15s, box-shadow .15s;
}
body.hg-login .hg-login__input--pass { padding-right: 52px; }
body.hg-login .hg-login__input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-alpha-20, rgba(5, 97, 122, .2));
    background: #ffffff;
}

body.hg-login .hg-login__eye {
    position: absolute;
    right: 2px;
    top: 2px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #45595F;
    cursor: pointer;
}
body.hg-login .hg-login__eye:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }
body.hg-login .hg-login__eye-slash { display: none; }
body.hg-login .hg-login__eye[aria-pressed="true"] .hg-login__eye-slash { display: inline; }

body.hg-login .hg-login__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

body.hg-login .hg-login__check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    color: #2A3E44;
    cursor: pointer;
}
body.hg-login .hg-login__check input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--color-primary);
}

body.hg-login .hg-login__link {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
}
body.hg-login .hg-login__link:hover,
body.hg-login .hg-login__link:focus { color: var(--color-primary-active); text-decoration: underline; }

body.hg-login .hg-login__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 12px;
    background: var(--color-primary);
    color: #ffffff;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
body.hg-login .hg-login__submit:hover { background: var(--color-primary-hover); }
body.hg-login .hg-login__submit:active { background: var(--color-primary-active); }
body.hg-login .hg-login__submit:focus-visible { outline: 3px solid var(--color-primary-alpha-20, rgba(5, 97, 122, .2)); outline-offset: 2px; }

body.hg-login .hg-login__register { margin: 0; text-align: center; }

body.hg-login .hg-login__sep {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--hg-login-text-2);
}
body.hg-login .hg-login__sep::before,
body.hg-login .hg-login__sep::after { content: ""; flex: 1; height: 1px; background: var(--hg-login-line); }

body.hg-login .hg-login__sso {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    border: 1px solid var(--hg-login-border);
    border-radius: 12px;
    background: #ffffff;
}
body.hg-login .hg-login__sso + .hg-login__sso { margin-top: 10px; }
body.hg-login .hg-login__sso img { max-height: 26px; width: auto; }

body.hg-login .hg-login__apps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 24px;
    border-top: 1px solid var(--hg-login-line);
}
body.hg-login .hg-login__apps-label { font-size: 13px; color: var(--hg-login-text-2); }
body.hg-login .hg-login__apps-row { display: flex; gap: 12px; }
body.hg-login .hg-login__app {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 48px;
    border: 1px solid var(--hg-login-border);
    border-radius: 12px;
    color: var(--hg-login-text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
body.hg-login .hg-login__app:hover,
body.hg-login .hg-login__app:focus { border-color: var(--color-primary); color: var(--color-primary); text-decoration: none; }

body.hg-login .hg-login__footer {
    font-size: 13px;
    color: var(--hg-login-icon);
    text-align: center;
}

/* ---------- Telas menores ---------- */

@media (max-width: 1280px) {
    body.hg-login .hg-login__eco { padding: 40px 44px; }
    body.hg-login .hg-login__title { font-size: 32px; }
}

@media (max-width: 1100px) {
    body.hg-login .hg-login__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


@media (max-width: 960px) {
    body.hg-login .hg-login__shell { flex-direction: column; }
    body.hg-login .hg-login__eco {
        flex: 0 0 auto;
        gap: 16px;
        padding: 28px 24px 48px;
    }
    body.hg-login .hg-login__map { max-height: 220px; }
    body.hg-login .hg-login__hero { margin-top: 0; }
    body.hg-login .hg-login__title { font-size: 24px; line-height: 1.2; }
    body.hg-login .hg-login__lead,
    body.hg-login .hg-login__cards { display: none; }
    body.hg-login .hg-login__main {
        margin-top: -24px;
        padding: 28px 16px 24px;
        border-radius: 24px 24px 0 0;
        background: #ffffff;
        justify-content: flex-start;
        gap: 28px;
    }
    body.hg-login .hg-login__heading h2 { font-size: 24px; }
}

@media (max-width: 560px) {
    body.hg-login .hg-login__map { display: none; }
    body.hg-login .hg-login__input { font-size: 16px; }
}

/* ---------- Proporção pela altura da janela (desktop) ----------
   A ilustração fica com o espaço que sobra entre o selo e o título, em vez de
   uma fatia fixa da altura: em janela baixa ela encolhe e o título não sai da
   tela. Cada lado rola sozinho se ainda faltar espaço. */

@media (min-width: 961px) {
    body.hg-login .hg-login__shell { height: 100vh; min-height: 0; }
    body.hg-login .hg-login__eco { height: 100vh; overflow: hidden; }
    body.hg-login .hg-login__map {
        flex: 1 1 0;
        min-height: 0;
        height: auto;
        max-height: none;
    }
    body.hg-login .hg-login__hero { margin-top: 0; }
    /* Título numa linha: com Sora 700 a frase mede ~23,5x o tamanho da fonte.
       O painel tem min(54vw, 860px) menos 128px de respiro lateral. Se a fonte
       não carregar, quebra em duas linhas em vez de estourar. */
    body.hg-login .hg-login__title {
        max-width: none;
        font-size: min(30px, calc((min(54vw, 860px) - 128px) / 24.5));
    }
    body.hg-login .hg-login__main {
        height: 100vh;
        overflow-y: auto;
        justify-content: safe center;
    }
}

@media (min-width: 961px) and (max-height: 720px) {
    body.hg-login .hg-login__eco { gap: 16px; padding-top: 28px; padding-bottom: 28px; }
    body.hg-login .hg-login__lead { font-size: 15px; line-height: 1.5; }
    body.hg-login .hg-login__card { padding: 10px 12px; gap: 4px; }
    body.hg-login .hg-login__card strong { font-size: 13px; }
    body.hg-login .hg-login__card span { font-size: 12px; line-height: 1.4; }

    body.hg-login .hg-login__main { gap: 20px; padding-top: 24px; padding-bottom: 24px; }
    body.hg-login .hg-login__box { gap: 18px; }
    body.hg-login .hg-login__logo img { max-height: 44px; }
    body.hg-login .hg-login__heading h2 { font-size: 24px; margin-bottom: 4px; }
    body.hg-login .hg-login__heading p { font-size: 14px; }
    body.hg-login .hg-login__form { gap: 14px; }
    body.hg-login .hg-login__field { gap: 6px; }
    body.hg-login .hg-login__input { height: 44px; }
    body.hg-login .hg-login__control > svg { top: 12px; }
    body.hg-login .hg-login__eye { width: 40px; height: 40px; }
    body.hg-login .hg-login__check { min-height: 36px; }
    body.hg-login .hg-login__submit { height: 46px; }
    body.hg-login .hg-login__apps { gap: 10px; padding-top: 14px; }
    body.hg-login .hg-login__app { height: 42px; }
}

@media (min-width: 961px) and (max-width: 1280px) {
    body.hg-login .hg-login__title { font-size: calc((54vw - 88px) / 24.5); }
}

@media (min-width: 961px) and (max-height: 560px) {
    body.hg-login .hg-login__lead,
    body.hg-login .hg-login__cards { display: none; }
}
