{% set lang = get_lang(request) %}
<section class="card">
    <h2>{{ t('system.autostart', lang) }}</h2>
    <p class="section-desc">{{ t('system.autostart_desc', lang) }}</p>
    <div class="signal-item" style="margin-bottom: 1rem;">
        <span class="signal-dot {{ 'active' if launchagent.enabled else 'inactive' }}"></span>
        <span>{{ t('system.enabled' if launchagent.enabled else 'system.disabled', lang) }}</span>
    </div>
    <div class="system-actions" style="margin-bottom: 0.75rem;">
        {% if launchagent.enabled %}
        <button class="btn-sm btn-stop"
                hx-post="/system/launchagent/toggle"
                hx-target="#launchagent-section"
                hx-swap="innerHTML">
            {{ t('system.disabled', lang) }}
        </button>
        {% else %}
        <button class="btn-sm btn-start"
                hx-post="/system/launchagent/toggle"
                hx-target="#launchagent-section"
                hx-swap="innerHTML">
            {{ t('system.enabled', lang) }}
        </button>
        {% endif %}
    </div>
    <div style="font-size: 0.6875rem; color: var(--text-dim); word-break: break-all;">
        {{ launchagent.path }}
    </div>
</section>
