/* Central do Cliente Unatel */
:root {
  --marinho: #313468;
  --royal: #0000A8;
  --eletrico: #033FFF;
  --ciano: #01E3FF;
  --fundo: #F3F5FB;
  --branco: #FFFFFF;
  --texto: #313468;
  --suave: #5A5E7E;
  --suave-claro: #C9CCE6;
  --borda: #CDD2E6;
  --linha: #E2E5F1;
  --campo: #F7F8FC;
  --azul-claro: #E9ECFF;
  --vermelho: #B3261E;
  --vermelho-fundo: #FDECEA;
  --verde: #1B6B3A;
  --verde-fundo: #E5F5EC;
  --verde-ponto: #1FA855;
  --laranja: #8A4B00;
  --laranja-fundo: #FFF1DE;
  --laranja-borda: #FFD8A8;
  --raio: 20px;
  --sombra: 0 12px 30px rgba(49, 52, 104, 0.12);
  --fonte: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: var(--fonte);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--royal); }
a:hover { color: var(--eletrico); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
svg { flex: 0 0 auto; }
.oculto { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--eletrico); outline-offset: 2px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 18px; border-radius: 14px; border: 0;
  font-weight: 800; font-size: 15px; text-decoration: none; white-space: nowrap;
  transition: transform .12s ease, background-color .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primario { background: var(--royal); color: var(--branco); }
.btn-primario:hover { background: #00008a; color: var(--branco); }
.btn-ciano { background: var(--ciano); color: var(--marinho); }
.btn-ciano:hover { background: #4eecff; color: var(--marinho); }
.btn-contorno { background: var(--branco); color: var(--texto); border: 1.5px solid var(--borda); }
.btn-contorno:hover { border-color: var(--suave); color: var(--texto); }
.btn-contorno-claro { background: transparent; color: var(--branco); border: 1.5px solid rgba(255, 255, 255, .35); }
.btn-contorno-claro:hover { border-color: var(--branco); color: var(--branco); }
.btn-suave { background: var(--azul-claro); color: var(--royal); min-height: 44px; padding: 0 16px; font-size: 14px; }
.btn-pequeno { min-height: 44px; padding: 0 16px; font-size: 14px; border-radius: 12px; }
.btn-icone { width: 44px; min-height: 44px; padding: 0; border-radius: 12px; }
.btn-bloco { width: 100%; min-height: 54px; border-radius: 16px; font-size: 16px; }

/* ---------- Selos ---------- */
.selo { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.selo-vencida { color: var(--vermelho); background: var(--vermelho-fundo); }
.selo-aberta { color: var(--royal); background: var(--azul-claro); }
.selo-paga { color: var(--verde); background: var(--verde-fundo); }
.selo-alerta { color: var(--laranja); background: var(--laranja-fundo); }
.status-online { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--verde); }
.status-online::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--verde-ponto); }
.status-offline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--suave); }
.status-offline::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--borda); }

