/* Clube Fideliz · ID visual oficial: azul #0C3181, laranja #FEA934, creme #FFF9F1 (Vantely como fonte da marca; Urbanist enquanto a licença não chega) */
@font-face {
  font-family: 'Vantely';
  src: url('../fonts/vantely.woff2?v=1') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}
:root {
  --azul: #3845C5;
  --azul-escuro: #162898;
  --azul-noite: #0C3181;
  --laranja: #E87026;
  --laranja-claro: #FEA934;
  --tinta: #14204F;
  --tinta-fraca: #6A7099;
  --linha: #ECE4D6;
  --fundo: #FFF9F1;
  --branco: #fff;
  --verde: #16A34A;
  --vermelho: #DC2626;
  --ambar: #B45309;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: var(--fundo);
  color: var(--tinta);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100dvh;
}
h1, h2, h3, .marca-fonte { font-family: 'Vantely', 'Urbanist', 'Nunito', sans-serif; letter-spacing: .015em; }
a { color: var(--azul); }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; }
img, svg { vertical-align: middle; }

/* ---------- topo do app ---------- */
.topo-app {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 18px 10px;
  background: var(--azul-noite);
  color: #fff;
}
.topo-marca { display: flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font-family: 'Urbanist', sans-serif; font-size: 20px; font-weight: 600; }
.topo-marca b { color: var(--laranja-claro); font-weight: 600; }
.topo-marca em { font-style: normal; font-size: 11px; background: rgba(255,255,255,.15); border-radius: 99px; padding: 2px 10px; margin-left: 4px; }
.topo-sair { color: rgba(255,255,255,.85); display: inline-flex; }
.topo-sair svg { width: 20px; height: 20px; }

.miolo-app { max-width: 520px; margin: 0 auto; padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }

/* ---------- navegação de baixo ---------- */
.nav-app {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: flex-end; justify-content: space-around;
  background: #fff;
  border-top: 1px solid var(--linha);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(12, 49, 129, .08);
  max-width: 100%;
}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: var(--tinta-fraca); font-size: 10.5px; font-weight: 700; min-width: 58px; }
.nav-item svg { width: 22px; height: 22px; }
.nav-item.ativo { color: var(--azul); }
.nav-escanear {
  display: flex; align-items: center; justify-content: center;
  width: 60px; height: 60px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #FEC96B, #FEA934 55%, #E87026);
  color: #fff; text-decoration: none;
  margin-top: -28px;
  box-shadow: 0 10px 22px rgba(232, 112, 38, .40), 0 0 0 6px #fff;
}
.nav-escanear svg { width: 26px; height: 26px; }
.nav-escanear.ativo { outline: 3px solid var(--azul); outline-offset: 2px; }

