/* componentes.css
   Botoes, selos, faixa de atualizacao, janelas, avisos e carregamento.
   Na etapa 4 esta lista cresce (cartoes, campos, esqueleto...). */

/* Botoes */
.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--e2);
  min-height: 44px;
  padding: 0 var(--e5);
  border-radius: var(--raio-botao);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform var(--rapido) ease, box-shadow var(--rapido) ease, background var(--rapido) ease;
  text-decoration: none;
}

.botao:active {
  transform: scale(0.97);
}

.botao-principal {
  background: var(--degrade);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(225, 65, 1, 0.25);
}

.botao-principal:hover {
  box-shadow: 0 6px 20px rgba(225, 65, 1, 0.32);
}

.botao-secundario {
  background: #FFFFFF;
  color: var(--texto);
  border-color: var(--borda);
}

.botao-secundario:hover {
  border-color: #D2D2D8;
  background: var(--fundo-bloco);
}

.botao-pequeno {
  min-height: 36px;
  padding: 0 var(--e4);
  font-size: 14px;
}

@media (max-width: 767px) {
  .botao {
    min-height: 48px;
  }
  .botao-pequeno {
    min-height: 40px;
  }
}

/* Selos */
.selo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--fundo-separacao);
  color: var(--texto-suave);
  white-space: nowrap;
}

.selo-laranja {
  background: var(--laranja-suave);
  color: var(--laranja-escuro);
}

.selo img {
  width: 14px;
  height: 14px;
}

/* Ponto de status */
.ponto {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--texto-fraco);
}

.ponto-verde {
  background: var(--verde);
}

.ponto-ambar {
  background: var(--ambar);
}

/* Estrela da marca girando (carregamento) */
.estrela-girando {
  width: 56px;
  height: 56px;
  animation: estrela-gira 1.4s cubic-bezier(0.6, 0, 0.4, 1) infinite;
}

@keyframes estrela-gira {
  0% { transform: rotate(0deg) scale(1); opacity: 1; }
  50% { transform: rotate(180deg) scale(0.82); opacity: 0.8; }
  100% { transform: rotate(360deg) scale(1); opacity: 1; }
}

/* Tela cheia de atualizacao */
.tela-atualizando {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--e4);
  padding: var(--e5);
  background: rgba(255, 255, 255, 0.97);
  text-align: center;
  animation: aparecer var(--medio) ease;
}

.tela-atualizando strong {
  font-family: var(--fonte-titulo);
  font-size: 18px;
}

.tela-atualizando span {
  color: var(--texto-suave);
  font-size: 14px;
}

/* Faixa de nova versao */
.faixa-atualizacao {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--e3);
  padding: calc(var(--e3) + var(--seguro-topo)) var(--e4) var(--e3);
  background: var(--laranja-suave);
  border-bottom: 1px solid var(--laranja-borda);
  color: var(--texto);
  font-size: 14px;
  animation: descer var(--medio) ease;
}

.faixa-atualizacao img {
  width: 18px;
  height: 18px;
}

.faixa-atualizacao p {
  margin: 0;
}

.faixa-atualizacao strong {
  color: var(--laranja-escuro);
}

/* Janela (modal) */
.fundo-janela {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--e4);
  background: rgba(26, 26, 25, 0.35);
  animation: aparecer var(--medio) ease;
}

.janela {
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  overflow: auto;
  padding: var(--e5);
  background: #FFFFFF;
  border-radius: var(--raio);
  box-shadow: var(--sombra-forte);
  animation: subir var(--medio) ease;
}

.janela-topo {
  display: flex;
  align-items: center;
  gap: var(--e3);
  margin-bottom: var(--e4);
}

.janela-topo img {
  width: 28px;
  height: 28px;
}

.janela-topo h2 {
  margin: 0;
  font-size: 20px;
}

.janela ul {
  margin: 0 0 var(--e5);
  padding-left: 20px;
  color: var(--texto-suave);
}

.janela li + li {
  margin-top: var(--e2);
}

.janela .botao {
  width: 100%;
}

@media (max-width: 767px) {
  .fundo-janela {
    align-items: flex-end;
    padding: 0;
  }
  .janela {
    max-width: none;
    border-radius: 20px 20px 0 0;
    padding-bottom: calc(var(--e5) + var(--seguro-baixo));
  }
}

