/* =====================================================================
   Bridge v3 — Login do handoff "Redesign premium do CRM" (tela 1).
   Carrega DEPOIS do bridge-login.css e só vale com <body class="login-v2">.
   Só apresentação: o formulário, os IDs (#loginForm, #form, #usuario,
   #senha, #entrar) e o envio (/login/authenticate) continuam os mesmos.
   Os toasts/modais do SweetAlert continuam vindo do bridge-login.css.
   ===================================================================== */
body.login-v2 {
  --v3l-glow: rgba(37,99,235,.5);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif !important;
  color: #1a2233;
  -webkit-font-smoothing: antialiased;
}
@keyframes v3lBlob  { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(30px,-26px) scale(1.12); } }
@keyframes v3lFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes v3lPop   { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes v3lAnel  { from { stroke-dashoffset: 100; } }
@keyframes v3lKb    { from { transform: scale(1); } to { transform: scale(1.05); } }

/* ---- split em tela cheia ---- */
body.login-v2 .v3-login {
  display: flex; width: 100%; height: 100vh; min-height: 100vh;
  background: #fff; overflow: hidden; text-align: left;
}

/* ---- arte (esquerda): slides com crossfade ---- */
body.login-v2 .v3-arte {
  position: relative; overflow: hidden; flex: 1.08 1 0; min-width: 0;
  background: linear-gradient(150deg, #0b1d52 0%, #1d4ed8 52%, #0ea5c4 100%);
  color: #fff;
}
body.login-v2 .v3-slide {
  position: absolute; inset: 0; overflow: hidden;
  opacity: 0; visibility: hidden;
  transition: opacity 1s ease, visibility 0s linear 1s;
}
body.login-v2 .v3-slide.on {
  opacity: 1; visibility: visible; z-index: 1;
  transition: opacity 1s ease, visibility 0s;
}

/* slide 1: a marca (gradiente, blobs, grade de pontos, vidro) */
body.login-v2 .v3-slide-marca {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px 44px;
  background: linear-gradient(150deg, #0b1d52 0%, #1d4ed8 52%, #0ea5c4 100%);
}
/* ocupa o lugar dos pontos do carrossel (que ficam soltos por cima), como no protótipo:
   marca no topo, conteúdo no meio, pontos embaixo */
body.login-v2 .v3-slide-marca::after { content: ''; display: block; flex: none; height: 7px; }
body.login-v2 .v3-blob { position: absolute; border-radius: 50%; pointer-events: none; }
body.login-v2 .v3-blob.a {
  width: 520px; height: 520px; left: -140px; top: -160px;
  background: radial-gradient(circle, rgba(96,165,250,.55), transparent 65%);
  animation: v3lBlob 14s ease-in-out infinite;
}
body.login-v2 .v3-blob.b {
  width: 460px; height: 460px; right: -160px; bottom: -120px;
  background: radial-gradient(circle, rgba(34,211,238,.45), transparent 65%);
  animation: v3lBlob 18s ease-in-out infinite reverse;
}
body.login-v2 .v3-grade {
  position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px);
  background-size: 26px 26px;
}

/* slide 1 com foto (castelo): foto ao fundo, véu azul da marca por cima, logo no topo e título embaixo.
   Os cartões de vidro e os blobs ficam só na versão sem foto, para não cobrir o castelo. */
body.login-v2 .v3-com-foto .v3-foto {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  width: 100% !important; height: 100% !important;
  object-fit: cover; object-position: 50% 42%;
}
body.login-v2 .v3-com-foto.on .v3-foto { animation: v3lKb 26s ease-in-out infinite alternate; }
body.login-v2 .v3-com-foto::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(11,29,82,.62) 0%, rgba(11,29,82,.06) 26%, rgba(11,29,82,.10) 50%, rgba(7,14,44,.92) 100%);
}
body.login-v2 .v3-com-foto .v3-blob,
body.login-v2 .v3-com-foto .v3-grade,
body.login-v2 .v3-com-foto .v3-vidro { display: none; }
body.login-v2 .v3-slide-marca .v3-arte-topo,
body.login-v2 .v3-slide-marca .v3-arte-meio { z-index: 2; }
body.login-v2 .v3-com-foto .v3-arte-meio { margin-top: auto; margin-bottom: 30px; }
body.login-v2 .v3-com-foto .v3-arte-meio h2 { margin-top: 0; text-shadow: 0 4px 30px rgba(5,12,40,.65); }
body.login-v2 .v3-arte-topo { position: relative; display: flex; align-items: center; gap: 12px; }
body.login-v2 .v3-logo {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font: 800 19px/1 'Plus Jakarta Sans', 'Inter', sans-serif; color: #fff;
  box-shadow: 0 10px 30px rgba(10,30,80,.3);
  animation: v3lFloat 6s ease-in-out infinite;
}
body.login-v2 .v3-marca b { display: block; font: 800 20px/1 'Plus Jakarta Sans', 'Inter', sans-serif; letter-spacing: -.02em; }
body.login-v2 .v3-marca small { display: block; font-size: 10px; line-height: 1.2; letter-spacing: .16em; text-transform: uppercase; opacity: .75; margin-top: 4px; }

