:root {
  /* Paleta Premium Brasil */
  --primary: #004a99; /* Navy Blue */
  --primary-hover: #003366;
  --primary-soft: rgba(0, 74, 153, 0.08);
  --primary-2: #0073e6; /* azul mais claro p/ fim do gradiente (tema claro) */
  --primary-grad: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  --secondary: #ffcc00; /* Gold */
  --accent: #00a859; /* Emerald Green */
  
  --background: #f1f5f9;
  --foreground: #0f172a;
  --card: #ffffff;
  --card-hover: #f8fafc;
  --card-border: #e2e8f0;
  
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
}

.dark {
  --background: #0f172a;
  --foreground: #f8fafc;
  --card: #1e293b;
  --card-hover: #334155;
  --card-border: #334155;
  
  --primary: #3b82f6;
  --primary-soft: rgba(59, 130, 246, 0.15);
  --primary-2: #60a5fa; /* fim do gradiente no tema escuro (mais claro p/ contraste) */
  
  --slate-100: #1e293b;
  --slate-200: #334155;
  --slate-500: #94a3b8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', 'Inter', sans-serif;
  transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  min-height: 100vh;
}

/* Geometric Background Removed */
.bg-geometric {
  background-color: var(--background);
}

.container {
  width: 100%;
  max-width: 550px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

/* Header Section */

.header-hero h1 {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -1.5px;
  color: var(--foreground);
}

.header-hero h1 span {
  color: var(--primary);
}

.header-hero p {
  color: var(--slate-500);
  font-weight: 600;
  font-size: 1.1rem;
}

.stats-pill {
  display: inline-flex;
  background: var(--card);
  padding: 0.6rem 1.5rem;
  border-radius: 2rem;
  gap: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--card-border);
  margin-top: 1.5rem;
}

.stats-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.stats-item i {
  color: var(--primary);
}

/* Ranking Card */
.ranking-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--card-border);
  margin-bottom: 2.5rem;
}

.ranking-header {
  padding: 1.25rem 1.5rem;
  background: var(--slate-50);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ranking-header span {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--slate-500);
}

.ranking-header a {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.leader-row {
  display: grid;
  grid-template-columns: 40px 1fr 90px;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--card-border);
  gap: 1rem;
}

.leader-row:last-child {
  border-bottom: none;
}

.leader-rank {
  font-weight: 900;
  font-size: 1.25rem;
  color: var(--slate-300);
  text-align: center;
}

.top-1 { color: #FFD700 !important; text-shadow: 0 0 15px rgba(255, 215, 0, 0.6); filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); } /* Gold */
.top-2 { color: #E5E4E2 !important; text-shadow: 0 0 15px rgba(229, 228, 226, 0.5); } /* Platinum/Silver */
.top-3 { color: #CD7F32 !important; text-shadow: 0 0 10px rgba(205, 127, 50, 0.4); } /* Bronze */

.leader-info {
  display: flex;
  flex-direction: column;
}

.leader-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--foreground);
}

.leader-city {
  font-size: 0.8rem;
  color: var(--slate-500);
  font-weight: 600;
  text-transform: uppercase;
}

.leader-points {
  text-align: right;
  font-weight: 900;
  color: var(--primary);
  font-size: 1.1rem;
}

.leader-points span {
  display: block;
  font-size: 0.65rem;
  color: var(--slate-400);
  text-transform: uppercase;
  margin-top: -2px;
}

/* Action Section */
.action-section {
  text-align: center;
}

.action-section p {
  color: var(--slate-400);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.jrh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 2rem;
  border-radius: var(--radius-lg);
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  gap: 0.75rem;
  box-shadow: var(--shadow-lg);
}

.btn-primary {
  background: var(--primary-grad);
  color: #ffffff;
  border: none;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(0, 74, 153, 0.4);
}

.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1rem;
  padding: 1rem 2rem;
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--foreground);
  border: 2px solid var(--card-border);
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-login:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