/* Aviso rapido (toast) */
.aviso {
  position: fixed;
  left: 50%;
  bottom: calc(var(--e5) + var(--seguro-baixo));
  z-index: 960;
  max-width: calc(100% - 32px);
  padding: var(--e3) var(--e4);
  border-radius: var(--raio-pequeno);
  background: var(--texto);
  color: #FFFFFF;
  font-size: 14px;
  box-shadow: var(--sombra-forte);
  transform: translateX(-50%);
  animation: aviso-subir var(--medio) ease;
}

/* Animacoes comuns */
@keyframes aparecer {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes subir {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes aviso-subir {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes descer {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

/* Etapa 3: botao do Google, perigo, mensagens, avatar e carregamento inicial */
.botao-google {
  min-height: 52px;
  padding: 0 var(--e6);
  background: #FFFFFF;
  color: var(--texto);
  border-color: var(--borda);
  box-shadow: var(--sombra);
  font-size: 16px;
}

.botao-google:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--sombra-forte);
}

.botao-google:disabled {
  cursor: default;
  opacity: 0.85;
}

.botao-perigo {
  background: var(--vermelho);
  color: #FFFFFF;
}

.botao-perigo-texto {
  background: transparent;
  color: var(--vermelho);
  border-color: transparent;
}

.botao-perigo-texto:hover {
  background: var(--vermelho-suave);
}

.botao:disabled {
  opacity: 0.6;
  cursor: default;
}

.estrela-pequena {
  width: 20px;
  height: 20px;
}

.mensagem {
  width: 100%;
  margin: 0;
  padding: var(--e3) var(--e4);
  border-radius: var(--raio-pequeno);
  font-size: 14px;
  text-align: center;
}

.mensagem-erro {
  background: var(--vermelho-suave);
  color: var(--vermelho);
}

.mensagem-aviso {
  background: var(--ambar-suave);
  color: #92400E;
}

.mensagem-info {
  background: var(--laranja-suave);
  color: var(--texto);
}

.selo-super {
  background: var(--degrade);
  color: #FFFFFF;
}

.avatar {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--laranja-suave);
  color: var(--laranja-escuro);
  font-weight: 700;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-grande {
  width: 64px;
  height: 64px;
  font-size: 22px;
}

.janela-texto {
  color: var(--texto-suave);
  margin-bottom: var(--e5);
}

.janela-acoes {
  display: flex;
  gap: var(--e3);
}

.janela-acoes .botao {
  flex: 1;
}

.carregando-inicial {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--e3);
  color: var(--texto-suave);
  font-size: 14px;
}

/* Guarda de carregamento (nucleo/guarda.js) */
.guarda {
  padding: var(--e5);
  text-align: center;
}

.guarda strong {
  font-family: var(--fonte-titulo);
  font-size: 18px;
  color: var(--texto);
}

.guarda-estrela {
  width: 48px;
  height: 48px;
}

.guarda-detalhe {
  max-width: 420px;
  color: var(--texto-fraco);
  font-size: 12px;
  word-break: break-word;
}

/* Faixa de conexao (componentes/faixa-conexao.js) */
.faixa-conexao {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 880;
  padding: calc(var(--e2) + var(--seguro-topo)) var(--e4) var(--e2);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  animation: descer var(--medio) ease;
}

.faixa-conexao-off {
  background: var(--ambar-suave);
  color: #92400E;
}

.faixa-conexao-enviando {
  background: var(--laranja-suave);
  color: var(--laranja-escuro);
}

.faixa-conexao-ok {
  background: var(--verde-suave);
  color: var(--verde);
}

.selo-pendente {
  background: var(--ambar-suave);
  color: #92400E;
}

/* Campo de texto */
.campo {
  width: 100%;
  min-height: 44px;
  padding: 0 var(--e4);
  border: 1px solid var(--borda);
  border-radius: var(--raio-botao);
  font: inherit;
  color: var(--texto);
  background: #FFFFFF;
}

.campo:focus {
  outline: none;
  border-color: var(--laranja);
  box-shadow: 0 0 0 3px var(--laranja-suave);
}

@media (max-width: 767px) {
  .campo {
    min-height: 48px;
    font-size: 16px;
  }
}