body.login-v2 .v3-arte-meio {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  max-width: 470px; margin: 40px 0;
}
body.login-v2 .v3-vidro {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 16px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 20px 40px -18px rgba(5,15,50,.6);
}
body.login-v2 .v3-vidro.um   { align-self: flex-start; animation: v3lPop .7s .2s cubic-bezier(.2,.8,.2,1) both, v3lFloat 7s 1s ease-in-out infinite; }
body.login-v2 .v3-vidro.dois { align-self: flex-end;   animation: v3lPop .7s .4s cubic-bezier(.2,.8,.2,1) both, v3lFloat 8s 1.4s ease-in-out infinite; }
body.login-v2 .v3-vidro .ic {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; background: rgba(255,255,255,.2);
}
body.login-v2 .v3-vidro .ic svg { width: 17px; height: 17px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body.login-v2 .v3-vidro .anel { width: 42px; height: 42px; flex: none; transform: rotate(-90deg); }
body.login-v2 .v3-vidro .anel circle { fill: none; stroke-width: 3.4; }
body.login-v2 .v3-vidro .anel .fundo { stroke: rgba(255,255,255,.22); }
body.login-v2 .v3-vidro .anel .arco {
  stroke: #fff; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 32;
  animation: v3lAnel 1.4s .6s cubic-bezier(.2,.8,.2,1) both;
}
body.login-v2 .v3-vidro small { display: block; font-size: 11px; line-height: 1.35; opacity: .8; }
body.login-v2 .v3-vidro strong { display: block; font: 800 18px/1.3 'Plus Jakarta Sans', 'Inter', sans-serif; white-space: nowrap; }

body.login-v2 .v3-arte-meio h2 {
  display: block; margin: 26px 0 0; padding: 0; border: 0;
  font: 800 clamp(30px, 3.4vw, 44px)/1.08 'Plus Jakarta Sans', 'Inter', sans-serif;
  letter-spacing: -.03em; color: #fff; text-align: left; text-transform: none;
  text-wrap: balance; text-shadow: 0 2px 20px rgba(10,30,80,.3);
}
body.login-v2 .v3-arte-meio p {
  margin: 0; max-width: 400px; font-size: 15px; line-height: 1.5;
  color: #fff; opacity: .88; text-align: left; text-wrap: pretty;
}

/* slide 2+: artes de campanha (as mesmas do login v2) */
body.login-v2 .v3-slide-foto { background: #150a2e; }
body.login-v2 .v3-slide-foto img {
  position: absolute; inset: 0; width: 100% !important; height: 100% !important;
  object-fit: cover; object-position: left center;   /* o logo da campanha fica sempre inteiro */
}
body.login-v2 .v3-slide-foto.on img { animation: v3lKb 26s ease-in-out infinite alternate; }
body.login-v2 .v3-slide-foto::after {   /* base levemente escura para os pontos do carrossel */
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 26%;
  background: linear-gradient(180deg, rgba(8,4,24,0), rgba(8,4,24,.55));
}

/* indicador de slides */
body.login-v2 .v3-dots { position: absolute; left: 44px; bottom: 40px; z-index: 3; display: flex; gap: 7px; }
body.login-v2 .v3-dots i {
  display: block; width: 7px; height: 7px; border-radius: 999px;
  background: rgba(255,255,255,.5); cursor: pointer;
  transition: width .3s ease, background .3s ease;
}
body.login-v2 .v3-dots i.on { width: 22px; background: #fff; }

/* ---- formulário (direita) ---- */
body.login-v2 .v3-painel {
  flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center;
  padding: 46px 48px; background: #fff; overflow-y: auto;
}
body.login-v2 .v3-form { width: 100%; max-width: 360px; margin: 0; animation: v3lPop .6s .1s cubic-bezier(.2,.8,.2,1) both; }
body.login-v2 .v3-form #formContent {
  display: flex; flex-direction: column;
  width: 100% !important; max-width: none !important; max-height: none !important;
  margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important;
  background: transparent !important; box-shadow: none !important; text-align: left !important;
}
body.login-v2 .v3-eyebrow { font-size: 11px; font-weight: 700; line-height: 1.4; letter-spacing: .12em; text-transform: uppercase; color: #2563eb; }
body.login-v2 .v3-form #formContent h2.header {
  display: block !important; margin: 6px 0 6px !important; padding: 0 !important; border: 0 !important;
  font: 800 28px/1.2 'Plus Jakarta Sans', 'Inter', sans-serif !important;
  letter-spacing: -.02em !important; color: #1a2233 !important;
  text-align: left !important; text-transform: none !important;
}
body.login-v2 .v3-form #formContent #erro {
  margin: 0 0 28px !important; font-size: 14px !important; line-height: 1.5;
  color: #5b6577 !important; text-align: left !important;
}
body.login-v2 .v3-form #form { display: flex; flex-direction: column; }
body.login-v2 .v3-rotulo {
  display: block; margin: 0 0 6px; max-width: none;
  font-size: 12px; font-weight: 600; line-height: 1.4; color: #5b6577; text-align: left;
}
body.login-v2 .v3-campo {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 16px; padding: 0 14px;
  border: 1px solid #e7eaf1; border-radius: 12px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
body.login-v2 .v3-campo.senha { margin-bottom: 24px; }
body.login-v2 .v3-campo:focus-within { border-color: #3b82f6; box-shadow: 0 0 0 4px rgba(37,99,235,.15); }
body.login-v2 .v3-campo svg {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: #7c8598; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
body.login-v2 #form .v3-campo input#usuario,
body.login-v2 #form .v3-campo input#senha {
  flex: 1 1 auto; min-width: 0; width: auto !important;
  margin: 0 !important; padding: 14px 0 !important;
  border: 0 !important; border-radius: 0 !important; outline: 0 !important; box-shadow: none !important;
  background: transparent none !important;
  font: 400 14px/1.4 'Inter', system-ui, sans-serif !important; color: #1a2233 !important;
  text-align: left !important;
}
body.login-v2 #form .v3-campo input::placeholder { color: #646d7f !important; opacity: 1; }
/* preenchimento automático do navegador sem a faixa amarela/azul dentro do campo */
body.login-v2 #form .v3-campo input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 40px #fff inset !important;
  -webkit-text-fill-color: #1a2233 !important;
  caret-color: #1a2233;
}

body.login-v2 #form #entrar.button_link {
  display: flex !important; align-items: center; justify-content: space-between;
  width: 100% !important; margin: 0 !important; padding: 15px 18px !important;
  border: 0 !important; border-radius: 12px !important;
  font: 700 15px/1.2 'Inter', system-ui, sans-serif !important; letter-spacing: 0 !important; text-transform: none !important;
  color: #fff !important; background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  box-shadow: 0 14px 30px -8px var(--v3l-glow) !important;
  cursor: pointer; transition: transform .15s, box-shadow .2s, filter .2s !important;
}
body.login-v2 #form #entrar.button_link:hover {
  filter: brightness(1.06); transform: translateY(-1px);
  box-shadow: 0 18px 38px -6px var(--v3l-glow) !important;
}
body.login-v2 #form #entrar.button_link:active { transform: scale(.98); }
body.login-v2 #form #entrar svg {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .2s ease;
}
body.login-v2 #form #entrar:hover svg { transform: translateX(3px); }

