﻿/* ══ Voto Vivo — Design System & Shared Styles ══════════════════ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Impede scroll/bounce no documento — só .scroll rola */
html {
  overflow: hidden;
  overscroll-behavior: none;
  height: 100%;
}

/* ── Design tokens ── */
:root {
  --green:      #16A34A;
  --green-dark: #15803D;
  --green-bg:   #F0FDF4;
  --dark:       #0F172A;
  --gray:       #F1F5F9;
  --gray-2:     #E2E8F0;
  --gray-3:     #5D6B80;   /* 4.9:1 mesmo sobre as superfícies cinza; o #94A3B8 anterior ficava em 2.6 — mesma correção já aplicada no web */
  --text:       #1E293B;
  --white:      #FFFFFF;
  --red:        #EF4444;
  --red-bg:     #FEF2F2;
  --amber:      #F59E0B;
  --amber-bg:   #FFFBEB;
  --blue:       #3B82F6;
  --blue-bg:    #EFF6FF;
  --orange:     #F97316;
  --orange-bg:  #FFF7ED;
  --fucsia:     #D946EF;
  --fucsia-bg:  #FDF4FF;
  --error:      #EF4444;
}

/* ── Base ── */
body {
  font-family: 'Inter', sans-serif;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 24px 16px;
  overscroll-behavior: none;
}

@media (max-width: 768px), (max-height: 900px) {
  body { padding: 0; align-items: stretch; }
  .phone { border-radius: 0; margin: 0 auto; }
}

/* ── Phone shell ── */
.phone {
  width: min(390px, 100vw);
  height: min(844px, 100vh);
  height: min(844px, 100svh);
  background: var(--gray);
  border-radius: 44px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 80px rgba(0,0,0,.6);
  position: relative;
}

/* ── Status bar (oculta — app roda no celular real) ── */
.status-bar { display: none; }
.status-bar .time  { font-weight: 700; font-size: 15px; }
.status-bar .icons { display: flex; gap: 6px; align-items: center; }
.status-bar .icons svg { width: 16px; height: 16px; }

/* ── Scroll area ── */
.scroll {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  overscroll-behavior-y: none;
}
.scroll::-webkit-scrollbar { display: none; }

/* ── Bottom navigation ── */
.bottom-nav {
  flex-shrink: 0;
  height: 72px;
  background: var(--white);
  border-top: 1px solid var(--gray-2);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px 8px;
  z-index: 100;
}
.nav-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  cursor: pointer; padding: 8px 16px;
  border-radius: 12px;
  transition: background .15s;
  text-decoration: none;
}
.nav-item:hover { background: var(--gray); }
.nav-item svg   { width: 22px; height: 22px; stroke: var(--gray-3); fill: none; stroke-width: 2; stroke-linecap: round; }
.nav-item span  { font-size: 10px; font-weight: 600; color: var(--gray-3); }
.nav-item.active svg  { stroke: var(--green); }
.nav-item.active span { color: var(--green); }

/* ── Avatar images ── */
.avatar img, .notif-avatar img, .pf-avatar img,
.profile-avatar img, .user-avatar img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* ── Fotos de políticos — recortes das colagens oficiais ──
   Requer: assets/images/pol-grid-1.jpg  (retratos com bandeiras)
           assets/images/pol-grid-2.jpg  (plenário)
   Linha superior = 3 políticos | Linha inferior = 2 políticos         ── */
.pol-1,.pol-2,.pol-3,.pol-4,.pol-5 { background-image: url('../images/pol-grid-1.jpg') !important; background-repeat: no-repeat !important; }
.pol-6,.pol-7,.pol-8,.pol-9,.pol-10 { background-image: url('../images/pol-grid-2.jpg') !important; background-repeat: no-repeat !important; }
.pol-1         { background-size: 320% auto !important; background-position: 2%   5% !important; }
.pol-2,.pol-7  { background-size: 320% auto !important; background-position: 50%  15% !important; }
.pol-3         { background-size: 320% auto !important; background-position: 98%  5% !important; }
.pol-6         { background-size: 320% auto !important; background-position: 2%   15% !important; }
.pol-8         { background-size: 320% auto !important; background-position: 98%  15% !important; }
.pol-4,.pol-9  { background-size: 215% auto !important; background-position: 5%   90% !important; }
.pol-5,.pol-10 { background-size: 215% auto !important; background-position: 95%  90% !important; }

/* ── Top bar — despesa, votacao, projeto, seguindo, meu-perfil, atualizacoes ── */
.top-bar {
  background: var(--white);
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px 14px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--gray-2);
}
.top-bar-title { font-size: 17px; font-weight: 700; color: var(--dark); }

/* ── Botão ícone quadrado — buscar, despesa, projeto, votacao, meu-perfil, seguindo ── */
.icon-btn {
  width: 36px; height: 36px;
  border: none; background: var(--gray); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  text-decoration: none; color: inherit;
}
.icon-btn svg { width: 18px; height: 18px; stroke: var(--dark); fill: none; stroke-width: 2; stroke-linecap: round; }

/* ── Badges — home, atualizacoes, projeto ── */
.badge {
  font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 99px;
  letter-spacing: .3px; white-space: nowrap;
}
.badge-vote   { background: var(--blue-bg);  color: var(--blue); }
.badge-spend  { background: var(--fucsia-bg); color: var(--fucsia); }
.badge-law    { background: var(--green-bg); color: var(--green); }
.badge-alert  { background: var(--red-bg);   color: var(--red); }
.badge-absent { background: var(--orange-bg); color: var(--orange); }

