/* Estilos CSS para CVX Sustentabilidade - Melhorias de Design */

/* Variáveis CSS para uma paleta de cores mais suave e profissional */
:root {
  --cvx-primary-green: #34D399; /* Um verde mais suave e vibrante */
  --cvx-secondary-blue: #60A5FA; /* Um azul mais calmo */
  --cvx-text-dark: #1F2937; /* Cinzento escuro para texto principal */
  --cvx-text-muted: #6B7280; /* Cinzento médio para texto secundário */
  --cvx-background-light: #F9FAFB; /* Fundo muito claro */
  --cvx-card-background: #FFFFFF; /* Fundo do cartão branco */
  --cvx-border-color: #E5E7EB; /* Cor de borda suave */
  --cvx-shadow-light: rgba(0, 0, 0, 0.05);
  --cvx-shadow-medium: rgba(0, 0, 0, 0.1);
}

.cvx-sust {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif; /* Fonte moderna e limpa */
  max-width: 1200px; /* Aumentar um pouco a largura máxima */
  margin: 30px auto; /* Mais margem superior e inferior */
  padding: 0 20px; /* Mais padding lateral */
  color: var(--cvx-text-dark);
}

.cvx-sust .section {
  margin: 30px 0; /* Aumentar espaçamento entre secções */
}

.cvx-sust .card {
  background: var(--cvx-card-background);
  border: 1px solid var(--cvx-border-color);
  border-radius: 12px; /* Bordas ligeiramente mais arredondadas */
  padding: 25px; /* Mais padding dentro dos cartões */
  box-shadow: 0 4px 12px var(--cvx-shadow-light); /* Sombra mais subtil */
  transition: all 0.3s ease; /* Transição suave para interatividade */
}

.cvx-sust .card:hover {
  box-shadow: 0 6px 16px var(--cvx-shadow-medium); /* Sombra ligeiramente mais pronunciada no hover */
}

.cvx-sust .title {
  font-weight: 700; /* Um pouco menos bold para um look mais moderno */
  color: var(--cvx-text-dark);
  margin-bottom: 10px; /* Espaçamento padrão para títulos */
}

.cvx-sust .title.h1 { font-size: 2.2em; }
.cvx-sust .title.h2 { font-size: 1.8em; }
.cvx-sust .title.h3 { font-size: 1.4em; }
.cvx-sust .title.h4 { font-size: 1.2em; }

.cvx-sust .muted {
  color: var(--cvx-text-muted);
  font-size: 0.95em;
}

.cvx-sust .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--cvx-primary-green); /* Usar o novo verde primário */
  color: #FFFFFF;
  border-radius: 8px; /* Bordas mais suaves para botões */
  padding: 10px 18px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  border: none; /* Remover borda padrão */
  cursor: pointer;
}

.cvx-sust .btn:hover {
  background-color: #25B880; /* Um verde ligeiramente mais escuro no hover */
  box-shadow: 0 2px 8px var(--cvx-shadow-medium);
}

.cvx-sust .btn-dark {
    background: #111;
}

.cvx-sust .btn-close {
    background: #e5e7eb;
    color: #111;
}

.cvx-sust .chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 20px; /* Mais arredondado para um look "chip" */
  border: 1px solid var(--cvx-border-color);
  background: var(--cvx-background-light);
  margin: 4px 6px 4px 0;
  font-size: 0.85em;
  color: var(--cvx-text-dark);
}

.cvx-sust .grid3 {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

.cvx-sust .grid2 {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

.cvx-sust .tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.cvx-sust .accent-green {
  background: #ECFDF5; /* Verde suave para acentos */
  border-color: #A7F3D0;
}

.cvx-sust .accent-blue {
  background: #EFF6FF; /* Azul suave para acentos */
  border-color: #BFDBFE;
}

.cvx-sust .accent-yellow {
    background: #fef3c7;
    border-color: #fde68a;
}

.cvx-sust .barbg {
  height: 12px; /* Altura da barra um pouco maior */
  background: var(--cvx-border-color);
  border-radius: 6px; /* Bordas arredondadas */
  overflow: hidden;
  flex: 1;
}

.cvx-sust .barfg {
  height: 100%;
  background: var(--cvx-primary-green);
  border-radius: 6px;
}

.cvx-heatmap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(28px, 1fr)); /* Ajuste automático para melhor responsividade */
  gap: 4px;
  padding: 5px;
  background: var(--cvx-background-light);
  border-radius: 8px;
}