/* ---------- Login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--marinho); }
.login-topo { position: relative; overflow: hidden; padding: 64px 28px 36px; display: flex; flex-direction: column; gap: 28px; }
.login-topo img { width: 150px; height: auto; display: block; }
.login-topo .rotulo { font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ciano); }
.login-topo h1 { font-size: 30px; line-height: 1.15; font-weight: 800; color: var(--branco); margin-top: 8px; }
.login-topo p { font-size: 15px; line-height: 1.5; color: var(--suave-claro); margin-top: 8px; }
.login-topo .anel { position: absolute; right: -60px; top: 40px; width: 180px; height: 180px; border-radius: 50%; border: 22px solid var(--ciano); opacity: .18; pointer-events: none; }
.login-form { flex: 1 1 auto; background: var(--branco); border-radius: 28px 28px 0 0; padding: 32px 28px 28px; display: flex; flex-direction: column; gap: 18px; }
.login-rodape { margin-top: auto; display: flex; flex-direction: column; gap: 12px; align-items: center; padding-top: 12px; }
.login-rodape p { font-size: 14px; color: var(--suave); }
.login-rodape a.link-forte { font-weight: 700; text-decoration: none; }
.aviso-demo { font-size: 13px; font-weight: 600; color: var(--laranja); background: var(--laranja-fundo); border-radius: 12px; padding: 10px 14px; }

.campo { display: flex; flex-direction: column; gap: 8px; }
.campo label { font-size: 14px; font-weight: 700; }
.campo input, .campo select, .campo textarea {
  width: 100%; min-height: 52px; border: 1.5px solid var(--borda); border-radius: 14px; padding: 0 16px;
  font-size: 16px; font-weight: 500; color: var(--texto); background: var(--campo);
}
.campo textarea { padding: 14px 16px; min-height: 120px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border-color: var(--eletrico); background: var(--branco); box-shadow: 0 0 0 3px rgba(3, 63, 255, .15); }
.campo-senha { position: relative; }
.campo-senha input { padding-right: 52px; }
.campo-senha button { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; border: 0; background: transparent; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--suave); }
.linha-opcoes { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--royal); margin: 0; }
.link-forte { font-size: 14px; font-weight: 700; text-decoration: none; }
.erro-form { font-size: 14px; font-weight: 700; color: var(--vermelho); background: var(--vermelho-fundo); border-radius: 12px; padding: 12px 14px; }

@media (min-width: 900px) {
  .login { flex-direction: row; align-items: stretch; }
  .login-topo { flex: 1 1 50%; justify-content: center; padding: 64px clamp(40px, 6vw, 96px); }
  .login-topo h1 { font-size: 44px; max-width: 12ch; }
  .login-topo p { font-size: 17px; max-width: 36ch; }
  .login-topo .anel { width: 360px; height: 360px; border-width: 44px; right: -120px; top: auto; bottom: -80px; }
  .login-form { flex: 0 1 520px; border-radius: 0; justify-content: center; padding: 64px clamp(32px, 5vw, 72px); }
  .login-form .login-rodape { margin-top: 12px; }
}

/* ---------- Estrutura logada ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
.lateral { display: none; }
.conteudo { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.menu-inferior {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--branco); border-top: 1px solid var(--linha);
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
}
.menu-inferior a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; text-decoration: none; color: var(--suave); font-size: 11px; font-weight: 700; }
.menu-inferior a span { width: 52px; height: 30px; border-radius: 999px; display: flex; align-items: center; justify-content: center; }
.menu-inferior a[aria-current="page"] { color: var(--royal); font-weight: 800; }
.menu-inferior a[aria-current="page"] span { background: var(--azul-claro); }

.cabecalho { background: var(--branco); padding: calc(20px + env(safe-area-inset-top)) 20px 16px; border-bottom: 1px solid var(--linha); display: flex; flex-direction: column; gap: 14px; }
.cabecalho h1 { font-size: 26px; font-weight: 800; }
.cabecalho-voltar { flex-direction: row; align-items: center; gap: 6px; padding-left: 12px; }
.cabecalho-voltar h1 { font-size: 18px; }
.cabecalho-voltar a { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--texto); }

.heroi { background: var(--marinho); padding: calc(24px + env(safe-area-inset-top)) 20px 84px; display: flex; flex-direction: column; gap: 16px; }
.heroi-topo { display: flex; justify-content: space-between; align-items: center; }
.heroi-topo img { width: 96px; height: auto; display: block; }
.heroi p { font-size: 15px; color: var(--suave-claro); }
.heroi h1 { font-size: 26px; font-weight: 800; color: var(--branco); }
.heroi .btn-icone { background: rgba(255, 255, 255, .1); color: var(--branco); }
.heroi + .pagina { margin-top: -72px; }

.pagina { padding: 16px; display: flex; flex-direction: column; gap: 14px; max-width: 1200px; }
.cartao { background: var(--branco); border-radius: var(--raio); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.cartao-escuro { background: var(--marinho); color: var(--branco); }
.cartao-destaque { box-shadow: var(--sombra); border-radius: 22px; padding: 20px; }
.cartao-alerta { border: 1.5px solid var(--laranja-borda); }
.cartao h2 { font-size: 16px; font-weight: 800; }
.cartao-escuro h2 { color: var(--branco); font-size: 18px; }
.cartao-escuro p, .cartao-escuro .rotulo-suave { color: var(--suave-claro); font-size: 14px; }
.coluna { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.titulo-secao { margin: 6px 4px 0; font-size: 13px; font-weight: 800; color: var(--suave); text-transform: uppercase; letter-spacing: .08em; }
.entre { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.rotulo-suave { font-size: 14px; font-weight: 700; color: var(--suave); }
.valor-grande { font-size: 36px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.valor-medio { font-size: 24px; font-weight: 800; }
.duas-colunas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.texto-suave { font-size: 13px; color: var(--suave); }
.texto-forte { color: var(--texto); font-weight: 800; }

.item { background: var(--branco); border-radius: 18px; padding: 14px 18px; display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--texto); }
a.item:hover { color: var(--texto); box-shadow: 0 4px 14px rgba(49, 52, 104, .08); }
.item-icone { width: 40px; height: 40px; border-radius: 12px; background: var(--azul-claro); color: var(--royal); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.item-icone.escuro { width: 46px; height: 46px; border-radius: 14px; background: var(--marinho); color: var(--ciano); }
.item-icone.alerta { background: var(--laranja-fundo); color: var(--laranja); }
.item-texto { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item-texto strong { font-size: 15px; font-weight: 800; }
.item-texto span { font-size: 13px; color: var(--suave); }

.atalhos { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; }

/* Faixa de aviso (definida no painel administrativo) */
.faixa-aviso { border-radius: 18px; padding: 14px 18px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 1.45; border: 1.5px solid transparent; }
.faixa-aviso strong { font-size: 15px; font-weight: 800; }
.faixa-info { background: var(--azul-claro); color: #00007a; border-color: #C9D0FF; }
.faixa-alerta { background: var(--vermelho-fundo); color: #8C1D17; border-color: #F6C7C3; }
.faixa-manutencao { background: var(--laranja-fundo); color: #6E3C00; border-color: var(--laranja-borda); }
.heroi + .pagina .faixa-aviso { box-shadow: var(--sombra); }
.atalho { background: var(--branco); border: 0; border-radius: 18px; padding: 14px 4px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; color: var(--texto); font-size: 12px; font-weight: 700; text-align: center; line-height: 1.25; }
.atalho:hover { color: var(--texto); box-shadow: 0 4px 14px rgba(49, 52, 104, .08); }
.atalho span { width: 40px; height: 40px; border-radius: 12px; background: var(--azul-claro); color: var(--royal); display: flex; align-items: center; justify-content: center; }

.segmentos { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 4px; background: #EEF0F8; border-radius: 14px; padding: 4px; }
.segmentos button { min-height: 40px; border: 0; border-radius: 11px; background: transparent; color: var(--suave); font-weight: 700; font-size: 14px; }
.segmentos button[aria-selected="true"] { background: var(--branco); color: var(--texto); font-weight: 800; box-shadow: 0 2px 6px rgba(49, 52, 104, .12); }

.seletor { min-height: 44px; padding: 0 40px 0 14px; border: 1.5px solid var(--borda); border-radius: 14px; background: var(--campo); font-weight: 700; font-size: 14px; color: var(--texto); appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23313468' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; max-width: 100%; }

.fatura { background: var(--branco); border-radius: 18px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.fatura-acoes { display: flex; gap: 8px; }

.resumo-escuro { background: var(--marinho); color: var(--branco); border-radius: 18px; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.resumo-escuro span:first-child { font-size: 13px; color: var(--suave-claro); }

.grafico { display: flex; align-items: flex-end; gap: 6px; height: 190px; border-bottom: 1px solid var(--linha); padding-bottom: 2px; }
.grafico-coluna { flex: 1 1 0; display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 100%; min-width: 0; }
.barra { flex: 0 1 14px; min-height: 2px; border-radius: 5px 5px 2px 2px; background: var(--marinho); height: 0; transition: height .4s ease; }
.barra.upload { background: var(--ciano); }
.barra.unica { background: var(--eletrico); }
.barra.hoje { background: var(--ciano); }
.grafico-rotulos { display: flex; gap: 6px; }
.grafico-rotulos span { flex: 1 1 0; min-width: 0; text-align: center; font-size: 11px; font-weight: 700; color: var(--suave); white-space: nowrap; overflow: hidden; }
.grafico-mini { height: 86px; gap: 10px; border: 0; }
.legenda { display: flex; gap: 12px; font-size: 12px; font-weight: 700; color: var(--suave); }
.legenda span { display: flex; align-items: center; gap: 6px; }
.legenda span::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--marinho); }
.legenda span.up::before { background: var(--ciano); }

.qr { padding: 12px; border-radius: 16px; border: 1.5px solid var(--linha); width: 220px; max-width: 100%; align-self: center; background: var(--branco); }
.qr svg, .qr img { display: block; width: 100%; height: auto; }
.codigo { width: 100%; background: var(--fundo); border-radius: 12px; padding: 12px 14px; font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.codigo-quebra { white-space: normal; word-break: break-all; }

.etapas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.etapas span { height: 6px; border-radius: 999px; background: var(--linha); }
.etapas span.feito { background: var(--royal); }
.etapas-rotulos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; font-size: 11px; font-weight: 700; color: var(--suave); }

.vazio { text-align: center; padding: 28px 18px; color: var(--suave); font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.vazio strong { color: var(--texto); font-size: 16px; }

/* Carregando */
.esqueleto { border-radius: 18px; background: linear-gradient(90deg, #E8EBF5 0%, #F4F6FC 50%, #E8EBF5 100%); background-size: 200% 100%; animation: brilho 1.2s ease-in-out infinite; }
.esqueleto.alto { height: 160px; }
.esqueleto.medio { height: 84px; }
@keyframes brilho { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Avisos */
.aviso { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; z-index: 60;
  background: var(--marinho); color: var(--branco); font-weight: 700; font-size: 14px; padding: 12px 18px; border-radius: 14px; box-shadow: var(--sombra);
  transition: opacity .2s ease, transform .2s ease; max-width: calc(100vw - 32px); pointer-events: none; }
.aviso.visivel { opacity: 1; transform: translate(-50%, 0); }
.aviso.erro { background: var(--vermelho); }

/* Janela (folha inferior no celular) */
.janela-fundo { position: fixed; inset: 0; background: rgba(20, 22, 50, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.janela { background: var(--branco); width: 100%; max-width: 520px; border-radius: 24px 24px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; max-height: 90vh; overflow: auto; }
.janela h2 { font-size: 20px; font-weight: 800; }

/* ---------- Computador ---------- */
@media (min-width: 900px) {
  .app { display: flex; }
  .lateral { display: flex; flex-direction: column; gap: 32px; position: sticky; top: 0; height: 100vh; flex: 0 0 248px; background: var(--marinho); padding: 32px 20px; }
  .lateral img { width: 120px; height: auto; margin-left: 8px; }
  .lateral nav { display: flex; flex-direction: column; gap: 4px; }
  .lateral nav a { min-height: 46px; padding: 0 14px; border-radius: 12px; color: var(--suave-claro); display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 700; text-decoration: none; }
  .lateral nav a:hover { color: var(--branco); background: rgba(255, 255, 255, .06); }
  .lateral nav a[aria-current="page"] { color: var(--branco); font-weight: 800; background: rgba(1, 227, 255, .14); }
  .lateral nav a[aria-current="page"] svg { color: var(--ciano); }
  .lateral .btn, .lateral nav + .sair { margin-top: auto; }
  .lateral .sair { background: transparent; border: 0; color: var(--suave-claro); font-weight: 700; font-size: 14px; min-height: 44px; }
  .lateral .sair:hover { color: var(--branco); }
  .conteudo { flex: 1 1 auto; min-width: 0; padding-bottom: 48px; }
  .menu-inferior { display: none; }
  .aviso { bottom: 32px; }
  .heroi { background: transparent; padding: 32px clamp(16px, 3vw, 40px) 0; }
  .heroi-topo img, .heroi .btn-icone { display: none; }
  .heroi p { color: var(--suave); }
  .heroi h1 { color: var(--texto); font-size: 30px; }
  .heroi + .pagina { margin-top: 0; }
  .cabecalho { background: transparent; border: 0; padding: 32px clamp(16px, 3vw, 40px) 0; }
  .cabecalho h1 { font-size: 30px; }
  .cabecalho .segmentos, .cabecalho .seletor { max-width: 420px; }
  .pagina { padding: 24px clamp(16px, 3vw, 40px); gap: 20px; }
  .grade-inicio { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
  .lista-larga { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
  .janela-fundo { align-items: center; }
  .janela { border-radius: 24px; }
  .pagamento-grade { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; max-width: 960px; }
}
@media (max-width: 899px) {
  .grade-inicio, .lista-larga, .pagamento-grade { display: flex; flex-direction: column; gap: 14px; }
}
@media (max-width: 360px) {
  .atalhos { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .valor-grande { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