/* Nav Buttons */
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: var(--primary-soft);
  color: var(--primary) !important;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none !important;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.nav-btn:hover {
  background: var(--primary);
  color: white !important;
  transform: translateY(-1px);
}

.nav-btn i {
  font-size: 0.9rem;
}

/* Theme Toggle - Floating Switch Futurista 3D Neon */
.theme-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  width: 90px;
  height: 44px;
  border: none;
  border-radius: 999px;
  padding: 5px;
  cursor: pointer;
  overflow: visible;
  background: linear-gradient(160deg, #e8d5a0, #f5e6b8, #fef9e7);
  box-shadow:
    inset 4px 4px 10px rgba(160, 120, 20, 0.25),
    inset -4px -4px 10px rgba(255, 255, 255, 0.95),
    0 4px 15px rgba(0, 0, 0, 0.1),
    0 0 30px rgba(250, 204, 21, 0.3);
  transition: background 0.7s ease, box-shadow 0.7s ease, transform 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.06);
}

.theme-toggle:active {
  transform: scale(0.97);
}

.dark .theme-toggle {
  background: linear-gradient(160deg, #0a0e1a, #131b2e, #0c1222);
  box-shadow:
    inset 4px 4px 12px rgba(0, 0, 0, 0.85),
    inset -3px -3px 10px rgba(255, 255, 255, 0.03),
    0 4px 15px rgba(0, 0, 0, 0.4),
    0 0 35px rgba(59, 130, 246, 0.25),
    0 0 70px rgba(59, 130, 246, 0.1);
}

/* Glow radial neon */
.toggle-glow {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  top: 50%;
  left: 26px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(250, 204, 21, 0.5), transparent 65%);
  filter: blur(8px);
  opacity: 0.8;
  transition:
    left 0.7s cubic-bezier(0.68, -0.45, 0.27, 1.45),
    background 0.7s ease,
    opacity 0.7s ease;
  pointer-events: none;
}

.dark .toggle-glow {
  left: 64px;
  opacity: 1;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.6), rgba(96, 165, 250, 0.2) 50%, transparent 70%);
  filter: blur(10px);
}

/* Bolinha deslizante 3D */
.toggle-ball {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  position: absolute;
  top: 5px;
  left: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #ffffff, #fff3d4);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.15),
    0 0 12px rgba(250, 204, 21, 0.5),
    0 0 25px rgba(250, 204, 21, 0.2),
    inset 2px 2px 4px rgba(255, 255, 255, 0.9),
    inset -2px -2px 4px rgba(200, 160, 30, 0.15);
  transition:
    transform 0.7s cubic-bezier(0.68, -0.45, 0.27, 1.45),
    background 0.7s ease,
    box-shadow 0.7s ease;
}

.dark .toggle-ball {
  transform: translateX(46px);
  background: linear-gradient(145deg, #1a2540, #0a1628);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.5),
    0 0 14px rgba(96, 165, 250, 0.8),
    0 0 30px rgba(59, 130, 246, 0.5),
    0 0 60px rgba(59, 130, 246, 0.2),
    inset 2px 2px 5px rgba(255, 255, 255, 0.06),
    inset -2px -2px 5px rgba(0, 0, 0, 0.7);
}

/* Ícone dentro da bolinha */
.toggle-icon {
  font-size: 16px;
  line-height: 1;
  transition: transform 0.5s ease, filter 0.5s ease, color 0.5s ease;
  color: #e6a817;
  filter: drop-shadow(0 0 3px rgba(250, 180, 21, 0.6));
}

.dark .toggle-icon {
  color: #93bbfc;
  filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.9)) drop-shadow(0 0 12px rgba(59, 130, 246, 0.5));
}

.theme-toggle:hover .toggle-icon,
.theme-toggle-nav:hover .toggle-icon {
  transform: rotate(20deg) scale(1.15);
}