/* ---------- blocos ---------- */
.cartao { background: #fff; border: 1px solid var(--linha); border-radius: 20px; padding: 18px; margin-bottom: 14px; }
.cartao-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cartao-topo h2 { font-size: 16.5px; }
.saldo-hero {
  background: linear-gradient(150deg, var(--azul) 10%, var(--azul-escuro) 60%, var(--azul-noite));
  color: #fff; border-radius: 24px; padding: 24px 22px; margin-bottom: 16px;
  position: relative; overflow: hidden;
}
.saldo-hero::after {
  content: ''; position: absolute; right: -46px; top: -46px; width: 160px; height: 160px;
  background: radial-gradient(circle at 35% 30%, #FEC96B, #FEA934 55%, #E87026); border-radius: 50%; opacity: .9;
}
.saldo-rotulo { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #B7BCEF; }
.saldo-valor { font-family: 'Urbanist', sans-serif; font-size: 46px; font-weight: 700; line-height: 1.15; position: relative; z-index: 1; }
.saldo-valor small { font-size: 17px; font-weight: 600; color: var(--laranja-claro); }
.saldo-obs { font-size: 13px; color: #C6CAF4; position: relative; z-index: 1; }

.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--azul); color: #fff; border: none; border-radius: 14px;
  padding: 13px 20px; font-weight: 800; font-size: 15px; text-decoration: none;
  transition: transform .12s, box-shadow .12s;
}
.botao:active { transform: scale(.98); }
.botao-laranja { background: linear-gradient(135deg, #FEA934, #E87026); box-shadow: 0 8px 18px rgba(232, 112, 38, .35); }
.botao-suave { background: #EDEFFC; color: var(--azul); }
.botao-largo { width: 100%; }
.botao-mini { padding: 8px 14px; font-size: 13px; border-radius: 10px; }

.campo { display: block; margin-bottom: 13px; }
.campo span { display: block; font-size: 12.5px; font-weight: 700; color: var(--tinta-fraca); margin-bottom: 5px; }
.campo input, .campo select {
  width: 100%; padding: 13px 15px; border: 1.5px solid var(--linha); border-radius: 14px; background: #fff;
  font-size: 15px; color: var(--tinta);
}
.campo input:focus, .campo select:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(56, 69, 197, .14); }

.aviso { border-radius: 14px; padding: 12px 15px; font-size: 13.5px; font-weight: 600; margin-bottom: 14px; }
.aviso-ok { background: #DCFCE7; color: #166534; }
.aviso-erro { background: #FEE2E2; color: #B91C1C; }
.aviso-info { background: #E4E7FB; color: var(--azul-escuro); }

.selo { display: inline-block; border-radius: 99px; padding: 3px 11px; font-size: 11.5px; font-weight: 800; }

.lista-mov { list-style: none; }
.lista-mov li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--linha); }
.lista-mov li:last-child { border-bottom: none; }
.mov-icone { width: 40px; height: 40px; border-radius: 13px; display: flex; align-items: center; justify-content: center; flex: none; background: #EDEFFC; color: var(--azul); font-weight: 800; }
.mov-texto { flex: 1; min-width: 0; }
.mov-texto strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mov-texto small { color: var(--tinta-fraca); font-size: 12px; }
.mov-pontos { font-family: 'Urbanist', sans-serif; font-weight: 700; font-size: 16px; white-space: nowrap; }
.mov-pontos.ganho { color: var(--verde); }
.mov-pontos.pendente { color: var(--ambar); }

.vazio { text-align: center; color: var(--tinta-fraca); padding: 34px 14px; font-size: 14px; }
.vazio svg { width: 40px; height: 40px; display: block; margin: 0 auto 10px; color: #C3C8EA; }

/* ---------- entrada (login) ---------- */
.entrada {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(165deg, var(--azul-escuro) 0%, var(--azul-noite) 55%, #081B3F 100%);
  padding: 30px 18px;
  position: relative; overflow: hidden;
}
.entrada::before {
  content: ''; position: absolute; width: 430px; height: 430px; right: -170px; top: -150px; border-radius: 50%;
  background: radial-gradient(circle, rgba(254, 169, 52, .30), transparent 62%);
}
.entrada::after {
  content: ''; position: absolute; width: 400px; height: 400px; left: -160px; bottom: -150px; border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 69, 197, .5), transparent 62%);
}
.entrada > * { position: relative; z-index: 1; }
.entrada-marca img { filter: drop-shadow(0 16px 34px rgba(3, 9, 34, .55)); }
.entrada-cartao { width: 100%; max-width: 400px; background: #fff; border-radius: 26px; padding: 30px 26px; box-shadow: 0 30px 70px rgba(6, 18, 51, .45); }
.entrada-marca { text-align: center; margin-bottom: 8px; color: #fff; }
.entrada-marca .nome { font-family: 'Urbanist', sans-serif; font-size: 34px; font-weight: 700; color: var(--tinta); display: block; margin-top: 6px; }
.entrada-marca .nome b { color: var(--laranja); font-weight: 700; }
.entrada-frase { text-align: center; color: var(--tinta-fraca); font-size: 14px; margin-bottom: 20px; }
.codigo-campo input { text-align: center; letter-spacing: 12px; font-size: 26px; font-weight: 800; font-family: 'Urbanist', sans-serif; }

/* ---------- escanear ---------- */
.scan-caixa { position: relative; border-radius: 22px; overflow: hidden; background: #081B3F; aspect-ratio: 3/4; margin-bottom: 14px; }
.scan-caixa video { width: 100%; height: 100%; object-fit: cover; }
.scan-mira { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.scan-mira i {
  width: min(64vw, 260px); aspect-ratio: 1; border-radius: 26px;
  box-shadow: 0 0 0 200vmax rgba(8, 27, 63, .55);
  border: 3px solid var(--laranja-claro);
}
.scan-dica { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; color: #fff; font-size: 13px; font-weight: 700; text-shadow: 0 1px 6px rgba(0,0,0,.6); }

/* ---------- resultado do cupom ---------- */
.resultado { text-align: center; padding: 8px 4px 2px; }
.resultado .bola { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; }
.resultado .bola svg { width: 40px; height: 40px; }
.resultado h2 { font-size: 20px; margin-bottom: 6px; }
.resultado p { color: var(--tinta-fraca); font-size: 14px; }
.resultado .pontos-grandes { font-family: 'Urbanist', sans-serif; font-size: 40px; font-weight: 700; color: var(--laranja); }
.resultado .pontos-grandes small { display: block; font-size: 15px; font-weight: 600; color: var(--tinta-fraca); margin-top: -4px; }

/* ---------- admin ---------- */
.topo-admin {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 22px;
  background: #fff; border-bottom: 1px solid var(--linha); padding: 12px 22px;
  overflow-x: auto;
}
.topo-admin .topo-marca { color: var(--tinta); font-size: 18px; }
.topo-admin nav { display: flex; gap: 4px; margin-left: auto; }
.topo-admin nav a { text-decoration: none; color: var(--tinta-fraca); font-weight: 700; font-size: 13.5px; padding: 8px 13px; border-radius: 10px; white-space: nowrap; }
.topo-admin nav a:hover { color: var(--azul); background: #EDEFFC; }
.topo-admin nav a.ativo { color: #fff; background: var(--azul); }
.topo-admin .topo-sair { color: var(--tinta-fraca); font-size: 13px; font-weight: 700; text-decoration: none; }
.miolo-admin { max-width: 1080px; margin: 0 auto; padding: 24px 22px 60px; }
.pagina-titulo h1 { font-size: 24px; margin-bottom: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--linha); border-radius: 18px; padding: 16px 18px; }
.kpi > small { font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--tinta-fraca); }
.kpi > strong { display: block; font-family: 'Urbanist', sans-serif; font-size: 28px; margin-top: 2px; }
.tabela { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--linha); border-radius: 18px; overflow: hidden; }
.tabela th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--tinta-fraca); padding: 12px 16px; border-bottom: 1px solid var(--linha); background: #FCF7EE; }
.tabela td { padding: 12px 16px; border-bottom: 1px solid var(--linha); font-size: 14px; vertical-align: middle; }
.tabela tr:last-child td { border-bottom: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92em; }
@media (max-width: 720px) {
  .miolo-admin { padding: 16px 14px 50px; }
  .topo-admin { flex-wrap: wrap; row-gap: 8px; }
  .topo-admin nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .topo-admin .topo-sair { margin-left: auto; }
  .tabela { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
