/* ══════════════════════════════════════════════════════════════════════════
   LOGIN / LANDING DO NEXUS
   Tela dividida na diagonal: à esquerda a "landing" (rola, com efeitos), à direita o login.
   Fica independente do tema do painel (sempre escura). Os IDs usados pelo JS de autenticação
   (auth-login-screen, auth-reset-screen, auth-email, auth-senha, auth-login-erro…) não mudam.
   ══════════════════════════════════════════════════════════════════════════ */

.nx-auth {
  --nx-bg: #07060d;
  --nx-line: rgba(255, 255, 255, 0.09);
  --nx-text: #f5f3ff;
  --nx-muted: #a29bbd;
  --nx-p1: #8b5cf6;
  --nx-p2: #a78bfa;
  --nx-p3: #c4b5fd;
  --nx-p4: #6d28d9;
  --nx-display: 'Inter', 'Plus Jakarta Sans', -apple-system, 'Segoe UI', sans-serif;
  /* a diagonal: x do corte no topo e na base da tela */
  --t: 64vw;
  --b: 50vw;
  --mx: 70vw; --my: 30vh;

  position: fixed; inset: 0; z-index: 1000;
  display: flex;
  background: var(--nx-bg);
  color: var(--nx-text);
  font-family: var(--nx-display);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
.nx-auth *, .nx-auth *::before, .nx-auth *::after { box-sizing: border-box; }

/* ── Fundo geral (aparece do lado do login) ───────────────────────────── */
.nx-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; background:
    radial-gradient(900px 600px at 95% 0%, rgba(109, 40, 217, 0.28), transparent 60%),
    radial-gradient(700px 500px at 100% 100%, rgba(139, 92, 246, 0.16), transparent 60%),
    #0a0812; }
.nx-bg::before { /* grade sutil */
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--nx-line) 1px, transparent 1px), linear-gradient(90deg, var(--nx-line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(70% 70% at 80% 40%, #000 0%, transparent 75%);
          mask-image: radial-gradient(70% 70% at 80% 40%, #000 0%, transparent 75%);
  opacity: 0.55;
}
.nx-bg::after { /* holofote que segue o mouse */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(560px circle at var(--mx) var(--my), rgba(167, 139, 250, 0.16), transparent 62%);
}
.nx-grain { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0.07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }

/* ── Lado esquerdo: a história (recortada na diagonal) ────────────────── */
.nx-story {
  position: absolute; inset: 0; z-index: 2;
  clip-path: polygon(0 0, var(--t) 0, var(--b) 100%, 0 100%);
  background:
    radial-gradient(1100px 700px at 12% 8%, rgba(109, 40, 217, 0.55), transparent 62%),
    radial-gradient(800px 600px at 78% 95%, rgba(139, 92, 246, 0.28), transparent 60%),
    linear-gradient(160deg, #0b0716 0%, #07050f 55%, #0a0618 100%);
}
.nx-orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.55; pointer-events: none; will-change: transform; }
.nx-orb.o1 { width: 420px; height: 420px; left: -80px; top: 10%; background: #7c3aed; animation: nxFloat 14s ease-in-out infinite; }
.nx-orb.o2 { width: 360px; height: 360px; left: 32vw; top: 58%; background: #c026d3; opacity: 0.28; animation: nxFloat 18s ease-in-out -6s infinite reverse; }
.nx-orb.o3 { width: 300px; height: 300px; left: 18vw; top: -60px; background: #4f46e5; opacity: 0.35; animation: nxFloat 16s ease-in-out -3s infinite; }
@keyframes nxFloat { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(40px, -34px, 0) scale(1.12); } }

.nx-story-scroll {
  position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--t) + 2vw);
  overflow-y: auto; overflow-x: hidden;
  scroll-snap-type: y proximity; scroll-behavior: smooth;
  scrollbar-width: none; -ms-overflow-style: none;
}
.nx-story-scroll::-webkit-scrollbar { display: none; }

.nx-slide {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 7vh clamp(28px, 6vw, 96px); padding-right: calc(var(--t) - var(--b) + clamp(28px, 4vw, 64px));
  scroll-snap-align: start;
  position: relative;
}
.nx-slide-inner { max-width: min(600px, 44vw); }

/* revelar ao rolar (estilo Apple: sobe, desfoca e aparece) */
.nx-reveal { opacity: 0; transform: translateY(34px) scale(0.985); filter: blur(8px);
  transition: opacity 0.9s cubic-bezier(.2, .7, .2, 1), transform 0.9s cubic-bezier(.2, .7, .2, 1), filter 0.9s cubic-bezier(.2, .7, .2, 1);
  transition-delay: var(--d, 0s); }
.nx-slide.in .nx-reveal { opacity: 1; transform: none; filter: none; }

.nx-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--nx-p3); margin-bottom: 18px; }
.nx-eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--nx-p1), var(--nx-p3)); }

