/* Link de acesso (/convite#token): a pessoa cria a própria senha. Aparece no lugar do cartão de entrada de login.html (o <head> liga
   html.cv). Dois lados: o painel escuro com a boas-vindas e o que ela vai poder fazer (a cor de tinta da plataforma, que já tem versão
   clara e escura) e o formulário, com a força da senha e os requisitos. Textos e cores saem dos tokens; nada solto. */

.cv-card { display: none; }
html.cv .lg-card { display: none; }
html.cv .cv-card { display: grid; }
html.cv body.lg { overflow-y: auto; align-content: center; }

.cv-card {
  position: relative; z-index: 1; width: 100%; max-width: 1072px; min-height: 576px; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  background: var(--surface); border: 1px solid var(--border); border-radius: 28px; overflow: hidden;
  box-shadow: 0 30px 70px rgba(15, 42, 61, .18), 0 2px 6px rgba(15, 42, 61, .06);
  animation: lgEntra .8s var(--ease) backwards;
}
.cv-card.saindo { animation: lgSai .45s var(--ease) forwards; }
.cv-card.erro { animation: lgTreme .45s ease; }

/* ── lado escuro: o logo em cima e a saudação grande embaixo, sem mais nada ── */
.cv-lado {
  position: relative; display: flex; flex-direction: column; padding: 38px 36px 34px; color: #fff;
  background:
    radial-gradient(120% 70% at 12% 0%, color-mix(in srgb, var(--ink-icon) 22%, transparent), transparent 62%),
    linear-gradient(165deg, var(--ink-2), var(--ink));
}
.cv-logo { width: 64px; height: 64px; object-fit: contain; align-self: flex-start; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .3)); animation: lgLogo .9s var(--ease) .15s backwards; }
.cv-lado h1 { margin-top: auto; font-size: var(--fs-4xl); line-height: 1; letter-spacing: -.035em; font-weight: 700; color: #fff; animation: lgSobe .6s var(--ease) .25s backwards; }
.cv-lado h1 span { display: block; }       /* "Bem-vindo(a)," e o nome, um embaixo do outro; a saudação desce para o pé do painel */

/* ── lado do formulário ── */
.cv-conteudo { display: flex; flex-direction: column; padding: 46px 48px 38px; min-width: 0; }
.cv-conteudo h2 { font-size: var(--fs-3xl); line-height: 1.1; letter-spacing: -.035em; font-weight: 700; animation: lgSobe .6s var(--ease) .2s backwards; }
.cv-sub { margin-top: 8px; font-size: var(--fs-md); color: var(--text-mut); animation: lgSobe .6s var(--ease) .27s backwards; }
.cv-form { flex: 1; display: flex; flex-direction: column; margin-top: 18px; }
.cv-form[hidden], .cv-sub[hidden] { display: none; }
.cv-campo { margin-bottom: 16px; animation: lgSobe .6s var(--ease) backwards; }
.cv-campo:nth-of-type(1) { animation-delay: .34s; }
.cv-campo:nth-of-type(2) { animation-delay: .41s; }
.cv-campo label { display: block; font-size: var(--fs-sm); font-weight: 700; margin-bottom: 7px; }
.cv-senha { position: relative; }
.cv-senha .cd-in { padding: 12px 46px 12px 16px; border-radius: 12px; letter-spacing: .12em; background: var(--surface-2); }
.cv-senha .cd-in:focus { background: var(--surface); }
.cv-olho { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: none; background: none; border-radius: 8px; cursor: pointer; color: var(--text-mut); display: grid; place-items: center; }
.cv-olho:hover { background: var(--surface-2); color: var(--text); }
.cv-olho svg { width: 18px; height: 18px; }

/* força da senha: quatro barras (só orientam; a regra é o requisito abaixo e a do servidor): âmbar = fraca ou média, verde = boa ou forte */
.cv-forca { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.cv-forca i { height: 6px; border-radius: 999px; background: var(--surface-3); transition: background .3s var(--ease); }
.cv-forca[data-n="1"] i:nth-child(-n+1), .cv-forca[data-n="2"] i:nth-child(-n+2) { background: var(--warn-fill); }
.cv-forca[data-n="3"] i:nth-child(-n+3), .cv-forca[data-n="4"] i { background: var(--ok-fill); }
.cv-reqs { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.cv-forca-dica { display: block; margin-top: 8px; font-size: var(--fs-xs); color: var(--text-mut); }
.cv-reqs li { display: flex; align-items: center; gap: 9px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-mut); transition: color .25s; }
.cv-reqs li b { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); transition: background .25s, border-color .25s; }
.cv-reqs li.ok { color: var(--ok); }
.cv-reqs li.ok b { background: var(--ok-fill); border-color: var(--ok-fill); }
.cv-caps { display: block; margin-top: 8px; color: var(--warn); font-size: var(--fs-sm); font-weight: 600; }
.cv-dica { display: block; margin-top: 6px; color: var(--danger); font-size: var(--fs-sm); font-weight: 600; }
.cv-caps[hidden], .cv-dica[hidden], .lg-erro[hidden] { display: none; }

.cv-lembrar { display: flex; align-items: center; gap: 9px; font-size: var(--fs-sm); color: var(--text-dim); margin: 0 0 18px; cursor: pointer; }
.cv-lembrar input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.cv-ok { width: 100%; margin-top: auto; padding: 14px 16px; border-radius: 12px; font-size: var(--fs-lg); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; animation: lgSobe .6s var(--ease) .5s backwards; }
.cv-ok:disabled { opacity: .55; cursor: not-allowed; }
.cv-ok:disabled.carregando { opacity: .8; cursor: progress; }
.cv-ok svg { width: 18px; height: 18px; }
/* a senha foi salva: o botão vira verde (concluído) antes de entrar no sistema */
.cv-ok.salvo, .cv-ok.salvo:disabled { opacity: 1; cursor: default; background: var(--ok-fill); border-color: var(--ok-fill); color: #fff; }
.cv-rodape { text-align: center; margin-top: 14px; font-size: var(--fs-xs); color: var(--text-mut); }
.cv-rodape a { color: var(--accent-strong); font-weight: 600; }

/* link que não vale: some o formulário e fica só o aviso */
.cv-card.sem-link .cv-conteudo h2 { font-size: var(--fs-xl); }
.cv-card.sem-link .lg-erro { margin-top: 18px; }

@media (max-width: 820px) {
  .cv-card { grid-template-columns: 1fr; max-width: 520px; min-height: 0; border-radius: 22px; }
  .cv-lado { padding: 26px 26px 22px; }
  .cv-logo { width: 48px; height: 48px; }
  .cv-lado h1 { margin-top: 14px; }
  html.cv body.lg { padding: 64px 16px 120px; }                  /* folga para o botão de tema (em cima) e o rodapé fixo com o Ajuda (embaixo) */
  .cv-conteudo { padding: 28px 26px 26px; }
  .cv-ok { margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) { .cv-card, .cv-card * { animation: none !important; transition: none !important; } }
