Feature: User preferences (theme)
  As a signed-in user
  I want to switch between system/light/dark theme
  So that the app matches my preference, applied immediately

  Background:
    Given I am signed in as "Alice" "Martin"

  Scenario: Switching theme autosaves and applies immediately, no explicit save button
    Given my saved theme preference is "SYSTEM"
    And updating the theme preference will succeed
    When I visit "/parametres/preferences-utilisateur"
    Then I should not see "Enregistrer"
    When I click the radio "Clair"
    Then the theme update request should have been made with theme "LIGHT"
    And I should see "Enregistré ✓"
    And the page theme should be "light"