/* ── Botão voltar — base estrutural (login, cadastro, perfil-parlamentar, perfil-executivo, eleicoes) ── */
.btn-back {
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.btn-back svg { width: 20px; height: 20px; }

/* ── Grupo de input de formulário — login, cadastro ── */
.input-group { margin-bottom: 16px; }
.input-group label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.input-wrap { position: relative; }
.input-wrap input {
  width: 100%;
  padding: 15px 48px 15px 16px;
  border: 2px solid var(--gray-2);
  border-radius: 14px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color .2s;
}
.input-wrap input::placeholder { color: var(--gray-3); }
.input-wrap input:focus { border-color: var(--green); }
.input-wrap .icon {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  display: flex;
}
.input-wrap .icon svg { width: 20px; height: 20px; stroke: var(--gray-3); }

/* ── Card de seção — perfil-parlamentar, perfil-executivo ── */
.card {
  background: var(--white);
  border-radius: 16px;
  margin: 8px 8px 0;
  padding: 16px;
}
.card-title { font-size: 14px; font-weight: 700; color: var(--dark); margin-bottom: 12px; }

/* ── Linha de despesa — perfil-parlamentar, perfil-executivo ── */
.exp-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 4px; border-bottom: 1px solid var(--gray);
  margin: 0 -4px;
  cursor: pointer; transition: background .15s; border-radius: 8px;
}
.exp-row:first-child { padding-top: 0; }
.exp-row:last-child  { border-bottom: none; padding-bottom: 0; }
.exp-row:active { background: var(--gray); }
.exp-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--gray);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.exp-icon svg { width: 18px; height: 18px; stroke: var(--gray-3); fill: none; stroke-width: 2; stroke-linecap: round; }
.exp-icon.amber { background: var(--amber-bg); } .exp-icon.amber svg { stroke: var(--amber); }
.exp-icon.blue  { background: var(--blue-bg);  } .exp-icon.blue  svg { stroke: var(--blue); }
.exp-icon.green { background: var(--green-bg); } .exp-icon.green svg { stroke: var(--green); }
.exp-icon.red   { background: var(--red-bg);   } .exp-icon.red   svg { stroke: var(--red); }
.exp-body { flex: 1; min-width: 0; }
.exp-desc { font-size: 13px; font-weight: 600; color: var(--text); }
.exp-date { font-size: 11px; color: var(--gray-3); margin-top: 2px; }
.exp-val  { font-size: 14px; font-weight: 700; color: var(--dark); flex-shrink: 0; }

/* ── Linha de configuração — meu-perfil ── */
.settings-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--gray);
  cursor: pointer; transition: background .1s;
  text-decoration: none; color: inherit;
}
.settings-row:first-of-type { border-top: none; }
.settings-row:hover { background: var(--gray); }
.settings-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.settings-icon svg { width: 17px; height: 17px; fill: none; stroke-width: 2; stroke-linecap: round; }
.si-green { background: var(--green-bg); } .si-green svg { stroke: var(--green); }
.si-blue  { background: var(--blue-bg);  } .si-blue  svg { stroke: var(--blue); }
.si-amber { background: var(--amber-bg); } .si-amber svg { stroke: var(--amber); }
.si-gray  { background: var(--gray);     } .si-gray  svg { stroke: var(--gray-3); }
.si-red   { background: var(--red-bg);   } .si-red   svg { stroke: var(--red); }
.settings-label { flex: 1; font-size: 14px; font-weight: 600; color: var(--text); }
.settings-sub { font-size: 12px; color: var(--gray-3); font-weight: 400; }
.settings-arrow svg { width: 16px; height: 16px; stroke: var(--gray-3); fill: none; stroke-width: 2; stroke-linecap: round; }
.settings-badge {
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 99px;
}

/* ── Dark mode — logo ── */
.phone.dark [data-component="logo"] svg circle             { stroke: #ffffff !important; }
.phone.dark [data-component="logo"] svg text:first-of-type { fill: #ffffff !important; }
.phone.dark .drawer-header svg circle                      { stroke: #ffffff !important; }

/* ── Dark mode ── */
.phone.dark {
  --green-bg:  rgba(22, 163, 74, .15);
  --dark:      #F1F5F9;
  --gray:      #1E293B;
  --gray-2:    #334155;
  --gray-3:    #9EB0C4;   /* 4.7:1 sobre --gray-2 (pior caso, ex.: badge "Em breve" com fundo --gray-2 e texto --gray-3); o #64748B anterior ficava em 2.2. Valor próprio para o escuro do mobile — as superfícies dele (--gray/--white) não são as mesmas do web, então não dá pra reaproveitar o hex de lá. */
  --text:      #CBD5E1;
  --white:     #0F172A;
  --red-bg:    rgba(239, 68, 68, .15);
  --amber-bg:  rgba(245, 158, 11, .15);
  --blue-bg:   rgba(59, 130, 246, .15);
  --purple-bg: rgba(249, 115, 22, .15);
  --fucsia-bg: rgba(217, 70, 239, .15);
}

/* ── Responsive ── */
/* 768px (nao 430px) para que celular em paisagem e telas largas
   tambem recebam o app inteiro, em vez da moldura de mockup. */
@media (max-width: 768px) {
  body  { background: var(--gray); padding: 0; }
  .phone { width: 100%; height: 100svh; border-radius: 0; box-shadow: none; }
}
