/* Telas de autenticação (login, esqueci/redefinir/trocar senha).
   Layout em dois painéis: institucional (azul marinho) + formulário.
   Independente do style.css do resto da intranet. */

:root {
  --navy: #0f172a;
  --navy-2: #111c3a;
  --amarelo: #FABE27;          /* amarelo do símbolo da marca Artvel */
  --texto: #0f172a;
  --muted: #64748b;
  --borda: #cbd5e1;
  --erro: #b91c1c;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body.auth {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--texto);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

.auth-layout {
  display: grid;
  grid-template-columns: 55fr 45fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Painel institucional ---------- */
.auth-marca {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: clamp(32px, 7vh, 80px) clamp(32px, 5vw, 84px);
  color: #fff;
  background:
    radial-gradient(900px 520px at 10% -6%, rgba(99, 130, 255, .16), transparent 62%),
    radial-gradient(820px 640px at 105% 104%, rgba(64, 98, 220, .20), transparent 62%),
    linear-gradient(160deg, #0f172a 0%, #111c3a 55%, #0b1226 100%);
}
.auth-arte { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.auth-marca-topo, .auth-empresas { position: relative; z-index: 1; }

.auth-logo-grupo { display: block; width: min(440px, 100%); height: auto; }

.auth-boas-vindas { margin-top: clamp(28px, 7vh, 72px); max-width: 430px; }
.auth-boas-vindas::before {
  content: "";
  display: block;
  width: 52px; height: 4px;
  margin-bottom: 18px;
  background: var(--amarelo);
  border-radius: 2px;
  transform: skewX(-24deg);
}
.auth-boas-vindas h2 {
  margin: 0 0 12px;
  font-size: clamp(26px, 2.5vw, 36px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.01em;
}
.auth-boas-vindas p { margin: 0; font-size: 16.5px; line-height: 1.55; color: #cbd5e1; }

.auth-empresas-titulo {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #94a3b8;
}
.auth-empresas-grade {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 36px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.auth-empresas-grade li { display: flex; align-items: center; height: 76px; }
.auth-empresas-grade img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  transition: transform .2s ease;
}
.auth-empresas-grade li:hover img { transform: translateY(-2px); }

/* ---------- Painel do formulário ---------- */
.auth-painel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px clamp(20px, 4vw, 56px);
  background: #f8fafc;
}
.auth-cartao {
  width: 100%;
  max-width: 424px;
  padding: 40px 36px 32px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 14px 34px rgba(15, 23, 42, .08);
}
.auth-cartao h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.2; letter-spacing: -.01em; }
.auth-sub { margin: 0 0 22px; font-size: 14.5px; line-height: 1.5; color: var(--muted); }

.auth-campo { margin-bottom: 16px; }
.auth-cartao label:not(.auth-check) {
  display: block; margin-bottom: 6px;
  font-size: 13.5px; font-weight: 600; color: #1e293b;
}
.auth-cartao input[type="text"],
.auth-cartao input[type="email"],
.auth-cartao input[type="password"] {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font: inherit;
  font-size: 16px;               /* 16px evita o zoom automático do iPhone */
  color: var(--texto);
  background: #fff;
  border: 1.5px solid var(--borda);
  border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-cartao input:hover { border-color: #94a3b8; }
.auth-cartao input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 4px rgba(250, 190, 39, .40);
}
.auth-cartao input::placeholder { color: #94a3b8; }

.auth-input-senha { position: relative; }
.auth-input-senha input { padding-right: 50px !important; }
.auth-olho {
  position: absolute; right: 4px; top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; border-radius: 8px;
  background: transparent; color: var(--muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.auth-olho[hidden] { display: none; }
.auth-olho:hover { background: #f1f5f9; color: var(--navy); }
.auth-olho:focus-visible { outline: 2px solid var(--navy); outline-offset: 1px; }
.auth-olho .ico-ocultar { display: none; }
.auth-olho[aria-pressed="true"] .ico-mostrar { display: none; }
.auth-olho[aria-pressed="true"] .ico-ocultar { display: block; }

/* Checkbox "Lembrar meu CPF" */
.auth-check {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  margin: 2px 0 6px;
  font-size: 14px; color: #334155;
  cursor: pointer; user-select: none;
}
.auth-check input {
  position: absolute; opacity: 0;
  width: 20px; height: 20px; margin: 0;
  cursor: pointer;
  z-index: 1;
}
.auth-check-caixa {
  flex: none;
  width: 20px; height: 20px;
  border: 1.5px solid var(--borda);
  border-radius: 6px;
  background: #fff;
  display: grid; place-items: center;
  pointer-events: none;          /* o clique vai direto para o <input> invisível por cima */
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.auth-check-caixa::after {
  content: "";
  width: 5px; height: 10px;
  margin-top: -2px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform .15s ease;
}
.auth-check:hover .auth-check-caixa { border-color: #94a3b8; }
.auth-check input:checked + .auth-check-caixa { background: var(--navy); border-color: var(--navy); }
.auth-check input:checked + .auth-check-caixa::after { transform: rotate(45deg) scale(1); }
.auth-check input:focus-visible + .auth-check-caixa { box-shadow: 0 0 0 4px rgba(250, 190, 39, .45); border-color: var(--navy); }

/* Mensagens */
.auth-msg { margin: 14px 0 0; padding: 10px 14px; font-size: 13.5px; line-height: 1.45; border-radius: 10px; }
.auth-msg.erro { color: var(--erro); background: #fef2f2; border: 1px solid #fecaca; }
.auth-msg.ok { color: #065f46; background: #ecfdf5; border: 1px solid #a7f3d0; }

/* Botão principal */
.auth-botao {
  width: 100%; height: 48px;
  margin-top: 18px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 10px;
  font: inherit; font-size: 16px; font-weight: 600;
  color: #fff; background: var(--navy);
  box-shadow: inset 0 -3px 0 var(--amarelo);
  cursor: pointer;
  transition: background .2s ease, box-shadow .2s ease, transform .15s ease;
}
.auth-botao:hover {
  background: #1e293b;
  transform: translateY(-1px);
  box-shadow: inset 0 -3px 0 var(--amarelo), 0 10px 22px rgba(15, 23, 42, .25);
}
.auth-botao:active { transform: none; }
.auth-botao:focus-visible { outline: none; box-shadow: inset 0 -3px 0 var(--amarelo), 0 0 0 4px rgba(250, 190, 39, .55); }
.auth-botao.is-loading { cursor: progress; background: #1e293b; transform: none; }
.auth-spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-gira .7s linear infinite;
}
.auth-botao.is-loading .auth-spinner { display: block; }

/* Links */
.auth-links, .auth-ajuda { margin: 0; text-align: center; }
.auth-links { margin-top: 20px; }
.auth-ajuda { margin-top: 10px; font-size: 13.5px; color: var(--muted); }
.auth-cartao a {
  color: var(--navy); font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--amarelo);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  border-radius: 3px;
}
.auth-cartao a:hover { text-decoration-color: var(--navy); }
.auth-cartao a:focus-visible { outline: 3px solid rgba(250, 190, 39, .7); outline-offset: 2px; }

.auth-rodape { max-width: 424px; margin: 22px 0 0; text-align: center; font-size: 12.5px; line-height: 1.5; color: #94a3b8; }

/* ---------- Animações suaves ---------- */
@keyframes auth-gira { to { transform: rotate(360deg); } }
@keyframes auth-subir { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes auth-aparecer { from { opacity: 0; } to { opacity: 1; } }
.auth-cartao { animation: auth-subir .5s ease both; }
.auth-marca-topo { animation: auth-aparecer .8s ease both; }
.auth-empresas-grade li { animation: auth-subir .6s ease both; }
.auth-empresas-grade li:nth-child(1) { animation-delay: .15s; }
.auth-empresas-grade li:nth-child(2) { animation-delay: .25s; }
.auth-empresas-grade li:nth-child(3) { animation-delay: .35s; }
.auth-empresas-grade li:nth-child(4) { animation-delay: .45s; }

/* Depois de enviar o formulário (ex.: senha errada) a página volta pronta, sem refazer a entrada animada. */
.sem-animacao :not(.auth-spinner), .sem-animacao :not(.auth-spinner)::before, .sem-animacao :not(.auth-spinner)::after { animation: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Tablet / janelas estreitas ---------- */
@media (max-width: 1023.98px) {
  .auth-arte-selo { display: none; }
  .auth-layout { grid-template-columns: 1fr 1fr; }
  .auth-marca { padding: 36px 28px; }
  .auth-empresas-grade { gap: 12px 20px; }
  .auth-empresas-grade li { height: 56px; }
  .auth-cartao { padding: 32px 26px 26px; }
}

/* ---------- Celular: o painel institucional vira uma faixa só com o logo ---------- */
@media (max-width: 767.98px) {
  .auth-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-marca { padding: 22px 24px; gap: 0; align-items: center; }
  .auth-marca-topo { width: 100%; display: flex; justify-content: center; }
  .auth-logo-grupo { width: min(250px, 72%); }
  .auth-boas-vindas, .auth-empresas { display: none; }
  .auth-arte { opacity: .75; }
  .auth-painel { justify-content: flex-start; padding: 24px 16px 32px; }
  .auth-cartao { padding: 28px 22px 24px; border-radius: 16px; }
  .auth-cartao h1 { font-size: 23px; }
}