.nx-h2 { font-size: clamp(34px, 4.6vw, 70px); line-height: 1.03; letter-spacing: -0.04em; font-weight: 700; margin: 0 0 20px; color: #fff; }
.nx-p  { font-size: clamp(15px, 1.25vw, 19px); line-height: 1.55; color: var(--nx-muted); max-width: 30em; margin: 0; }
.nx-grad { background: linear-gradient(100deg, #fff 0%, var(--nx-p3) 30%, var(--nx-p1) 60%, #e879f9 100%); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; animation: nxGrad 7s ease-in-out infinite; }
@keyframes nxGrad { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* ── Slide 1: herói ───────────────────────────────────────────────────── */
.nx-logo-wrap { width: clamp(92px, 9vw, 132px); aspect-ratio: 1; margin-bottom: 30px; perspective: 800px; position: relative; }
.nx-logo-wrap::before { content: ""; position: absolute; inset: -22%; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 55%, rgba(167, 139, 250, 0.9) 75%, transparent 90%); filter: blur(22px); opacity: 0.55; animation: nxSpin 6s linear infinite; }
.nx-logo-wrap::after { content: ""; position: absolute; inset: -9px; border-radius: 34px; border: 1px solid rgba(196, 181, 253, 0.28); }
@keyframes nxSpin { to { transform: rotate(360deg); } }
.nx-logo { position: relative; width: 100%; height: 100%; border-radius: 28px; display: block; z-index: 1;
  box-shadow: 0 24px 60px rgba(109, 40, 217, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.12);
  transform: rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg)); transition: transform 0.18s ease-out; animation: nxBob 6s ease-in-out infinite; }
@keyframes nxBob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }

.nx-wordmark { font-size: clamp(76px, 12.5vw, 188px); line-height: 0.9; letter-spacing: -0.065em; font-weight: 800; margin: 0 0 22px; }
.nx-tag { font-size: clamp(18px, 1.9vw, 28px); font-weight: 500; letter-spacing: -0.02em; color: #e9e3ff; margin: 0 0 14px; max-width: 20em; }

.nx-scrollhint { margin-top: clamp(28px, 6vh, 64px); display: inline-flex; align-items: center; gap: 12px; font-size: 13px; color: var(--nx-muted); letter-spacing: 0.04em; background: none; border: 0; cursor: pointer; font-family: inherit; }
.nx-mouse { width: 22px; height: 34px; border: 1.5px solid rgba(255, 255, 255, 0.35); border-radius: 12px; position: relative; }
.nx-mouse::after { content: ""; position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--nx-p3); animation: nxWheel 1.8s ease-in-out infinite; }
@keyframes nxWheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ── Slide 2: pipeline de disparos ────────────────────────────────────── */
.nx-flow { margin-top: 38px; position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 560px; }
.nx-flow::before { content: ""; position: absolute; left: 6%; right: 6%; top: 27px; height: 2px; background: linear-gradient(90deg, rgba(139, 92, 246, 0.15), rgba(167, 139, 250, 0.7), rgba(139, 92, 246, 0.15)); }
.nx-flow::after { content: ""; position: absolute; top: 22px; left: 6%; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 18px 4px rgba(167, 139, 250, 0.9); animation: nxTravel 3.6s cubic-bezier(.6, 0, .4, 1) infinite; }
@keyframes nxTravel { 0% { left: 6%; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { left: calc(94% - 12px); opacity: 0; } }
.nx-node { position: relative; z-index: 1; text-align: center; font-size: 12px; color: var(--nx-muted); }
.nx-node b { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 10px; border-radius: 18px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); backdrop-filter: blur(10px); color: var(--nx-p3); }
.nx-node b svg { width: 24px; height: 24px; }
.nx-node span { display: block; color: #e9e3ff; font-weight: 600; font-size: 13px; }

/* ── Slide 3: operação ao vivo ────────────────────────────────────────── */
.nx-live { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; color: #fda4af; background: rgba(244, 63, 94, 0.12); border: 1px solid rgba(244, 63, 94, 0.3); padding: 6px 12px; border-radius: 99px; margin-bottom: 20px; }
.nx-live i { width: 8px; height: 8px; border-radius: 50%; background: #fb7185; box-shadow: 0 0 0 0 rgba(251, 113, 133, 0.7); animation: nxPulse 1.6s infinite; }
@keyframes nxPulse { 70% { box-shadow: 0 0 0 10px rgba(251, 113, 133, 0); } 100% { box-shadow: 0 0 0 0 rgba(251, 113, 133, 0); } }
.nx-bars { margin-top: 34px; height: 120px; max-width: 520px; display: flex; align-items: flex-end; gap: 7px; padding: 18px 20px; border-radius: 22px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.1); backdrop-filter: blur(12px); }
.nx-bars i { flex: 1; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--nx-p3), var(--nx-p4)); height: 30%; transform-origin: bottom; animation: nxBar 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * -0.17s); }
@keyframes nxBar { 0%, 100% { height: 24%; opacity: 0.6; } 50% { height: 92%; opacity: 1; } }
.nx-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; max-width: 540px; }
.nx-chip { font-size: 13px; padding: 8px 14px; border-radius: 99px; color: #e9e3ff; background: rgba(139, 92, 246, 0.14); border: 1px solid rgba(167, 139, 250, 0.3); }

/* ── Slide 4: grade de módulos ────────────────────────────────────────── */
.nx-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 34px; max-width: 560px; }
.nx-tile { padding: 16px 14px; border-radius: 18px; background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px);
  transition: transform 0.35s cubic-bezier(.2, .7, .2, 1), border-color 0.35s, background 0.35s; }
