/*
 * Login (/login) e cadastro (/cadastro) do MeuPMS, no visual do site do produto.
 * Prefixo lg-; todas as regras ficam no escopo .lg.lg-pms (o contêiner tem as classes "lg lg-pms").
 * Paleta e regras vindas do site MeuPMS (meupms.github.io/assets/css/style.css; ver docs/MARCA.md).
 * Sem fonte externa: usa a pilha de fontes do sistema. A tela é sempre clara, mesmo com tema escuro do sistema.
 * Mobile first: a base vale para celular (<900px); a grade desktop entra no min-width 900px.
 */

/* Contêiner da tela */
.lg.lg-pms {
  position: fixed; inset: 0; z-index: 1300;
  height: 100vh; height: 100dvh;
  display: grid; grid-template-columns: 1fr;
  overflow-x: hidden; overflow-y: auto;
  background: #f8fafc; color: #0f172a;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
  /* o tema do sistema pode ser escuro: aqui os componentes Mud usam estas cores fixas claras */
  --mud-palette-primary: #0369a1; --mud-palette-primary-darken: #075985;
  --mud-palette-text-primary: #0f172a; --mud-palette-text-secondary: #475569;
  --mud-palette-lines-inputs: #cbd5e1; --mud-palette-divider: #e2e8f0;
  --mud-palette-surface: #fff; --mud-palette-background: #f8fafc; --mud-palette-error: #dc2626;
}
.lg.lg-pms, .lg.lg-pms *, .lg.lg-pms *::before, .lg.lg-pms *::after { box-sizing: border-box; }
.lg.lg-pms { padding-bottom: env(safe-area-inset-bottom); }

