/* ============================================================
   Simulacro de Votación – Perú 2026
   Sistema de estilos – Mobile First
   Colores: Rojo Perú #dc2626, Blanco, Gris claro
   ============================================================ */

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

:root {
  --rojo:        #dc2626;
  --rojo-dark:   #b91c1c;
  --rojo-light:  #fef2f2;
  --blanco:      #ffffff;
  --gris-claro:  #f9fafb;
  --gris-borde:  #e5e7eb;
  --gris-texto:  #6b7280;
  --negro:       #111827;
  --verde:       #16a34a;
  --sombra-sm:   0 1px 4px rgba(0,0,0,.08);
  --sombra-md:   0 4px 16px rgba(0,0,0,.10);
  --sombra-lg:   0 8px 32px rgba(0,0,0,.12);
  --radio:       12px;
  --radio-sm:    8px;
  --radio-lg:    20px;
  --fuente:      'Segoe UI', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--fuente);
  background:  var(--gris-claro);
  color:       var(--negro);
  font-size:   15px;
  line-height: 1.6;
}

a { color: var(--rojo); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.container {
  max-width: 1100px;
  margin:    0 auto;
  padding:   0 16px;
}

/* ── Aviso oficial ────────────────────────────────────────── */
.aviso-oficial {
  background: var(--rojo);
  color: #fff;
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .2px;
}

/* ── Banners ──────────────────────────────────────────────── */
.banner-wrapper {
  text-align: center;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid var(--gris-borde);
}
.banner-wrapper img { width: 100%; height: auto; max-height: none; display: block; border-radius: var(--radio-sm); }
.banner-anuncia {
  background: linear-gradient(135deg,#fff7ed,#fff);
  border: 2px dashed #f97316;
  padding: 16px;
}
.banner-anuncia a {
  font-weight: 700;
  color: #f97316;
  font-size: 15px;
  text-decoration: none;
}
.banner-anuncia-inline {
  grid-column: 1 / -1;
  background: #fff7ed;
  border: 2px dashed #f97316;
  padding: 20px;
  text-align: center;
  border-radius: var(--radio);
}
.banner-anuncia-inline a {
  color: #f97316;
  font-weight: 700;
  font-size: 16px;
}
.candidatos-banner-inter {
  grid-column: 1 / -1;
}
.candidatos-banner-inter img { max-height: 100px; margin: 0 auto; border-radius: var(--radio-sm); }

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  background: #fff;
  border-bottom: 2px solid var(--rojo);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--sombra-sm);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 17px;
  color: var(--negro);
  text-decoration: none;
}
.brand-flag { font-size: 22px; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--negro);
}
.nav-menu {
  display: flex;
  list-style: none;
  gap: 4px;
}
.nav-menu a {
  display: block;
  padding: 8px 14px;
  border-radius: var(--radio-sm);
  color: var(--negro);
  font-weight: 500;
  font-size: 14px;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.nav-menu a:hover,
.nav-menu a.active {
  background: var(--rojo-light);
  color: var(--rojo);
}

@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0; right: 0;
    background: #fff;
    border-bottom: 2px solid var(--rojo);
    padding: 8px;
    gap: 4px;
    box-shadow: var(--sombra-md);
  }
  .nav-menu.open { display: flex; }
}

