/* App do Cliente MegaTelecom — estilo mobile-first, sem framework (sem
   passo de build), no mesmo espírito visual dos outros dois sistemas
   (azul da marca, cards arredondados, bastante espaço em branco). */

:root {
  --marca: #0d6efd;
  --marca-escuro: #0b5ed7;
  --marca-rgb: 13, 110, 253;
  --verde: #198754;
  --vermelho: #dc3545;
  --ambar: #fd7e14;
  --texto: #1f2937;
  --texto-muted: #6b7280;
  --fundo: #f4f6f9;
  --borda: #e5e7eb;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--fundo);
  position: relative;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.escondido { display: none !important; }

/* ---------- Login ---------- */
.tela-login {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 28px;
  background: linear-gradient(160deg, var(--marca) 0%, var(--marca-escuro) 100%);
  color: #fff;
  min-height: 100vh;
  min-height: 100dvh;
}
.tela-login .logo-chip {
  width: 72px; height: 72px;
  border-radius: 20px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 700;
  margin-bottom: 20px;
}
.tela-login h1 { font-size: 1.5rem; margin: 0 0 6px; }
.tela-login p.subtitulo { margin: 0 0 28px; opacity: 0.9; font-size: 0.95rem; }
.tela-login label { display: block; font-size: 0.85rem; margin-bottom: 6px; opacity: 0.95; }
.tela-login input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: none;
  font-size: 1.05rem;
  margin-bottom: 14px;
  background: rgba(255,255,255,0.97);
}
.tela-login .btn-entrar {
  width: 100%;
  padding: 15px;
  border-radius: 12px;
  border: none;
  background: #fff;
  color: var(--marca-escuro);
  font-weight: 700;
  font-size: 1.02rem;
  margin-top: 6px;
}
.tela-login .btn-entrar:disabled { opacity: 0.6; }
.tela-login .erro {
  background: rgba(255,255,255,0.15);
  border-left: 3px solid #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 14px;
}
.tela-login .rodape-ajuda {
  margin-top: 24px;
  font-size: 0.82rem;
  opacity: 0.85;
  text-align: center;
}

/* ---------- Topo do app ---------- */
.topo-app {
  position: sticky; top: 0; z-index: 10;
  background: var(--marca);
  color: #fff;
  padding: 16px 18px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.topo-app .topo-titulo { font-weight: 700; font-size: 1.05rem; }
.topo-app .topo-sub { font-size: 0.78rem; opacity: 0.9; }
.topo-app select.seletor-contrato {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.82rem;
  max-width: 150px;
}
.topo-app button.btn-sair {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.85rem;
}

/* ---------- Conteúdo ---------- */
.conteudo-app {
  flex: 1;
  padding: 16px 16px 90px;
  overflow-y: auto;
}

.card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid var(--borda);
}
.card h3 { margin: 0 0 4px; font-size: 1rem; }
.card p.muted { color: var(--texto-muted); font-size: 0.85rem; margin: 2px 0; }

.stat-linha { display: flex; align-items: center; gap: 12px; }
.stat-icone {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.stat-icone.verde { background: rgba(25,135,84,0.12); color: var(--verde); }
.stat-icone.vermelho { background: rgba(220,53,69,0.12); color: var(--vermelho); }
.stat-icone.azul { background: rgba(13,110,253,0.12); color: var(--marca); }
.stat-icone.ambar { background: rgba(253,126,20,0.12); color: var(--ambar); }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.badge.verde { background: rgba(25,135,84,0.12); color: var(--verde); }
.badge.vermelho { background: rgba(220,53,69,0.12); color: var(--vermelho); }
.badge.ambar { background: rgba(253,126,20,0.12); color: var(--ambar); }
.badge.cinza { background: #eef0f3; color: var(--texto-muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  font-size: 0.92rem;
  width: 100%;
}
.btn-primario { background: var(--marca); color: #fff; }
.btn-secundario { background: #eef2ff; color: var(--marca); }
.btn:disabled { opacity: 0.55; }
.btn-linha { display: flex; gap: 10px; margin-top: 8px; }

textarea, input.campo, select.campo {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--borda);
  font-size: 0.95rem;
  font-family: inherit;
  margin-bottom: 10px;
}
label.rotulo { font-size: 0.82rem; color: var(--texto-muted); margin-bottom: 4px; display: block; }

.vazio { text-align: center; color: var(--texto-muted); padding: 40px 20px; font-size: 0.9rem; }

.secao-titulo { font-size: 1.15rem; font-weight: 700; margin: 4px 0 14px; }

/* ---------- Faturas ---------- */
.fatura-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.fatura-item + .fatura-item { border-top: 1px solid var(--borda); margin-top: 10px; padding-top: 10px; }
.fatura-valor { font-weight: 700; font-size: 1.05rem; }
.fatura-venc { font-size: 0.82rem; color: var(--texto-muted); }

/* ---------- Chamados ---------- */
.chamado-item { border-top: 1px solid var(--borda); padding-top: 10px; margin-top: 10px; }
.chamado-item:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.chamado-protocolo { font-size: 0.78rem; color: var(--texto-muted); }

/* ---------- Chat ---------- */
.chat-lista { display: flex; flex-direction: column; gap: 10px; padding-bottom: 10px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; font-size: 0.92rem; line-height: 1.4; white-space: pre-wrap; }
.msg.cliente { align-self: flex-end; background: var(--marca); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistente { align-self: flex-start; background: #fff; border: 1px solid var(--borda); border-bottom-left-radius: 4px; }
.chat-barra { display: flex; gap: 8px; align-items: flex-end; }
.chat-barra textarea { margin-bottom: 0; resize: none; max-height: 100px; }
.chat-barra button { flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%; padding: 0; }

/* ---------- Notícias ---------- */
.noticia-imagem { width: 100%; border-radius: 10px; margin-bottom: 10px; display: block; }

/* ---------- Nav inferior ---------- */
.nav-inferior {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: #fff;
  border-top: 1px solid var(--borda);
  display: flex;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  z-index: 20;
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none;
  padding: 6px 2px;
  color: var(--texto-muted);
  font-size: 0.68rem;
  border-radius: 10px;
}
.nav-item .nav-icone { font-size: 1.25rem; line-height: 1; }
.nav-item.ativo { color: var(--marca); }

/* ---------- Loading / spinner ---------- */
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: girar 0.7s linear infinite;
  display: inline-block;
}
.spinner.escuro { border-color: rgba(13,110,253,0.25); border-top-color: var(--marca); }
@keyframes girar { to { transform: rotate(360deg); } }

.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: #1f2937; color: #fff;
  padding: 10px 18px; border-radius: 999px;
  font-size: 0.85rem;
  z-index: 50;
  max-width: 90%;
  text-align: center;
}
