/* =============================================================================
   Login do Flow (/Auth/Login). Desktop: painel da marca + formulário.
   Celular: faixa da marca no topo e o cartão do formulário por cima, alvos de
   toque grandes e campos de 16px (o iPhone não dá zoom ao focar).
   ============================================================================= */
:root {
    --lg-1: #2438E8;
    --lg-1-h: #1C2ED0;
    --lg-grad: linear-gradient(135deg, #1833FF 0%, #3565FF 50%, #00C2FF 100%);
    --lg-grad-2: linear-gradient(135deg, #2438E8 0%, #6366F1 60%, #8B5CF6 100%);
    --lg-ink: #0A0B1E;
    --lg-text: #1E2333;
    --lg-muted: #5C6478;
    --lg-line: #E2E8F0;
    --lg-bg: #F6F7FB;
    --lg-ring: rgba(36, 56, 232, .16);
    --lg-red: #B91C1C;
}
/* O atributo hidden precisa vencer os display:flex das peças abaixo. */
.lg [hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body.lg { margin: 0; font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--lg-text); background: var(--lg-bg); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
.lg h1, .lg h2 { font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; margin: 0; color: var(--lg-ink); letter-spacing: -.02em; }
.lg p { margin: 0; }
.lg-wrap { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 55fr) minmax(0, 45fr); }

/* ---------- marca (desktop) ---------- */
.lg-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(32px, 5vw, 64px); background: #fff; border-right: 1px solid var(--lg-line); z-index: 0; }
.lg-grid { position: absolute; inset: 0; background-image: radial-gradient(rgba(15, 23, 42, .06) 1px, transparent 1px); background-size: 28px 28px; z-index: -1; }
.lg-luz { position: absolute; border-radius: 50%; filter: blur(50px); z-index: -1; }
.lg-luz--1 { top: -12%; left: -12%; width: 650px; height: 650px; background: radial-gradient(circle, rgba(32, 56, 255, .10), transparent 70%); }
.lg-luz--2 { bottom: -18%; right: -12%; width: 600px; height: 600px; background: radial-gradient(circle, rgba(139, 92, 246, .14), transparent 70%); }
/* Rede neural (js/login-neural.js). Fica atrás do texto da marca e acima da grade de pontos. */
.lg-rede { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.lg-logo-pill { display: inline-flex; align-items: center; }
.lg-logo-pill img { height: 52px; width: auto; display: block; }
.lg-brand-body { max-width: 560px; margin: auto 0; }
.lg-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(32, 56, 255, .06); border: 1px solid rgba(32, 56, 255, .15); font-size: .85rem; font-weight: 650; color: var(--lg-1); margin-bottom: 22px; }
.lg-brand h1 { font-size: clamp(2.2rem, 3.6vw, 3.2rem); font-weight: 800; line-height: 1.12; margin-bottom: 18px; }
.lg-grad { background: var(--lg-grad-2); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.lg-brand-body > p { font-size: 1.1rem; color: var(--lg-muted); line-height: 1.6; margin-bottom: 34px; }
.lg-feats { list-style: none; margin: 0; padding: 26px 0 0; display: flex; gap: 32px; border-top: 1px solid var(--lg-line); flex-wrap: wrap; }
.lg-feats li { display: flex; flex-direction: column; gap: 4px; }
.lg-feats strong { font-size: 1.12rem; color: var(--lg-ink); }
.lg-feats span { font-size: .85rem; color: var(--lg-muted); }
.lg-brand-foot { font-size: .85rem; color: #94A3B8; }

/* ---------- formulário ---------- */
.lg-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: clamp(24px, 5vw, 48px); gap: 18px; }
.lg-mob-top { display: none; }
.lg-card { width: 100%; max-width: 420px; }
.lg-head { margin-bottom: 26px; }
.lg-head h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: 6px; }
.lg-head p { color: var(--lg-muted); font-size: .97rem; }
.lg-form { display: flex; flex-direction: column; gap: 18px; }
.lg-campo { display: flex; flex-direction: column; gap: 6px; }
.lg-campo > label { font-weight: 650; font-size: .88rem; color: #334155; }
.lg-input { position: relative; display: flex; align-items: center; }
.lg-input > .bi:first-child { position: absolute; left: 16px; color: #94A3B8; font-size: 1.1rem; pointer-events: none; transition: color .2s; }
.lg-input input, .lg-input select {
    width: 100%; height: 52px; padding: 0 16px 0 46px; font: inherit; font-size: 1rem; color: var(--lg-ink);
    background: #fff; border: 1px solid var(--lg-line); border-radius: 14px; box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
    transition: border-color .2s, box-shadow .2s; -webkit-appearance: none; appearance: none;
}
.lg-input input:hover, .lg-input select:hover { border-color: #CBD5E1; }
.lg-input input:focus, .lg-input select:focus { outline: none; border-color: var(--lg-1); box-shadow: 0 0 0 4px var(--lg-ring); }
.lg-input:focus-within > .bi:first-child { color: var(--lg-1); }
.lg-input input[type=password], .lg-input input#password { padding-right: 52px; }
.lg-olho { position: absolute; right: 6px; width: 42px; height: 42px; border: 0; background: none; border-radius: 10px; color: #64748B; cursor: pointer; font-size: 1.15rem; display: grid; place-items: center; }
.lg-olho:hover { background: #F1F5F9; color: var(--lg-ink); }
.lg-input--select select { padding-right: 42px; cursor: pointer; }
.lg-seta { position: absolute; right: 16px; color: #94A3B8; pointer-events: none; }
.lg-campo.is-invalido .lg-input input, .lg-campo.is-invalido .lg-input select { border-color: var(--lg-red); box-shadow: 0 0 0 4px rgba(185, 28, 28, .1); }
.lg-erro { display: none; color: var(--lg-red); font-size: .82rem; font-weight: 600; }
.lg-campo.is-invalido .lg-erro { display: block; }
.lg-caps { color: #B45309; font-size: .82rem; font-weight: 650; display: inline-flex; gap: 6px; align-items: center; }
.lg-unidade-chip { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: #F1F4FF; border: 1px solid #DCE2FF; color: #1E2A9E; font-size: .9rem; font-weight: 600; margin-top: -4px; }
.lg-unidade-chip span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-unidade-chip button { border: 0; background: none; color: var(--lg-1); font: inherit; font-weight: 700; cursor: pointer; padding: 4px 6px; text-decoration: underline; }
.lg-linha { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lg-chk { display: inline-flex; align-items: center; gap: 10px; font-size: .92rem; color: #475569; cursor: pointer; min-height: 40px; user-select: none; }
.lg-chk input { width: 20px; height: 20px; accent-color: var(--lg-1); cursor: pointer; }
.lg-seguro { display: inline-flex; align-items: center; gap: 6px; color: #64748B; font-size: .8rem; background: #EEF2F7; padding: 5px 10px; border-radius: 8px; }
.lg-btn { height: 54px; border: 0; border-radius: 14px; background: var(--lg-grad); color: #fff; font: inherit; font-weight: 750; font-size: 1.02rem; letter-spacing: .01em; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; box-shadow: 0 12px 24px -8px rgba(32, 56, 255, .45); transition: transform .2s, box-shadow .2s, filter .2s; }
.lg-btn:hover { transform: translateY(-1px); box-shadow: 0 16px 28px -8px rgba(32, 56, 255, .55); filter: brightness(1.04); }
.lg-btn:active { transform: translateY(0); }
.lg-btn[disabled] { opacity: .75; cursor: wait; transform: none; }
.lg-spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: lg-gira .8s linear infinite; }
@keyframes lg-gira { to { transform: rotate(360deg); } }
.lg-alert { display: flex; align-items: flex-start; gap: 12px; border-radius: 14px; border: 1px solid #FECACA; background: #FEF2F2; color: #991B1B; padding: 12px 16px; font-size: .92rem; margin-bottom: 18px; }
.lg-alert .bi { font-size: 1.1rem; }
.lg-ajuda { color: #64748B; font-size: .84rem; text-align: center; display: flex; gap: 6px; align-items: center; justify-content: center; }
.lg-foot { color: #94A3B8; font-size: .8rem; }
.lg :focus-visible { outline: 2px solid var(--lg-1); outline-offset: 2px; }

/* ---------- celular e tablet ---------- */
@media (max-width: 992px) {
    /* minmax(0,…): sem isso a coluna cresce até o conteúdo (select de unidade) e o celular ganha rolagem lateral. */
    .lg-wrap { grid-template-columns: minmax(0, 1fr); }
    .lg-main, .lg-card, .lg-form, .lg-input { min-width: 0; }
    .lg-brand { display: none; }
    body.lg { background: #fff; }
    .lg-main { justify-content: flex-start; padding: 0 0 calc(20px + env(safe-area-inset-bottom, 0px)); gap: 0; min-height: 100dvh; }
    .lg-mob-top {
        display: flex; align-items: flex-start; justify-content: center; width: 100%;
        padding: calc(28px + env(safe-area-inset-top, 0px)) 20px 64px;
        background: radial-gradient(circle at 85% 0%, rgba(139, 92, 246, .55), transparent 55%), var(--lg-grad-2);
        border-radius: 0 0 32px 32px;
    }
    .lg-logo-pill--mob { background: #fff; border-radius: 999px; padding: 10px 22px; box-shadow: 0 12px 30px -12px rgba(10, 11, 30, .45); }
    .lg-logo-pill--mob img { height: 34px; }
    .lg-card {
        max-width: 480px; margin: -40px 16px 0; width: calc(100% - 32px); background: #fff; border-radius: 24px;
        padding: 26px 20px 22px; box-shadow: 0 24px 50px -24px rgba(10, 11, 30, .35); border: 1px solid #EEF1F6;
    }
    .lg-head { margin-bottom: 20px; text-align: center; }
    .lg-head h2 { font-size: 1.5rem; }
    .lg-form { gap: 16px; }
    .lg-input input, .lg-input select { height: 54px; font-size: 16px; }
    .lg-btn { height: 56px; }
    .lg-foot { margin-top: 18px; text-align: center; }
}
@media (max-width: 360px) {
    .lg-card { padding: 22px 16px 18px; }
    .lg-seguro { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
