/* =====================================================================
   TRADESIS · LOGIN — versão moderna e dinâmica
   Obs.: os nomes de classes usados pelo JS foram preservados
   (.ts-login-caixa_campos, .login-principal, .recuperar-senha, etc.)
   ===================================================================== */

:root {
  --ts-primary: var(--color-bg-primary, #13216A);
  --ts-primary-light: #2b3ba6;
  --ts-primary-dark: #0c1444;
  --ts-accent: #4361ee;
  --ts-bg: #eef1f9;
  --ts-card: #ffffff;
  --tsl-text: #1c2333;
  --ts-muted: #8a90a2;
  --tsl-border: #e3e7f2;
  --ts-error: #e63946;
  --ts-radius: 16px;
  --ts-input-radius: 11px;
  --ts-font: 'Nunito Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
  margin: 0;
}

/* ---------- Layout principal (split) ---------- */
.ts-login-container {
  display: flex;
  flex-direction: row-reverse;
  min-height: 100vh;
  width: 100%;
  font-family: var(--ts-font);
  background: var(--ts-bg);
  color: var(--tsl-text);
  overflow: hidden;
}

.ts-login-container *,
.ts-login-container *::before,
.ts-login-container *::after {
  box-sizing: border-box;
}

/* ---------- Lado da marca (esquerda) ---------- */
.ts-login-brand-side {
  position: relative;
  flex: 1 1 60%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.10), transparent 45%),
    linear-gradient(135deg, var(--ts-primary-dark) 0%, var(--ts-primary) 45%, var(--ts-primary-light) 100%);
  background-size: 200% 200%;
  animation: ts-gradient 16s ease infinite;
  color: #fff;
  overflow: hidden;
}

@keyframes ts-gradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* orbs decorativas flutuantes */
.ts-login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.35;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 70%);
  animation: ts-float 12s ease-in-out infinite;
}
.ts-login-orb--1 { width: 320px; height: 320px; top: -80px; right: -60px; opacity: 0.18; }
.ts-login-orb--2 { width: 220px; height: 220px; bottom: -40px; left: -40px; opacity: 0.14; animation-delay: -4s; }
.ts-login-orb--3 { width: 120px; height: 120px; top: 45%; right: 18%; opacity: 0.20; animation-delay: -8s; }

@keyframes ts-float {
  0%, 100% { transform: translateY(0) translateX(0); }
  50%      { transform: translateY(-26px) translateX(14px); }
}

.ts-login-brand-content {
  position: relative;
  z-index: 2;
  max-width: 460px;
  animation: ts-fade-up 0.9s ease both;
}

.ts-login-brand-logo {
  height: 46px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  margin-bottom: 42px;
  filter: brightness(0) invert(1);
}

/* logo personalizado da empresa (logo_login): mantém as cores originais */
.ts-login-brand-logo.ts-login-logo-custom {
  filter: none;
}
.ts-login-mobile-logo img.ts-login-logo-custom {
  max-width: 200px;
  object-fit: contain;
}

.ts-login-brand-title {
  font-size: 40px;
  line-height: 1.15;
  font-weight: 600;
  margin: 0 0 18px;
  letter-spacing: -0.5px;
}

.ts-login-brand-text {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
  margin: 0 0 40px;
}

.ts-login-brand-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}
.ts-login-brand-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.9);
}
.ts-login-brand-features i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 17px;
}

