/* ═══════════════════════════════════════════════════════════
   POLIMÉTRICA — Termómetro Electoral 2027
   assets/css/termometro.css
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg-deep:    #07080f;
  --bg-card:    #0d1117;
  --bg-hover:   #131929;
  --border:     #1e293b;
  --border-acc: #334155;
  --text-head:  #f1f5f9;
  --text-body:  #94a3b8;
  --text-muted: #475569;
  --accent:     #6366f1;
  --accent-lt:  #818cf8;
  --morena:     #8B0000;
  --pan:        #005BBB;
  --pri:        #CC0000;
  --mc:         #F97316;
  --pvem:       #1A8A1A;
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --shadow:     0 4px 24px rgba(0,0,0,.5);
  --trans:      all 0.22s ease;
}

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

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-deep);
  color: var(--text-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── HERO ─────────────────────────────────────────────────── */
.t-hero {
  background: linear-gradient(160deg, #0f172a 0%, #1e1b4b 55%, #0f172a 100%);
  border-bottom: 1px solid #312e81;
  padding: 56px 24px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.t-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% -20%, #6366f130 0%, transparent 70%);
  pointer-events: none;
}
.t-hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: #1e1b4b; border: 1px solid #4338ca;
  border-radius: 20px; padding: 6px 16px;
  font-size: 12px; color: #a5b4fc; letter-spacing: .5px;
  margin-bottom: 20px; text-transform: uppercase;
}
.t-hero-badge span { font-size: 16px; }
.t-hero h1 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  color: var(--text-head);
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 14px;
}
.t-hero h1 em { color: var(--accent-lt); font-style: normal; }
.t-hero p {
  font-size: 16px; color: var(--text-body);
  max-width: 560px; margin: 0 auto 32px; line-height: 1.6;
}
.t-stats {
  display: flex; justify-content: center; gap: 40px;
  flex-wrap: wrap; margin-top: 12px;
}
.t-stat { text-align: center; }
.t-stat-num { font-size: 32px; font-weight: 800; color: var(--accent-lt); }
.t-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── CONTENEDOR PRINCIPAL ─────────────────────────────────── */
.t-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

/* ── FLUJO DE PASOS ───────────────────────────────────────── */
.t-steps { display: none; }
.t-steps.active { display: block; }

/* Indicador de progreso */
.t-progress {
  display: flex; align-items: center; margin-bottom: 40px;
  gap: 0;
}
.t-progress-step {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; position: relative;
}
.t-progress-step:not(:last-child)::after {
  content: '';
  position: absolute; top: 14px; left: 50%; right: -50%;
  height: 2px; background: var(--border);
  z-index: 0;
}
.t-progress-step.done::after  { background: var(--accent); }
.t-progress-dot {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; z-index: 1; transition: var(--trans);
}
.t-progress-step.done  .t-progress-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.t-progress-step.active .t-progress-dot { border-color: var(--accent-lt); box-shadow: 0 0 0 4px #6366f122; }
.t-progress-label {
  font-size: 10px; color: var(--text-muted); margin-top: 6px;
  text-align: center; white-space: nowrap;
}

/* Tarjeta de paso */
.t-step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.35s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.t-step-num {
  font-size: 11px; font-weight: 700; letter-spacing: 2px;
  color: var(--accent-lt); text-transform: uppercase; margin-bottom: 8px;
}
.t-step-card h2 {
  font-size: 22px; font-weight: 700; color: var(--text-head);
  margin-bottom: 8px;
}
.t-step-card p {
  font-size: 14px; color: var(--text-body); margin-bottom: 28px; line-height: 1.55;
}

/* ── SELECTS ──────────────────────────────────────────────── */
.t-select {
  width: 100%;
  background: var(--bg-deep); border: 1px solid var(--border-acc);
  border-radius: var(--radius-sm); color: var(--text-head);
  padding: 14px 16px; font-size: 15px; font-family: inherit;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23475569' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer; transition: var(--trans);
}
.t-select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px #6366f122;
}

/* ── TARJETAS DE CANDIDATOS ───────────────────────────────── */
.t-candidatos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.t-candidato-card {
  background: var(--bg-deep);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 14px;
  text-align: center;
  cursor: pointer;
  transition: var(--trans);
  position: relative;
  user-select: none;
}
.t-candidato-card:hover {
  border-color: var(--border-acc);
  background: var(--bg-hover);
  transform: translateY(-2px);
}
.t-candidato-card.selected {
  border-color: var(--c-partido, var(--accent));
  background: color-mix(in srgb, var(--c-partido, var(--accent)) 12%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-partido, var(--accent)) 20%, transparent);
}
.t-candidato-card.selected::before {
  content: '✓';
  position: absolute; top: 10px; right: 12px;
  font-size: 14px; font-weight: 700;
  color: var(--c-partido, var(--accent));
}