/* Hero (faixa da marca) */
.lg.lg-pms .lg-hero {
  position: relative; min-height: 150px; padding: 20px 20px 18px;
  background: #111827;
  color: #fff; display: flex; align-items: flex-end; overflow: hidden;
  isolation: isolate;
}
/* Fundo em movimento: manchas suaves em tons neutros, com um toque da marca */
.lg.lg-pms .lg-hero::after {
  content: ""; position: absolute; inset: -20%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(38% 42% at 20% 30%, rgba(56,189,248,.22), transparent 70%),
    radial-gradient(34% 38% at 80% 70%, rgba(226,50,54,.16), transparent 70%),
    radial-gradient(30% 34% at 60% 10%, rgba(148,163,184,.18), transparent 70%);
  animation: lg-drift 16s ease-in-out infinite alternate;
}
.lg.lg-pms .lg-hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%);
          mask-image: linear-gradient(to bottom, #000, transparent 85%);
  animation: lg-pontilhado 40s linear infinite;
}
@keyframes lg-drift {
  0%   { transform: translate3d(-4%, -2%, 0) scale(1); }
  50%  { transform: translate3d(3%, 4%, 0) scale(1.08); }
  100% { transform: translate3d(-2%, 3%, 0) scale(1.03); }
}
@keyframes lg-pontilhado {
  from { background-position: 0 0; }
  to   { background-position: 22px 22px; }
}
@keyframes lg-sobe {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@keyframes lg-pisca {
  0%, 100% { box-shadow: 0 0 0 0 rgba(56,189,248,.6); }
  50%      { box-shadow: 0 0 0 6px rgba(56,189,248,0); }
}
.lg.lg-pms .lg-hero-in { position: relative; z-index: 2; width: 100%; padding: 0; }
.lg.lg-pms .lg-logo {
  position: absolute; z-index: 2; top: 20px; left: 20px;
  height: auto; width: auto; max-height: 36px; filter: none;
  display: inline-flex; align-items: center;
}
.lg.lg-pms .lg-hero h1 {
  margin: 0 0 6px; color: #fff;
  font-family: inherit; font-weight: 800;
  font-size: clamp(26px, 4.4vw, 42px); line-height: 1.08;
  letter-spacing: -.02em; text-transform: none;
}
.lg.lg-pms .lg-hero p { display: none; margin: 0; color: #fff; opacity: .92; font-size: 18px; line-height: 1.5; max-width: 30em; }
.lg.lg-pms .lg-pontos {
  display: none; list-style: none; margin: 16px 0 0; padding: 0;
  flex-wrap: wrap; gap: 10px 22px; font-size: 14px; color: #fff;
}
.lg.lg-pms .lg-pontos li { display: inline-flex; align-items: center; gap: 8px; }
.lg.lg-pms .lg-pontos li::before {
  content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #38bdf8;
}

/* Área do formulário */
.lg.lg-pms .lg-side {
  display: flex; flex-direction: column; justify-content: center;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  background: #f8fafc; min-width: 0;
}
.lg.lg-pms .lg-card {
  width: 100%; max-width: none; margin: 0 auto;
  padding: 20px; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 18px;
  box-shadow: 0 1px 2px rgba(15,23,42,.05), 0 8px 24px rgba(15,23,42,.06);
  animation: lg-pms-in .5s ease-out;
}
.lg.lg-pms .lg-card:has(.lg-form-grid) { max-width: 780px; }
/* Entrada em sequência na faixa da marca */
.lg.lg-pms .lg-hero-in h1 { animation: lg-sobe .7s ease-out both; }
.lg.lg-pms .lg-hero-in p { animation: lg-sobe .7s .12s ease-out both; }
.lg.lg-pms .lg-pontos li { animation: lg-sobe .6s ease-out both; }
.lg.lg-pms .lg-pontos li:nth-child(1) { animation-delay: .25s; }
.lg.lg-pms .lg-pontos li:nth-child(2) { animation-delay: .35s; }
.lg.lg-pms .lg-pontos li:nth-child(3) { animation-delay: .45s; }
.lg.lg-pms .lg-pontos li::before { animation: lg-pisca 2.4s ease-out infinite; }
.lg.lg-pms .lg-form-grid > .lg-field { animation: lg-sobe .5s ease-out both; }
.lg.lg-pms .lg-form-grid > .lg-field:nth-child(odd) { animation-delay: .05s; }
.lg.lg-pms .lg-form-grid > .lg-field:nth-child(even) { animation-delay: .12s; }
/* Botão principal: brilho que passa ao passar o mouse */
.lg.lg-pms .mud-button-filled { position: relative; overflow: hidden; }
.lg.lg-pms .mud-button-filled::after {
  content: ""; position: absolute; top: 0; left: -75%; width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg); transition: left .6s ease;
}
.lg.lg-pms .mud-button-filled:hover::after { left: 125%; }
@keyframes lg-pms-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.lg.lg-pms .lg-kick {
  display: inline-block; margin: 0 0 8px; padding-bottom: 4px;
  font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: #0369a1; border-bottom: 2px solid #e23236; /* vermelho da marca só em detalhe */
}
.lg.lg-pms .lg-card h2 {
  margin: 0 0 4px; color: #0f172a;
  font-family: inherit; font-weight: 700; font-size: 28px; line-height: 1.15; letter-spacing: -.01em;
}
.lg.lg-pms .lg-sub { margin: 0 0 22px; color: #475569; font-size: 15px; line-height: 1.5; }

.lg.lg-pms .lg-ok {
  margin: 0 0 16px; padding: 12px 14px;
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px;
  color: #166534; font-size: 14px; line-height: 1.5;
}

/* Separador "ou" */
.lg.lg-pms .lg-sep {
  display: flex; align-items: center; gap: 12px; margin: 20px 0;
  color: #64748b; font-size: 13px;
}
.lg.lg-pms .lg-sep::before, .lg.lg-pms .lg-sep::after {
  content: ""; flex: 1 1 auto; height: 1px; background: #e2e8f0;
}

/* Botões (Mud) */
.lg.lg-pms .mud-button-root {
  min-height: 48px; padding: 11px 24px; border-radius: 10px;
  text-transform: none; letter-spacing: .01em; font-weight: 600;
  width: 100%;
  transition: transform .15s, box-shadow .15s, background-color .15s;
}
.lg.lg-pms .mud-button-filled {
  background: linear-gradient(135deg, #0369a1, #4f46e5); color: #fff;
  font-weight: 700; border: 0;
}
.lg.lg-pms .mud-button-filled:hover {
  background: linear-gradient(135deg, #0369a1, #4f46e5); color: #fff;
  transform: translateY(-2px); box-shadow: 0 8px 20px rgba(3,105,161,.28);
}
.lg.lg-pms .mud-button-filled:disabled,
.lg.lg-pms .mud-button-filled.mud-disabled {
  background: #cbd5e1; color: #64748b; transform: none; box-shadow: none;
}
.lg.lg-pms .mud-button-outlined {
  background: transparent; color: #0369a1; border: 1px solid #0369a1; font-weight: 600;
}
.lg.lg-pms .mud-button-outlined:hover { background-color: rgba(3,105,161,.06); }
.lg.lg-pms .lg-back { display: flex; justify-content: center; margin-top: 18px; }
.lg.lg-pms .lg-back .mud-button-root { color: #0369a1; font-weight: 600; width: auto; }
.lg.lg-pms .mud-button-root:focus-visible,
.lg.lg-pms a:focus-visible {
  outline: 2px solid #0369a1; outline-offset: 2px;
}
.lg.lg-pms .lg-btn-row { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }

/* Campos (outlined do Mud): raio 10px, altura mínima 48px, fonte 16px (evita zoom no iOS) */
.lg.lg-pms .mud-input-outlined { min-height: 48px; border-radius: 10px; }
.lg.lg-pms .mud-input-outlined-border { border: 1px solid #cbd5e1; border-radius: 10px; }
.lg.lg-pms .mud-input-control:focus-within .mud-input-outlined-border {
  border-color: #0369a1; outline: 2px solid #0369a1; outline-offset: 2px;
}
.lg.lg-pms .mud-input-slot,
.lg.lg-pms .mud-input-root,
.lg.lg-pms .mud-select input,
.lg.lg-pms input,
.lg.lg-pms select { font-size: 16px; }
.lg.lg-pms .mud-select { min-height: 48px; }

.lg.lg-pms .lg-form-grid { display: grid; grid-template-columns: 1fr; gap: 14px 16px; }
.lg.lg-pms .lg-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lg.lg-pms .lg-field.full { grid-column: 1 / -1; }
.lg.lg-pms .lg-field > label {
  color: #0f172a; font-size: 14px; font-weight: 600; line-height: 1.3;
}

/* Telefone com prefixo +55 */
.lg.lg-pms .lg-tel { display: flex; align-items: stretch; gap: 8px; }
.lg.lg-pms .lg-tel > span,
.lg.lg-pms .lg-tel .lg-ddi {
  display: inline-flex; align-items: center; flex: none;
  min-height: 48px; padding: 0 12px;
  border: 1px solid #cbd5e1; border-radius: 10px; background: #f8fafc;
  color: #475569; font-size: 16px; font-weight: 600;
}
.lg.lg-pms .lg-tel .mud-input-control { flex: 1 1 auto; min-width: 0; }

/* Campo-armadilha anti-robô: fora da tela */
.lg.lg-pms .lg-hp {
  position: absolute; left: -9999px; height: 0; width: 0; overflow: hidden;
  pointer-events: none;
}

/* Caixa do anti-robô (Turnstile), centralizada */
.lg.lg-pms .lg-turnstile {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  min-height: 65px; margin: 6px 0;
}

/* Aceite de termos */
.lg.lg-pms .lg-consent {
  display: flex; align-items: flex-start; gap: 8px; margin-top: 8px;
  color: #475569; font-size: 14px; line-height: 1.5;
}
.lg.lg-pms .lg-consent a { color: #0369a1; font-weight: 600; }

/* Desktop */
@media (min-width: 900px) {
  .lg.lg-pms {
    grid-template-columns: .8fr 1.2fr; overflow: hidden;
  }
  .lg.lg-pms .lg-hero { min-height: 100vh; padding: 0; }
  .lg.lg-pms .lg-hero-in { padding: 0 56px 64px; }
  .lg.lg-pms .lg-logo { top: 32px; left: 56px; max-height: 42px; }
  .lg.lg-pms .lg-hero p { display: block; }
  .lg.lg-pms .lg-pontos { display: flex; }
  .lg.lg-pms .lg-side { padding: 40px 56px; overflow: auto; }
  .lg.lg-pms .lg-card { padding: 28px; }
  .lg.lg-pms .lg-form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 20px; }
  .lg.lg-pms .lg-card:has(.lg-form-grid) { padding: 32px; }
  .lg.lg-pms .lg-btn-row { flex-direction: row; align-items: center; }
  .lg.lg-pms .lg-btn-row .mud-button-root { width: auto; }
  .lg.lg-pms .lg-back .mud-button-root { width: auto; }
}

/* Sem animações e transições para quem pede menos movimento */
@media (prefers-reduced-motion: reduce) {
  .lg.lg-pms,
  .lg.lg-pms *,
  .lg.lg-pms *::before,
  .lg.lg-pms *::after {
    animation: none !important; transition: none !important;
  }
}
