/* =============================================================================
   login-ui.css — Tela de Login "Mirante" (redesign no tema futurista NIMO)
   Linguagem visual: dark + aurora + glassmorphism + acento de marca --nm05.
   Tudo ESCOPADO sob .login-screen (e a única exceção body.login, que só o
   _NotLoggedLayout usa = exclusivo do login). Self-contained: tokens, floating
   label e switch são redefinidos aqui — não depende de outros CSS além do
   site.css base (que é vencido por ordem de carga + especificidade).
   Carregar DEPOIS de site.css.
   ============================================================================= */

/* ----------------------------------------------------------------------------
   Reset do container/legado (login-only: body.login só existe nesta tela).
   A foto é full-bleed; o gutter do .container.body-content é zerado.
   ---------------------------------------------------------------------------- */
body.login {
    background: var(--gray100, #121212);
    overflow: hidden;
}

    body.login .container.body-content {
        max-width: none;
        width: 100%;
        padding: 0;
        margin: 0;
    }

/* ----------------------------------------------------------------------------
   Wrapper — palco em duas colunas (hero + formulário).
   Tokens do tema redefinidos no escopo (não são globais).
   ---------------------------------------------------------------------------- */
.login-screen {
    --nm05: #FFA17F;
    --nm09: #d9704c;
    --gray100: #121212;
    --txt: #ECECEC;
    --txt-dim: #9aa0a6;
    --stock-danger: #FF8A7A;
    --ls-field-autofill-bg: #23262e; /* fundo opaco do campo quando o navegador autocompleta */

    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100dvh;
    display: flex;
    background: var(--gray100);
    color: var(--txt);
    font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
    overflow: hidden;
    z-index: 1;
}

/* =============================================================================
   HERO (esquerda) — a foto cinematográfica da mina + marca + tagline
   ============================================================================= */
.login-screen__hero {
    position: relative;
    flex: 1 1 56%;
    min-width: 0;
    overflow: hidden;
}

/* Foto: base --gray100 garante 1º paint escuro (sem flash branco da PNG pesada).
   object-position 70% mantém o flare quente do sol apontando p/ o formulário. */
.ls-photo {
    position: absolute;
    inset: 0;
    background: var(--gray100) url("../images/loginNimo-v2.png") no-repeat;
    background-size: cover;
    background-position: 70% 50%;
}

/* Scrim editorial: escurece a esquerda (onde marca/título vivem) e abre à
   direita p/ o flare sobreviver. Vinheta ancora a cópia inferior-esquerda. */
.ls-hero-scrims {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(105deg, rgba(8, 12, 20, 0.86) 0%, rgba(10, 12, 16, 0.60) 30%, rgba(8, 10, 14, 0.18) 55%, transparent 72%),
        radial-gradient(120% 90% at 30% 64%, transparent 40%, rgba(6, 8, 12, 0.58) 100%);
}

/* Aurora coral fundida ao flare real do sol (mix-blend screen, canto sup. dir.).
   Opacidade capada p/ nunca estourar a área do sol p/ branco puro. */
.ls-aurora {
    position: absolute;
    top: -10%;
    right: -6%;
    width: 62%;
    height: 70%;
    pointer-events: none;
    background:
        radial-gradient(circle at 70% 30%, rgba(255, 161, 127, 0.20), transparent 70%),
        radial-gradient(circle at 80% 20%, rgba(217, 112, 76, 0.12), transparent 72%);
    filter: blur(34px);
    mix-blend-mode: screen;
    opacity: 0.85;
    animation: ls-aurora-drift 12s ease-in-out infinite alternate;
}

/* Grade tech sussurrada só no escuro inferior-esquerdo (mascarada). */
.ls-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 36px 36px;
    -webkit-mask-image: radial-gradient(circle at 30% 65%, #000, transparent 70%);
    mask-image: radial-gradient(circle at 30% 65%, #000, transparent 70%);
}

.ls-hero-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(40px, 5vw, 72px);
    padding-left: max(clamp(40px, 5vw, 72px), env(safe-area-inset-left));
}

/* --- Marca (topo-esquerda, sobre a região azul mais escura) --- */
.ls-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    animation: ls-fade-up 0.5s ease both;
}

