/* ============================================================
   ÁREA DO CLIENTE — visual
   ============================================================
   Site de serviço de verdade, no padrão que o brasileiro conhece de banco e
   operadora: faixa azul-marinho com a marca da revenda, conteúdo claro em
   largura total no computador, uma coluna no celular. A cor de ação é um
   verde-petróleo que conversa com a cor do Pix, porque pagar é o gesto
   principal daqui. Nenhum emoji: ícones são desenhos próprios. */

@font-face {
  font-family: 'Archivo';
  src: url('fontes/archivo-latin.woff2') format('woff2');
  font-weight: 500 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --papel: #F1F3F6;
  --superficie: #FFFFFF;
  --tinta: #17253C;
  --tinta-2: #5A6B84;
  --linha: #E3E8EF;
  --faixa: #17253C;
  --faixa-tinta: #FFFFFF;
  --faixa-tinta-2: rgba(255, 255, 255, 0.68);
  --acao: #0B7A66;
  --acao-escura: #095E4F;
  --titulo: 'Archivo', -apple-system, sans-serif;
  --texto: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { color-scheme: light; }
body {
  font-family: var(--texto);
  background: var(--papel);
  color: var(--tinta);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
.escondido { display: none !important; }
#tela-home { display: flex; flex-direction: column; min-height: 100dvh; }
#tela-home .conteudo { flex: 1; width: 100%; }
.largura { max-width: 1140px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--acao); outline-offset: 2px; border-radius: 4px; }
.faixa :focus-visible, .entrada-painel :focus-visible { outline-color: #fff; }

.marca {
  font-family: var(--titulo); font-weight: 800; font-size: 19px;
  letter-spacing: -0.01em; color: var(--faixa-tinta);
}

/* ───────────────── entrada ───────────────── */
.entrada { display: grid; grid-template-columns: minmax(400px, 44%) 1fr; min-height: 100dvh; }

.entrada-painel {
  background: var(--faixa); color: var(--faixa-tinta);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 44px 52px;
}
.entrada-chamada h1 {
  font-family: var(--titulo); font-weight: 800;
  font-size: clamp(30px, 3.2vw, 44px); line-height: 1.12; letter-spacing: -0.02em;
  max-width: 420px; text-wrap: balance;
}
.entrada-chamada p { color: var(--faixa-tinta-2); font-size: 17px; margin-top: 14px; }
.entrada-pe { color: var(--faixa-tinta-2); font-size: 13px; }

.entrada-form { display: grid; place-items: center; padding: 48px 24px; }
.form-login { width: min(400px, 100%); }
.form-login h2 { font-family: var(--titulo); font-weight: 700; font-size: 26px; margin-bottom: 22px; }

.rotulo { display: block; font-size: 13.5px; font-weight: 600; color: var(--tinta); margin: 16px 0 6px; }
.campo {
  width: 100%; padding: 13px 14px; border-radius: 10px; font-size: 16px;
  background: var(--superficie); color: var(--tinta);
  border: 1px solid #C9D2DE; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.campo:focus { border-color: var(--acao); box-shadow: 0 0 0 3px rgba(11, 122, 102, 0.15); }
.campo-senha { letter-spacing: 0.35em; }

.botao {
  border: none; border-radius: 10px; font-weight: 700;
  padding: 14px 20px; font-size: 15.5px;
  background: var(--acao); color: #fff;
  transition: background 0.15s;
}
.botao:hover { background: var(--acao-escura); }
.botao:disabled { opacity: 0.55; cursor: default; }
.botao-cheio { width: 100%; margin-top: 22px; }

.link-simples {
  display: block; width: 100%; margin-top: 14px; padding: 8px;
  background: none; border: none;
  color: var(--acao); font-size: 14.5px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
}
.link-simples:hover { color: var(--acao-escura); }

.erro { color: #B42318; font-size: 13.5px; margin-top: 12px; line-height: 1.45; }
.nota { color: var(--tinta-2); font-size: 13px; margin-top: 18px; line-height: 1.5; }
.nota-ok { color: var(--acao-escura); font-size: 13.5px; margin-top: 12px; line-height: 1.5; }

/* ───────────────── a faixa (topo da casa) ───────────────── */
.faixa { background: var(--faixa); color: var(--faixa-tinta); }

.faixa-topo {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 18px; padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.btn-topo {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 999px;
  color: var(--faixa-tinta); font-size: 13.5px; font-weight: 600; padding: 8px 16px;
}
.btn-topo:hover { background: rgba(255, 255, 255, 0.1); }
.btn-topo svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

.faixa-status {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 40px;
  padding-top: 34px; padding-bottom: 38px;
}
.ola { color: var(--faixa-tinta-2); font-size: 15px; }
.status-titulo {
  font-family: var(--titulo); font-weight: 800;
  font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.02em; line-height: 1.12;
  margin-top: 6px;
}
.status-linha { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.status-sub { color: var(--faixa-tinta-2); font-size: 14.5px; }

.selo {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 4px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.18);
}
.selo-ok { color: #7EE2C4; }
.selo-alerta { color: #FFD08A; }
.selo-perigo { color: #FFA8A8; }

/* O trilho do ciclo: quanto ainda falta dos 30 dias. */
.trilho {
  width: min(420px, 100%); height: 6px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.16); margin-top: 20px; overflow: hidden;
}
.trilho-fill {
  height: 100%; border-radius: 99px; width: 0;
  background: #2DD4A7;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
#heroi.alerta .trilho-fill { background: #F5B04C; }
#heroi.vencido .trilho-fill { background: #F87171; }
.trilho-legenda { color: var(--faixa-tinta-2); font-size: 12.5px; margin-top: 8px; }
.trilho-legenda span { color: var(--faixa-tinta); font-weight: 700; font-variant-numeric: tabular-nums; }

.status-acao { text-align: right; flex-shrink: 0; }
.botao-renovar {
  border: none; border-radius: 10px;
  background: #fff; color: var(--acao-escura);
  font-family: var(--titulo); font-weight: 800; font-size: 16px;
  padding: 15px 30px;
  transition: transform 0.12s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.botao-renovar:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); }
.status-acao-nota { color: var(--faixa-tinta-2); font-size: 12.5px; margin-top: 10px; }

/* ───────────────── conteúdo ───────────────── */
.conteudo {
  display: grid; grid-template-columns: minmax(320px, 5fr) minmax(0, 7fr); gap: 36px;
  padding-top: 36px; align-items: start;
}
.secao { font-family: var(--titulo); font-weight: 700; font-size: 17px; margin-bottom: 14px; }

/* acessos */
.acesso {
  display: flex; align-items: center; gap: 14px;
  background: var(--superficie); border: 1px solid var(--linha); border-radius: 12px;
  padding: 16px 18px; margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}
.acesso-icone {
  width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center;
  background: #EDF1F6; color: var(--tinta);
}
.acesso-icone svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.acesso-meio { flex: 1; min-width: 0; }
.acesso-nome { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.acesso-linha { color: var(--tinta-2); font-size: 13px; margin-top: 3px; overflow-wrap: anywhere; }
.acesso-linha b, .acesso-linha span { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; color: var(--tinta); letter-spacing: 0.02em; }
.selo-teste {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  color: #B54708; background: #FFFAEB; border: 1px solid #FEDF89;
  border-radius: 99px; padding: 2px 8px; margin-left: 8px; vertical-align: 1px;
}
.btn-olho {
  background: none; border: 1px solid var(--linha); border-radius: 8px;
  color: var(--acao); font-size: 13px; font-weight: 700; padding: 7px 13px;
  flex-shrink: 0;
}
.btn-olho:hover { border-color: var(--acao); background: #F0FAF7; }

/* pagamentos */
.tabela-caixa {
  background: var(--superficie); border: 1px solid var(--linha); border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05); overflow-x: auto;
}
.tabela-pagamentos { width: 100%; border-collapse: collapse; }
.tabela-pagamentos th {
  text-align: left; font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--tinta-2);
  padding: 13px 18px; border-bottom: 1px solid var(--linha);
}
.tabela-pagamentos td { padding: 14px 18px; border-bottom: 1px solid #EEF1F5; font-size: 14px; }
.tabela-pagamentos tr:last-child td { border-bottom: none; }
.fat-data { font-weight: 600; white-space: nowrap; }
.fat-sub { color: var(--tinta-2); }
.th-valor, .fat-valor { text-align: right; }
.fat-valor {
  font-family: var(--titulo); font-weight: 700; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.fatura-selo {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 0.04em;
  padding: 3px 10px; border-radius: 999px; text-transform: uppercase;
}
.pago { color: #067647; background: #ECFDF3; border: 1px solid #ABEFC6; }
.pendente { color: #B54708; background: #FFFAEB; border: 1px solid #FEDF89; }
.gratis { color: #175CD3; background: #EFF8FF; border: 1px solid #B2DDFF; }
.tabela-vazia { color: var(--tinta-2); text-align: center; padding: 26px 18px !important; }

.rodape { text-align: center; color: var(--tinta-2); font-size: 13px; padding-top: 44px; padding-bottom: 40px; }

/* ───────────────── janelas ───────────────── */
.veu { position: fixed; inset: 0; background: rgba(13, 22, 38, 0.5); z-index: 40; }
.folha {
  position: fixed; z-index: 50;
  background: var(--superficie);
  padding: 26px 26px 30px;
  box-shadow: 0 24px 70px rgba(13, 22, 38, 0.35);
  max-height: calc(100dvh - 32px); overflow-y: auto;
}
.folha-fechar {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  border: none; background: var(--papel); color: var(--tinta-2);
  display: grid; place-items: center;
}
.folha-fechar:hover { background: var(--linha); color: var(--tinta); }
.folha-fechar svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.folha h3 { font-family: var(--titulo); font-weight: 700; font-size: 20px; }
.folha-sub { color: var(--tinta-2); font-size: 14px; margin: 6px 0 16px; }
.folha-alca { display: none; }

.pix-qr {
  display: grid; place-items: center;
  border: 1px solid var(--linha); border-radius: 12px; padding: 14px; margin: 4px 0 12px;
}
.pix-qr img { width: 190px; height: 190px; display: block; }

/* computador: janela centrada */
@media (min-width: 761px) {
  .folha {
    left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: min(420px, calc(100vw - 48px));
    border-radius: 14px;
  }
}

/* tablet em pé: as duas colunas não cabem, empilha mais cedo */
@media (max-width: 900px) {
  .conteudo { grid-template-columns: minmax(0, 1fr); }
  .col-pagamentos { margin-top: 20px; }
}

/* ───────────────── celular ───────────────── */
@media (max-width: 760px) {
  .largura { padding-left: 18px; padding-right: 18px; }

  .entrada { grid-template-columns: 1fr; min-height: auto; }
  .entrada-painel { padding: 36px 24px 30px; gap: 18px; }
  .entrada-chamada h1 { font-size: 27px; }
  .entrada-chamada p { font-size: 15px; margin-top: 8px; }
  .entrada-pe { display: none; }
  .entrada-form { padding: 30px 20px 44px; place-items: start center; }

  .faixa-status { flex-direction: column; align-items: stretch; gap: 24px; padding-top: 26px; padding-bottom: 30px; }
  .botao-renovar { width: 100%; padding: 15px 20px; }
  .status-acao-nota { text-align: center; }

  .conteudo { gap: 8px; padding-top: 26px; }

  /* a tabela vira lista */
  .tabela-pagamentos thead { display: none; }
  .tabela-pagamentos tr {
    display: grid; grid-template-columns: 1fr auto; gap: 2px 12px;
    padding: 13px 16px; border-bottom: 1px solid #EEF1F5;
  }
  .tabela-pagamentos tr:last-child { border-bottom: none; }
  .tabela-pagamentos td { display: block; padding: 0; border: none; }
  .fat-valor { grid-column: 2; grid-row: 1; }
  .fat-sub { grid-column: 1; grid-row: 2; font-size: 13px; }
  .tabela-pagamentos td:last-child { grid-column: 2; grid-row: 2; justify-self: end; }
  .tabela-vazia { grid-column: 1 / -1; }

  /* janelas viram folha de baixo, como app */
  .folha {
    left: 0; right: 0; bottom: 0;
    border-radius: 18px 18px 0 0;
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
    animation: subir 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .folha-alca { display: block; width: 40px; height: 4px; border-radius: 99px; background: #D4DAE3; margin: -8px auto 16px; }
}

@keyframes subir { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .folha { animation: none; }
  .trilho-fill { transition: none; }
}
