/* ==========================================================================
   Tela de login — "rede viva"
   Fundo escuro com ondas de sinal Wi-Fi, malha de rede e auroras; cartão de
   vidro com rótulos flutuantes. Arquivo próprio (não usa o app.css) pra a
   página carregar leve e sem regras do painel interferindo.
   Animações desligadas em prefers-reduced-motion.
   ========================================================================== */

:root {
  --lg-fundo: #070B1F;
  --lg-fundo-2: #0D1533;
  --lg-azul: #2F5EE8;
  --lg-azul-claro: #6E93F2;
  --lg-ciano: #22D3EE;
  --lg-verde: #34D399;
  --lg-texto: #F4F6FF;
  --lg-texto-2: #A9B4D6;
  --lg-texto-3: #7482AD;
  --lg-borda: rgba(255, 255, 255, .12);
  --lg-raio: 22px;
}

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

html, body { margin: 0; min-height: 100%; }

body.lg {
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--lg-fundo);
  color: var(--lg-texto);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

/* ---------- Fundo animado ---------- */

.lg-fundo { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }

.lg-aurora {
  position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: blur(90px); opacity: .45; mix-blend-mode: screen;
}
.lg-aurora--a { background: radial-gradient(circle, #2F5EE8 0%, transparent 65%); top: -22vmax; left: -14vmax; animation: lg-deriva 22s ease-in-out infinite alternate; }
.lg-aurora--b { background: radial-gradient(circle, #0EA5B7 0%, transparent 65%); bottom: -26vmax; right: -16vmax; animation: lg-deriva 26s ease-in-out infinite alternate-reverse; opacity: .32; }

@keyframes lg-deriva {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(6vmax, 4vmax) scale(1.12); }
}

.lg-malha {
  position: absolute; inset: -2px;
  background-image:
    linear-gradient(rgba(110, 147, 242, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 147, 242, .07) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 50%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse at 30% 50%, #000 20%, transparent 75%);
}

/* Ondas de sinal saindo de um ponto — o "Wi-Fi" da marca, em movimento. */
.lg-sinal { position: absolute; left: 30%; top: 52%; width: 0; height: 0; }
.lg-sinal span {
  position: absolute; left: 50%; top: 50%;
  width: 90vmin; height: 90vmin; margin: -45vmin 0 0 -45vmin;
  border-radius: 50%; border: 1.5px solid rgba(110, 147, 242, .35);
  opacity: 0; transform: scale(.05);
  animation: lg-onda 8s cubic-bezier(.2, .6, .3, 1) infinite;
}
.lg-sinal span:nth-child(2) { animation-delay: 2s; }
.lg-sinal span:nth-child(3) { animation-delay: 4s; }
.lg-sinal span:nth-child(4) { animation-delay: 6s; }
@keyframes lg-onda {
  0%   { opacity: 0; transform: scale(.05); }
  12%  { opacity: .9; }
  100% { opacity: 0; transform: scale(1); }
}
.lg-sinal__ponto {
  position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: var(--lg-ciano); box-shadow: 0 0 0 6px rgba(34, 211, 238, .15), 0 0 28px 6px rgba(34, 211, 238, .55);
}

/* Nós da rede piscando — aparelhos "conectando". */
.lg-nos i {
  position: absolute; left: var(--x); top: var(--y);
  width: 6px; height: 6px; border-radius: 50%; background: var(--lg-azul-claro);
  box-shadow: 0 0 14px 3px rgba(110, 147, 242, .6);
  opacity: .25; animation: lg-pisca 4.5s ease-in-out infinite; animation-delay: var(--d);
}
@keyframes lg-pisca { 0%, 100% { opacity: .2; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.25); } }

/* ---------- Palco ---------- */

.lg-palco {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(380px, .85fr);
  align-items: center; gap: clamp(24px, 5vw, 80px);
  padding: clamp(28px, 5vw, 72px);
  max-width: 1400px; margin: 0 auto;
}

/* ---------- Marca ---------- */

.lg-marca { display: flex; align-items: center; gap: 12px; }
.lg-marca__logo {
  width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--lg-azul), #1E3FAE);
  box-shadow: 0 10px 30px rgba(47, 94, 232, .45), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.lg-marca__logo svg { width: 24px; height: 24px; fill: #fff; }
.lg-marca span { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.lg-marca em { font-style: normal; color: var(--lg-azul-claro); }
.lg-marca--mobile { display: none; }

/* ---------- Hero (lado esquerdo) ---------- */

.lg-hero { display: flex; flex-direction: column; gap: 28px; max-width: 620px; animation: lg-sobe .8s ease-out both; }

.lg-hero h1 {
  margin: 8px 0 0; font-size: clamp(32px, 3.6vw, 52px); line-height: 1.08;
  font-weight: 800; letter-spacing: -.03em;
}
.lg-destaque {
  background: linear-gradient(90deg, var(--lg-azul-claro), var(--lg-ciano), var(--lg-verde), var(--lg-azul-claro));
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: lg-brilho 8s linear infinite;
}
@keyframes lg-brilho { to { background-position: 300% 0; } }

.lg-sub { margin: -8px 0 0; font-size: 17px; line-height: 1.6; color: var(--lg-texto-2); max-width: 520px; }

.lg-recursos { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lg-recursos li {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px;
  background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .07);
  max-width: 470px; animation: lg-sobe .7s ease-out both;
}
.lg-recursos li:nth-child(1) { animation-delay: .15s; }
.lg-recursos li:nth-child(2) { animation-delay: .27s; }
.lg-recursos li:nth-child(3) { animation-delay: .39s; }
.lg-recursos__ic {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; display: grid; place-items: center;
  font-size: 18px; background: rgba(110, 147, 242, .14); border: 1px solid rgba(110, 147, 242, .25);
}
.lg-recursos strong { display: block; font-size: 14.5px; font-weight: 700; }
.lg-recursos small { display: block; font-size: 12.5px; color: var(--lg-texto-3); margin-top: 1px; }

.lg-assinatura {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px;
  padding-top: 22px; border-top: 1px solid var(--lg-borda);
}
.lg-assinatura__logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: var(--lg-azul-claro);
  background: rgba(255, 255, 255, .06); border: 1px solid var(--lg-borda);
}
.lg-assinatura small { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--lg-azul-claro); }
.lg-assinatura a { font-size: 14px; font-weight: 800; text-decoration: none; }
.lg-assinatura a:hover { color: var(--lg-azul-claro); }
.lg-segmentos { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; }
.lg-segmentos span {
  font-size: 11px; color: var(--lg-texto-2); padding: 4px 9px; border-radius: 20px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); white-space: nowrap;
}

/* ---------- Cartão de login (vidro) ---------- */

.lg-cartao-area { display: flex; flex-direction: column; align-items: center; animation: lg-sobe .8s .1s ease-out both; }

.lg-cartao {
  --mx: 50%; --my: 0%;
  position: relative; width: 100%; max-width: 420px;
  padding: 34px 32px 28px; border-radius: var(--lg-raio);
  background: linear-gradient(160deg, rgba(23, 33, 72, .78), rgba(11, 17, 43, .82));
  border: 1px solid rgba(255, 255, 255, .1);
  -webkit-backdrop-filter: blur(22px) saturate(140%); backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .08);
  overflow: hidden; isolation: isolate;
}
/* Borda em gradiente que gira devagar. */
.lg-cartao::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; z-index: -1;
  background: conic-gradient(from var(--lg-ang, 0deg), transparent 0 30%, rgba(110, 147, 242, .9), rgba(34, 211, 238, .9), transparent 70% 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: lg-gira 7s linear infinite;
}
@property --lg-ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes lg-gira { to { --lg-ang: 360deg; } }

/* Luz que acompanha o ponteiro (posição vem do login.js). */
.lg-cartao__brilho {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(110, 147, 242, .16), transparent 60%);
}
.lg-cartao:hover .lg-cartao__brilho { opacity: 1; }

