/* =========================================================================
   SEEAI EXPLORE — Autenticação v2 (candidata MLW-20261112)
   Escopo: body.seeai-auth-v2 (login, recuperar, redefinir, troca obrigatória).
   Apenas apresentação. Nenhum name/id/método/destino de formulário muda.
   Identidade alinhada a seeaidata.com.br: navy #080d18, azul de rede, vermelho alvo.
   ========================================================================= */
html body.seeai-auth-v2 {
  --auth-bg: #080d18;
  --auth-bg-2: #0b1424;
  --auth-card: rgba(14, 24, 41, .82);
  --auth-card-border: rgba(110, 160, 230, .18);
  --auth-line: rgba(120, 170, 235, .14);
  --auth-text: #eef4fc;
  --auth-text-2: #b3c2d6;
  --auth-muted: #8597ae;
  --auth-blue: #2f9bff;
  --auth-blue-2: #58b4ff;
  --auth-red: #ff3047;
  --auth-red-soft: rgba(255, 48, 71, .14);
  --auth-ok: #4fd6a0;
  --auth-ok-soft: rgba(79, 214, 160, .12);
  --auth-warn: #ffc15a;
  --auth-field: #0a1322;
  --auth-field-border: #263a55;
  --auth-focus: #8bc7ff;
  --auth-radius: 14px;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(1100px 700px at 18% 40%, rgba(47,155,255,.13), transparent 62%),
    radial-gradient(700px 520px at 30% 62%, rgba(255,48,71,.08), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(47,155,255,.06), transparent 60%),
    var(--auth-bg);
  color: var(--auth-text);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: block;
  padding: 0;
  overflow-x: hidden;
}
html body.seeai-auth-v2 *, html body.seeai-auth-v2 *::before, html body.seeai-auth-v2 *::after { box-sizing: border-box; }

