*{
  box-sizing:border-box;
}

:root{
  font-family:Inter,Arial,sans-serif;
  color:#172033;
  background:#f4f6fa;
}

body{
  margin:0;
  min-height:100vh;
}

button,
input{
  font:inherit;
}

.login-shell{
  min-height:100vh;
  display:grid;
  grid-template-columns:minmax(360px,42%) 1fr;
}

/* ACESSO */

.login-access{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:48px 7vw;
  background:#ffffff;
}

.login-box{
  width:100%;
  max-width:430px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:64px;
}

.brand-mark{
  font-size:28px;
  font-weight:900;
  letter-spacing:-1.5px;
}

.brand-product{
  padding-left:12px;
  border-left:1px solid #d7dce5;
  color:#687386;
  font-size:14px;
  font-weight:700;
}

.login-heading{
  margin-bottom:32px;
}

.eyebrow,
.context-tag{
  display:inline-block;
  margin-bottom:12px;
  font-size:11px;
  font-weight:800;
  letter-spacing:.16em;
}

.eyebrow{
  color:#667085;
}

.login-heading h1{
  margin:0 0 10px;
  font-size:36px;
  line-height:1.1;
  letter-spacing:-1.4px;
}

.login-heading p{
  margin:0;
  color:#667085;
  line-height:1.6;
}

label{
  display:block;
  margin-bottom:20px;
}

label span{
  display:block;
  margin-bottom:8px;
  font-size:13px;
  font-weight:700;
}

input{
  width:100%;
  height:52px;
  padding:0 15px;
  border:1px solid #d6dbe4;
  border-radius:10px;
  outline:none;
  background:#fff;
  color:#172033;
  transition:.2s ease;
}

input:focus{
  border-color:#6b7280;
  box-shadow:0 0 0 3px rgba(17,24,39,.07);
}

.turnstile-wrap{
  min-height:70px;
  margin:4px 0 18px;
}

.primary-button,
.secondary-button{
  width:100%;
  min-height:50px;
  border-radius:10px;
  cursor:pointer;
  font-weight:800;
  transition:.2s ease;
}

.primary-button{
  border:0;
  background:#172033;
  color:#fff;
}