.lg-cartao__topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.lg-saudacao { font-size: 13px; font-weight: 700; color: var(--lg-azul-claro); }
.lg-selo {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--lg-verde);
  padding: 4px 9px; border-radius: 20px; background: rgba(52, 211, 153, .1); border: 1px solid rgba(52, 211, 153, .25);
}
.lg-selo svg { width: 13px; height: 13px; fill: currentColor; }

.lg-cartao h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.lg-cartao__sub { margin: 6px 0 22px; font-size: 14px; color: var(--lg-texto-2); }

.lg-erro {
  display: flex; align-items: flex-start; gap: 9px; margin-bottom: 18px; padding: 12px 14px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.45; color: #FECACA;
  background: rgba(240, 68, 56, .12); border: 1px solid rgba(240, 68, 56, .35);
  animation: lg-treme .45s ease-in-out;
}
.lg-erro svg { width: 18px; height: 18px; fill: #F87171; flex-shrink: 0; margin-top: 1px; }
@keyframes lg-treme { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* Campo com rótulo flutuante */
.lg-campo { position: relative; margin-bottom: 14px; }
.lg-campo input {
  width: 100%; height: 58px; padding: 22px 48px 6px 46px;
  font-family: inherit; font-size: 16px; font-weight: 600; color: var(--lg-texto); /* 16px: o iOS não dá zoom ao focar */
  background: rgba(255, 255, 255, .05); border: 1.5px solid rgba(255, 255, 255, .12); border-radius: 14px;
  outline: none; transition: border-color .2s, background .2s, box-shadow .2s;
}
.lg-campo input:hover { border-color: rgba(255, 255, 255, .22); }
.lg-campo input:focus {
  border-color: var(--lg-azul-claro); background: rgba(110, 147, 242, .08);
  box-shadow: 0 0 0 4px rgba(110, 147, 242, .18);
}
/* Autopreenchimento do navegador sem fundo amarelo/branco. */
.lg-campo input:-webkit-autofill {
  -webkit-text-fill-color: var(--lg-texto);
  -webkit-box-shadow: 0 0 0 1000px #121B40 inset; caret-color: var(--lg-texto);
}
.lg-campo label {
  position: absolute; left: 46px; top: 50%; transform: translateY(-50%);
  font-size: 15px; font-weight: 600; color: var(--lg-texto-3); pointer-events: none;
  transition: top .18s ease, font-size .18s ease, color .18s ease;
}
.lg-campo input:focus + label,
.lg-campo input:not(:placeholder-shown) + label,
.lg-campo input:-webkit-autofill + label {
  top: 15px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--lg-azul-claro);
}
.lg-campo__ic { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; fill: var(--lg-texto-3); transition: fill .2s; }
.lg-campo:focus-within .lg-campo__ic { fill: var(--lg-azul-claro); }

.lg-olho {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 10px;
  background: none; color: var(--lg-texto-3); cursor: pointer;
}
.lg-olho svg { width: 20px; height: 20px; fill: currentColor; }
.lg-olho:hover { background: rgba(255, 255, 255, .07); color: var(--lg-texto); }
.lg-olho:focus-visible { outline: 2px solid var(--lg-azul-claro); outline-offset: 1px; }
.lg-olho[aria-pressed="true"] { color: var(--lg-azul-claro); }
.lg-olho[aria-pressed="true"]::after {
  content: ""; position: absolute; left: 9px; right: 9px; top: 50%; height: 2px;
  background: currentColor; transform: rotate(-45deg); border-radius: 2px;
}

.lg-caps { margin: -4px 0 12px; font-size: 12.5px; font-weight: 700; color: #FBBF24; }

/* Botão Entrar */
.lg-entrar {
  position: relative; width: 100%; height: 56px; margin-top: 6px; border: 0; border-radius: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px; overflow: hidden;
  font-family: inherit; font-size: 16px; font-weight: 800; color: #fff; letter-spacing: .01em;
  background: linear-gradient(135deg, #3B6BF5, #1E3FAE 60%, #0E7490);
  background-size: 160% 160%; background-position: 0% 50%;
  box-shadow: 0 14px 34px rgba(47, 94, 232, .45), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .15s ease, box-shadow .2s ease, background-position .4s ease;
}
.lg-entrar:hover { background-position: 100% 50%; box-shadow: 0 18px 40px rgba(47, 94, 232, .55), inset 0 1px 0 rgba(255, 255, 255, .25); }
.lg-entrar:active { transform: translateY(1px) scale(.995); }
.lg-entrar:focus-visible { outline: 3px solid var(--lg-ciano); outline-offset: 3px; }
.lg-entrar__seta { width: 20px; height: 20px; fill: currentColor; transition: transform .2s; }
.lg-entrar:hover .lg-entrar__seta { transform: translateX(4px); }
/* Reflexo passando pelo botão */
.lg-entrar::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .28), transparent);
  transform: skewX(-18deg); animation: lg-reflexo 5s ease-in-out infinite 1.5s;
}
@keyframes lg-reflexo { 0%, 70% { left: -60%; } 100% { left: 130%; } }