/* Grade de fundo (pontos de rede), puramente decorativa */
.auth-v2-backdrop {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(rgba(120,170,235,.16) 1px, transparent 1.4px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(1000px 700px at 30% 45%, #000 20%, transparent 75%);
          mask-image: radial-gradient(1000px 700px at 30% 45%, #000 20%, transparent 75%);
}

.auth-v2-shell {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(400px, .85fr);
}

/* ---------------- Lado da marca ---------------- */
.auth-v2-hero {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px clamp(32px, 5vw, 72px);
  border-right: 1px solid var(--auth-line);
  overflow: hidden;
}
.auth-v2-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-v2-company { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--auth-text-2); font-weight: 600; }
.auth-v2-company i { width: 8px; height: 8px; border-radius: 50%; background: var(--auth-red); box-shadow: 0 0 0 4px var(--auth-red-soft), 0 0 14px var(--auth-red); }
.auth-v2-secure { font-size: 12px; color: var(--auth-muted); display: inline-flex; align-items: center; gap: 6px; }
.auth-v2-secure svg { width: 14px; height: 14px; }

.auth-v2-stage { position: relative; display: grid; grid-template-columns: minmax(240px, 400px) minmax(0, 1fr); align-items: center; gap: clamp(24px, 4vw, 56px); margin: 24px 0; }
.auth-v2-emblem { position: relative; aspect-ratio: 1; width: 100%; display: grid; place-items: center; }
.auth-v2-emblem::before, .auth-v2-emblem::after {
  content: ""; position: absolute; border-radius: 50%; inset: 2%;
  border: 1px solid rgba(88,180,255,.22);
}
.auth-v2-emblem::after { inset: -12%; border-style: dashed; border-color: rgba(88,180,255,.14); animation: auth-v2-spin 90s linear infinite; }
.auth-v2-emblem .auth-v2-ring { position: absolute; inset: 16%; border-radius: 50%; border: 1px solid rgba(255,48,71,.28); box-shadow: inset 0 0 60px rgba(47,155,255,.10); }
.auth-v2-emblem .auth-v2-tick { position: absolute; background: rgba(255,48,71,.7); }
.auth-v2-tick.t { top: -16%; left: 50%; width: 1px; height: 9%; }
.auth-v2-tick.b { bottom: -16%; left: 50%; width: 1px; height: 9%; }
.auth-v2-tick.l { left: -16%; top: 50%; height: 1px; width: 9%; }
.auth-v2-tick.r { right: -16%; top: 50%; height: 1px; width: 9%; }
.auth-v2-emblem img { position: relative; width: 100%; max-width: none; height: auto; filter: drop-shadow(0 18px 50px rgba(47,155,255,.28)); }
@keyframes auth-v2-spin { to { transform: rotate(360deg); } }

.auth-v2-copy h1 { margin: 0 0 16px; font-size: clamp(28px, 2.7vw, 42px); line-height: 1.08; letter-spacing: -.02em; font-weight: 750; }
.auth-v2-copy h1 em { font-style: normal; background: linear-gradient(90deg, var(--auth-blue-2), #9ad2ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-v2-copy h1 b { color: var(--auth-red); font-weight: inherit; }
.auth-v2-copy p { margin: 0 0 22px; max-width: 46ch; color: var(--auth-text-2); font-size: 15.5px; line-height: 1.6; }
.auth-v2-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.auth-v2-chips li { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; font-size: 12.5px; color: var(--auth-text-2); background: rgba(47,155,255,.08); border: 1px solid rgba(88,180,255,.20); }
.auth-v2-chips li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--auth-blue-2); }
.auth-v2-chips li.is-red::before { background: var(--auth-red); }

.auth-v2-foot { display: flex; gap: 20px; flex-wrap: wrap; font-size: 12px; color: var(--auth-muted); }
.auth-v2-foot a { color: var(--auth-text-2); text-decoration: none; }
.auth-v2-foot a:hover { color: var(--auth-blue-2); text-decoration: underline; }

/* ---------------- Lado do formulário ---------------- */
.auth-v2-panel { display: grid; place-items: center; padding: 40px clamp(20px, 4vw, 56px); background: linear-gradient(180deg, rgba(11,20,36,.55), rgba(8,13,24,.2)); }
html body.seeai-auth-v2 .auth-v2-card {
  text-align: left; color: var(--auth-text);
  width: min(420px, 100%);
  padding: 32px 32px 26px;
  border-radius: 20px;
  background: var(--auth-card);
  border: 1px solid var(--auth-card-border);
  box-shadow: 0 30px 80px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.04);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  position: relative;
}
.auth-v2-card::before { /* filete vermelho/azul no topo */
  content: ""; position: absolute; left: 28px; right: 28px; top: -1px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--auth-blue) 30%, var(--auth-red) 70%, transparent);
}
html body.seeai-auth-v2 .login-logo.auth-v2-mark { display: block; width: 250px; max-width: 100%; max-height: none; height: auto; margin: -10px 0 14px -12px; aspect-ratio: auto; background: transparent; border: 0; box-shadow: none; padding: 0; }
.auth-v2-eyebrow { margin: 0 0 6px; font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--auth-blue-2); font-weight: 650; }
.auth-v2-card h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.01em; font-weight: 720; }
.auth-v2-lede { margin: 0 0 22px; color: var(--auth-text-2); font-size: 14px; line-height: 1.5; }
.auth-v2-identity { display: flex; align-items: center; gap: 10px; margin: -8px 0 18px; padding: 10px 12px; border-radius: 12px; background: rgba(47,155,255,.07); border: 1px solid rgba(88,180,255,.18); font-size: 13.5px; color: var(--auth-text-2); }
.auth-v2-identity .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--auth-blue), #1b5fae); color: #fff; font-weight: 700; font-size: 13px; flex: none; }

