<header class="page-heading"><p class="eyebrow">POLÍTICA INTERNA</p><h1>Facciones, leyes y elecciones</h1><p>El apoyo se calcula a partir de tus políticas, guerras, tecnologías, comercio y colonias. Las leyes consumen influencia mientras permanezcan activas.</p></header>

<section class="panel" aria-labelledby="factions-title"><h2 id="factions-title">Facciones imperiales</h2><div class="table-wrap"><table><caption>Apoyo e impulso actuales</caption><thead><tr><th>Facción</th><th>Agenda</th><th>Apoyo</th><th>Impulso</th></tr></thead><tbody>{% for faction in factions %}<tr><th scope="row">{{ FACTIONS[faction.faction_key].name }}</th><td>{{ FACTIONS[faction.faction_key].agenda }}</td><td>{{ faction.support|round(1) }}</td><td>{{ '+' if faction.momentum >= 0 else '' }}{{ faction.momentum|round(1) }}</td></tr>{% endfor %}</tbody></table></div></section>

<section class="panel" aria-labelledby="laws-title"><h2 id="laws-title">Leyes</h2><div class="card-grid">{% for key, law in LAWS.items() %}<article class="entity-card"><h3>{{ law.name }}</h3><p>{{ law.effect }}</p><dl><div><dt>Promotora</dt><dd>{{ FACTIONS[law.faction].name }}</dd></div><div><dt>Aprobación</dt><dd>{{ law.cost }} influencia</dd></div><div><dt>Mantenimiento</dt><dd>{{ law.maintenance }} influencia por ciclo</dd></div></dl>{% if key in active_laws %}<form method="post" action="{{ url_for('law_repeal_action') }}"><input type="hidden" name="csrf_token" value="{{ csrf_token() }}"><input type="hidden" name="law_key" value="{{ key }}"><button class="button button-danger" type="submit">Derogar</button></form>{% else %}<form method="post" action="{{ url_for('law_enact_action') }}"><input type="hidden" name="csrf_token" value="{{ csrf_token() }}"><input type="hidden" name="law_key" value="{{ key }}"><button class="button" type="submit">Aprobar</button></form>{% endif %}</article>{% endfor %}</div></section>

<section class="panel" aria-labelledby="elections-title"><h2 id="elections-title">Elecciones, consejos y nombramientos</h2><p>Forma vigente: {{ {'democracy':'democracia electoral','council':'consejo de coalición','appointment':'nombramiento directo'}.get(config.get('government_type','democracy')) }}.</p><form method="post" action="{{ url_for('election_action') }}" class="inline-form"><input type="hidden" name="csrf_token" value="{{ csrf_token() }}">{% if config.get('government_type') == 'appointment' %}<label>Facción nombrada <select name="appointed_faction">{% for key, faction in FACTIONS.items() %}<option value="{{ key }}">{{ faction.name }}</option>{% endfor %}</select></label>{% endif %}<button class="button button-primary" type="submit">Renovar mandato cuando termine el actual</button></form>{% if elections %}<ol>{% for election in elections %}<li>{{ election.held_at|date_label }}: asumió el mandato {{ FACTIONS[election.winner_faction].name }}; vigente hasta {{ election.mandate_until|date_label }}.</li>{% endfor %}</ol>{% else %}<p>Aún no se han renovado mandatos.</p>{% endif %}</section>
