:root {
  --bg-page: #f3f7fc; --card-bg: #fff; --text: #101a31; --muted: #66738b;
  --primary: var(--am-marca, #1163dd); --primary-dark: var(--am-marca-hover, #0756c8); --primary-weak: var(--am-marca-suave, #eef5ff);
  --border: #dfe7f1; --shadow: 0 24px 70px rgba(31,72,130,.18); --radius: 28px;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--text); font-family: 'Poppins', Arial, sans-serif; background: radial-gradient(circle at 12% 18%, rgba(var(--am-marca-rgb, 17,99,221), .08), transparent 31%), radial-gradient(circle at 88% 80%, rgba(var(--am-marca-rgb, 17,99,221), .06), transparent 28%), linear-gradient(145deg, #f8fbff, var(--bg-page)); }
.login-fundo { min-height: 100vh; display: grid; place-items: center; padding: 34px; }
.login { width: min(1120px, 100%); border: 8px solid rgba(255,255,255,.86); border-radius: var(--radius); background: var(--card-bg); box-shadow: var(--shadow); overflow: hidden; }
.login-container { display: grid; grid-template-columns: minmax(0, 48%) minmax(0, 52%); min-height: min(680px, calc(100vh - 84px)); }
.imagem-left { position: relative; min-width: 0; overflow: hidden; isolation: isolate; background: linear-gradient(145deg, #073b8b, #087bf0); }
.imagem-left::before { content: ""; position: absolute; z-index: 1; inset: 0; pointer-events: none; background: linear-gradient(145deg, rgba(0,48,128,.5), rgba(0,126,255,.38)); mix-blend-mode: color; }
.imagem-left::after { content: ""; position: absolute; z-index: 2; left: -12%; right: -12%; bottom: -14%; height: 28%; pointer-events: none; border-radius: 50% 50% 0 0; background: linear-gradient(135deg, #075dd4, #0799ff); box-shadow: inset -1px 0 rgba(255,255,255,.18); }
.imagem-left .imagem-desktop { position: absolute; right: -4%; bottom: 3%; width: 92%; height: auto; display: block; object-fit: contain; object-position: center bottom; mix-blend-mode: screen; }
.login-imagem-personalizada .imagem-left .imagem-desktop { z-index: 1; mix-blend-mode: normal; transform: translate(var(--login-img-pos-x, 0%), var(--login-img-pos-y, 0%)) scale(var(--login-img-scale, 1)); transform-origin: center bottom; }
.login-hero-texto { position: absolute; z-index: 3; top: clamp(34px, 5vw, 64px); left: clamp(30px, 4vw, 54px); color: #fff; text-shadow: 0 2px 12px rgba(0,22,65,.25); }
.login-hero-texto strong { display: block; font-size: clamp(23px, 2.35vw, 34px); line-height: 1.2; letter-spacing: -.5px; }
.login-hero-texto strong em { position: relative; color: #19ebef; font-style: normal; }
.login-hero-texto strong em::after { content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 3px; border-radius: 999px; background: #19ebef; transform: rotate(-3deg); }
.login-hero-texto span { display: block; margin-top: 28px; font-size: clamp(14px, 1.35vw, 19px); line-height: 1.55; }
.login-hero-brand, .login-hero-beneficios { display: none; }
.login-dados-right { position: relative; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: clamp(44px, 6vw, 78px); background: linear-gradient(160deg, #fff 20%, #fbfdff); }
.login-marca { display: flex; align-items: center; justify-content: flex-start; gap: 15px; min-width: 0; }
.login-marca-logo { width: 66px; height: 66px; flex: 0 0 66px; display: block; object-fit: contain; border-radius: 15px; background: #fff; }
.login-marca-textos { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.login-marca-textos > strong { max-width: 100%; color: #0754bd; font-size: clamp(21px, 2.4vw, 31px); line-height: 1.12; overflow-wrap: anywhere; }
.login-boas-vindas { margin-top: 14px; text-align: left; }
.h2-titulo { margin: 0; color: var(--text); font-size: clamp(26px, 3vw, 34px); line-height: 1.15; font-weight: 800; letter-spacing: -.6px; }
.login-boas-vindas p { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.campo { width: 100%; display: flex; flex-direction: column; gap: 7px; }
label { color: #44536b; font-size: 12px; font-weight: 600; }
input[type="email"], input[type="password"], #recuperacaoCodigo { width: 100%; box-sizing: border-box; min-height: 50px; padding: 13px 15px; color: var(--text); border: 1px solid var(--border); border-radius: 12px; outline: none; background: #fff; font: inherit; font-size: 14px; transition: border-color .2s, box-shadow .2s; }
input::placeholder { color: #9aa5b5; }
input:focus { border-color: var(--am-marca-foco, var(--primary)); box-shadow: 0 0 0 4px rgba(var(--am-marca-rgb, 17,99,221), .13); }
.lembrar-container { display: flex; align-items: center; gap: 9px; margin: -7px 0 0; color: var(--muted); }
.lembrar-container input { width: 17px; height: 17px; accent-color: var(--primary); }
.lembrar-container label, .lembrar-container input { cursor: pointer; }
.botao-entrar { width: 100%; min-height: 54px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; margin-top: 2px; padding: 14px 18px; color: var(--am-marca-contraste, #fff); border: 0; border-radius: 12px; background: linear-gradient(135deg, var(--primary), var(--am-marca-hover, #0879ff)); box-shadow: 0 10px 22px rgba(var(--am-marca-rgb, 17,99,221), .24); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; transition: transform .15s, filter .2s, box-shadow .2s; }
.botao-entrar:hover:not(:disabled) { filter: brightness(1.04); box-shadow: 0 13px 28px rgba(var(--am-marca-rgb, 17,99,221), .3); transform: translateY(-1px); }
.botao-entrar:active:not(:disabled) { transform: translateY(0); }
.botao-entrar:disabled { cursor: not-allowed; opacity: .58; box-shadow: none; }
.login-icone { width: 20px; height: 20px; flex: 0 0 20px; display: block; }
.botao-entrar:focus-visible, .voltar-cliente:focus-visible { outline: 3px solid rgba(var(--am-marca-rgb, 17,99,221), .28); outline-offset: 3px; }
.login-divisor { display: flex; align-items: center; gap: 14px; margin: 20px 0 3px; color: #75839a; font-size: 12px; }
.login-divisor::before, .login-divisor::after { content: ""; height: 1px; flex: 1; background: #dce4ee; }
.mensagem { min-height: 20px; margin: 0; color: #b45309; font-size: 12px; }
.login-links-legais { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 12px; text-align: center; }
.login-links-legais a { color: #66758c; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; text-decoration: none; }
.login-links-legais a:hover { color: var(--am-marca-texto, var(--primary)); text-decoration: underline; }
.login-links-legais--cliente { width: min(100% - 32px, 560px); margin: 14px auto 24px; }
.voltar-cliente { position: absolute; top: 24px; left: 24px; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; color: var(--text); border: 1px solid var(--border); border-radius: 10px; background: #fff; text-decoration: none; font-size: 18px; font-weight: 700; transition: background .2s, transform .15s; }
.voltar-cliente:hover { background: var(--primary-weak); transform: translateX(-1px); }
.voltar-cliente:visited { color: var(--text); }
/* Seleção de empresa (login central multiempresa) */
.login-etapa { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.login-etapa[hidden] { display: none; }
.empresa-lista { display: flex; flex-direction: column; gap: 12px; max-height: min(48vh, 380px); padding: 3px; margin: -3px; overflow-x: hidden; overflow-y: auto; }
.empresa-opcao { width: 100%; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; color: var(--text); text-align: left; border: 1px solid var(--border); border-radius: 12px; background: #fff; font: inherit; cursor: pointer; transition: border-color .2s, background .2s, box-shadow .2s; }
.empresa-opcao:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-weak); }
.empresa-opcao:focus-visible { outline: 3px solid rgba(var(--am-marca-rgb, 17,99,221), .28); outline-offset: 2px; border-color: var(--primary); }
.empresa-opcao:disabled { cursor: not-allowed; opacity: .6; }
.empresa-opcao.is-loading { opacity: 1; border-color: var(--primary); background: var(--primary-weak); }
.empresa-opcao-textos { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.empresa-opcao-nome { font-size: 15px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.empresa-opcao-perfil { color: var(--muted); font-size: 12.5px; line-height: 1.35; overflow-wrap: anywhere; }
.empresa-opcao::after { content: ""; flex: 0 0 8px; width: 8px; height: 8px; border-top: 2px solid #8a98ad; border-right: 2px solid #8a98ad; transform: rotate(45deg); }
.empresa-opcao.is-loading::after { flex-basis: 16px; width: 16px; height: 16px; border: 2px solid rgba(var(--am-marca-rgb, 17,99,221), .25); border-top-color: var(--primary); border-radius: 50%; transform: none; animation: empresa-giro .7s linear infinite; }
@keyframes empresa-giro { to { transform: rotate(360deg); } }
.botao-voltar-etapa { align-self: flex-start; min-height: 40px; padding: 8px 4px; color: var(--muted); border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.botao-voltar-etapa:hover:not(:disabled) { color: var(--am-marca-texto, var(--primary)); }
.botao-voltar-etapa:focus-visible { outline: 3px solid rgba(var(--am-marca-rgb, 17,99,221), .28); outline-offset: 3px; border-radius: 8px; }
.botao-voltar-etapa:disabled { cursor: not-allowed; opacity: .55; }
#empresaTitulo:focus { outline: none; }
@media (min-width: 961px) {
  .login-fundo { padding: 20px; }
  .login { width: min(1440px, 92vw); }
  .login-container { grid-template-columns: minmax(0, 60%) minmax(0, 40%); min-height: min(720px, calc(100vh - 56px)); }
  .login-dados-right { align-items: center; gap: 20px; padding: clamp(38px, 4vw, 62px); }
  .login-dados-right > :not(.voltar-cliente) { width: 100%; max-width: 420px; }
  .login-marca { justify-content: flex-start; }
  .login-boas-vindas { margin-top: 20px; }
  .h2-titulo { font-size: clamp(28px, 2vw, 32px); letter-spacing: -.35px; }
  .imagem-left .imagem-desktop { right: -5%; bottom: 0; width: 68%; }
  .login-imagem-personalizada .imagem-left .imagem-desktop { right: 2%; bottom: 5%; width: 52%; max-height: 58%; transform: translate(var(--login-img-pos-x, 0%), var(--login-img-pos-y, 0%)) scale(var(--login-img-scale, 1)); transform-origin: center bottom; }
  .imagem-left::after { left: -10%; right: -10%; bottom: -17%; height: 30%; }
  .login-hero-brand { position: absolute; z-index: 3; top: 48px; left: clamp(42px, 4vw, 72px); display: flex; align-items: center; gap: 12px; color: #fff; }
  .login-hero-brand img { width: 46px; height: 46px; object-fit: contain; }
  .login-hero-brand b { font-size: 25px; }
  .login-hero-texto { top: 142px; left: clamp(42px, 4vw, 72px); }
  .login-hero-texto strong { font-size: clamp(30px, 2.35vw, 42px); }
  .login-hero-texto span { margin-top: 32px; }
  .login-hero-beneficios { position: absolute; z-index: 3; left: clamp(42px, 4vw, 72px); bottom: 58px; display: grid; gap: 13px; color: #fff; }
  .login-hero-beneficios > div { display: flex; align-items: center; gap: 12px; }
  .login-hero-beneficios i { width: 38px; height: 38px; flex: 0 0 38px; display: inline-grid; place-items: center; border-radius: 10px; background: rgba(17,137,255,.68); font-style: normal; box-shadow: inset 0 1px rgba(255,255,255,.13); }
  .login-hero-beneficios svg { width: 21px; height: 21px; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .login-hero-beneficios span { display: grid; gap: 2px; }
  .login-hero-beneficios b { font-size: 12px; line-height: 1.2; }
  .login-hero-beneficios small { color: rgba(255,255,255,.88); font-size: 10px; line-height: 1.3; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