.nx-tile:hover { transform: translateY(-5px); border-color: rgba(196, 181, 253, 0.5); background: rgba(139, 92, 246, 0.14); }
.nx-tile svg { width: 22px; height: 22px; color: var(--nx-p3); margin-bottom: 10px; display: block; }
.nx-tile span { font-size: 13px; font-weight: 600; color: #f1edff; line-height: 1.25; display: block; }

/* ── Slide 5: fechamento ──────────────────────────────────────────────── */
.nx-go { display: inline-flex; align-items: center; gap: 14px; margin-top: 34px; font-size: 16px; font-weight: 600; color: #fff; }
.nx-go svg { width: 46px; height: 46px; padding: 12px; border-radius: 50%; background: linear-gradient(135deg, var(--nx-p1), var(--nx-p4)); box-shadow: 0 10px 30px rgba(109, 40, 217, 0.55); animation: nxNudge 1.8s ease-in-out infinite; }
@keyframes nxNudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(8px); } }

/* ── Pontinhos de navegação (esquerda) ────────────────────────────────── */
.nx-dots { position: absolute; left: clamp(10px, 1.6vw, 26px); top: 50%; transform: translateY(-50%); z-index: 5; display: flex; flex-direction: column; gap: 12px; }
.nx-dots button { width: 7px; height: 7px; padding: 0; border-radius: 99px; border: 0; cursor: pointer; background: rgba(255, 255, 255, 0.25); transition: height 0.35s, background 0.35s; }
.nx-dots button.on { height: 26px; background: linear-gradient(180deg, var(--nx-p3), var(--nx-p1)); }

/* ── Borda brilhante da diagonal ──────────────────────────────────────── */
.nx-edge { position: absolute; inset: 0; z-index: 3; pointer-events: none; filter: drop-shadow(0 0 12px rgba(167, 139, 250, 0.75)); }
.nx-edge i { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 0%, var(--nx-p3) 22%, var(--nx-p1) 58%, transparent 100%); }
.nx-edge .e1 { clip-path: polygon(var(--t) 0, calc(var(--t) + 2px) 0, calc(var(--b) + 2px) 100%, var(--b) 100%); }
.nx-edge .e2 { opacity: 0.25; clip-path: polygon(calc(var(--t) + 16px) 0, calc(var(--t) + 17px) 0, calc(var(--b) + 17px) 100%, calc(var(--b) + 16px) 100%); }

/* ── Lado direito: o login ────────────────────────────────────────────── */
.nx-panel { position: absolute; right: 0; top: 0; bottom: 0; width: calc(100vw - var(--b) + 3vw); max-width: 760px; z-index: 5;
  display: flex; align-items: center; justify-content: center; padding: 32px clamp(20px, 3vw, 48px); padding-left: calc(var(--t) - var(--b) + 24px); overflow-y: auto; }
.nx-card { width: 100%; max-width: 410px; margin: auto; padding: 42px 38px 34px; border-radius: 28px; position: relative;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
  border: 1px solid rgba(255, 255, 255, 0.13); backdrop-filter: blur(26px) saturate(150%); -webkit-backdrop-filter: blur(26px) saturate(150%);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(139, 92, 246, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  animation: nxCardIn 1s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes nxCardIn { from { opacity: 0; transform: translateY(28px) scale(0.97); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }
.nx-card::before { /* aro de luz no topo */
  content: ""; position: absolute; left: 12%; right: 12%; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--nx-p3), transparent); }
.nx-card.shake { animation: nxShake 0.45s; }
@keyframes nxShake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }

