<?php

use App\Http\Controllers\Guest\AuthController;
use App\Http\Controllers\Guest\LocaleController;
use Illuminate\Support\Facades\Route;

Route::get('/', function () {
    return redirect()->route('login');
});

Route::middleware('guest')->group(function () {
    Route::get('login', [AuthController::class, 'showLogin'])->name('login');
    Route::post('login', [AuthController::class, 'storeLogin']);
});

Route::post('logout', [AuthController::class, 'destroy'])->middleware('auth')->name('logout');

Route::get('locale/{locale}', [LocaleController::class, 'switch'])->name('locale.switch');

// Dashboard fallback or redirect based on role could be handled here if needed.
