<main class="container-fluid py-4">
    <div class="row g-4">
        <div class="col-lg-3"><?php require APP_PATH . '/Views/admin/_sidebar.php'; ?></div>
        <div class="col-lg-9">
            <div class="d-flex flex-column flex-md-row justify-content-between gap-3 mb-4">
                <div>
                    <h1 class="h3 fw-bold text-cfc-dark mb-1">Acesso do Administrador</h1>
                    <p class="text-muted mb-0">Altere o Usuário/e-mail e a senha de entrada do painel administrativo.</p>
                </div>
            </div>
            <div class="card border-0 shadow-soft rounded-4">
                <div class="card-body p-4 p-md-5">
                    <form method="post" action="<?= e(url('admin/account/save')) ?>" class="row g-4">
                        <?= CSRF::input() ?>
                        <div class="col-md-6">
                            <label class="form-label">Nome do Administrador</label>
                            <input name="name" class="form-control" value="<?= e($admin['name'] ?? '') ?>" required>
                        </div>
                        <div class="col-md-6">
                            <label class="form-label">Usuário / E-mail de login</label>
                            <input type="email" name="email" class="form-control" value="<?= e($admin['email'] ?? '') ?>" required>
                        </div>
                        <div class="col-12"><hr></div>
                        <div class="col-md-4">
                            <label class="form-label">Senha Atual</label>
                            <input type="password" name="current_password" class="form-control" required>
                            <small class="text-muted">Obrigatória para confirmar qualquer alteração.</small>
                        </div>
                        <div class="col-md-4">
                            <label class="form-label">Nova Senha</label>
                            <input type="password" name="new_password" class="form-control" minlength="6">
                            <small class="text-muted">Deixe em branco para manter a senha atual.</small>
                        </div>
                        <div class="col-md-4">
                            <label class="form-label">Confirmar nova senha</label>
                            <input type="password" name="new_password_confirmation" class="form-control" minlength="6">
                        </div>
                        <div class="col-12">
                            <button class="btn btn-primary rounded-pill px-5 py-2">Salvar Acesso</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</main>
