/* =========================================================================
   ACVALI - Estilos (mobile-first / uso exclusivo no celular)
   Paleta: tons de verde + branco (baseado na carteirinha)
   ========================================================================= */

:root {
  --verde: #34c124;
  --verde-claro: #5cd84a;
  --verde-escuro: #1f8c14;
  --verde-bem-escuro: #14620d;
  --verde-wave: #45cd34;
  --branco: #ffffff;
  --cinza-bg: #f1f5f0;
  --cinza-texto: #5a6b58;
  --cinza-card: #ffffff;
  --sombra: 0 8px 24px rgba(20, 98, 13, 0.12);
  --sombra-forte: 0 12px 32px rgba(20, 98, 13, 0.22);
  --raio: 18px;
  --max: 480px; /* largura maxima estilo "tela de celular" */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  background: var(--cinza-bg);
  color: #1c2b1a;
  line-height: 1.4;
  overscroll-behavior-y: none;
}

/* Container central que simula a largura de um celular em telas grandes */
.app-shell {
  max-width: var(--max);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--cinza-bg);
  position: relative;
  display: flex;
  flex-direction: column;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* =========================================================================
   LOGIN
   ========================================================================= */
.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 24px;
  background: linear-gradient(160deg, var(--verde) 0%, var(--verde-escuro) 100%);
  position: relative;
  overflow: hidden;
}

.login-wrap::before {
  content: "";
  position: absolute;
  width: 140%;
  height: 60%;
  top: -10%;
  left: -20%;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  transform: rotate(-8deg);
}

.login-card {
  position: relative;
  z-index: 2;
  background: var(--branco);
  border-radius: 24px;
  padding: 32px 24px 28px;
  box-shadow: var(--sombra-forte);
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

.login-logo .logo-full {
  width: 210px;
  max-width: 72%;
  height: auto;
  display: block;
  margin-bottom: 8px;
}

.login-logo h1 {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--verde-escuro);
  margin-top: 4px;
}

.login-logo p {
  font-size: 12px;
  color: var(--cinza-texto);
  text-align: center;
  margin-top: 2px;
}

.login-card h2 {
  font-size: 18px;
  margin-bottom: 4px;
  color: #1c2b1a;
}

.login-card .sub {
  font-size: 13px;
  color: var(--cinza-texto);
  margin-bottom: 20px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--cinza-texto);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 2px solid #e3ebe1;
  border-radius: 12px;
  background: #f8faf7;
  transition: border-color 0.15s;
}

.field input:focus {
  outline: none;
  border-color: var(--verde);
  background: #fff;
}

.btn-primary {
  width: 100%;
  padding: 15px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--verde);
  border-radius: 12px;
  margin-top: 6px;
  transition: transform 0.08s, background 0.15s;
}

.btn-primary:active {
  transform: scale(0.98);
  background: var(--verde-escuro);
}

.login-erro {
  background: #ffe9e9;
  color: #c0392b;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 14px;
  display: none;
}

.login-erro.show {
  display: block;
}

.login-dica {
  margin-top: 18px;
  font-size: 11.5px;
  color: var(--cinza-texto);
  text-align: center;
  background: #f0f6ee;
  padding: 10px;
  border-radius: 10px;
  line-height: 1.5;
}

/* =========================================================================
   TOPO DO APP
   ========================================================================= */
.topbar {
  background: var(--verde);
  color: #fff;
  padding: 14px 18px 14px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 1px;
}

.topbar .brand .logo-topo {
  height: 40px;
  width: auto;
  display: block;
  margin: -6px 0; /* compensa o espaco das antenas p/ nao aumentar a barra */
}

.topbar .sair {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 20px;
}

.topbar .sair:active {
  background: rgba(255, 255, 255, 0.35);
}

/* Conteudo das telas */
.view {
  flex: 1;
  padding: 18px 16px 90px;
  display: none;
}

.view.active {
  display: block;
}

/* =========================================================================
   CARTEIRINHA (frente recriada do design + verso com QR)
   ========================================================================= */
.saudacao {
  font-size: 15px;
  color: var(--cinza-texto);
  margin-bottom: 14px;
}

.saudacao b {
  color: #1c2b1a;
}

.card-scene {
  perspective: 1400px;
  margin: 0 auto 14px;
  max-width: 420px;
}

.card-flip {
  position: relative;
  width: 100%;
  aspect-ratio: 1.586 / 1; /* proporcao cartao */
  transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
  cursor: pointer;
}

.card-flip.flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--sombra-forte);
}

/* ----- FRENTE (arte oficial do Gabriel + numero dinamico por cima) ----- */
.card-front {
  background: var(--verde);
}

/* imagem oficial da carteirinha como fundo da frente */
.card-front .card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* "MEMBRO" no canto superior direito (sobreposto na arte) */
.card-membro-ov {
  position: absolute;
  top: 9%;
  right: 5.5%;
  font-weight: 800;
  letter-spacing: 3px;
  font-size: clamp(11px, 3.4vw, 17px);
  color: #0e2b0a;
}

/* numero da matricula no canto inferior esquerdo (dinamico) */
.card-matricula {
  position: absolute;
  left: 8.5%;
  bottom: 10%;
  font-weight: 800;
  font-size: clamp(18px, 6.6vw, 30px);
  letter-spacing: 4px;
  color: #111;
}

/* ----- VERSO ----- */
.card-back {
  transform: rotateY(180deg);
  background: linear-gradient(150deg, var(--verde-escuro), var(--verde-bem-escuro));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: #fff;
}

