<?php
declare(strict_types=1);

/**
 * Application configuration. Copy values into config.local.php to override
 * without editing this file.
 */
$default = [
    'app' => [
        'name' => 'AOSWARE CRM',
        'env' => 'local',
        'debug' => true,
        'base_path' => '/crm/Staff-Portal',
        'timezone' => 'America/New_York', // fallback before login; admin sets company time in Settings
        'session_name' => 'AOSWARE_STAFF',
        'session_lifetime' => 28800,
    ],
    'db' => [
        'host' => '127.0.0.1',
        'port' => 3306,
        'name' => 'crm',
        'user' => 'root',
        'pass' => '',
        'charset' => 'utf8mb4',
    ],
    'security' => [
        'login_max_attempts' => 8,
        'login_window_minutes' => 15,
        'password_min_length' => 8,
        'csrf_key' => 'aosware_staff_csrf',
    ],
    'mail' => [
        'from_name' => 'AOSWARE CRM',
        'from_address' => 'noreply@localhost',
        'enabled' => false,
    ],
];

$localFile = __DIR__ . '/config.local.php';
if (is_file($localFile)) {
    $local = require $localFile;
    if (is_array($local)) {
        $default = array_replace_recursive($default, $local);
    }
}

return $default;