.lg-entrar__carregando {
  display: none; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: lg-roda .7s linear infinite;
}
@keyframes lg-roda { to { transform: rotate(360deg); } }
.lg-entrar.carregando { cursor: progress; }
.lg-entrar.carregando .lg-entrar__carregando { display: block; }
.lg-entrar.carregando .lg-entrar__seta { display: none; }

.lg-ajuda { margin: 18px 0 0; text-align: center; font-size: 12.5px; color: var(--lg-texto-3); }

.lg-credito-mobile { display: none; }

@keyframes lg-sobe { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

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

@media (max-width: 1100px) {
  .lg-palco { grid-template-columns: minmax(0, 1fr) minmax(360px, 420px); }
  .lg-segmentos { display: none; }
}

/* Celular / tablet em pé: só a marca e o cartão — o hero sai, o fundo animado fica. */
@media (max-width: 860px) {
  .lg-palco { grid-template-columns: 1fr; padding: 28px 18px calc(28px + env(safe-area-inset-bottom)); align-content: center; }
  .lg-hero { display: none; }
  .lg-marca--mobile { display: flex; margin-bottom: 22px; }
  .lg-sinal { left: 50%; top: 22%; }
  .lg-cartao { padding: 28px 22px 24px; }
  .lg-cartao h2 { font-size: 23px; }
  .lg-credito-mobile { display: block; margin: 22px 0 0; font-size: 12px; color: var(--lg-texto-3); text-align: center; }
  .lg-credito-mobile a { color: var(--lg-azul-claro); font-weight: 800; text-decoration: none; }
}

/* Celular deitado / tela baixa: tudo mais compacto pra o botão não cair da dobra. */
@media (max-width: 860px) and (max-height: 620px) {
  .lg-palco { align-content: start; padding-top: 16px; }
  .lg-marca--mobile { margin-bottom: 12px; }
  .lg-cartao__sub, .lg-ajuda, .lg-credito-mobile { display: none; }
}

/* Sem backdrop-filter (navegadores antigos): cartão sólido, continua legível. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .lg-cartao { background: #111A3D; }
}

/* Quem pediu menos movimento no sistema: tudo parado. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .lg-sinal span { opacity: .25; }
  .lg-sinal span:nth-child(1) { transform: scale(.3); }
  .lg-sinal span:nth-child(2) { transform: scale(.55); }
  .lg-sinal span:nth-child(3) { transform: scale(.8); }
  .lg-sinal span:nth-child(4) { transform: scale(1); }
}