.card-back .qr-box {
  background: #fff;
  padding: 10px;
  border-radius: 12px;
  line-height: 0;
}

.card-back .qr-box img,
.card-back .qr-box canvas {
  display: block;
  width: 120px;
  height: 120px;
}

.card-back .back-nome {
  margin-top: 12px;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
}

.card-back .back-info {
  font-size: 11.5px;
  opacity: 0.9;
  margin-top: 2px;
}

.card-hint {
  text-align: center;
  font-size: 12px;
  color: var(--cinza-texto);
  margin-bottom: 8px;
}

.card-hint span {
  background: #e7f3e4;
  padding: 5px 12px;
  border-radius: 20px;
}

.status-ativo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e7f7e3;
  color: var(--verde-escuro);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 20px;
  margin: 0 auto 18px;
}

.status-ativo .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--verde);
  box-shadow: 0 0 0 4px rgba(52, 193, 36, 0.2);
}

.dados-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dado-item {
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--sombra);
}

.dado-item .label {
  font-size: 11px;
  color: var(--cinza-texto);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dado-item .valor {
  font-size: 15px;
  font-weight: 700;
  margin-top: 2px;
}

/* =========================================================================
   PARCEIROS / FILTROS
   ========================================================================= */
.section-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}

.section-sub {
  font-size: 13px;
  color: var(--cinza-texto);
  margin-bottom: 16px;
}

.busca {
  position: relative;
  margin-bottom: 12px;
}

.busca input {
  width: 100%;
  padding: 13px 16px 13px 42px;
  font-size: 15px;
  border: 2px solid #e3ebe1;
  border-radius: 12px;
  background: #fff;
}

.busca input:focus {
  outline: none;
  border-color: var(--verde);
}

.busca .lupa {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 0.5;
}

.filtros-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--cinza-texto);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 14px 0 8px;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  background: #fff;
  border: 2px solid #e3ebe1;
  color: var(--cinza-texto);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 20px;
  white-space: nowrap;
  transition: all 0.12s;
}

.chip.active {
  background: var(--verde);
  border-color: var(--verde);
  color: #fff;
}

.resultado-info {
  font-size: 12.5px;
  color: var(--cinza-texto);
  margin: 16px 0 10px;
}

/* Card de parceiro */
.parceiros-lista {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.parceiro {
  background: #fff;
  border-radius: var(--raio);
  overflow: hidden;
  box-shadow: var(--sombra);
}

.parceiro .foto-wrap {
  position: relative;
  display: block;
}

.parceiro img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  background: #e3ebe1;
}

/* placeholder da foto (gradiente por categoria + emoji) enquanto nao ha foto real */
.parceiro .foto-ph {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.parceiro .foto-ph span {
  font-size: 56px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25));
}

.parceiro .cat-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(20, 98, 13, 0.85);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 20px;
  backdrop-filter: blur(2px);
}

.parceiro .maps-pin {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: #fff;
  color: var(--verde-escuro);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.parceiro .info {
  padding: 14px 16px 16px;
}

.parceiro .nome {
  font-size: 17px;
  font-weight: 800;
}

.parceiro .cidade {
  font-size: 12.5px;
  color: var(--cinza-texto);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.parceiro .desconto {
  margin-top: 10px;
  background: #eafae6;
  color: var(--verde-escuro);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.parceiro .detalhe {
  font-size: 12px;
  color: var(--cinza-texto);
  margin-top: 8px;
}

.parceiro .acoes {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.parceiro .acoes a {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  padding: 10px;
  border-radius: 10px;
}

.parceiro .acoes .ver-maps {
  background: var(--verde);
  color: #fff;
}

.parceiro .acoes .ligar {
  background: #f0f6ee;
  color: var(--verde-escuro);
}

.vazio {
  text-align: center;
  padding: 40px 20px;
  color: var(--cinza-texto);
}

.vazio .emoji {
  font-size: 40px;
}

/* =========================================================================
   BARRA INFERIOR (navegacao)
   ========================================================================= */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max);
  background: #fff;
  display: flex;
  border-top: 1px solid #e3ebe1;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
  z-index: 60;
}

.tabbar button {
  flex: 1;
  background: none;
  padding: 10px 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--cinza-texto);
  font-size: 11px;
  font-weight: 600;
}

.tabbar button .ic {
  font-size: 22px;
}

.tabbar button.active {
  color: var(--verde);
}

/* =========================================================================
   PAGINA DE VALIDACAO (publica, aberta pelo QR)
   ========================================================================= */
.validar-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  background: linear-gradient(160deg, var(--verde) 0%, var(--verde-escuro) 100%);
  text-align: center;
}

.validar-card {
  background: #fff;
  border-radius: 24px;
  padding: 32px 24px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--sombra-forte);
}

.validar-card .check {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #e7f7e3;
  color: var(--verde);
  font-size: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.validar-card.invalido .check {
  background: #ffe9e9;
  color: #c0392b;
}

.validar-card h2 {
  font-size: 22px;
  color: var(--verde-escuro);
}

.validar-card.invalido h2 {
  color: #c0392b;
}

.validar-card .nome-grande {
  font-size: 20px;
  font-weight: 800;
  margin: 14px 0 4px;
}

.validar-card .linha {
  font-size: 14px;
  color: var(--cinza-texto);
  margin-top: 2px;
}

.validar-card .selo {
  margin-top: 18px;
  font-size: 12px;
  color: var(--cinza-texto);
  border-top: 1px solid #eee;
  padding-top: 14px;
}

.validar-card .selo b {
  color: var(--verde-escuro);
}