.toggle-icon .fa-sun { display: inline; }
.toggle-icon .fa-moon { display: none; }
.dark .toggle-icon .fa-sun { display: none; }
.dark .toggle-icon .fa-moon { display: inline; }

/* Admin / Painel Specifics */
.input-group { margin-bottom: 1.25rem; }
.input-group label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--slate-600);
  margin-bottom: 0.5rem;
}

input, select {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--foreground);
  font-size: 1rem;
  font-weight: 500;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
  opacity: 0.8;
}

/* Header Section */
.header-hero {
  text-align: center;
  margin-bottom: 2.5rem;
  padding: 3rem 0;
  background: radial-gradient(circle at center, var(--primary-soft) 0%, transparent 70%);
  border-radius: 2rem;
}

/* Layout Utilities */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.step-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.step-badge {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.9rem;
}

.chapa-highlight {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  padding: 1.25rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  border: 1px solid rgba(255,255,255,0.1);
}

.verification-pill {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--slate-100);
  border-radius: 12px;
  border: 1px solid var(--card-border);
}

.required-dot {
  color: #ef4444;
  margin-left: 2px;
}

.map-container {
  height: 500px;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  position: relative;
  background: white;
}

.qr-container {
  text-align: center;
  padding: 2rem;
  background: var(--slate-100);
  border-radius: 12px;
  border: 1px dashed var(--slate-300);
}

.qr-container img {
  width: 180px;
  height: 180px;
  margin-bottom: 1.5rem;
  border: 8px solid white;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

@media (max-width: 1024px) {
  .map-container {
    height: 400px;
  }
}
/* Modal System */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: none; /* Controlled by JS or show/hide classes */
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.modal-content {
  background: var(--card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--card-border);
  overflow: hidden;
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  background: var(--slate-50);
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-overlay.active {
  display: flex;
}

/* Candidate Overlay */
.candidate-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4vw;
  overflow: hidden;
}

.candidate-overlay.active {
  opacity: 1;
}

.candidate-photo {
  width: 380px;
  height: 380px;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0.65;
  filter: saturate(1.2);
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 1.2s ease-in-out;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  border: 4px solid rgba(255,255,255,0.1);
}

.candidate-photo.federal {
  transform: translateX(-200px);
}

.candidate-photo.estadual {
  transform: translateX(200px);
}

.candidate-overlay.active .candidate-photo {
  transform: translateX(0);
}

/* Background Dimming when chapa selected */
body.bg-dimmed::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, transparent 0%, rgba(15, 23, 42, 0.8) 100%);
  z-index: -2;
  opacity: 0;
  transition: opacity 1s;
  pointer-events: none;
}

body.bg-dimmed.active::after {
  opacity: 1;
}

@media (max-width: 1200px) {
  .candidate-photo {
    width: 280px;
    height: 280px;
  }
}

@media (max-width: 768px) {
  .candidate-overlay {
    align-items: flex-start;
    justify-content: center; /* Centraliza no mobile */
    padding-top: 80px;
    opacity: 0;
    z-index: 5; /* Coloca na frente do fundo, mas atrás do texto */
    gap: -40px; /* Sobreposição leve */
  }
  
  .candidate-overlay.active {
    opacity: 0.65; /* 65% como solicitado */
  }

  .candidate-photo {
    width: 170px;
    height: 170px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin: 0 -25px; /* Faz elas se sobreporem levemente */
    opacity: 1; /* A opacidade será controlada apenas pelo pai (.candidate-overlay) */
    border: 2px solid rgba(255,255,255,0.2);
  }

  .candidate-photo.federal {
    transform: translateY(20px) rotate(-3deg);
  }

  .candidate-photo.estadual {
    transform: translateY(20px) rotate(3deg);
  }

  .candidate-overlay.active .candidate-photo {
    transform: translateY(0) rotate(0deg);
  }
}



