/* ============ NUVEM DESK AI · LOGIN ============ */
/* Reusa tokens de styles.css. Tudo aqui é específico da tela de entrada. */

.lg-stage {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(72% 56% at 50% 34%, var(--brand-green-soft) 0%, transparent 64%),
    radial-gradient(46% 40% at 84% 86%, var(--brand-green-soft) 0%, transparent 70%),
    var(--bg);
  padding: 24px;
  overflow: hidden;
}

/* Textura discreta de fundo — grade hairline monocromática, sem gradiente. */
.lg-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--hairline) 1px, transparent 1px),
    linear-gradient(to bottom, var(--hairline) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 42%, #000 0%, transparent 78%);
          mask-image: radial-gradient(ellipse 80% 70% at 50% 42%, #000 0%, transparent 78%);
  opacity: 0.6;
  pointer-events: none;
}

/* ---------- Cartão central ---------- */
.lg-card {
  position: relative;
  width: 100%;
  max-width: 392px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 18px 48px rgba(0,0,0,0.07), 0 4px 12px rgba(0,0,0,0.04);
  padding: 28px 28px 22px;
}
[data-theme="dark"] .lg-card {
  box-shadow: 0 18px 48px rgba(0,0,0,0.4), 0 0 0 1px var(--hairline);
}

.lg-head { margin-bottom: 18px; }
.lg-head .logo { padding: 0; height: auto; font-size: 14px; margin-bottom: 18px; }
.lg-head .logo-mark { width: 24px; height: 24px; font-size: 13px; }
.lg-title {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}
.lg-sub {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 3px;
  line-height: 1.45;
}

/* ---------- Seletor de contexto (Conta local / AD) ---------- */
.lg-tabs {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 7px;
  padding: 2px;
  margin-bottom: 18px;
}
.lg-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  border: 0;
  background: transparent;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 550;
  color: var(--text-3);
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.lg-tab:hover { color: var(--text-2); }
.lg-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 0 var(--hairline-strong), 0 1px 2px rgba(0,0,0,0.05);
}
[data-theme="dark"] .lg-tab.active { box-shadow: 0 0 0 1px var(--hairline-strong); }
.lg-tab .lg-tab-default {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-green-strong);
  background: var(--brand-green-soft);
  padding: 1px 4px;
  border-radius: 3px;
}

/* ---------- Campos ---------- */
.lg-form { display: flex; flex-direction: column; gap: 14px; }
.lg-field-group { display: flex; flex-direction: column; gap: 6px; }
.lg-label {
  font-size: 12px;
  font-weight: 550;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lg-label .lg-forgot {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
  text-decoration: none;
}
.lg-label .lg-forgot:hover { color: var(--brand-green-strong); text-decoration: underline; }

.lg-field {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  height: 40px;
  transition: border-color .15s, box-shadow .15s;
}
.lg-field:hover { border-color: var(--text-4); }
.lg-field:focus-within {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px var(--ring);
}
.lg-field.invalid { border-color: var(--brand-red); }
.lg-field.invalid:focus-within { box-shadow: 0 0 0 3px var(--brand-red-soft); }
.lg-field-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  color: var(--text-4);
  flex-shrink: 0;
}
.lg-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--text);
  padding: 0 4px 0 0;
  height: 100%;
}
.lg-field input::placeholder { color: var(--text-4); }
.lg-eye {
  width: 38px;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--text-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lg-eye:hover { color: var(--text-2); }

/* ---------- Linha lembrar-me ---------- */
.lg-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 12.5px;
  color: var(--text-2);
}
.lg-checkbox {
  width: 17px; height: 17px;
  border: 1px solid var(--hairline-strong);
  border-radius: 5px;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.lg-remember input { position: absolute; opacity: 0; pointer-events: none; }
.lg-remember input:checked + .lg-checkbox {
  background: var(--brand-green);
  border-color: var(--brand-green);
}
.lg-remember input:focus-visible + .lg-checkbox {
  box-shadow: 0 0 0 3px var(--ring);
}

/* ---------- Botão primário ---------- */
.lg-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  border: 1px solid var(--brand-green-strong);
  background: var(--brand-green);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin-top: 2px;
  transition: filter .15s, background .15s;
}
.lg-submit:hover { background: var(--brand-green-strong); }
.lg-submit:disabled { opacity: 0.55; pointer-events: none; }
.lg-submit.busy { pointer-events: none; }