.nx-card-head { text-align: left; margin-bottom: 28px; }
.nx-mini { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.nx-mini img { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 6px 20px rgba(109, 40, 217, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.12); }
.nx-mini div { line-height: 1.15; }
.nx-mini strong { display: block; font-size: 17px; letter-spacing: -0.02em; }
.nx-mini small { font-size: 11px; color: var(--nx-muted); letter-spacing: 0.04em; }
.nx-title { font-size: 28px; font-weight: 700; letter-spacing: -0.035em; margin: 0 0 6px; color: #fff; }
.nx-sub { font-size: 14px; color: var(--nx-muted); margin: 0; line-height: 1.5; }

.nx-field { position: relative; margin-bottom: 14px; }
.nx-field input { width: 100%; height: 56px; padding: 24px 46px 8px 16px; font-family: inherit; font-size: 15px; color: #fff; outline: none;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 14px;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s; }
.nx-field input:hover { border-color: rgba(255, 255, 255, 0.22); }
.nx-field input:focus { border-color: var(--nx-p2); background: rgba(139, 92, 246, 0.09); box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2); }
.nx-field label { position: absolute; left: 16px; top: 17px; margin: 0; display: block; font-family: inherit; font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--nx-muted); pointer-events: none; transform-origin: left top; transition: transform 0.2s ease, color 0.2s ease; }
.nx-field input:focus + label, .nx-field input:not(:placeholder-shown) + label, .nx-field input:-webkit-autofill + label { transform: translateY(-9px) scale(0.76); color: var(--nx-p3); }
.nx-field input:-webkit-autofill { -webkit-text-fill-color: #fff; -webkit-box-shadow: 0 0 0 100px #1a1230 inset; caret-color: #fff; border-radius: 14px; }
.nx-eye { position: absolute; right: 8px; top: 8px; width: 40px; height: 40px; display: grid; place-items: center; background: none; border: 0; border-radius: 10px; color: var(--nx-muted); cursor: pointer; transition: color 0.2s, background 0.2s; }
.nx-eye:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.nx-eye svg { width: 20px; height: 20px; }

.nx-btn { position: relative; width: 100%; height: 54px; margin-top: 10px; border: 0; border-radius: 14px; cursor: pointer; overflow: hidden;
  font-family: inherit; font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; color: #fff;
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); box-shadow: 0 14px 34px rgba(109, 40, 217, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s; }
.nx-btn::after { content: ""; position: absolute; top: 0; left: -80%; width: 50%; height: 100%; transform: skewX(-22deg); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent); transition: left 0.7s; }
.nx-btn:hover { transform: translateY(-2px); box-shadow: 0 20px 44px rgba(109, 40, 217, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.nx-btn:hover::after { left: 130%; }
.nx-btn:active { transform: translateY(0) scale(0.99); }
.nx-btn:disabled { cursor: wait; filter: saturate(0.7) brightness(0.9); transform: none; }
.nx-btn .spin { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; animation: nxSpin 0.7s linear infinite; vertical-align: -3px; margin-right: 8px; }
.nx-btn.loading .spin { display: inline-block; }

.nx-erro { margin-top: 14px; padding: 11px 14px; font-size: 13px; line-height: 1.4; color: #fecaca; text-align: left; background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.35); border-radius: 12px; }
.nx-foot { margin: 22px 0 0; font-size: 12px; line-height: 1.5; color: var(--nx-muted); text-align: center; }
.nx-foot b { color: #e9e3ff; font-weight: 600; }
.nx-hint { margin-top: 6px; font-size: 11.5px; color: var(--nx-muted); }

/* ── Tela de redefinir senha: card central, mesmo fundo ───────────────── */
.nx-auth--solo { align-items: center; justify-content: center; padding: 24px; overflow-y: auto; }
.nx-auth--solo .nx-card { z-index: 5; margin: auto; }
.nx-auth--solo .nx-bg { z-index: 0; }

/* ── Telas menores ────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .nx-auth { --t: 60vw; --b: 46vw; }
  .nx-slide-inner { max-width: min(520px, 42vw); }
  .nx-card { padding: 36px 28px 28px; }
}
@media (max-width: 900px) {
  /* celular/tablet em pé: sem diagonal — só o card, com a marca no topo */
  .nx-story, .nx-edge, .nx-dots, .nx-orb { display: none; }
  .nx-auth { overflow-y: auto; align-items: flex-start; }
  .nx-panel { position: relative; width: 100%; max-width: none; min-height: 100%; padding: calc(20px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom)); }
  .nx-card { max-width: 440px; padding: 34px 24px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .nx-auth *, .nx-auth *::before, .nx-auth *::after { animation: none !important; transition: none !important; }
  .nx-reveal { opacity: 1; transform: none; filter: none; }
}