/* ---------- Lado do formulário (direita) — ocupa 40% ---------- */
.ts-login-form-side {
  flex: 0 0 40%;
  max-width: 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.ts-login-caixaLogin {
  width: 100%;
  max-width: 400px;
}

/* logo topo — visível principalmente no mobile */
.ts-login-mobile-logo {
  display: none;
  text-align: center;
  margin-bottom: 28px;
}
.ts-login-mobile-logo img {
  height: 38px;
  width: auto;
}

/* ---------- Painéis (cards que trocam) ---------- */
.ts-login-caixa_campos {
  display: flex;
  flex-direction: column;
  background: var(--ts-card);
  border: 1px solid var(--tsl-border);
  border-radius: var(--ts-radius);
  padding: 40px 36px;
  box-shadow: 0 24px 60px -28px rgba(19, 33, 106, 0.28);
  animation: ts-panel-in 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ts-panel-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ts-fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* imagens antigas (fixas) desativadas no novo layout */
.ts-login-imagem_brand,
.ts-login-imagem_logo {
  display: none !important;
}

/* ---------- Títulos e textos ---------- */
.ts-login-texto_acesso {
  font-weight: 600;
  font-size: 24px;
  color: var(--tsl-text);
  margin: 0 0 6px;
  line-height: 1.25;
  letter-spacing: -0.3px;
}

.ts-login-subtitulo {
  font-size: 14px;
  color: var(--ts-muted);
  font-weight: 400;
  margin: 0 0 28px;
  line-height: 1.5;
}

.ts-login-texto_campos {
  color: var(--ts-muted) !important;
  font-weight: 500;
  font-size: 12px;
  line-height: 16px;
}

/* ---------- Formulário ---------- */
.ts-login-form {
  display: flex;
  flex-direction: column;
}

.ts-login-form-group {
  margin-bottom: 22px;
  position: relative;
}

/* label flutuante sobre a borda do input */
.ts-login-label {
  position: absolute;
  top: -8px;
  left: 12px;
  background: var(--ts-card);
  padding: 0 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ts-muted);
  z-index: 1;
  transition: color 0.2s ease;
  pointer-events: none;
}
.ts-login-form-group:focus-within .ts-login-label {
  color: var(--ts-primary);
}
.ts-login-label span { color: var(--ts-error) !important; }

.ts-login-inputs_login {
  padding: 14px 44px 14px 14px;
  border: 1.5px solid var(--tsl-border);
  border-radius: var(--ts-input-radius);
  width: 100%;
  font-size: 15px;
  color: var(--tsl-text);
  font-family: var(--ts-font);
  background: #fbfcfe;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  outline: none;
}
.ts-login-inputs_login::placeholder { color: #b4b9c9; }
.ts-login-inputs_login:hover { border-color: #ccd2e4; }
.ts-login-inputs_login:focus {
  border-color: var(--ts-primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(19, 33, 106, 0.10);
}

select.ts-login-inputs_login {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a90a2' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

/* ---------- Preview de senha ---------- */
.ts-login-password-preview {
  position: relative;
}
.ts-login-password-preview-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 18px;
  color: var(--ts-muted);
  transition: color 0.2s ease;
}
.ts-login-password-preview-toggle:hover { color: var(--ts-primary); }

/* ---------- Botão principal ---------- */
.ts-login-botao {
  position: relative;
  min-width: 100px;
  width: 100%;
  background: linear-gradient(135deg, var(--ts-primary) 0%, var(--ts-primary-light) 100%);
  color: #fff;
  padding: 14px;
  border: none;
  border-radius: var(--ts-input-radius);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--ts-font);
  letter-spacing: 0.2px;
  box-shadow: 0 12px 24px -10px rgba(19, 33, 106, 0.55);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.ts-login-botao:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px -10px rgba(19, 33, 106, 0.6);
  filter: brightness(1.06);
}
.ts-login-botao:active { transform: translateY(0); }

/* ---------- Link "esqueci minha senha" ---------- */
.ts-login-texto_senha {
  align-self: flex-end;
  color: var(--ts-primary) !important;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  margin: -6px 0 22px;
  transition: opacity 0.2s ease;
}
.ts-login-texto_senha:hover { opacity: 0.7; text-decoration: underline; }

/* ---------- Bloco "solicitar senha" ---------- */
.ts-login-solicitar_senha {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--tsl-border);
  text-align: center;
}
.ts-login-texto_solicitar {
  color: var(--ts-muted) !important;
  font-size: 13px;
  font-weight: 400;
  margin: 0 0 12px;
  line-height: 1.5;
}
.ts-login-botao_solicitar {
  background: rgba(19, 33, 106, 0.06);
  color: var(--ts-primary);
  padding: 11px 18px;
  border-radius: var(--ts-input-radius);
  text-decoration: none;
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--ts-font);
  transition: background 0.2s ease;
}
.ts-login-botao_solicitar:hover { background: rgba(19, 33, 106, 0.12); }

/* ---------- Botões secundários / voltar ---------- */
.ts-login-divBotao {
  margin-top: 8px;
  display: flex;
  gap: 12px;
}
.ts-login-divBotao .ts-login-botao { flex: 1; }

.ts-login-botao_solicitar_voltar {
  flex: 0 0 auto;
  min-width: 96px;
  padding: 14px 20px;
  border: 1.5px solid var(--tsl-border);
  border-radius: var(--ts-input-radius);
  background: #fff !important;
  color: var(--tsl-text);
  font-weight: 600;
  font-size: 14px;
  font-family: var(--ts-font);
  cursor: pointer;
  box-shadow: none;
  margin: 0;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.ts-login-botao_solicitar_voltar:hover {
  background: #f3f5fb !important;
  border-color: #ccd2e4;
}

/* ---------- Mensagens de erro ---------- */
.ts-login-texto_erro {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 13px;
  color: var(--ts-error);
  font-style: normal;
  background: rgba(230, 57, 70, 0.08);
  border: 1px solid rgba(230, 57, 70, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 18px;
}
.ts-login-texto_erro::before {
  content: "\F33A";
  font-family: "bootstrap-icons";
  font-size: 15px;
  flex-shrink: 0;
}

/* ---------- QR Code ---------- */
#qrcode {
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--tsl-border);
}
.ts-login-caixa_campos.gerar-qrcode { margin-top: 0 !important; }

/* ---------- Página de erro ---------- */
.ts-login-caixa_campos.pagina-erro { text-align: center; }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .ts-login-container { flex-direction: column; }
  .ts-login-brand-side { display: none; }
  .ts-login-form-side {
    flex: 1 1 100%;
    max-width: 100%;
    width: 100%;
  }
  .ts-login-mobile-logo { display: block; }
}

@media (max-width: 480px) {
  .ts-login-caixa_campos { padding: 32px 22px; border: none; box-shadow: none; }
  .ts-login-form-side { padding: 24px 16px; }
  .ts-login-texto_acesso { font-size: 18px; line-height: 1.3; }
  .ts-login-subtitulo { font-size: 13px; margin-bottom: 22px; }
}