/* ---------- Banners de estado ---------- */
.lg-banner {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.45;
  border: 1px solid transparent;
}
.lg-banner .lg-banner-ico { flex-shrink: 0; margin-top: 1px; }
.lg-banner b { font-weight: 600; display: block; margin-bottom: 1px; }
.lg-banner.error {
  background: var(--brand-red-soft);
  border-color: rgba(220,38,38,0.25);
  color: var(--brand-red);
}
.lg-banner.warn {
  background: var(--brand-amber-soft);
  border-color: rgba(217,119,6,0.25);
  color: var(--brand-amber);
}
.lg-banner .lg-banner-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

/* ---------- Painel Active Directory ---------- */
.lg-ad {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.lg-ad-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
}
.lg-ad-logo {
  width: 34px; height: 34px;
  border-radius: 7px;
  background: #0078D4;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.lg-ad-info { min-width: 0; }
.lg-ad-name { font-size: 13px; font-weight: 600; color: var(--text); }
.lg-ad-domain {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
  margin-top: 1px;
}
.lg-ad-note {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}
.lg-submit.ad {
  background: var(--text);
  border-color: var(--text);
  color: var(--surface);
}
.lg-submit.ad:hover { filter: brightness(1.15); background: var(--text); }
[data-theme="dark"] .lg-submit.ad { filter: none; }
[data-theme="dark"] .lg-submit.ad:hover { filter: brightness(0.92); }

/* ---------- MFA ---------- */
.lg-mfa { display: flex; flex-direction: column; gap: 16px; }
.lg-mfa-head { text-align: center; }
.lg-mfa-ico {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--brand-green-soft);
  color: var(--brand-green-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.lg-mfa-title { font-size: 15px; font-weight: 600; color: var(--text); }
.lg-mfa-sub {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 4px;
  line-height: 1.45;
}
.lg-mfa-sub b { color: var(--text-2); font-weight: 600; font-family: var(--font-mono); }
.lg-otp {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.lg-otp input {
  width: 44px;
  height: 52px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.lg-otp input:focus {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px var(--ring);
}
.lg-otp input.filled { border-color: var(--text-4); }
.lg-mfa-resend {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
}
.lg-mfa-resend button {
  border: 0;
  background: transparent;
  color: var(--brand-green-strong);
  font-weight: 550;
  font-size: 12px;
  padding: 0;
}
.lg-mfa-resend button:disabled { color: var(--text-4); pointer-events: none; }
.lg-link-btn {
  border: 0;
  background: transparent;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: center;
}
.lg-link-btn:hover { color: var(--text); }

/* ---------- Sucesso ---------- */
.lg-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 14px 0 8px;
}
.lg-success-ico {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--brand-green-soft);
  color: var(--brand-green-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.lg-success-title { font-size: 15px; font-weight: 600; color: var(--text); }
.lg-success-sub { font-size: 12.5px; color: var(--text-3); }

/* ---------- Spinner ---------- */
.lg-spin {
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lgSpin .7s linear infinite;
}
.lg-submit.ad .lg-spin { border-color: rgba(255,255,255,0.25); border-top-color: #fff; }
[data-theme="dark"] .lg-submit.ad .lg-spin { border-color: rgba(0,0,0,0.2); border-top-color: var(--surface); }
@keyframes lgSpin { to { transform: rotate(360deg); } }

/* ---------- Rodapé do cartão ---------- */
.lg-card-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
  font-size: 11.5px;
  color: var(--text-3);
}
.lg-card-foot a {
  color: var(--text-2);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.lg-card-foot a:hover { color: var(--text); }
.lg-card-foot .sep { color: var(--hairline-strong); }
.lg-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--brand-green);
  flex-shrink: 0;
  position: relative;
}
.lg-status-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--brand-green);
  opacity: 0.4;
  animation: lgPulse 2s ease-out infinite;
}
@keyframes lgPulse { 0% { transform: scale(0.8); opacity: 0.5; } 100% { transform: scale(1.8); opacity: 0; } }

/* ---------- Rodapé global (versão, termos) ---------- */
.lg-page-foot {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  font-size: 11px;
  color: var(--text-4);
  flex-wrap: wrap;
}
.lg-page-foot a { color: var(--text-3); text-decoration: none; }
.lg-page-foot a:hover { color: var(--text-2); text-decoration: underline; }
.lg-page-foot .sep { opacity: 0.5; }
.lg-page-foot .mono { font-family: var(--font-mono); }

/* ---------- Faixa de ambiente ---------- */
.lg-env {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  padding: 2px 7px;
  border-radius: 999px;
}
.lg-env.dev { background: var(--brand-blue-soft); color: var(--brand-blue); }
.lg-env.homolog { background: var(--brand-amber-soft); color: var(--brand-amber); }
.lg-env.prod { background: var(--brand-green-soft); color: var(--brand-green-strong); }

/* ============ LAYOUT SPLIT ============ */
.lg-stage.split { padding: 0; }
.lg-stage.split::before { display: none; }
.lg-split-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  width: 100%;
  min-height: 100vh;
}
.lg-split-right {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: var(--bg);
}
.lg-split-grid .lg-card {
  box-shadow: none;
  border: 1px solid var(--hairline);
}