.ls-brand__mark {
    width: 150px;
    height: auto;
    filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.5));
}

/* "live dot" coral — eco de radar/cava, pulsa lentamente (a marca está viva). */
.ls-brand__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--nm05);
    box-shadow: 0 0 0 5px rgba(255, 161, 127, 0.14), 0 0 12px rgba(255, 161, 127, 0.6);
    animation: ls-orbit-pulse 4s ease-in-out infinite;
}

/* --- Cópia editorial (inferior-esquerda) --- */
.ls-hero-copy {
    max-width: 560px;
    animation: ls-fade-up 0.6s ease 0.1s both;
}

.ls-accent-bar {
    display: block;
    width: 3px;
    height: 28px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--nm05), var(--nm09));
    box-shadow: 0 0 12px rgba(255, 161, 127, 0.5);
    margin-bottom: 18px;
}

.ls-kicker {
    display: block;
    font-size: 12.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--txt-dim);
    font-weight: 600;
}

.ls-headline {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
    font-size: clamp(30px, 3.6vw, 48px);
    line-height: 1.1;
    color: #fff !important; /* vence h1..h6,label{color !important} do site.css */
    margin: 14px 0 24px;
}

/* Palavra-chave do título "acende" em coral (mesma receita .grad do guia). */
.ls-grad {
    background: linear-gradient(100deg, var(--nm05), #ffd2bf 55%, var(--nm05));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.ls-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ls-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--txt);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 999px;
    padding: 7px 14px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

    .ls-chip svg {
        width: 14px;
        height: 14px;
        color: var(--nm05);
        flex: none;
    }

/* =============================================================================
   FORMULÁRIO (direita) — coluna de vidro fosco
   ============================================================================= */
.login-screen__form {
    position: relative;
    flex: 0 1 clamp(380px, 44%, 520px);
    display: grid;
    place-items: center;
    padding: clamp(28px, 4vw, 56px);
    background: linear-gradient(180deg, rgba(20, 22, 28, 0.66), rgba(18, 18, 18, 0.52));
    -webkit-backdrop-filter: blur(16px) saturate(1.15);
    backdrop-filter: blur(16px) saturate(1.15);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

/* "Continuous-light seam" — o feixe coral que liga a foto ao botão Entrar. */
.ls-seam {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    z-index: 3;
    background: linear-gradient(180deg, transparent, rgba(255, 161, 127, 0.30) 18%, rgba(255, 161, 127, 0.55) 50%, rgba(255, 161, 127, 0.30) 82%, transparent);
    box-shadow: 0 0 16px rgba(255, 161, 127, 0.40);
    animation: ls-seam-breathe 6s ease-in-out infinite alternate;
}

/* Aurora coral atrás do vidro (o painel "pega" cor de marca). */
.ls-form-aurora {
    position: absolute;
    left: -20%;
    right: -20%;
    bottom: -20%;
    height: 70%;
    pointer-events: none;
    background:
        radial-gradient(480px 280px at 70% 25%, rgba(255, 161, 127, 0.16), transparent 70%),
        radial-gradient(420px 260px at 60% 10%, rgba(217, 112, 76, 0.10), transparent 72%);
    filter: blur(38px);
    animation: ls-aurora-drift 12s ease-in-out infinite alternate;
    animation-delay: -4s;
}

.ls-form {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 360px;
    animation: ls-fade-up 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s both;
}

.ls-form-kicker {
    display: block;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--nm05);
    font-weight: 600;
}

.ls-form-title {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
    color: #fff !important; /* vence h1..h6,label{color !important} do site.css */
    font-size: 26px;
    margin: 10px 0 4px;
}

.ls-form-sub {
    color: var(--txt-dim);
    font-size: 14px;
    margin: 0 0 26px;
}

/* Retícula "orbit-lock" — assinatura derivada do "o" da marca (ponto-no-círculo).
   No foco de qualquer campo o arco varre o anel e o ponto acende ("trava no alvo"). */
.ls-reticle {
    position: absolute;
    top: -2px;
    right: 0;
    width: 34px;
    height: 34px;
    pointer-events: none;
}

    .ls-reticle .ls-reticle__ring {
        fill: none;
        stroke: rgba(255, 161, 127, 0.25);
        stroke-width: 1.4;
    }

    .ls-reticle .ls-reticle__arc {
        fill: none;
        stroke: var(--nm05);
        stroke-width: 1.6;
        stroke-linecap: round;
        stroke-dasharray: 82;
        stroke-dashoffset: 82;
        transform: rotate(-90deg);
        transform-origin: center;
        transition: stroke-dashoffset 0.6s ease;
    }

    .ls-reticle .ls-reticle__dot {
        fill: rgba(255, 161, 127, 0.5);
        transition: fill 0.3s ease;
    }

.ls-form:focus-within .ls-reticle__arc,
.ls-form.is-active .ls-reticle__arc {
    stroke-dashoffset: 20;
}

.ls-form:focus-within .ls-reticle__dot,
.ls-form.is-active .ls-reticle__dot {
    fill: var(--nm05);
}

/* --- Campos (floating-label próprio, discretos — sem borda em gradiente) --- */
.login-screen .ls-field {
    position: relative;
    margin-top: 16px;
}

/* !important nas cores/bordas p/ vencer regras globais agressivas do site.css:
   `input,select{background/color/border !important}` e `h1..h6,label{color !important}`. */
.login-screen .ls-field > .form-control {
    width: 100%;
    height: 54px;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    border-radius: 10px;
    color: var(--txt) !important;
    font-size: 15px;
    line-height: 1.2;
    padding: 1.35rem 0.9rem 0.35rem 2.6rem;
    box-shadow: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
    outline: none;
}

.login-screen .ls-field--password > .form-control {
    padding-right: 2.8rem;
}

.login-screen .ls-field > .form-control:focus,
.login-screen .ls-field.is-focused > .form-control {
    border-color: rgba(255, 161, 127, 0.55) !important;
    box-shadow: 0 0 0 3px rgba(255, 161, 127, 0.14);
    background: rgba(255, 255, 255, 0.07) !important;
}

/* Autofill do navegador (Chrome/Edge) pinta um fundo branco/azulado por cima do
   CSS. Repintamos com um inset box-shadow opaco escuro (cor de vidro do tema) e
   forçamos a cor do texto, mantendo a borda/foco. Ajuste fino via --ls-field-autofill-bg. */
.login-screen .ls-field > .form-control:-webkit-autofill,
.login-screen .ls-field > .form-control:-webkit-autofill:hover,
.login-screen .ls-field > .form-control:-webkit-autofill:active {
    -webkit-text-fill-color: var(--txt) !important;
    caret-color: var(--txt);
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    -webkit-box-shadow: 0 0 0 1000px var(--ls-field-autofill-bg) inset !important;
    box-shadow: 0 0 0 1000px var(--ls-field-autofill-bg) inset !important;
    transition: background-color 600000s 0s, color 600000s 0s;
}

.login-screen .ls-field > .form-control:-webkit-autofill:focus,
.login-screen .ls-field.is-focused > .form-control:-webkit-autofill {
    border-color: rgba(255, 161, 127, 0.55) !important;
    -webkit-box-shadow: 0 0 0 3px rgba(255, 161, 127, 0.14), 0 0 0 1000px var(--ls-field-autofill-bg) inset !important;
    box-shadow: 0 0 0 3px rgba(255, 161, 127, 0.14), 0 0 0 1000px var(--ls-field-autofill-bg) inset !important;
}

.login-screen .ls-field > .form-control::placeholder {
    color: transparent;
}

/* Label base centralizado. Resetamos o box-model do .form-floating do bootstrap
   (height:100%/padding/width:100%) p/ o posicionamento absoluto ser determinístico;
   cor com !important p/ vencer h1..h6,label{!important} do site.css. */
.login-screen .ls-field > label {
    position: absolute;
    left: 2.6rem;
    top: 50%;
    height: auto !important;
    width: auto !important;
    max-width: calc(100% - 3.5rem);
    transform: translateY(-50%);
    transform-origin: left center;
    margin: 0;
    padding: 0 !important;
    border: 0 !important;
    color: var(--txt-dim) !important;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 400;
    white-space: nowrap;
    pointer-events: none;
    transition: top 0.16s ease, font-size 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

/* Flutua: estados via classe JS (is-focused/is-filled, robusto p/ autofill) E via
   CSS nativo (:focus / :not(:placeholder-shown)) como fallback sem-JS p/ usuário real. */
.login-screen .ls-field.is-focused > label,
.login-screen .ls-field.is-filled > label,
.login-screen .ls-field > .form-control:focus ~ label,
.login-screen .ls-field > .form-control:not(:placeholder-shown) ~ label {
    top: 0.5rem !important;
    transform: translateY(0) !important;
    font-size: 11px !important;
    letter-spacing: 0.04em;
    color: var(--nm05) !important;
}

/* Ícone líder + botão "olho" */
.ls-field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    color: var(--txt-dim);
    z-index: 2;
    pointer-events: none;
    transition: color 0.18s ease;
}

    .ls-field-icon svg {
        width: 18px;
        height: 18px;
    }

.login-screen .ls-field:focus-within .ls-field-icon,
.login-screen .ls-field.is-focused .ls-field-icon {
    color: var(--nm05);
}

.ls-eye {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0;
    border-radius: 8px;
    color: var(--txt-dim);
    cursor: pointer;
    z-index: 2;
    transition: color 0.15s ease, background-color 0.15s ease;
}

    .ls-eye:hover {
        color: var(--nm05);
        background: rgba(255, 255, 255, 0.05);
    }

    .ls-eye svg {
        width: 18px;
        height: 18px;
    }

    .ls-eye .ls-eye-off {
        display: none;
    }

    .ls-eye.is-on .ls-eye-on {
        display: none;
    }

    .ls-eye.is-on .ls-eye-off {
        display: inline;
    }

/* Mensagem de validação (cliente) — danger discreto */
.ls-validation {
    display: block;
    color: var(--stock-danger);
    font-size: 12px;
    margin: 5px 2px 0;
}

    .ls-validation:empty {
        display: none;
    }

/* --- Lembrar de mim (reusa o switch-toggle padrão do app) --- */
.ls-remember {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
}

.ls-remember__label {
    margin: 0;
    color: var(--txt) !important; /* vence label{color !important} do site.css */
    font-size: 14px;
    font-weight: 500;
}

/* --- Erro (slot danger — cor semântica, NUNCA coral) --- */
.ls-error {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    background: rgba(255, 138, 122, 0.10);
    border: 1px solid rgba(255, 138, 122, 0.32);
    border-left: 3px solid var(--stock-danger);
    border-radius: 10px;
    color: var(--stock-danger);
    font-size: 13px;
    padding: 10px 12px;
    animation: ls-shake 0.16s ease;
}

    .ls-error svg {
        width: 16px;
        height: 16px;
        flex: none;
    }

/* --- Botão Entrar — botão canônico NIMO (término do feixe de luz) --- */
.ls-submit {
    width: 100%;
    height: 52px;
    margin-top: 22px;
    border: 0;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--nm05), #e8825f);
    color: #2a1206;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.02em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 18px rgba(255, 161, 127, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .ls-submit:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 26px rgba(255, 161, 127, 0.40);
    }

    .ls-submit:active {
        transform: translateY(0);
    }

    .ls-submit:focus-visible {
        outline: none;
        box-shadow: 0 6px 18px rgba(255, 161, 127, 0.28), 0 0 0 3px rgba(255, 161, 127, 0.30);
    }

    .ls-submit .ls-arrow {
        width: 18px;
        height: 18px;
        transition: transform 0.15s ease;
    }

    .ls-submit:hover .ls-arrow {
        transform: translateX(3px);
    }

/* =============================================================================
   Fallback: sem backdrop-filter, o painel vira sólido legível (não vidro vazio).
   ============================================================================= */
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
    .login-screen__form {
        background: rgba(20, 22, 28, 0.92);
    }
}