.cvx-heatmap .day {
  height: 28px; /* Tamanho do dia um pouco maior */
  width: 28px; /* Garantir que é quadrado */
  border-radius: 6px;
  background: #E5E7EB; /* Cor de fundo padrão para dias sem atividade */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--cvx-text-dark);
  font-weight: 500;
  transition: background-color 0.3s ease;
  background-color: rgba(16,185,129,var(--alpha, 0.15));
}

.gauge {
  position: relative;
  width: 140px; /* Aumentar o tamanho do gauge */
  height: 140px;
  margin: 15px auto; /* Centralizar e adicionar margem */
}

.gauge svg {
  position: absolute;
  inset: 0;
}

.gauge .txt {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--cvx-text-dark);
  font-size: 1.8em; /* Aumentar o tamanho do texto percentual */
}

.spark {
  width: 100%; /* Tornar o sparkline responsivo */
  height: 80px;
}

.spark svg {
  width: 100%;
  height: 100%;
}

.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mb-1 { margin-bottom: .25rem; }
.m-0 { margin: 0; }
.ml-2 { margin-left: .5rem; }
.ml-4 { margin-left: 1rem; }
.my-1 { margin-top: .4rem; margin-bottom: .4rem; }
.input-small { width: 100px; }
.text-warning { color: #b45309; }
.badge-current { background: #059669; color: #fff; border-radius: .5rem; padding: .15rem .5rem; }
.grid3-records { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .6rem; flex: 1; min-width: 320px; }
.card-record { padding: .6rem; }
.category-label { width: 10rem; font-size: .9rem; font-weight: 700; }
.category-kg { width: 8rem; text-align: right; }
.card-tile { padding: .6rem; }
.grid { display: grid; }
.font-bold { font-weight: 700; }
.rank-position { width: 1.5rem; text-align: center; }
.rank-kg { width: 6rem; text-align: right; }
.icon-large { font-size: 20px; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 9999; }
.modal-content { max-width: 720px; width: 100%; }
.list-disc { list-style: disc; }
.text-center { text-align: center; }
.muted-small { font-size: 11px; color: #6b7280; }
.qr-code { border: 1px solid #e5e7eb; border-radius: 8px; }
.text-right { text-align: right; }

@media(min-width:768px) {
  .cvx-sust .grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cvx-sust .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cvx-sust .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Estilos para o Certificado (render_certificate) */
body.cvx-certificate-page {
  background: #F0FDF4; /* Manter o fundo suave */
}

.cvx-certificate-page .wrap {
  max-width: 900px; /* Aumentar um pouco a largura do certificado */
  margin: 30px auto;
  padding: 0 20px;
}

.cvx-certificate-page .box {
  border: 2px solid #B2F5EA; /* Borda mais distinta */
  border-radius: 18px;
  background: #FFFFFF;
  padding: 30px;
  box-shadow: 0 8px 20px var(--cvx-shadow-light);
}

.cvx-certificate-page .hdr {
  color: var(--cvx-primary-green); /* Usar o verde primário */
}

.cvx-certificate-page .leaf {
  background: var(--cvx-primary-green);
}

.cvx-certificate-page .muted {
  color: var(--cvx-text-muted);
}

.cvx-certificate-page strong {
  color: var(--cvx-text-dark);
}

/* Estilos para o Widget (render_widget) */
body.cvx-widget-body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--cvx-text-dark);
}

.cvx-widget-body .w {
  padding: 15px;
  border: 1px solid var(--cvx-border-color);
  border-radius: 12px;
  background: var(--cvx-card-background);
  box-shadow: 0 2px 8px var(--cvx-shadow-light);
}

.cvx-widget-body .t {
  font-weight: 700;
  font-size: 1.2em;
  color: var(--cvx-primary-green);
}

.cvx-widget-body .muted {
  font-size: 0.85em;
  color: var(--cvx-text-muted);
}