/* Painel de marca — verde-esmeralda da marca, moderno */
.lg-brand {
  position: relative;
  background:
    radial-gradient(120% 90% at 88% 14%, rgba(134,239,172,0.34) 0%, rgba(134,239,172,0) 50%),
    radial-gradient(70% 55% at 64% 62%, rgba(236,253,245,0.14) 0%, rgba(236,253,245,0) 60%),
    radial-gradient(95% 75% at 10% 100%, rgba(2,44,22,0.62) 0%, rgba(2,44,22,0) 60%),
    linear-gradient(158deg, #1B9E47 0%, #0F7A38 46%, #0A4F26 100%);
  color: #F4F6F4;
  padding: 44px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.lg-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 30% 20%, #000, transparent 75%);
          mask-image: radial-gradient(ellipse 90% 80% at 30% 20%, #000, transparent 75%);
  pointer-events: none;
}
.lg-brand > * { position: relative; z-index: 1; }
.lg-brand .logo { position: absolute; top: 44px; left: 48px; height: auto; width: auto; min-height: 0; }
.lg-brand-mid { display: flex; flex-direction: column; gap: 18px; max-width: 30ch; }
.lg-brand-foot {
  position: absolute;
  left: 48px; right: 48px; bottom: 40px;
}

/* Ilustração de fundo — convergência omnichannel → orbe de IA */
.lg-brand-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%; height: 100%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 130px);
          mask-image: linear-gradient(to bottom, transparent 0, #000 130px);
  pointer-events: none;
  overflow: hidden;
}
.lg-brand .logo { font-size: 22px; gap: 12px; }
.lg-brand .logo .logo-mark { width: 40px; height: 40px; font-size: 21px; border-radius: 10px; }
.lg-brand .logo .logo-word { color: #fff; }
.lg-brand .logo .logo-word span[style] { color: rgba(255,255,255,0.55) !important; }
.lg-brand .logo .logo-org {
  color: rgba(255,255,255,0.5);
  border-left: none;
  font-size: 13px;
  padding-left: 0;
  margin-left: 2px;
}
.lg-brand-orb {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--brand-green), var(--brand-red), var(--brand-green));
  -webkit-mask: radial-gradient(circle, transparent 36%, #000 38%);
          mask: radial-gradient(circle, transparent 36%, #000 38%);
  animation: aiSpin 6s linear infinite;
  margin-bottom: 28px;
}
.lg-brand-tag {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.025em;
  max-width: 18ch;
}
.lg-brand-tag .accent { color: #FFFFFF; text-shadow: 0 1px 14px rgba(255,255,255,0.35); }
.lg-brand-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(255,255,255,0.82);
  margin-top: 16px;
  max-width: 34ch;
}
.lg-brand-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.lg-brand-ch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.92);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 4px 9px;
  border-radius: 999px;
  backdrop-filter: blur(2px);
}
.lg-brand-ch .dot { width: 7px; height: 7px; border-radius: 50%; }
.lg-brand-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 22px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: rgba(255,255,255,0.6);
}

@media (max-width: 880px) {
  .lg-split-grid { grid-template-columns: 1fr; }
  .lg-brand { display: none; }
}

/* Entrada suave do cartão */
@media (prefers-reduced-motion: no-preference) {
  .lg-card { animation: lgCardIn .3s cubic-bezier(.2,.7,.3,1) both; }
}
@keyframes lgCardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
