/*! =============================================================================
 *  © 2026 Renzo Núñez · RonBStudio — "Perú Elige 2026 · Segunda Vuelta".
 *  Código propietario. https://www.ronbstudio.com
 * ============================================================================= */
/* =============================================================================
 *  Archivo: exterior-paises.css
 *  Cuadro "Voto del Exterior" por continente/país con banderas SVG. Hermano
 *  visual de jee-actas.css / proy-departamentos.css.
 * ===========================================================================*/

.exterior-paises-section {
  max-width: var(--container-max, 1100px);
  margin: 0 auto;
  padding: var(--sp-3, 0.75rem) var(--container-padding, 1rem) var(--sp-5, 1.5rem);
}

.extp {
  max-width: 820px;
  margin: 0 auto;
  background:
    radial-gradient(ellipse at top left,
      var(--c-mv-mapa-radial-from) 0%, var(--c-mv-mapa-radial-mid) 60%, transparent 100%),
    var(--c-mv-bg-card, #ffffff);
  border: 1px solid var(--c-mv-card-border, #e2e8f0);
  border-radius: var(--c-card-radius, 16px);
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: var(--c-card-shadow, 0 1px 3px rgba(15, 23, 42, 0.06));
}

.extp__head { text-align: center; margin-bottom: 1.1rem; }
.extp__title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.35rem; font-weight: 700;
  color: var(--c-mv-card-title, #2c5599);
  margin: 0 0 0.3rem; line-height: 1.25;
}
.extp__sub {
  font-size: 0.85rem; color: var(--c-mv-ink-muted, #64748b);
  margin: 0 auto; max-width: 560px;
}
.extp__avance {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.22rem; font-weight: 800; letter-spacing: -0.01em;
  color: var(--c-mv-card-title, #2c5599);
  margin: 0.4rem auto 0;
}

/* --- Anillo de progreso de carga de países (NN/total) --- */
.extp { position: relative; }
.extp__progress {
  position: absolute; top: 1.15rem; right: 1.25rem;
  width: 66px; height: 66px;
}
.extp__progress-svg {
  width: 100%; height: 100%; display: block;
  transform: rotate(-90deg);   /* el progreso arranca a las 12 en punto */
}
.extp__progress-track {
  fill: none; stroke: var(--c-mv-card-border, #e2e8f0); stroke-width: 6;
}
.extp__progress-fill {
  fill: none; stroke: var(--c-mv-card-title, #2c5599);
  stroke-width: 6; stroke-linecap: round;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.35s ease;
}
.extp__progress:not(.extp__progress--done) .extp__progress-fill {
  animation: extpRingPulse 1.8s ease-in-out infinite;
}
@keyframes extpRingPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) {
  .extp__progress-fill { animation: none !important; transition: none; }
}
.extp__progress--done .extp__progress-fill { stroke: #16a34a; animation: none; }
.extp__progress--done .extp__progress-n { color: #16a34a; }
.extp__progress-txt {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1; pointer-events: none;
}
.extp__progress-n {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.78rem; font-weight: 800; font-variant-numeric: tabular-nums;
  color: var(--c-mv-card-title, #2c5599);
  transition: color 0.35s ease;
}
.extp__progress-cap {
  font-size: 0.46rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--c-mv-ink-muted, #64748b);
  margin-top: 0.16rem;
}
@media (max-width: 640px) {
  /* En móvil el anillo baja del rincón (chocaría con el título) y se centra.
     OJO: relative (no static) — el texto interno es absoluto y se ancla al anillo. */
  .extp__progress { position: relative; top: auto; right: auto; margin: 0.65rem auto 0; }
}

/* --- Dropdowns --- */
.extp__controls {
  display: flex; gap: 0.75rem; justify-content: center;
  flex-wrap: wrap; margin-bottom: 1.1rem;
}
.extp__field { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; flex: 1 1 220px; max-width: 300px; }
.extp__field-lbl {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--c-mv-ink-muted, #64748b); padding-left: 0.15rem;
}
.extp__select {
  appearance: none; -webkit-appearance: none;
  width: 100%; padding: 0.55rem 2rem 0.55rem 0.8rem;
  font-family: inherit; font-size: 0.92rem; font-weight: 600;
  color: var(--c-mv-ink, #1e293b);
  background-color: #fff;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%232c5599' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 0.7rem center;
  border: 1.5px solid var(--c-mv-card-border, #cbd5e1);
  border-radius: 10px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.extp__select:hover { border-color: #94a3b8; }
.extp__select:focus { outline: none; border-color: #2c5599; box-shadow: 0 0 0 3px rgba(44, 85, 153, 0.15); }

/* --- Resumen del scope (barra grande) --- */
.extp__summary { margin: 0 auto 1.1rem; max-width: 560px; }
.extp__sumlegend {
  display: flex; justify-content: space-between; font-size: 0.82rem; font-weight: 700; margin-bottom: 0.35rem;
}
.extp__sumlegend-k { color: #ea580c; }
.extp__sumlegend-s { color: #9a1024; }
.extp__sumbar {
  display: flex; height: 14px; border-radius: 7px; overflow: hidden;
  background: #eef2f7; box-shadow: inset 0 1px 2px rgba(15,23,42,.08);
}
.extp__sumbar-k { background: linear-gradient(90deg, #fb923c, #ea580c); }
.extp__sumbar-s { background: linear-gradient(90deg, #9a1024, #c8302a); }
.extp__sumtot { text-align: center; font-size: 0.74rem; color: var(--c-mv-ink-muted, #64748b); margin-top: 0.4rem; }

/* --- Lista de países --- */
.extp__list { display: flex; flex-direction: column; gap: 0.1rem; }
.extp__row {
  display: grid;
  grid-template-columns: minmax(120px, 1.4fr) minmax(80px, 2fr) auto;
  align-items: center; gap: 0.7rem;
  padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--c-mv-card-border, #eef2f7);
}
.extp__row:hover { background: rgba(44, 85, 153, 0.035); border-radius: 8px; }

.extp__pais { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.extp__flag {
  width: 26px; height: 18px; border-radius: 3px; object-fit: cover; flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(15,23,42,.12); background: #f1f5f9;
}
.extp__flag--na { display: inline-flex; align-items: center; justify-content: center; font-size: 13px; box-shadow: none; }
.extp__pais-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.18; }
.extp__pais-nm { font-size: 0.9rem; font-weight: 600; color: var(--c-mv-ink, #1e293b); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.extp__pais-pct { font-size: 0.65rem; font-weight: 600; color: var(--c-mv-ink-muted, #94a3b8); }

.extp__bar {
  display: flex; height: 11px; border-radius: 6px; overflow: hidden;
  background: #eef2f7; box-shadow: inset 0 1px 1px rgba(15,23,42,.06);
}
.extp__bar-k { background: #ea580c; }
.extp__bar-s { background: #9a1024; }

.extp__nums { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; min-width: 78px; }
.extp__win { font-weight: 800; font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.extp__win--k { color: #ea580c; }
.extp__win--s { color: #9a1024; }
.extp__votos { font-size: 0.68rem; color: var(--c-mv-ink-muted, #94a3b8); white-space: nowrap; }

.extp__empty { text-align: center; color: var(--c-mv-ink-muted, #64748b); font-size: 0.85rem; padding: 1rem 0; }

/* --- Nota --- */
.extp__note {
  text-align: center; margin: 1rem auto 0; max-width: 600px;
  font-size: 0.76rem; font-style: italic; color: var(--c-mv-ink-muted, #64748b);
}
.extp__note--error { color: var(--c-party-ap, #c8302a); font-style: normal; }

/* --- Responsive --- */
@media (max-width: 560px) {
  .extp { padding: 1.5rem 0.7rem 1.25rem; }
  .extp__title { font-size: 1.08rem; }
  .extp__sub { font-size: 0.78rem; }
  .extp__avance { font-size: 1.05rem; }
  .extp__controls { gap: 0.5rem; }
  .extp__field { flex: 1 1 100%; max-width: none; }
  .extp__row { grid-template-columns: minmax(96px, 1.2fr) 1.4fr auto; gap: 0.5rem; padding: 0.5rem 0.2rem; }
  .extp__pais-nm { font-size: 0.82rem; }
  .extp__flag { width: 22px; height: 15px; }
  .extp__win { font-size: 0.8rem; }
  .extp__votos { font-size: 0.62rem; }
}