/* ── Main content ─────────────────────────────────────────── */
.main-content { min-height: 60vh; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #7f1d1d 0%, var(--rojo-dark) 40%, var(--rojo) 100%);
  color: #fff;
  padding: 56px 0 48px;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  padding: 6px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: .5px;
}
.hero-title {
  font-size: clamp(26px, 5vw, 44px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
}
.hero-subtitle {
  font-size: 16px;
  color: rgba(255,255,255,.85);
  max-width: 480px;
  margin: 0 auto 28px;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.stat-box {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radio);
  padding: 16px 28px;
  text-align: center;
}
.stat-num {
  display: block;
  font-size: 28px;
  font-weight: 800;
}
.stat-label {
  font-size: 12px;
  color: rgba(255,255,255,.75);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: var(--radio-sm);
  font-weight: 600;
  font-size: 14px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  line-height: 1.4;
}
.btn-lg { padding: 13px 30px; font-size: 16px; border-radius: var(--radio); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-primary {
  background: var(--rojo);
  color: #fff;
  border-color: var(--rojo);
}
.btn-primary:hover {
  background: var(--rojo-dark);
  border-color: var(--rojo-dark);
  text-decoration: none;
  color: #fff;
}
.btn-outline {
  background: transparent;
  color: var(--rojo);
  border-color: var(--rojo);
}
.btn-outline:hover {
  background: var(--rojo-light);
  text-decoration: none;
}
.btn-secondary {
  background: var(--negro);
  color: #fff;
  border-color: var(--negro);
}
.btn-secondary:hover { background: #374151; text-decoration: none; color: #fff; }
.btn-success { background: var(--verde); color: #fff; border-color: var(--verde); }
.btn-danger  { background: #ef4444; color: #fff; border-color: #ef4444; }

/* ── Section titles ───────────────────────────────────────── */
.section-title {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}
.section-subtitle {
  text-align: center;
  color: var(--gris-texto);
  margin-bottom: 32px;
  font-size: 14px;
}

/* ── Educativa ────────────────────────────────────────────── */
.seccion-educativa {
  background: #fff;
  padding: 56px 0;
  border-bottom: 1px solid var(--gris-borde);
}
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.edu-card {
  background: var(--gris-claro);
  border: 1px solid var(--gris-borde);
  border-radius: var(--radio);
  padding: 24px;
  text-align: center;
  transition: box-shadow .15s, transform .15s;
}
.edu-card:hover { box-shadow: var(--sombra-md); transform: translateY(-2px); }
.edu-icon { font-size: 36px; margin-bottom: 12px; }
.edu-card h3 { font-size: 15px; margin-bottom: 8px; }
.edu-card p  { font-size: 13px; color: var(--gris-texto); }
.edu-cta { text-align: center; }

/* ── Estado del voto ──────────────────────────────────────── */
.estado-voto {
  padding: 12px 20px;
  border-radius: var(--radio-sm);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
  text-align: center;
}
.estado-puede   { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.estado-ya-voto { background: #fef9c3; color: #854d0e; border: 1px solid #fef08a; }
.link-verificar { color: var(--rojo); margin-left: 8px; }

.mensaje-voto {
  padding: 14px 20px;
  border-radius: var(--radio-sm);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}
.msg-ok    { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.msg-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* ── Candidatos grid ──────────────────────────────────────── */
.seccion-candidatos {
  padding: 56px 0;
}
.candidatos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.candidato-card {
  background: #fff;
  border-radius: var(--radio);
  box-shadow: var(--sombra-sm);
  border: 1px solid var(--gris-borde);
  padding: 20px;
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}
.candidato-card:hover { box-shadow: var(--sombra-lg); transform: translateY(-3px); }
.candidato-foto-link { display: block; }
.candidato-foto {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--rojo-light);
}
.candidato-info { flex: 1; width: 100%; }
.candidato-nombre {
  font-size: 15px;
  font-weight: 700;
  color: var(--negro);
  display: block;
  margin-bottom: 4px;
  text-decoration: none;
}
.candidato-nombre:hover { color: var(--rojo); }
.candidato-partido { font-size: 12px; color: var(--gris-texto); margin-bottom: 10px; }
.candidato-barra {
  background: var(--gris-borde);
  border-radius: 100px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 6px;
}
.barra-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rojo), #f87171);
  border-radius: 100px;
  transition: width .5s ease;
}
.candidato-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--gris-texto);
}
.btn-votar {
  background: var(--rojo);
  color: #fff;
  border: none;
  border-radius: var(--radio-sm);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  width: 100%;
}
.btn-votar:hover:not(:disabled) { background: var(--rojo-dark); }
.btn-votar-disabled {
  background: var(--gris-borde) !important;
  color: var(--gris-texto) !important;
  cursor: not-allowed !important;
}

/* ── Resultados mini ──────────────────────────────────────── */
.seccion-resultados-mini {
  background: #fff;
  padding: 48px 0;
  border-top: 1px solid var(--gris-borde);
}
.live-dot  { color: var(--rojo); animation: pulse 1.5s infinite; }
.live-label { color: var(--rojo); font-size: 12px; font-weight: 700; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

.resultados-mini-lista { display: flex; flex-direction: column; gap: 12px; }
.resultado-mini-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--gris-claro);
  border-radius: var(--radio-sm);
  padding: 12px 16px;
}
.mini-foto {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.mini-info { flex: 1; min-width: 0; }
.mini-nombre  { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-partido { display: block; font-size: 11px; color: var(--gris-texto); }
.mini-barra-wrap { flex: 1; display: flex; align-items: center; gap: 8px; }
.mini-barra { flex: 1; background: var(--gris-borde); height: 6px; border-radius: 100px; overflow: hidden; }
.mini-barra-fill { height: 100%; background: var(--rojo); border-radius: 100px; transition: width .5s; }
.mini-porc  { font-size: 12px; color: var(--gris-texto); white-space: nowrap; }
.mini-votos { font-size: 12px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }

/* ── Modales ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-box {
  background: #fff;
  border-radius: var(--radio-lg);
  padding: 36px 28px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--sombra-lg);
  animation: slideUp .2s ease;
}
@keyframes slideUp { from{transform:translateY(24px);opacity:0} to{transform:translateY(0);opacity:1} }
.modal-icon { font-size: 52px; margin-bottom: 16px; }
.modal-box h3 { font-size: 20px; margin-bottom: 12px; }
.modal-box p  { color: var(--gris-texto); margin-bottom: 8px; }
.modal-disclaimer { font-size: 12px; color: var(--gris-texto); }
.modal-btns { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.modal-candidato-nombre { font-size: 20px; font-weight: 700; color: var(--rojo); margin: 8px 0 !important; }

/* ── Popup banner ─────────────────────────────────────────── */
.popup-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}
.popup-box {
  position: relative;
  background: #fff;
  border-radius: var(--radio-lg);
  padding: 8px;
  max-width: 320px;
  width: 100%;
}
.popup-box img { border-radius: var(--radio); width: 100%; aspect-ratio: 4/10; object-fit: cover; }
.popup-close {
  position: absolute;
  top: -12px; right: -12px;
  background: var(--rojo);
  color: #fff;
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sombra-md);
}

/* ── Resultados página ────────────────────────────────────── */
.page-header {
  text-align: center;
  margin-bottom: 36px;
}
.page-header h1 { font-size: clamp(22px, 4vw, 32px); margin-bottom: 8px; }
.page-header p   { color: var(--gris-texto); font-size: 14px; }
.disclaimer-page {
  display: inline-block;
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fef08a;
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 12px;
  margin-top: 8px;
}

.ganador-card {
  background: linear-gradient(135deg,#fff7f7,#fff);
  border: 2px solid var(--rojo-light);
  border-radius: var(--radio-lg);
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
  box-shadow: var(--sombra-md);
  flex-wrap: wrap;
}
.ganador-badge {
  background: var(--rojo);
  color: #fff;
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  display: inline-block;
}
.ganador-foto {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--rojo-light);
}
.ganador-nombre  { font-size: 24px; font-weight: 700; }
.ganador-partido { color: var(--gris-texto); margin: 4px 0; }
.ganador-stats   { font-size: 15px; }

.tabla-resultados-wrap { overflow-x: auto; }
.tabla-resultados {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radio);
  overflow: hidden;
  box-shadow: var(--sombra-sm);
}
.tabla-resultados th {
  background: var(--rojo);
  color: #fff;
  padding: 12px 16px;
  font-size: 13px;
  text-align: left;
}
.tabla-resultados td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gris-borde);
  font-size: 14px;
}
.tabla-resultados tr:last-child td { border-bottom: none; }
.tabla-resultados tr:hover td { background: var(--gris-claro); }
.tabla-candidato { display: flex; align-items: center; gap: 10px; }
.tabla-foto { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.pos-cell { font-size: 20px; text-align: center; }
.barra-cell { min-width: 120px; }
.barra-tabla { background: var(--gris-borde); height: 8px; border-radius: 100px; overflow: hidden; }
.barra-tabla-fill { height: 100%; background: var(--rojo); border-radius: 100px; transition: width .5s; }

.stats-tipos { margin-top: 36px; }
.tipos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.tipo-card {
  background: #fff;
  border-radius: var(--radio);
  padding: 20px;
  text-align: center;
  box-shadow: var(--sombra-sm);
  border: 1px solid var(--gris-borde);
}
.tipo-label { font-size: 13px; color: var(--gris-texto); margin-bottom: 8px; }
.tipo-cnt   { font-size: 24px; font-weight: 700; }
.tipo-porc  { font-size: 13px; color: var(--rojo); font-weight: 600; }

/* ── Perfil candidato ─────────────────────────────────────── */
.breadcrumb { font-size: 13px; color: var(--gris-texto); margin-bottom: 20px; }
.breadcrumb a { color: var(--gris-texto); }
.breadcrumb a:hover { color: var(--rojo); }

.perfil-candidato {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  background: #fff;
  border-radius: var(--radio-lg);
  padding: 32px;
  box-shadow: var(--sombra-md);
  margin-bottom: 32px;
}
.perfil-foto {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radio);
  border: 3px solid var(--rojo-light);
}
.perfil-nombre  { font-size: 28px; font-weight: 700; margin-bottom: 4px; }
.perfil-partido { color: var(--gris-texto); font-size: 15px; margin-bottom: 20px; }
.perfil-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.perfil-stat { text-align: center; }
.pstat-num   { display: block; font-size: 22px; font-weight: 700; color: var(--rojo); }
.pstat-label { font-size: 12px; color: var(--gris-texto); }
.barra-perfil { background: var(--gris-borde); height: 8px; border-radius: 100px; overflow: hidden; margin-bottom: 16px; }
.barra-perfil-fill { height: 100%; background: var(--rojo); border-radius: 100px; transition: width .5s; }
.perfil-desc { font-size: 14px; color: #374151; line-height: 1.7; margin-bottom: 16px; }
.fuente-jne { background: var(--gris-claro); border-radius: var(--radio-sm); padding: 12px 16px; font-size: 13px; margin-top: 12px; }
.ya-voto-msg { font-size: 14px; color: var(--gris-texto); }
.ya-voto-msg a { color: var(--rojo); }

@media (max-width: 640px) {
  .perfil-candidato { grid-template-columns: 1fr; }
  .perfil-foto      { max-width: 160px; margin: 0 auto; }
}

/* ── Verificación ─────────────────────────────────────────── */
.verif-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.verif-tab {
  flex: 1;
  padding: 12px;
  border: 2px solid var(--gris-borde);
  background: #fff;
  border-radius: var(--radio-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all .15s;
}
.verif-tab.active {
  border-color: var(--rojo);
  background: var(--rojo-light);
  color: var(--rojo);
}
.verif-panel {
  background: #fff;
  border: 1px solid var(--gris-borde);
  border-radius: var(--radio);
  padding: 24px;
  margin-bottom: 20px;
}
.verif-panel h3 { margin-bottom: 8px; font-size: 17px; }
.verif-panel p  { color: var(--gris-texto); font-size: 14px; margin-bottom: 16px; }
.otp-input-wrap { margin: 16px 0; }
.otp-input {
  font-size: 28px !important;
  font-weight: 700 !important;
  letter-spacing: 8px !important;
  text-align: center !important;
  max-width: 220px !important;
}
.otp-timer { font-size: 13px; color: var(--gris-texto); margin-top: 8px; }
.note-google { font-style: italic; margin-bottom: 16px; }
.verif-info {
  background: var(--gris-claro);
  border-radius: var(--radio-sm);
  padding: 20px;
  font-size: 14px;
}
.verif-info h4  { margin-bottom: 10px; }
.verif-info ul  { padding-left: 20px; }
.verif-info li  { margin-bottom: 6px; }

/* ── Formularios ──────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #374151;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gris-borde);
  border-radius: var(--radio-sm);
  font-size: 14px;
  font-family: var(--fuente);
  transition: border-color .15s, box-shadow .15s;
  background: #fff;
  color: var(--negro);
}
.form-control:focus {
  outline: none;
  border-color: var(--rojo);
  box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  background: #111;
  color: #ccc;
  padding: 48px 0 24px;
  font-size: 13px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}
.footer h4 { color: #fff; margin-bottom: 12px; font-size: 14px; }
.footer p   { margin-bottom: 8px; color: #9ca3af; }
.footer a   { color: #9ca3af; }
.footer a:hover { color: #fff; }
.footer ul  { list-style: none; }
.footer li  { margin-bottom: 6px; }
.footer .disclaimer { color: #6b7280; font-size: 12px; font-style: italic; }
.footer-bottom {
  border-top: 1px solid #333;
  padding-top: 20px;
  text-align: center;
  color: #6b7280;
}
.footer-bottom strong { color: #ccc; }

/* ── Importar candidatos ──────────────────────────────────── */
.import-section {
  background: #fff;
  border-radius: var(--radio-lg);
  padding: 32px;
  box-shadow: var(--sombra-md);
  margin: 24px 0;
}