/* Formulário — mantém .login-form para compatibilidade com testes existentes */
html body.seeai-auth-v2 .login-form { display: grid; gap: 14px; margin: 0; }
html body.seeai-auth-v2 .auth-v2-field { display: grid; gap: 7px; font-size: 13px; font-weight: 600; color: var(--auth-text); }
html body.seeai-auth-v2 .auth-v2-field small { color: var(--auth-muted); font-weight: 500; }
html body.seeai-auth-v2 .auth-v2-input { position: relative; display: block; }
html body.seeai-auth-v2 .auth-v2-input > svg.lead { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--auth-muted); pointer-events: none; }
html body.seeai-auth-v2 .auth-v2-input input {
  width: 100%; height: 46px; padding: 0 44px 0 40px; border-radius: 11px;
  border: 1px solid var(--auth-field-border); background: var(--auth-field); color: var(--auth-text);
  font: inherit; font-size: 15px; font-weight: 500; outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
html body.seeai-auth-v2 .auth-v2-input input::placeholder { color: #5c6e86; font-weight: 400; }
html body.seeai-auth-v2 .auth-v2-input input:hover { border-color: #33507a; }
html body.seeai-auth-v2 .auth-v2-input input:focus { border-color: var(--auth-blue); box-shadow: 0 0 0 3px rgba(47,155,255,.22); background: #0c1729; }
html body.seeai-auth-v2 .auth-v2-input input:focus + svg.lead, html body.seeai-auth-v2 .auth-v2-input:focus-within > svg.lead { color: var(--auth-blue-2); }
html body.seeai-auth-v2 .auth-v2-input input[aria-invalid="true"] { border-color: rgba(255,48,71,.7); }

/* Toggle de senha: dentro do campo (antes ficava fora, left:calc(100%+4px)) */
html body.seeai-auth-v2 .password-field { position: relative; display: block; }
html body.seeai-auth-v2 .password-toggle, html body.seeai-auth-v2 .login-form .password-toggle {
  position: absolute; left: auto; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; padding: 0; margin: 0; border: 0; border-radius: 8px;
  display: grid; place-items: center; background: transparent; color: var(--auth-muted); cursor: pointer; box-shadow: none;
}
html body.seeai-auth-v2 .password-toggle:hover { color: var(--auth-text); background: rgba(255,255,255,.05); }
html body.seeai-auth-v2 .password-toggle:focus-visible { outline: 2px solid var(--auth-focus); outline-offset: 1px; }
html body.seeai-auth-v2 .password-toggle svg { width: 18px; height: 18px; }
html body.seeai-auth-v2 .auth-v2-caps { display: none; margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--auth-warn); align-items: center; gap: 6px; }
html body.seeai-auth-v2 .auth-v2-caps.is-on { display: inline-flex; }

html body.seeai-auth-v2 .auth-v2-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: -2px; }
html body.seeai-auth-v2 .link-muted { color: var(--auth-text-2); font-size: 13px; text-decoration: none; font-weight: 500; }
html body.seeai-auth-v2 .link-muted:hover { color: var(--auth-blue-2); text-decoration: underline; }
html body.seeai-auth-v2 .link-muted:focus-visible { outline: 2px solid var(--auth-focus); outline-offset: 2px; border-radius: 4px; }

html body.seeai-auth-v2 .auth-v2-submit, html body.seeai-auth-v2 .login-form button[type="submit"] {
  position: relative; width: 100%; height: 48px; margin-top: 4px; border: 0; border-radius: 12px;
  background: linear-gradient(180deg, #3aa2ff, #1f7fe6); color: #fff; font: inherit; font-size: 15px; font-weight: 700; letter-spacing: .01em;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; cursor: pointer;
  box-shadow: 0 10px 26px rgba(31,127,230,.35), inset 0 1px 0 rgba(255,255,255,.18);
  transition: transform .08s, box-shadow .15s, filter .15s;
}
html body.seeai-auth-v2 .auth-v2-submit:hover { filter: brightness(1.07); box-shadow: 0 12px 30px rgba(31,127,230,.45), inset 0 1px 0 rgba(255,255,255,.2); }
html body.seeai-auth-v2 .auth-v2-submit:active { transform: translateY(1px); }
html body.seeai-auth-v2 .auth-v2-submit:focus-visible { outline: 2px solid var(--auth-focus); outline-offset: 2px; }
html body.seeai-auth-v2 .auth-v2-submit:disabled { opacity: .7; cursor: progress; }
html body.seeai-auth-v2 .auth-v2-submit svg { width: 17px; height: 17px; }
html body.seeai-auth-v2 .auth-v2-submit.is-danger { background: linear-gradient(180deg, #ff4a5e, #e0243a); box-shadow: 0 10px 26px rgba(224,36,58,.32), inset 0 1px 0 rgba(255,255,255,.18); }
html body.seeai-auth-v2 .auth-v2-submit .spin { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: auth-v2-spin .8s linear infinite; }
html body.seeai-auth-v2 .auth-v2-submit.is-busy .spin { display: inline-block; }
html body.seeai-auth-v2 .auth-v2-submit.is-busy .ico { display: none; }
html body.seeai-auth-v2 .auth-v2-secondary { display: inline-flex; justify-content: center; align-items: center; height: 42px; border-radius: 11px; border: 1px solid var(--auth-field-border); color: var(--auth-text-2); text-decoration: none; font-size: 14px; font-weight: 600; }
html body.seeai-auth-v2 .auth-v2-secondary:hover { border-color: #3b5c88; color: var(--auth-text); }

/* Alertas — mantém .alert e .ok-alert */
html body.seeai-auth-v2 .alert {
  display: flex; gap: 10px; align-items: flex-start; margin: 0 0 18px; padding: 11px 13px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.45; color: #ffd9de; background: var(--auth-red-soft); border: 1px solid rgba(255,48,71,.38);
}
html body.seeai-auth-v2 .alert svg { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--auth-red); }
html body.seeai-auth-v2 .alert.ok-alert, html body.seeai-auth-v2 .alert.is-info { color: #d6f6e9; background: var(--auth-ok-soft); border-color: rgba(79,214,160,.36); }
html body.seeai-auth-v2 .alert.ok-alert svg, html body.seeai-auth-v2 .alert.is-info svg { color: var(--auth-ok); }
html body.seeai-auth-v2 .alert.is-warn { color: #ffeccc; background: rgba(255,193,90,.10); border-color: rgba(255,193,90,.36); }
html body.seeai-auth-v2 .alert.is-warn svg { color: var(--auth-warn); }
html body.seeai-auth-v2 .alert b { color: #fff; }

/* Status do formulário de troca obrigatória (id passwordStatus) */
html body.seeai-auth-v2 .status { min-height: 20px; margin-top: 2px; font-size: 13px; color: #ffb4bd; }

/* Regras de senha (somente feedback visual local; o servidor continua autoridade) */
html body.seeai-auth-v2 .auth-v2-rules { display: grid; gap: 5px; margin: -4px 0 2px; padding: 0; list-style: none; font-size: 12.5px; color: var(--auth-muted); }
html body.seeai-auth-v2 .auth-v2-rules li { display: flex; align-items: center; gap: 7px; }
html body.seeai-auth-v2 .auth-v2-rules li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #3a4f6b; flex: none; }
html body.seeai-auth-v2 .auth-v2-rules li.ok { color: var(--auth-ok); }
html body.seeai-auth-v2 .auth-v2-rules li.ok::before { border-color: var(--auth-ok); background: radial-gradient(circle, var(--auth-ok) 40%, transparent 45%); }

.auth-v2-card-foot { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--auth-line); display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--auth-muted); }
.auth-v2-card-foot span { display: inline-flex; align-items: center; gap: 6px; }
.auth-v2-card-foot svg { width: 13px; height: 13px; }

/* Etapas do conflito de sessão */
.auth-v2-sessions { display: grid; gap: 8px; margin: 0 0 18px; }
.auth-v2-session { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--auth-field-border); background: var(--auth-field); font-size: 13px; color: var(--auth-text-2); }
.auth-v2-session .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--auth-warn); box-shadow: 0 0 0 4px rgba(255,193,90,.14); flex: none; }
.auth-v2-session.new .dot { background: var(--auth-blue-2); box-shadow: 0 0 0 4px rgba(47,155,255,.16); }

/* ---------------- Responsivo ---------------- */
@media (max-width: 1080px) {
  .auth-v2-stage { grid-template-columns: 1fr; justify-items: start; }
  .auth-v2-emblem { width: 220px; }
}
@media (max-width: 860px) {
  .auth-v2-shell { grid-template-columns: 1fr; }
  .auth-v2-hero { display: none; }
  
  .auth-v2-panel { padding: 28px 16px; }
  .auth-v2-card { padding: 26px 22px 22px; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-v2-emblem::after, html body.seeai-auth-v2 .auth-v2-submit .spin { animation: none; }
}
@media (forced-colors: active) {
  .auth-v2-card, html body.seeai-auth-v2 .auth-v2-input input, html body.seeai-auth-v2 .alert { border: 1px solid CanvasText; }
}

/* Títulos h1 dentro do cartão (recuperar, redefinir, troca obrigatória) */
html body.seeai-auth-v2 .auth-v2-card h1.auth-v2-title { margin: 0 0 6px; font-size: 24px; line-height: 1.2; letter-spacing: -.01em; font-weight: 720; color: var(--auth-text); }
html body.seeai-auth-v2 .auth-v2-card p { color: var(--auth-text-2); }
html body.seeai-auth-v2 .link-muted.auth-v2-back { justify-self: center; margin-top: 2px; }
html body.seeai-auth-v2 .password-card.auth-v2-card { width: min(420px, 100%); padding: 32px 32px 26px; border-radius: 20px; background: var(--auth-card); border: 1px solid var(--auth-card-border); }
/* Botão de confirmação destrutiva (encerrar outra sessão) */
html body.seeai-auth-v2 .login-form button[type="submit"].auth-v2-submit.is-danger { background: linear-gradient(180deg, #ff4a5e, #e0243a); box-shadow: 0 10px 26px rgba(224,36,58,.32), inset 0 1px 0 rgba(255,255,255,.18); }

/* Hero animado (seeai-auth-hero.js): o canvas substitui a imagem estática quando a animação inicia */
.auth-v2-emblem .auth-v2-hero-canvas { position: absolute; inset: -14%; width: 128%; height: 128%; display: none; }
.auth-v2-emblem.is-animated .auth-v2-hero-canvas { display: block; }
.auth-v2-emblem.is-animated img { visibility: hidden; }
.auth-v2-emblem.is-animated .auth-v2-ring { border-color: rgba(255,48,71,.16); }


/* Class-off compatibility uses the existing legacy login classes and form contracts. */
body.login-page:not(.seeai-auth-v2) :is(.auth-v2-hero,.auth-v2-backdrop,.auth-v2-card-foot,.auth-v2-rules,.auth-v2-caps,.auth-v2-input>.lead,.auth-v2-submit>.ico,.auth-v2-submit>.spin,.auth-v2-sessions){display:none!important}
body.login-page:not(.seeai-auth-v2) :is(.auth-v2-shell,.auth-v2-panel){display:contents}
body.login-page:not(.seeai-auth-v2) .auth-v2-card{width:min(460px,calc(100vw - 32px));box-sizing:border-box}
body.login-page:not(.seeai-auth-v2) .alert>svg{display:none}
body.login-page:not(.seeai-auth-v2) .password-card{padding:28px;border:1px solid #274363;border-radius:16px;background:#0d1b2d;color:#eef5ff}
body.login-page:not(.seeai-auth-v2) .password-card label{display:grid;gap:6px;margin:16px 0}
body.login-page:not(.seeai-auth-v2) .password-card input{box-sizing:border-box;width:100%;padding:12px;border:1px solid #385574;border-radius:8px;background:#071423;color:#fff}
body.login-page:not(.seeai-auth-v2) .password-card button{width:100%;padding:12px;border:0;border-radius:8px;background:#1677ff;color:#fff}
body.login-page:not(.seeai-auth-v2) .password-card .status{min-height:24px;margin-top:14px;color:#ffb4b4}
