/* Só no site (aspiratrader): janela de acesso, estado do salvamento, faixa do banco D1 e Perfil.
   Usa os mesmos tokens de cor e fonte de public/app.css. */

/* ---------- janela de acesso ---------- */
/* as partes da janela trocam com o atributo hidden; o display: grid das classes não pode passar por cima dele */
dialog.login [hidden], dialog.confirmacao [hidden] { display: none !important; }
dialog.login { border: 1px solid var(--linha); border-radius: 18px; padding: 26px 24px; width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; background: var(--superficie); color: var(--tinta); box-shadow: var(--sombra); }
dialog.login::backdrop, dialog.confirmacao::backdrop { background: rgba(8, 9, 24, 0.72); backdrop-filter: blur(3px); }
.lg-cabeca, .boas-vindas { text-align: center; display: grid; gap: 6px; justify-items: center; margin-bottom: 14px; }
.lg-logo { display: block; }
.lg-cabeca h2, .boas-vindas h2 { font-family: var(--fonte-titulo); font-size: 1.4rem; font-weight: 600; letter-spacing: -0.01em; }
.boas-vindas { text-align: left; justify-items: stretch; }
.boas-vindas .lg-logo { justify-self: center; }
.boas-vindas h2 { text-align: center; }
.bv-passos { display: grid; gap: 8px; padding-left: 20px; color: var(--tinta-2); margin: 6px 0; }
.login-abas { display: flex; width: 100%; margin-bottom: 14px; }
.login-abas button { flex: 1; }
.login-form { display: grid; gap: 12px; }
.login-form .campo, dialog.confirmacao .campo { display: grid; gap: 5px; font-weight: 600; }
.login-form input, dialog.confirmacao input, .bloco label.campo input { width: 100%; font-weight: 400; }
.botao.largo { width: 100%; justify-content: center; min-height: 42px; }
.botao-texto { background: none; border: 0; color: var(--acao); font: inherit; font-weight: 600; cursor: pointer; padding: 6px; justify-self: center; text-decoration: underline; text-underline-offset: 3px; }
.botao-texto:hover { color: var(--acao-forte, var(--acao)); }
.erro-login { color: var(--perda); font-weight: 600; min-height: 1.2em; margin-top: 8px; }
.erro-login:empty { display: none; }
.qr { justify-self: center; background: #fff; padding: 10px; border-radius: 10px; min-height: 40px; }
.qr img, .qr canvas { display: block; }
.chave-totp, .codigo-rec { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; text-align: center; letter-spacing: 0.08em; font-weight: 700; overflow-wrap: anywhere; }
.codigo-rec { font-size: 1.35rem; padding: 12px; border: 1px dashed var(--linha-forte); border-radius: 10px; background: var(--superficie-2); }
dialog.confirmacao .login-form h2 { margin: 0; }

/* ---------- rodapé do menu: conta, salvamento e banco D1 ---------- */
#nuvem-estado { display: grid; gap: 2px; }
.nuvem-conta { display: inline-flex; align-items: center; gap: 6px; color: var(--trilho-tinta, var(--tinta)); font-weight: 600; text-decoration: none; }
.nuvem-conta:hover { text-decoration: underline; }
.nuvem-erro { color: var(--perda); }
.faixa-d1 { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 0 6px; font-size: 0.74rem; color: var(--trilho-tinta-2, var(--tinta-2)); text-decoration: none; text-transform: uppercase; letter-spacing: 0.06em; }
.faixa-d1 strong { color: var(--trilho-tinta, var(--tinta)); font-weight: 700; }
.faixa-d1-barra { display: block; width: 64px; height: 5px; border-radius: 99px; background: var(--superficie-2); overflow: hidden; }
.faixa-d1-barra i { display: block; height: 100%; border-radius: 99px; }
.faixa-d1-barra i.ciano { background: var(--neon-ciano); }
.faixa-d1-barra i.laranja { background: var(--neon-laranja); }
.faixa-d1-barra i.rosa { background: var(--perda); }
.faixa-d1 .etiqueta { text-transform: none; letter-spacing: 0; }

/* ---------- Perfil ---------- */
.progresso-valor.laranja { background: linear-gradient(90deg, var(--neon-laranja), var(--neon-rosa)); }
.medidores-d1 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px 24px; }
.bloco label.campo { display: grid; gap: 5px; font-weight: 600; }
.bloco input[type="file"] { font-weight: 400; max-width: 100%; }

/* telas menores: o menu vira uma barra no alto; a faixa do D1 fica só no Perfil (Consumo do D1) */
@media (max-width: 900px) {
  #faixa-d1 { display: none; }
}