.primary-button:hover:not(:disabled){
  transform:translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled{
  opacity:.5;
  cursor:not-allowed;
}

.secondary-button{
  margin-top:10px;
  border:1px solid #d6dbe4;
  background:#fff;
  color:#344054;
}

.code-info{
  margin:0 0 22px;
  color:#667085;
  line-height:1.6;
}

.login-message{
  margin:18px 0 0;
  padding:12px 14px;
  border-radius:9px;
  background:#f2f4f7;
  color:#344054;
  font-size:13px;
}

.security-note{
  display:flex;
  align-items:center;
  gap:8px;
  margin:28px 0 0;
  color:#98a2b3;
  font-size:12px;
}


/* CONTEXTO LEADS */

.login-context{
  position:relative;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:80px clamp(50px,7vw,120px);
  background:
    radial-gradient(circle at 78% 18%,rgba(255,255,255,.10),transparent 26%),
    radial-gradient(circle at 20% 80%,rgba(255,255,255,.06),transparent 30%),
    linear-gradient(135deg,#101828 0%,#182230 52%,#27364c 100%);
  color:#fff;
}

.login-context::after{
  content:"360º";
  position:absolute;
  right:-45px;
  bottom:-70px;
  font-size:230px;
  line-height:1;
  font-weight:900;
  color:rgba(255,255,255,.025);
  pointer-events:none;
}

.context-content{
  position:relative;
  z-index:1;
  max-width:720px;
}

.context-tag{
  color:#cbd5e1;
}

.context-content h2{
  max-width:680px;
  margin:0 0 24px;
  font-size:clamp(38px,4vw,64px);
  line-height:1.03;
  letter-spacing:-2.5px;
}

.context-content > p{
  max-width:620px;
  margin:0;
  color:#cbd5e1;
  font-size:17px;
  line-height:1.75;
}

.context-features{
  display:grid;
  gap:15px;
  margin-top:48px;
}

.context-features div{
  display:flex;
  align-items:center;
  gap:14px;
  color:#e5e7eb;
  font-size:14px;
}

.context-features i{
  width:36px;
  height:36px;
  display:grid;
  place-items:center;
  border:1px solid rgba(255,255,255,.12);
  border-radius:10px;
  background:rgba(255,255,255,.05);
}

.context-footer{
  position:absolute;
  left:clamp(50px,7vw,120px);
  bottom:36px;
  color:#98a2b3;
  font-size:12px;
}


/* RESPONSIVO */

@media (max-width:900px){
  .login-shell{
    grid-template-columns:1fr;
  }

  .login-access{
    min-height:100vh;
    padding:40px 24px;
  }

  .brand{
    margin-bottom:44px;
  }

  .login-context{
    display:none;
  }
}

@media (max-width:480px){
  .login-heading h1{
    font-size:31px;
  }

  .brand-mark{
    font-size:25px;
  }
}

/* Refinamento — Login Operacional */

.login-access{
  align-items:center;
}

.login-box{
  margin:auto;
}

.login-heading{
  margin-bottom:38px;
}

.login-heading h1{
  margin:0 0 18px;
  font-size:38px;
  line-height:1.1;
  letter-spacing:-1.4px;
}

.login-product{
  display:flex;
  align-items:center;
  gap:12px;
  font-size:20px;
  color:#172033;
}

.login-product strong{
  font-weight:800;
}

.login-product span{
  width:1px;
  height:22px;
  background:#d7dce5;
}

.security-note{
  justify-content:center;
  margin-top:28px;
}

/* ==========================================================
   TEMA OFICIAL L360º
   O Login Operacional utiliza os mesmos tokens da Index.
   ========================================================== */

html,
body{
  background:var(--background);
  color:var(--text);
}

.login-shell{
  background:var(--background);
}

.login-access{
  background:transparent;
  color:var(--text);
}

.login-heading h1,
.login-product{
  color:var(--text);
}

.login-product span{
  background:var(--border);
}

.login-access input{
  background:var(--surface);
  color:var(--text);
  border-color:var(--border);
}

.security-note{
  color:var(--text-muted);
}

/* O painel institucional representa visualmente o lado
   escuro do ecossistema, independentemente do tema ativo. */

.login-context{
  background:var(--background);
  border-left:1px solid var(--border);
}

/* No LIGHT, diferencia suavemente os dois lados sem criar
   um fundo externo ao padrão visual oficial. */

html[data-theme="light"] .login-context{
  background:#111111;
  color:#ffffff;
}

html[data-theme="light"] .login-context .context-content > p,
html[data-theme="light"] .login-context .context-features div,
html[data-theme="light"] .login-context .context-footer,
html[data-theme="light"] .login-context .context-tag{
  color:#cbd5e1;
}

/* ==========================================================
   PORTA MOBILE — PWA GESTÃO 360º
   ========================================================== */

.pwa-gate{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:28px;
  background:var(--background);
  color:var(--text);
}

.pwa-gate[hidden]{
  display:none;
}

.pwa-gate-card{
  width:100%;
  max-width:390px;
  text-align:center;
}

.pwa-gate-icon{
  width:76px;
  height:76px;
  object-fit:contain;
  margin-bottom:22px;
}

.pwa-gate-label{
  display:block;
  margin-bottom:8px;
  font-size:11px;
  font-weight:800;
  letter-spacing:.16em;
  color:var(--text-muted);
}

.pwa-gate h1{
  margin:0 0 14px;
  font-size:34px;
  letter-spacing:-1.3px;
}

.pwa-gate-card > p{
  margin:0 auto 28px;
  max-width:320px;
  line-height:1.6;
  color:var(--text-muted);
}

.pwa-ios-instructions{
  margin-top:20px;
  padding:16px;
  border:1px solid var(--border);
  border-radius:12px;
  line-height:1.6;
}

.pwa-waiting{
  margin-top:18px !important;
  font-size:13px;
}

/* ==========================================================
   LOGIN GESTÃO — COMPOSIÇÃO LIGHT | DARK
   ========================================================== */

/*
 * Coluna de acesso:
 * representação permanente do tema LIGHT da Index.
 */
.login-access{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:48px;
  background:
    radial-gradient(
      circle at 50% 30%,
      rgba(255,255,255,.96),
      rgba(245,245,245,.98) 48%,
      rgba(235,235,235,1) 100%
    );
  color:#222222;
}

.login-box{
  width:min(100%,430px);
  max-width:430px;
  margin:0 auto;
}

.login-heading,
.login-box form{
  width:100%;
}

.login-heading h1,
.login-product{
  color:#222222;
}

.login-product span{
  background:#d5d8dc;
}

.login-access label{
  color:#222222;
}

.login-access input{
  width:100%;
  background:#ffffff;
  color:#222222;
  border-color:#d5d8dc;
  color-scheme:light;
}

.login-access input::placeholder{
  color:#7b7f86;
}

.login-access input:focus{
  border-color:#888d94;
  box-shadow:0 0 0 3px rgba(0,0,0,.06);
}

.login-access .primary-button{
  background:#172033;
  color:#ffffff;
}

.login-access .secondary-button{
  background:#ffffff;
  color:#344054;
  border-color:#d5d8dc;
}

.login-access .security-note{
  justify-content:center;
  color:#667085;
}


/*
 * Coluna institucional:
 * representação permanente do tema DARK da Index.
 */
.login-context,
html[data-theme="light"] .login-context,
html[data-theme="dark"] .login-context{
  display:flex;
  flex-direction:column;
  justify-content:center;
  background:
    radial-gradient(
      circle at 45% 35%,
      rgba(92,73,9,.32),
      rgba(17,17,17,.98) 55%,
      #111111 100%
    );
  color:#ffffff;
  border-left:1px solid rgba(255,255,255,.10);
}

.login-context .context-content{
  width:100%;
  max-width:680px;
  margin:0 auto;
}

.login-context .context-content > p,
.login-context .context-features div,
.login-context .context-footer,
.login-context .context-tag{
  color:#cbd5e1;
}


/* Centralização proporcional das duas áreas */

@media (min-width:901px){
  .login-shell{
    grid-template-columns:42% 58%;
  }

  .login-access,
  .login-context{
    min-height:100vh;
  }
}

/* ==========================================================
   AJUSTE FINAL — LIGHT OFICIAL + STATUS OPERACIONAL
   ========================================================== */

/* A coluna de login reproduz diretamente o fundo LIGHT
   definido pelo tema oficial da Index. */
.login-access{
  background:var(--background) !important;
}

/*
 * Como a página mantém o contexto geral em dark para a
 * metade institucional, aplicamos à coluna clara exatamente
 * o background oficial definido para o light.
 */
html[data-theme="dark"] .login-access{
  --background:
    radial-gradient(
      circle at 50% 15%,
      rgba(250,208,44,.40),
      transparent 32%
    ),
    radial-gradient(
      circle at 15% 80%,
      rgba(250,208,44,.18),
      transparent 30%
    ),
    linear-gradient(
      135deg,
      #ffffff,
      #f5f1de
    );
}

/* Remove a marca-d'água 360º do painel institucional. */
.login-context::after{
  display:none !important;
}

/* Status operacional */
.security-note{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}

.security-note i{
  transition:color .2s ease;
}

.security-note[data-status="online"] i{
  color:#16a34a;
}

.security-note[data-status="maintenance"] i{
  color:#eab308;
}

.security-note[data-status="offline"] i{
  color:#dc2626;
}

/* ==========================================================
   AJUSTE FINAL — LIGHT OFICIAL + STATUS OPERACIONAL
   ========================================================== */

/* A coluna de login reproduz diretamente o fundo LIGHT
   definido pelo tema oficial da Index. */
.login-access{
  background:var(--background) !important;
}

/*
 * Como a página mantém o contexto geral em dark para a
 * metade institucional, aplicamos à coluna clara exatamente
 * o background oficial definido para o light.
 */
/* Remove a marca-d'água 360º do painel institucional. */
.login-context::after{
  display:none !important;
}

/* Status operacional */
.security-note{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}

.security-note i{
  transition:color .2s ease;
}

.security-note[data-status="online"] i{
  color:#667085;
}

.security-note[data-status="maintenance"] i{
  color:#eab308;
}

.security-note[data-status="offline"] i{
  color:#dc2626;
}

/* ==========================================================
   LOGIN GESTÃO — COR E CENTRALIZAÇÃO DEFINITIVAS
   ========================================================== */

/* Todo o conteúdo principal da coluna LIGHT fica centralizado. */
.login-access .login-box{
  width:min(100%,430px);
  margin:0 auto;
  text-align:center;
}

.login-access .login-heading{
  text-align:center;
}

.login-access .login-heading h1,
html[data-theme="dark"] .login-access .login-heading h1{
  color:#111111 !important;
  text-align:center;
}

.login-access .login-product,
html[data-theme="dark"] .login-access .login-product{
  justify-content:center;
  color:#111111 !important;
  text-align:center;
}

.login-access .login-product strong,
html[data-theme="dark"] .login-access .login-product strong{
  color:#111111 !important;
}

.login-access .login-product span{
  background:#111111;
  opacity:.28;
}

/* Formulário centralizado como conjunto.
   Labels permanecem à esquerda para leitura correta. */
.login-access form{
  width:100%;
  margin:36px auto 0;
}

.login-access form label{
  width:100%;
  text-align:left;
  color:#111111 !important;
}

.login-access form label span{
  color:#111111 !important;
}

.login-access .turnstile-wrap{
  display:flex;
  justify-content:center;
  width:100%;
}

.login-access .primary-button,
.login-access .secondary-button{
  margin-left:auto;
  margin-right:auto;
}

.login-access .security-note{
  width:100%;
  justify-content:center;
  text-align:center;
}


/* LAB360 — porta mobile de navegador; instalacao PWA continua opcional. */
.login-shell[hidden]{display:none!important}
.pwa-browser-button{
  display:flex;align-items:center;justify-content:center;gap:12px;
  width:100%;min-height:52px;margin:12px auto 0;padding:12px 18px;
  background:var(--surface);color:var(--text);
  border:1px solid var(--border);border-radius:12px;
  font:inherit;font-weight:700;cursor:pointer;
}
.pwa-browser-button:focus-visible,.mobile-login-close:focus-visible{
  outline:3px solid #e6bb2f;outline-offset:3px;
}
.pwa-browser-button:disabled{opacity:.65;cursor:wait}
.mobile-login-close{display:none}
@media (max-width:900px){
  .pwa-gate-card{display:flex;flex-direction:column;align-items:center;gap:12px}
  .pwa-gate-card>.pwa-browser-button{max-width:360px}
  .pwa-gate-card>#pwaWaiting{margin:6px auto!important}
  .pwa-gate-card>#pwaInstallButton{min-height:48px}
  body.mobile-login-open .login-shell{min-height:100dvh}
  body.mobile-login-open .login-box{position:relative;padding-top:40px}
  body.mobile-login-open .mobile-login-close{
    display:inline-flex;align-items:center;justify-content:center;
    position:absolute;top:0;right:0;min-height:36px;
    border:1px solid var(--border);border-radius:10px;
    padding:6px 14px;background:var(--surface);color:var(--text);
    font:inherit;font-size:13px;cursor:pointer;
  }
}

/* Chat16 — OTP visível tanto em Gestão como na entrada contextual TAY. */
#gestaoCaptchaStatus{margin:0 auto 10px;max-width:360px;font-size:12px;line-height:1.5;text-align:center;color:var(--l360-text-soft,#bfb8a6)}
#gestaoCaptchaStatus[hidden],#gestaoCaptchaRetry[hidden]{display:none!important}
#gestaoAuthCaptcha{display:flex;justify-content:center;min-height:65px;max-width:100%;overflow:visible}
#gestaoCaptchaRetry{max-width:360px;margin:0 auto 12px}
#gestaoAuthCaptcha iframe{max-width:100%}