body.login-v2 .v3-form .v2-legal { margin: 24px 0 0 !important; font-size: 11px; line-height: 1.55; color: #646d7f; text-align: left; }

/* tela baixa (notebook com zoom): tira os cartões de vidro para o título caber */
@media (max-height: 640px) and (min-width: 821px) {
  body.login-v2 .v3-vidro { display: none; }
  body.login-v2 .v3-arte-meio h2 { margin-top: 0; }
  /* com a foto, título menor e sem subtítulo para não cobrir o castelo */
  body.login-v2 .v3-com-foto .v3-arte-meio h2 { font-size: 28px; }
  body.login-v2 .v3-com-foto .v3-arte-meio p { display: none; }
  body.login-v2 .v3-com-foto .v3-arte-meio { margin-bottom: 22px; }
}

/* ---- celular: empilha, arte vira faixa ---- */
@media (max-width: 820px) {
  body.login-v2 { overflow: auto !important; height: auto; }
  body.login-v2 #app,
  body.login-v2 main.py-4 { height: auto !important; }
  body.login-v2 .v3-login { flex-direction: column; height: auto; overflow: visible; }
  body.login-v2 .v3-arte { flex: none; height: clamp(210px, 34vh, 300px); min-height: 210px; }
  body.login-v2 .v3-slide-marca { justify-content: flex-start; gap: 18px; padding: 22px 24px 40px; }
  body.login-v2 .v3-slide-marca::after { display: none; }
  body.login-v2 .v3-arte-meio { margin: 0; gap: 8px; }
  body.login-v2 .v3-vidro,
  body.login-v2 .v3-arte-meio p { display: none; }
  body.login-v2 .v3-arte-meio h2 { margin: 0; font-size: 24px; }
  body.login-v2 .v3-dots { left: 24px; bottom: 18px; }
  body.login-v2 .v3-painel { flex: 1 0 auto; align-items: flex-start; padding: 32px 24px 36px; overflow: visible; }
  body.login-v2 .v3-form { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  body.login-v2 .v3-login *,
  body.login-v2 .v3-login *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* glow-up v3: foco de teclado visível nos pontos do carrossel e no botão Entrar */
body.login-v2 .v3-dots i:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
body.login-v2 #form #entrar.button_link:focus-visible { outline: 2px solid #1d4ed8 !important; outline-offset: 3px; }
body.login-v2 .v3-campo:focus-within svg { stroke: #2563eb; }
/* área de toque dos pontos do carrossel (o desenho continua 7 px) */
body.login-v2 .v3-dots i { position: relative; }
body.login-v2 .v3-dots i::after { content: ''; position: absolute; left: -6px; right: -6px; top: -16px; bottom: -16px; }