/* =============================================================================
   Responsivo
   ============================================================================= */
/* Tira o "pinch" entre 861–1100px (laptop pequeno): alarga a coluna do form. */
@media (max-width: 1100px) {
    .login-screen__form {
        flex-basis: min(46%, 460px);
    }
}

/* Mobile: a divisão se dissolve — foto vira faixa-hero no topo, form vira card. */
@media (max-width: 860px) {
    body.login {
        overflow: auto;
    }

    .login-screen {
        flex-direction: column;
        height: 100dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .login-screen__hero {
        flex: none;
        height: clamp(140px, 34vw, 180px);
    }

    .ls-photo {
        background-position: center 35%;
    }

    .ls-hero-scrims {
        background: linear-gradient(180deg, rgba(18, 18, 18, 0) 30%, rgba(18, 18, 18, 0.85) 100%);
    }

    .ls-aurora,
    .ls-grid {
        display: none;
    }

    .ls-hero-content {
        height: 100%;
        justify-content: flex-end;
        align-items: center;
        gap: 6px;
        padding: 16px 20px 18px;
        text-align: center;
    }

    .ls-brand {
        justify-content: center;
    }

    .ls-brand__mark {
        width: 118px;
    }

    .ls-hero-copy {
        max-width: none;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .ls-accent-bar,
    .ls-headline,
    .ls-stats {
        display: none;
    }

    .ls-kicker {
        font-size: 10px;
        letter-spacing: 0.14em;
    }

    .login-screen__form {
        flex: none;
        display: block;
        padding: 20px 16px 32px;
        background: transparent;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        border-left: 0;
        box-shadow: none;
    }

    .ls-seam,
    .ls-form-aurora {
        display: none;
    }

    .ls-form {
        max-width: 420px;
        width: 100%;
        margin-inline: auto;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-top: 2px solid var(--nm05);
        border-radius: 16px;
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
        padding: 24px 18px 26px;
    }

    .login-screen .ls-field > .form-control {
        height: 56px;
    }

    .ls-submit {
        height: 54px;
    }
}

@media (max-width: 860px) {
    @supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
        .ls-form {
            background: rgba(20, 22, 28, 0.92);
        }
    }
}

@media (max-width: 360px) {
    .ls-reticle {
        display: none;
    }
}

/* =============================================================================
   Movimento & acessibilidade — desliga drift/pulse/entrada; mantém foco/hover.
   ============================================================================= */
@media (prefers-reduced-motion: reduce) {
    .login-screen *,
    .login-screen *::before,
    .login-screen *::after {
        animation: none !important;
    }

    .login-screen .ls-reticle__arc {
        transition: none !important;
    }
}

/* =============================================================================
   Keyframes
   ============================================================================= */
@keyframes ls-aurora-drift {
    from {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.6;
    }

    to {
        transform: translate3d(14px, -10px, 0) scale(1.08);
        opacity: 0.92;
    }
}

@keyframes ls-orbit-pulse {
    0%, 100% {
        box-shadow: 0 0 0 5px rgba(255, 161, 127, 0.14), 0 0 12px rgba(255, 161, 127, 0.6);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(255, 161, 127, 0.05), 0 0 16px rgba(255, 161, 127, 0.5);
    }
}

@keyframes ls-seam-breathe {
    from {
        opacity: 0.55;
    }

    to {
        opacity: 1;
    }
}

@keyframes ls-shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-3px);
    }

    75% {
        transform: translateX(3px);
    }
}

@keyframes ls-fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