/* Foto / Avatar */
.t-cand-foto {
  width: 72px; height: 72px; border-radius: 50%;
  margin: 0 auto 12px;
  background: var(--bg-card);
  border: 3px solid var(--c-partido, var(--border-acc));
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.t-cand-foto img { width: 100%; height: 100%; object-fit: cover; }
.t-cand-foto-placeholder {
  font-size: 22px; font-weight: 800;
  color: var(--c-partido, var(--text-muted));
  line-height: 1;
}
.t-cand-nombre {
  font-size: 13px; font-weight: 600; color: var(--text-head);
  line-height: 1.3; margin-bottom: 6px;
}
.t-cand-cargo {
  font-size: 11px; color: var(--text-muted); margin-bottom: 8px;
  line-height: 1.3;
}
.t-cand-partido {
  display: inline-block;
  background: var(--c-partido, var(--border));
  color: #fff;
  border-radius: 4px; padding: 2px 10px;
  font-size: 11px; font-weight: 700;
}
.t-cand-nsnc {
  grid-column: 1 / -1;
  background: transparent;
  border: 1px dashed var(--border-acc);
  padding: 14px;
}
.t-cand-nsnc .t-cand-nombre { font-size: 13px; color: var(--text-muted); font-weight: 400; }

/* ── ESTRELLAS ────────────────────────────────────────────── */
.t-estrellas {
  display: flex; gap: 10px; justify-content: center; margin-bottom: 8px;
}
.t-estrella {
  font-size: 36px; cursor: pointer; transition: transform 0.15s;
  filter: grayscale(1) opacity(.35);
  user-select: none;
}
.t-estrella.on  { filter: none; }
.t-estrella:hover { transform: scale(1.15); }
.t-estrellas-label {
  text-align: center; font-size: 13px; color: var(--text-muted); height: 20px;
}

/* ── OPCIONES MÚLTIPLES ───────────────────────────────────── */
.t-opciones {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.t-opcion {
  background: var(--bg-deep); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  cursor: pointer; transition: var(--trans);
  font-size: 14px; color: var(--text-body);
  display: flex; align-items: center; gap: 10px;
}
.t-opcion:hover { border-color: var(--border-acc); color: var(--text-head); }
.t-opcion.selected {
  border-color: var(--accent); background: #6366f118;
  color: var(--accent-lt); font-weight: 600;
}
.t-opcion .t-opcion-check {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
}
.t-opcion.selected .t-opcion-check::after { content: '✓'; }

/* ── BINARIO ──────────────────────────────────────────────── */
.t-binario {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.t-binario-btn {
  background: var(--bg-deep); border: 2px solid var(--border);
  border-radius: var(--radius-md); padding: 24px 16px;
  text-align: center; cursor: pointer; transition: var(--trans);
}
.t-binario-btn:hover { border-color: var(--border-acc); }
.t-binario-btn.selected-nuevo       { border-color: #10b981; background: #10b98118; }
.t-binario-btn.selected-continuidad { border-color: #f59e0b; background: #f59e0b18; }
.t-binario-emoji { font-size: 36px; margin-bottom: 10px; }
.t-binario-label { font-size: 15px; font-weight: 600; color: var(--text-head); }
.t-binario-sub   { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── BOTONES ──────────────────────────────────────────────── */
.t-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: var(--radius-sm);
  padding: 14px 28px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: var(--trans); font-family: inherit;
  text-decoration: none;
}
.t-btn-primary {
  background: var(--accent); color: #fff; width: 100%;
  margin-top: 28px;
}
.t-btn-primary:hover { background: var(--accent-lt); transform: translateY(-1px); }
.t-btn-primary:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.t-btn-skip {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); width: 100%; margin-top: 10px; font-size: 13px;
}
.t-btn-skip:hover { border-color: var(--border-acc); color: var(--text-body); }

/* ── REGISTRO (paso 6) ────────────────────────────────────── */
.t-registro-box {
  background: linear-gradient(135deg, #0f172a, #1e1b4b);
  border: 1px solid #4338ca;
  border-radius: var(--radius-lg);
  padding: 36px;
  text-align: center;
}
.t-registro-box h2 { color: var(--text-head); font-size: 22px; margin-bottom: 10px; }
.t-registro-box p  { color: var(--text-body); margin-bottom: 28px; }
.t-input {
  width: 100%; background: var(--bg-deep);
  border: 1px solid var(--border-acc); border-radius: var(--radius-sm);
  color: var(--text-head); padding: 13px 16px;
  font-size: 15px; font-family: inherit;
  margin-bottom: 12px; transition: var(--trans);
}
.t-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px #6366f122;
}
.t-input::placeholder { color: var(--text-muted); }

/* ── RESULTADOS INLINE ────────────────────────────────────── */
.t-resultados-preview {
  margin-top: 36px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}
.t-barra-row { margin-bottom: 14px; }
.t-barra-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.t-barra-nombre { font-size: 13px; font-weight: 600; color: var(--text-head); }
.t-barra-pct    { font-size: 14px; font-weight: 700; }
.t-barra-track {
  height: 8px; background: var(--border);
  border-radius: 4px; overflow: hidden;
}
.t-barra-fill {
  height: 100%; border-radius: 4px;
  transition: width 1s cubic-bezier(.4,0,.2,1);
}

/* ── TOAST ────────────────────────────────────────────────── */
.t-toast {
  position: fixed; bottom: 28px; right: 28px; z-index: 999;
  background: #1e293b; border: 1px solid var(--border-acc);
  border-radius: var(--radius-sm); padding: 14px 20px;
  font-size: 13px; color: var(--text-head);
  box-shadow: var(--shadow);
  animation: slideIn .3s ease;
}
.t-toast.error { border-left: 3px solid #ef4444; }
.t-toast.ok    { border-left: 3px solid #10b981; }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .t-step-card { padding: 24px 18px; }
  .t-candidatos { grid-template-columns: repeat(2, 1fr); }
  .t-binario { grid-template-columns: 1fr 1fr; }
  .t-opciones { grid-template-columns: 1fr; }
}
